(*
    Title: 	TermStream - Definitions
    LastEdit:	"Mon Sep 17 16:13:51 1984"
    Author: 	Mick Jordan
		Acorn Research Centre
*)

DEFINITION MODULE TermStream;

FROM Streams IMPORT Stream;

EXPORT QUALIFIED 
    CreateInOutput, CreateOutputForErrors, StreamErrorCode;

PROCEDURE StreamErrorCode(s: Stream): INTEGER;
(*  Returns OS error code in the event of an error.
*)

PROCEDURE CreateInOutput(): Stream;
(*  Returns an bi-directional stream to the terminal.
    Input is buffered at the level defined by the underlying
    operating system usually a line at a time.
    Output is buffered until a NewLineCh, a call to Streams.FlushOut
    or an input request on the stream.
    Only one instance of this stream is allowed; 
    repeated calls (without an intervening Delete)
    return the same stream handle.
*)
PROCEDURE CreateOutputForErrors(): Stream;
(*  Returns an unbuffered stream on which to output error messages.
    Whether this has the same destination as the output portion
    of the stream returned by CreateInOutput depends on the
    underlying operating system, which may also impose buffering.
    Only one instance of this stream is allowed; 
    repeated calls (without an intervening Delete)
    return the same stream handle.
*)

END TermStream .
