(*
    Title: 	SCTermStream - Definitions
    LastEdit:	"Tue Sep 11 15:22:39 1984"
    Author: 	jd
		Cambridge University Computer Laboratory

    This interface provides a means of getting at single character
    terminal input. CreateInOutput returns a stream to the terminal
    which will give each character to you as soon as it is typed.

    Unfortunately this usually affects both input and output, these being 
    handled by the same code in an operating system.  This is why the stream
    returned from CreateInOutout is a bi-directional stream; you should
    write to the terminal using it so that the right things happen
    when you Put a NewLineCh (CReturnCh is inserted unless TranslateCR(FALSE)
    has been called).  Similarly, with Get, CReturnCh will be converted 
    to NewLineCh unless TranslateCR(FALSE) has been called.

    If possible, the implementation will allow any special characters used
    by the operating system to maintain their functions (so that programs
    can still be killed easily).

    Be warned that most operating systems will only allow one such single
    character stream to be open at a time, and it shoul be properly closed
    on leaving the program.
*)
DEFINITION MODULE SCTermStream;
   

FROM Streams IMPORT Stream;

EXPORT QUALIFIED CreateInOutput, StreamErrorCode, TranslateCR;


PROCEDURE CreateInOutput (): Stream;
(*  Returns a single character InOut stream to the standard input  
*)
PROCEDURE TranslateCR(yes: BOOLEAN);
(*  controls the translation of carriage return into
    newline (line-feed).
    Translation occurs if 'yes=TRUE'.
    Default is 'yes=TRUE'.
*)
PROCEDURE StreamErrorCode(s: Stream): INTEGER;
(*  In the event of an OS error, this will be set to the error number.
*)


END SCTermStream.
