-- File: GCCommand.mesa, HGM August 15, 1978 12:29 AM
-- Last Edit: Ly September 20, 1978 6:37 PM

DIRECTORY
GCDefs: FROM "GCDefs" USING [
GCEchoer, GCLookAtThings, GCPRThings, GCPrintThings,
GCInterface, GetStats, SetDisplay, SetHost,
ToggleEchoServer, YesOrNo],
IODefs: FROM "<Mesa>IODefs" USING [
CR, ReadChar, WriteChar, WriteLine, WriteString];

GCCommand: PROGRAM [gc: GCDefs.GCInterface]
IMPORTS IODefs, GCDefs
EXPORTS GCDefs =
BEGIN OPEN gc, IODefs, GCDefs;

GateControlMainLoop: PUBLIC PROCEDURE =
BEGIN
c: CHARACTER;
DO
WriteChar[’>];
SELECT ReadChar[] FROM
’ => WriteLine[""L];
’. => WriteLine["."L];
’- =>
BEGIN
WriteChar[’-]; WriteChar[’-];
UNTIL (c←ReadChar[])=CR DO WriteChar[c]; ENDLOOP;
WriteChar[CR];
END;
’E, ’e => GCEchoer[];
’H, ’h => SetHost[];
’L, ’l => GCLookAtThings[];
’M, ’m =>
BEGIN
WriteString["Miscellaneous "L];
SELECT ReadChar[] FROM
’D, ’d => SetDisplay[];
’E, ’e => ToggleEchoServer[];
’? => WriteLine[" E(cho Server), D(isplay)."L];
ENDCASE => WriteLine["???"L];
END;
’P, ’p => GCPrintThings[];
’R, ’r => GCPRThings[];
’S, ’s => GetStats[];
’Q, ’q => IF YesOrNo["Quit."L] THEN RETURN[];
’? => WriteLine["?
E(cho), H(ost), L(ook), M(isc), P(rint), R(adio), S(tatistics), Q(uit)."L];
ENDCASE => WriteLine["???"L];
ENDLOOP;
END;

END. -- of GCCommand