<> <> <> <> DIRECTORY IO USING [STREAM, Value], Rope USING [ROPE]; TerminalIO: CEDAR DEFINITIONS = BEGIN <> <> <> <> <<>> ROPE: TYPE = Rope.ROPE; <<>> <<--output>> WriteRope: PROC [text: ROPE]; WriteRopes: PROC [t1, t2, t3: ROPE _ NIL]; WriteLn: PROC []; WriteChar: PROC [ch: CHAR]; WriteInt: PROC [i: INT]; Write: PROC [v1, v2, v3: IO.Value _ [null[]]]; Write1: PROC [value: IO.Value _ [null[]]]; WriteF: PROC [format: ROPE _ NIL, v1, v2, v3, v4, v5: IO.Value _ [null[]]]; WriteF1: PROC [format: ROPE _ NIL, value: IO.Value _ [null[]]]; TOS: PROC [] RETURNS [stream: IO.STREAM]; <<--creates an output stream which writes its output into the terminal >> <<>> <<--input>> UserAbort: SIGNAL; RequestRope: PROC [text: ROPE _ NIL] RETURNS [ROPE]; <<--may raise UserAbort>> RequestChar: PROC [text: ROPE _ NIL] RETURNS [CHAR]; <<--may raise UserAbort>> RequestInt: PROC [text: ROPE _ NIL] RETURNS [INT]; <<--may raise UserAbort>> RequestSelection: PROC [label: ROPE _ NIL, choice: LIST OF ROPE, text: ROPE _ NIL, default: NAT _ 0, timeOut: NAT _ 0] RETURNS [INT]; <<--returns: 1 for first choice, 2 for second...>> <<-- 0 if selected outside menu or on title-line>> <<-- -1 if time out>> <<--label: header text; can not be selected.>> <<--choice: list of possible selections.>> <<--text: written to the terminal.>> <<--default: the cursor might be initially moved to this line.>> <<--timeOut: in seconds; 0 for no time out.>> Confirm: PROC [choice: ROPE, label: ROPE _ NIL, timeOut: NAT _ 0, onTimeOut: BOOL _ FALSE] RETURNS [BOOL]; <<--choice: option to confirm>> <<--label: header text; can not be selected>> <<--timeOut: in seconds; 0 for no time out.>> <<--onTimeOut: returned result if timed out. >> <<>> <<--special>> <<>> AddLock: PRIVATE PROC [lock, unLock: PROC]; <<--USE WITH CARE. >> <<--Procedures tell client module whether some input is in progress.>> <<--The lock, unLock procedures are called within the monitorlock.>> <<--Locks cannot be removed, use only one lock per module.>> <<>> END.