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

  1. DEFINITION MODULE StdChans;
  2.  
  3.     (* Standard and default channels *)
  4.  
  5. IMPORT IOChan;
  6.  
  7. TYPE
  8.   ChanId = IOChan.ChanId;
  9.   (* Values of this type are used to identify channels *)
  10.  
  11. (* The following functions return the standard channel values.
  12.    These channels cannot be closed *)
  13.  
  14. PROCEDURE StdInChan (): ChanId;
  15. (* Returns a value identifying the implementation-defined standard source
  16.    for program input *)
  17.  
  18. PROCEDURE StdOutChan (): ChanId;
  19. (* Returns a value identifying the implementation-defined standard sink
  20.    for program output *)
  21.  
  22. PROCEDURE StdErrChan (): ChanId;
  23. (* Returns a value identifying the implementation-defined standard
  24.    destination for program error messages *)
  25.  
  26. (* The null device throws away all data written to it and gives an
  27.    immediate end of input indication on reading *)
  28.  
  29. PROCEDURE NullChan (): ChanId;
  30. (* Returns a value identifying a channel open to the null device *)
  31.  
  32. (* The default channel values *)
  33.  
  34. PROCEDURE InChan (): ChanId;
  35. (* Returns the identity of the current default input channel,
  36.    as used by input procedures that do not take a channel parameter.
  37.    Initially this is the value returned by the procedure StdInChan. *)
  38.  
  39. PROCEDURE OutChan (): ChanId;
  40. (* Returns the identity of the current default output channel,
  41.    as used by output procedures that do not take a channel parameter.
  42.    Initially this is the value returned by the procedure StdOutChan. *)
  43.  
  44. PROCEDURE ErrChan (): ChanId;
  45. (* Returns the identity of the current default error message channel.
  46.    Initially this is the value returned by the procedure StdErrChan. *)
  47.  
  48. (* The following procedures allow for redirection of the default channels *)
  49.  
  50. PROCEDURE SetInChan (cid: ChanId);
  51. (* Sets the current default input channel identity to that given by the
  52.    value of the parameter cid. *)
  53.  
  54. PROCEDURE SetOutChan (cid: ChanId);
  55. (* Sets the current default Output channel identity to that given by the
  56.    value of the parameter cid. *)
  57.  
  58. PROCEDURE SetErrChan (cid: ChanId);
  59. (* Sets the current default error channel identity to that given by the
  60.    value of the parameter cid. *)
  61.  
  62.  
  63. END StdChans.
  64.