(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) (FILECREATED "30-Sep-2021 19:23:57" {DSK}briggs>Projects>medley>library>UNIXTELNET.;2 3970 changes to%: (FNS UNIX-TCPCHAT.OPEN) previous date%: "16-Feb-90 17:00:31" {DSK}briggs>Projects>medley>library>UNIXTELNET.;1 ) (* ; " Copyright (c) 1989-1990 by Xerox Corporation. ") (PRETTYCOMPRINT UNIXTELNETCOMS) (RPAQQ UNIXTELNETCOMS [(FNS UNIX-TCPCHAT.HOST.FILTER UNIX-TCPCHAT.OPEN UNIX-TCPCHAT.GET.LOGIN UNIX-TCPCHAT.INIT) (INITVARS (CHAT.LOGINS) (CHAT.LOGINS.MENU)) (GLOBALVARS CHAT.LOGINS CHAT.LOGINS.MENU) (DECLARE%: DONTEVAL@LOAD DOCOPY (FILES (SYSLOAD) UNIXCHAT) (ADDVARS (AROUNDEXITFNS UNIX-TCPCHAT.INIT)) (P (UNIX-TCPCHAT.INIT]) (DEFINEQ (UNIX-TCPCHAT.HOST.FILTER (LAMBDA (HOST) (* ; "Edited 14-Feb-90 15:17 by bvm") (if (NOT (STRPOSL (CHARCODE (":" SPACE)) HOST)) then (* ;; "At least reject XNS names or things that will give RLOGIN a syntactic problem. Really should test whether HOST is a valid ip host name, but I don't know how to do that from here.") (LET ((UPHOST (MKATOM (U-CASE HOST)))) (if (NOT (ASSOC UPHOST NETWORKOSTYPES)) then (push NETWORKOSTYPES (BQUOTE ((\, UPHOST) . UNIX))))) (LIST HOST (FUNCTION UNIX-TCPCHAT.OPEN)))) ) (UNIX-TCPCHAT.OPEN [LAMBDA (HOST TERMTYPE LOGOPTION) (* ;  "Edited 30-Sep-2021 19:23 by briggs") (* ; "Edited 14-Feb-90 18:36 by bvm") (* ;; "For use on Maiko: chat to HOST by using ssh in a shell window.") (LET (NAME STR) (if [AND (OR (NEQ LOGOPTION 'NONE) (SETQ NAME (UNIX-TCPCHAT.GET.LOGIN HOST))) (SETQ STR (CREATE-SHELL-STREAM TERMTYPE (CL:FORMAT NIL "exec ssh ~@[-l ~A ~]~A" NAME HOST] then (STREAMPROP STR 'SENDSCREENPARAMS (FUNCTION UNIX.SENDSCREENPARAMS)) (STREAMPROP STR 'SETDISPLAYTYPE (FUNCTION UNIX.SETDISPLAYTYPE)) (LIST STR STR 'LOGOPTION 'NONE]) (UNIX-TCPCHAT.GET.LOGIN (LAMBDA (HOST) (* ; "Edited 15-Feb-90 11:28 by bvm") (LET (NAME) (if (OR (NULL CHAT.LOGINS) (EQ (SETQ NAME (MENU (OR CHAT.LOGINS.MENU (SETQ CHAT.LOGINS.MENU (create MENU ITEMS _ (APPEND CHAT.LOGINS (QUOTE (("**other**" T "Prompts for a name to login as")))) CENTERFLG _ T TITLE _ "Log in as:"))))) T)) then (* ; "Prompt for a name") (if (SETQ NAME (CHAT.PROMPT.FOR.INPUT (CL:FORMAT NIL "Log in to ~A as user: " HOST) NIL 16)) then (SETQ CHAT.LOGINS (SORT (CONS NAME CHAT.LOGINS) (FUNCTION UALPHORDER))) (SETQ CHAT.LOGINS.MENU NIL))) NAME)) ) (UNIX-TCPCHAT.INIT (LAMBDA (EVENT) (* ; "Edited 26-Oct-89 15:24 by bvm") (* ;; "If we wake up on Sun, install a new version of the tcp chat host filter.") (SELECTQ EVENT ((AFTERLOGOUT AFTERSYSOUT AFTERMAKESYS AFTERSAVEVM NIL) (if (EQ (MACHINETYPE) (QUOTE MAIKO)) then (if (NOT (CL:ASSOC (QUOTE N) CHAT.PROTOCOL.ABBREVS :TEST (QUOTE STRING-EQUAL))) then (* ; "TCPCHAT wasn't loaded--make sure that /n works") (push CHAT.PROTOCOL.ABBREVS (QUOTE (N . TCP)))) (PUTASSOC (QUOTE TCP) (FUNCTION UNIX-TCPCHAT.HOST.FILTER) CHAT.PROTOCOLTYPES) (* ; "Won't need to do this again, as you can't run a Sun sysout on a D machine.") (SETQ AROUNDEXITFNS (DREMOVE (FUNCTION UNIX-TCPCHAT.INIT) AROUNDEXITFNS)))) NIL)) ) ) (RPAQ? CHAT.LOGINS ) (RPAQ? CHAT.LOGINS.MENU ) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS CHAT.LOGINS CHAT.LOGINS.MENU) ) (DECLARE%: DONTEVAL@LOAD DOCOPY (FILESLOAD (SYSLOAD) UNIXCHAT) (ADDTOVAR AROUNDEXITFNS UNIX-TCPCHAT.INIT) (UNIX-TCPCHAT.INIT) ) (PUTPROPS UNIXTELNET COPYRIGHT ("Xerox Corporation" 1989 1990)) (DECLARE%: DONTCOPY (FILEMAP (NIL (872 3597 (UNIX-TCPCHAT.HOST.FILTER 882 . 1389) (UNIX-TCPCHAT.OPEN 1391 . 2318) ( UNIX-TCPCHAT.GET.LOGIN 2320 . 2889) (UNIX-TCPCHAT.INIT 2891 . 3595))))) STOP