-- Transport mechanism: TELNET interface

-- [Juniper]<DMS>MS>GlassDefs.mesa

-- Andrew Birrell  24-Dec-80 16:08:47

DIRECTORY
PupDefs		USING[ PupSocketID ];

GlassDefs: DEFINITIONS =

BEGIN

StringType:	TYPE = { pwd,	-- don't echo; end with SP, CR, ESC, DEL --
			 word,	-- echo; end with SP, CR, ESC, DEL --
			 line,	-- echo; end with CR, ESC, DEL --
			 any	-- echo; end with ESC, DEL --
			};

HandleObject:	TYPE = RECORD[
			ReadChar:	PROC RETURNS[CHARACTER],
			ReadString:	PROC[prompt, s: STRING,
					     type: StringType]
					RETURNS[CHARACTER],
			WriteChar:	PROC[CHARACTER],
			WriteString:	PROC[STRING],
			WriteDecimal:	PROC[CARDINAL],
			WriteLongDecimal: PROC[LONG CARDINAL],
			SendNow:	PROC,
			CharsLeft:	PROC RETURNS[CARDINAL],
			LinesLeft:	PROC RETURNS[CARDINAL],
			SetWidth:	PROC[CARDINAL]--0 means infinite--,
			SetHeight:	PROC[CARDINAL]--0 means infinite--,
			DelTyped:	PROC RETURNS[BOOLEAN],
			Synch:		PROC,
			Flush:		PROC ];

Handle:		TYPE = POINTER TO HandleObject;

TimeOut:	SIGNAL;
SynchReply:	SIGNAL;

Listen:		PROC[ work: PROC[Handle],
		      socket: PupDefs.PupSocketID ← [0,0] ];

END.