(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) (FILECREATED "22-Jul-88 15:35:50" |{MCS:MCS:STANFORD}TTYTALK.;2| 6354 previous date%: "13-Jun-88 16:35:13" |{MCS:MCS:STANFORD}TTYTALK.;1|) (PRETTYCOMPRINT TTYTALKCOMS) (RPAQQ TTYTALKCOMS ((* TALK TTY Service) (LOCALVARS . T) (FNS TALK.TTY.DISPLAY TALK.TTY.LISTEN TALK.TTY.CHARFN) [INITVARS (TALK.TTY.FONT DEFAULTFONT) (TALK.TTY.TERMTABLE (COPYTERMTABLE 'ORIG] (GLOBALVARS TALK.TTY.FONT TALK.TTY.TERMTABLE) (FILES TALK) (APPENDVARS (GAP.SERVICETYPES (5 TTY TALK.NS.SERVER)) (TALK.SERVICETYPES (TTY TALK.TTY.DISPLAY TALK.TTY.LISTEN))) (P (ECHOCHAR (CHARCODE BS) 'IGNORE TALK.TTY.TERMTABLE)))) (* TALK TTY Service) (DECLARE%: DOEVAL@COMPILE DONTCOPY (LOCALVARS . T) ) (DEFINEQ (TALK.TTY.DISPLAY [LAMBDA (MAINWINDOW WINDOW INPUTSTREAM OUTPUTSTREAM PROTOCOLTYPE USER) (* ; "Edited 8-Jun-88 12:21 by cdl") (LET (PROCESS) (DSPFONT TALK.TTY.FONT MAINWINDOW) (DSPFONT TALK.TTY.FONT WINDOW) (DSPSCROLL 'ON MAINWINDOW) (DSPSCROLL 'ON WINDOW) (if USER then (WINDOWPROP MAINWINDOW 'ICON (CONCAT "Talk with " USER))) [WINDOWPROP MAINWINDOW 'TALK.TTY.PROCESS (SETQ PROCESS (ADD.PROCESS `(TALK.TTY.CHARFN ,MAINWINDOW ,OUTPUTSTREAM ,(with TALK.PROTOCOLTYPE PROTOCOLTYPE TALK.CASEARRAY ] (TTY.PROCESS PROCESS]) (TALK.TTY.LISTEN [LAMBDA (MAINWINDOW WINDOW INPUTSTREAM OUTPUTSTREAM PROTOCOLTYPE) (* ; "Edited 8-Jun-88 12:21 by cdl") (DECLARE (SPECVARS INPUTSTREAM)) (PROG ((POSITION (create POSITION)) (CHARWIDTH (CHARWIDTH (CHARCODE A) TALK.TTY.FONT)) BYTE PROCESS EVENTFN CASEARRAY EOM?) [with TALK.PROTOCOLTYPE PROTOCOLTYPE (SETQ EVENTFN TALK.EVENTFN) (SETQ CASEARRAY TALK.CASEARRAY) (SETQ EOM? (EQ TALK.PROTOCOLNAME 'NS] (while (OPENWP WINDOW) do (APPLY* EVENTFN INPUTSTREAM OUTPUTSTREAM) (if (NOT (AND (OPENP INPUTSTREAM) (OPENP OUTPUTSTREAM))) then (RETURN)) (TALK.FLASH.CARET WINDOW POSITION 'OFF) (bind CCODE while (AND (OPENP INPUTSTREAM) (PROGN (if EOM? then (SPP.CLEAREOM INPUTSTREAM T)) (READP INPUTSTREAM))) do (SETQ BYTE (LOGAND (SETQ CCODE (READCCODE INPUTSTREAM)) (MASK.1'S 0 8))) [if CASEARRAY then (SETQ BYTE (SETQ CCODE (ELT CASEARRAY BYTE] (SELCHARQ BYTE (LF NIL) (^G (TALK.RINGBELLS WINDOW)) (BS (if (GEQ (DSPXPOSITION NIL WINDOW) CHARWIDTH) then (DSPBACKUP CHARWIDTH WINDOW))) (PRINTCCODE CCODE WINDOW))) (TALK.FLASH.CARET WINDOW POSITION 'ON)) (WINDOWPROP MAINWINDOW 'ICON (CONCAT (WINDOWPROP MAINWINDOW 'ICON) TALK.CLOSED.STRING)) (if (PROCESSP (SETQ PROCESS (WINDOWPROP MAINWINDOW 'TALK.TTY.PROCESS NIL))) then (DEL.PROCESS PROCESS]) (TALK.TTY.CHARFN [LAMBDA (DISPLAYSTREAM OUTPUTSTREAM CHARARRAY) (* ; "Edited 9-Jun-88 15:02 by cdl") (DECLARE (SPECVARS DISPLAYSTREAM OUTPUTSTREAM CHARARRAY)) [RESETFORM (TTYDISPLAYSTREAM DISPLAYSTREAM) (bind CCODE (STREAM _ (GETSTREAM NIL 'INPUT)) (CHARWIDTH _ (CHARWIDTH (CHARCODE A) TALK.TTY.FONT)) declare%: (SPECVARS STREAM) while (AND (OPENP OUTPUTSTREAM) (OPENWP DISPLAYSTREAM)) do (if (SETQ CCODE (RESETLST (RESETSAVE (SETTERMTABLE TALK.TTY.TERMTABLE)) (RESETSAVE (CONTROL T)) (READCCODE STREAM))) then (SELCHARQ CCODE (BS (if (GEQ (DSPXPOSITION NIL DISPLAYSTREAM) CHARWIDTH) then (DSPBACKUP CHARWIDTH DISPLAYSTREAM))) NIL) (if CHARARRAY then (SETQ CCODE (ELT CHARARRAY CCODE))) (PRINTCCODE CCODE OUTPUTSTREAM) (if (NOT (READP STREAM T)) then (FORCEOUTPUT OUTPUTSTREAM] (TTY.PROCESS T]) ) (RPAQ? TALK.TTY.FONT DEFAULTFONT) (RPAQ? TALK.TTY.TERMTABLE (COPYTERMTABLE 'ORIG)) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS TALK.TTY.FONT TALK.TTY.TERMTABLE) ) (FILESLOAD TALK) (APPENDTOVAR GAP.SERVICETYPES (5 TTY TALK.NS.SERVER)) (APPENDTOVAR TALK.SERVICETYPES (TTY TALK.TTY.DISPLAY TALK.TTY.LISTEN)) (ECHOCHAR (CHARCODE BS) 'IGNORE TALK.TTY.TERMTABLE) (DECLARE%: DONTCOPY (FILEMAP (NIL (1045 5941 (TALK.TTY.DISPLAY 1055 . 2143) (TALK.TTY.LISTEN 2145 . 4428) (TALK.TTY.CHARFN 4430 . 5939))))) STOP