home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / ISOsym / chanconsts.def next >
Text File  |  1996-08-29  |  2KB  |  56 lines

  1. DEFINITION MODULE ChanConsts;
  2.  
  3. (* Common types and values for device open requests and results *)
  4.  
  5. (* Device modules may allow combinations of the following flags to be given
  6.    when a channel is opened. An open procedure may not accept or honor all
  7.    combinations. *)
  8.  
  9. TYPE
  10.   ChanFlags = (
  11.     readFlag,        (* input operations are requested/available *)
  12.     writeFlag,        (* output operations are requested/available *)
  13.     oldFlag,        (* a file may/must/did exist before channel was opened *)
  14.     textFlag,        (* text operations are requested/available *)
  15.     rawFlag,        (* raw operations are requested/available *)
  16.     interactiveFlag,    (* interactive use is requested/available *)
  17.     echoFlag        (* echoing by interactive device on removal of
  18.              * characters from input stream requested/applies *)
  19.   );
  20.  
  21.   FlagSet = SET OF ChanFlags;
  22.  
  23. (* Singleton values of FlagSet, to allow for example, read+write. *)
  24. CONST
  25.   read        = FlagSet{readFlag};
  26.   write       = FlagSet{writeFlag};
  27.   old         = FlagSet{oldFlag};
  28.   text        = FlagSet{textFlag};
  29.   raw         = FlagSet{rawFlag};
  30.   interactive = FlagSet{interactiveFlag};
  31.   echo        = FlagSet{echoFlag};
  32.  
  33.  
  34. TYPE
  35.   OpenResults = (    (* Possible results of open requests *)
  36.     opened,         (* the open succeeded as requested *)
  37.     wrongNameFormat, (* given name is in the wrong format for the implementation *)
  38.     wrongFlags,         (* given flags include a value that does not apply to device *)
  39.     tooManyOpen,     (* this device cannot support any more open channels *)
  40.     outOfChans,      (* no more channels can be allocated *)
  41.     wrongPermissions,(* file or directory permissions do not allow request *)
  42.     noRoomOnDevice,  (* storage limits on the device prevent the open *)
  43.     noSuchFile,      (* a needed file does not exist *)
  44.     fileExists,      (* file of given name already exists, a new one is required *)
  45.     wrongFileType,   (* file is of the wrong type to support required operations *)
  46.     noTextOperations,(* text operations have been requested but are not supported *)
  47.     noRawOperations, (* raw operations have been requested but are not supported *)
  48.     noMixedOperations,(*text and binary operations have been requested but they
  49.             are not supported in combination *)
  50.     alreadyOpen,     (* the source/destination is already open for operations not
  51.             supported in combination with the requested operations *)
  52.     otherProblem     (* open failed for some other reason *)
  53.   );
  54.  
  55. END ChanConsts.
  56.