Terminal Input Output


DDISABLETERMINALSTREAM

%externalintegerfn DDISABLE TERMINAL STREAM1(%integername CURSOR, %integer STREAM, REASON) This procedure is used to suspend (REASON=4) or abort (REASON=5) an input (STREAM=0) or output (STREAM=1) operation. For interactive I/O streams, only the "abort" option is likely to be required, and the effect is to send a "control message" through the communications system. For an output stream, as much unprinted data as possible is flushed from the system, for an input stream, similarly any data which has been typed is flushed from the system. In each case the stream is re-initialised and further operations may not be carried out on the stream until it has been re-enabled using the DENABLE TERMINAL STREAM procedure. The DDISABLE TERMINAL STREAM procedure may be called at any time, but is typically invoked in response to an asynchronous "INT:" message generated by the user at the interactive terminal (see the procedure DCLEAR INT MESSAGE, described below, and the contingency handling procedures, described in Section A1.6).

DENABLETERMINALSTREAM

%externalintegerfn DENABLE TERMINAL STREAM(%integer STREAM, MODE, LEVEL, ADR, LEN, CURSOR) When a user logs in to EMAS 2900 from an interactive terminal, a process is created and two interactive streams, one for input and one for output, connect the process to the terminal. (Note that this usage of the word "connect" is distinct from that pertaining to files and virtual memories in EMAS 2900.) The process sends output to its terminal by writing the data into a file. Similarly, input from the terminal is placed by the System in a file. In each case, the file (or part of it) is used by the process and the communications system as a circular buffer. Procedure DENABLE TERMINAL STREAM is used to connect a file into the virtual memory and to specify the circular buffer within the file. ADR is the start of the buffer and LEN is its length (in bytes). STREAM should be set to 0 or 1, indicating input or output respectively LEVEL is not used and should be set to zero. MODE should be set to 1. After this procedure has been successfully executed, the specified circular buffer is available for interactive input or output. After a stream has been disabled or aborted (see procedure DDISABLE TERMINAL STREAM), this procedure may be called again to re-specify a circular buffer, to allow input or output to be resumed. Each EMAS 2900 process may have at most one input and one output stream connected to the communications system.