1 (* Library module defined by the International Standard
2 Information technology - programming languages
3 BS ISO/IEC 10514-1:1996E Part 1: Modula-2, Base Language.
5 Copyright ISO/IEC (International Organization for Standardization
6 and International Electrotechnical Commission) 1996-2021.
8 It may be freely copied for the purpose of implementation (see page
9 707 of the Information technology - Programming languages Part 1:
10 Modula-2, Base Language. BS ISO/IEC 10514-1:1996). *)
12 DEFINITION MODULE StdChans;
14 (* Access to standard and default channels *)
19 ChanId = IOChan.ChanId;
20 (* Values of this type are used to identify channels *)
22 (* The following functions return the standard channel values.
23 These channels cannot be closed.
26 PROCEDURE StdInChan (): ChanId;
27 (* Returns the identity of the implementation-defined standard source for
32 PROCEDURE StdOutChan (): ChanId;
33 (* Returns the identity of the implementation-defined standard source for program
37 PROCEDURE StdErrChan (): ChanId;
38 (* Returns the identity of the implementation-defined standard destination for program
42 PROCEDURE NullChan (): ChanId;
43 (* Returns the identity of a channel open to the null device. *)
45 (* The following functions return the default channel values *)
47 PROCEDURE InChan (): ChanId;
48 (* Returns the identity of the current default input channel. *)
50 PROCEDURE OutChan (): ChanId;
51 (* Returns the identity of the current default output channel. *)
53 PROCEDURE ErrChan (): ChanId;
54 (* Returns the identity of the current default error message channel. *)
56 (* The following procedures allow for redirection of the default channels *)
58 PROCEDURE SetInChan (cid: ChanId);
59 (* Sets the current default input channel to that identified by cid. *)
61 PROCEDURE SetOutChan (cid: ChanId);
62 (* Sets the current default output channel to that identified by cid. *)
64 PROCEDURE SetErrChan (cid: ChanId);
65 (* Sets the current default error channel to that identified by cid. *)