STDCHANS.DEF 2.1 KB

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