home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xc212os2.zip / ISODEF / chancons.def next >
Text File  |  1994-12-22  |  3KB  |  54 lines

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