Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/libsim/ttylin.sim
There is 1 other file named ttylin.sim in the archive. Click here to see a list.
00100	OPTIONS(/E/C);
00200	OPTIONS(/-Q/-A/-I/-D);
00300	EXTERNAL INTEGER PROCEDURE xcalli, sixbit;
00400	EXTERNAL TEXT PROCEDURE scanto, idsixbit;
00500	INTEGER PROCEDURE ttyline(ttyn); TEXT ttyn;
00600	BEGIN
00700	! Accepts tty name or number (octal format).
00800	! Returns node*2^18+line if network is in effect,
00900	! just line no if not, or zero on error.
01000	;
01100	
01200	CHARACTER c;
01300	TEXT t;
01400	INTEGER sixname, n;
01500	
01600	t:- ttyn;
01700	IF t =/= NOTEXT THEN
01800	BEGIN c:= t.Getchar;
01900	    IF Letter(c) THEN
02000	    BEGIN
02100		sixname:= sixbit(t);
02200		sixname:= xcalli(8R64,sixname,TRUE,0);	! DEVNAM;
02300		t:- idsixbit(sixname,0);
02400		IF t.Sub(1,3) NE "TTY" THEN GOTO error;
02500		ttyn:- t.Strip;
02600	    END letter ELSE
02700	    IF Digit(c) THEN
02800	    BEGIN ttyn:- Copy("TTY   "); ttyn.Setpos(4);
02850		GOTO pc;
02900		WHILE t.More AND ttyn.More DO
03000		BEGIN 
03040		    c:= t.Getchar;
03050		pc: ttyn.Putchar(c);
03100		END;
03200	    END digit;
03300	    ttyn.Setpos(1);
03400	    ttyline:= xcalli(8R165,sixbit(ttyn),TRUE,0);	! GTNTN.;
03500	END;
03600	error:
03700	;
03800	END;