(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) (FILECREATED "18-Jul-88 13:37:07" |{MCS:MCS:STANFORD}REMOTEPSW.;13| 21089 changes to%: (VARS REMOTEPSWCOMS) (FNS \REMOTE.PSWOP.SELECTED REMOTE.PROCESS.STATUS.WINDOW REMOTE.PROCESS.BACKTRACE REMOTE.PSW.REDISPLAY \REMOTE.PROCESS.BACKTRACE \REMOTE.PROCESS.RESTART \REMOTE.PROCESS.SUSPEND \REMOTE.PROCESS.TTY \REMOTE.PROCESS.WAKE) (RECORDS PROCESSDATA) previous date%: " 9-Nov-87 09:27:45" |{MCS:MCS:STANFORD}REMOTEPSW.;9|) (* " Copyright (c) 1985, 1986, 1987, 1988 by Xerox Corporation & Stanford University. All rights reserved. ") (PRETTYCOMPRINT REMOTEPSWCOMS) (RPAQQ REMOTEPSWCOMS ((FNS REMOTE.PROCESS.STATUS.WINDOW) (FNS REMOTE.PROCESS.BACKTRACE REMOTE.PSW.REDISPLAY REMOTE.PROCESS.ERROR \REMOTE.GET.PROCESS.DATA \REMOTE.PROCESS.BACKTRACE \REMOTE.PROCESS.KILL \REMOTE.PROCESS.RESTART \REMOTE.PROCESS.SUSPEND \REMOTE.PROCESS.TTY \REMOTE.PROCESS.WAKE \REMOTE.PSW.SELECTED \REMOTE.PSWOP.SELECTED) (VARS REMOTE.PSW.ITEMS REMOTE.PROCESS.ERRORS REMOTE.PROCESS.BACKTRACE.COMMANDS) (GLOBALVARS REMOTE.PSW.ITEMS REMOTE.PROCESS.ERRORS REMOTE.PROCESS.BACKTRACE.COMMANDS) (DECLARE%: DONTCOPY (RECORDS PROCESSDATA REMOTE.PSW.MENUS) (CONSTANTS (SELECTIONSHADE 520))) (FILES COURIERSERVE COURIERDEFS) (COURIERPROGRAMS PROCESS) (P (COURIER.START.SERVER)))) (DEFINEQ (REMOTE.PROCESS.STATUS.WINDOW [LAMBDA (HOST) (* ; "Edited 18-Jul-88 11:15 by cdl") (LET ((COURIERSTREAM (COURIER.OPEN HOST)) (WINDOW (CREATEW (CREATEREGION 0 0 100 100) HOST NIL T))) (WINDOWPROP WINDOW 'COURIERSTREAM COURIERSTREAM) (WINDOWPROP WINDOW 'LOCK (CREATE.MONITORLOCK)) [WINDOWADDPROP WINDOW 'CLOSEFN (FUNCTION (LAMBDA (WINDOW) (CLOSEF? (WINDOWPROP WINDOW 'COURIERSTREAM NIL] (REMOTE.PSW.REDISPLAY WINDOW) (MOVEW WINDOW) WINDOW]) ) (DEFINEQ (REMOTE.PROCESS.BACKTRACE [LAMBDA (PROCESS CMD WINDOW) (* ; "Edited 18-Jul-88 10:11 by cdl") (DECLARE (GLOBALVARS BACKTRACEFONT PROCBACKTRACEHEIGHT)) (PROG (PLACE REGION BACKTRACEWINDOW BULK.DATA.STREAM) (DECLARE (SPECVARS BACKTRACEWINDOW BULK.DATA.STREAM)) (if [NOT (WINDOWP (SETQ BACKTRACEWINDOW (CAR (ATTACHEDWINDOWS WINDOW] then (SETQ BACKTRACEWINDOW (CREATEW (with REGION (SETQ REGION (WINDOWPROP WINDOW 'REGION)) (create REGION BOTTOM _ (if (LESSP BOTTOM PROCBACKTRACEHEIGHT ) then (SETQ PLACE 'TOP) TOP else (SETQ PLACE 'BOTTOM) (DIFFERENCE BOTTOM PROCBACKTRACEHEIGHT )) HEIGHT _ PROCBACKTRACEHEIGHT using REGION)) "Process backtrace" NIL T)) (ATTACHWINDOW BACKTRACEWINDOW WINDOW PLACE 'JUSTIFY 'LOCALCLOSE) (DSPSCROLL 'OFF BACKTRACEWINDOW) (DSPFONT BACKTRACEFONT BACKTRACEWINDOW)) (DSPRESET BACKTRACEWINDOW) (SETQ BULK.DATA.STREAM (COURIER.CALL (WINDOWPROP WINDOW 'COURIERSTREAM) 'PROCESS 'BACKTRACE PROCESS CMD NIL)) (RESETLST [RESETSAVE NIL `(CLOSEF? ,BULK.DATA.STREAM] (COPYBYTES BULK.DATA.STREAM BACKTRACEWINDOW))]) (REMOTE.PSW.REDISPLAY [LAMBDA (WINDOW PROCESSDATA) (* ; "Edited 18-Jul-88 10:15 by cdl") (DECLARE (GLOBALVARS DEFAULTFONT)) (PROG ((COURIERSTREAM (WINDOWPROP WINDOW 'COURIERSTREAM)) PMENU OPMENU SELECTED WIDTH) [if (NULL PROCESSDATA) then (SETQ PROCESSDATA (COURIER.CALL COURIERSTREAM 'PROCESS 'GET.PROCESS.DATA] (for ATTACHEDWINDOW in (WINDOWPROP WINDOW 'ATTACHEDWINDOWS) do (DETACHWINDOW ATTACHEDWINDOW) (CLOSEW ATTACHEDWINDOW)) (with REMOTE.PSW.MENUS (WINDOWPROP WINDOW 'MENU) (if COMMANDMENU then (SETQ OPMENU COMMANDMENU) else (SETQ OPMENU (create MENU ITEMS _ REMOTE.PSW.ITEMS WHENSELECTEDFN _ (FUNCTION \REMOTE.PSWOP.SELECTED) CENTERFLG _ T MENUCOLUMNS _ 3))) (if PROCESSMENU then (DELETEMENU PROCESSMENU NIL WINDOW))) (SETQ PMENU (create MENU ITEMS _ (with PROCESSDATA PROCESSDATA PROCESSES) WHENSELECTEDFN _ (FUNCTION \REMOTE.PSW.SELECTED) MENUFONT _ DEFAULTFONT CENTERFLG _ T)) [SHAPEW WINDOW (create REGION WIDTH _ [WIDTHIFWINDOW (SETQ WIDTH (MAX (fetch IMAGEWIDTH of PMENU) (fetch IMAGEWIDTH of OPMENU] HEIGHT _ (HEIGHTIFWINDOW (PLUS (fetch IMAGEHEIGHT of PMENU) (fetch IMAGEHEIGHT of OPMENU) 4) T) using (WINDOWPROP WINDOW 'REGION] (if (NULL (with REMOTE.PSW.MENUS (WINDOWPROP WINDOW 'MENUS) COMMANDMENU)) then (ADDMENU OPMENU WINDOW (create POSITION XCOORD _ (QUOTIENT (DIFFERENCE WIDTH (fetch IMAGEWIDTH of OPMENU)) 2) YCOORD _ 0))) (ADDMENU PMENU WINDOW (create POSITION XCOORD _ (QUOTIENT (DIFFERENCE (with REGION (DSPCLIPPINGREGION NIL WINDOW) WIDTH) (fetch IMAGEWIDTH of PMENU)) 2) YCOORD _ (PLUS (fetch IMAGEHEIGHT of OPMENU) 4))) (if (SETQ SELECTED (with PROCESSDATA PROCESSDATA SELECTED)) then (if (FMEMB SELECTED (with PROCESSDATA PROCESSDATA PROCESSES)) then (SHADEITEM SELECTED PMENU SELECTIONSHADE))) (WINDOWPROP WINDOW 'PROCESSDATA PROCESSDATA]) (REMOTE.PROCESS.ERROR [LAMBDA (ERROR) (* ; "Edited 4-Sep-87 07:30 by cdl") (* DECLARATIONS%: (RECORD ERROR  (NIL TYPE)) (RECORD ALST  (KEY . VALUE))) (LET ((ALST (ASSOC (with ERROR ERROR TYPE) REMOTE.PROCESS.ERRORS))) (if ALST then (PROMPTPRINT (with ALST ALST VALUE)) else (PROMPTPRINT (with ERROR ERROR TYPE) (with ALST (ASSOC T REMOTE.PROCESS.ERRORS) VALUE]) (\REMOTE.GET.PROCESS.DATA [LAMBDA NIL (* ; "Edited 26-Aug-87 11:33 by cdl") (DECLARE (GLOBALVARS \PROCESSES)) `(RETURN (,(PROCESS.NAME (TTY.PROCESS)) ,(in \PROCESSES collect PROCESS.NAME]) (\REMOTE.PROCESS.BACKTRACE [LAMBDA (COURIERSTREAM PROGRAM PROCEDURE PROCESS COMMAND BULK.DATA.STREAM) (* ; "Edited 18-Jul-88 10:35 by cdl") (if (SETQ PROCESS (FIND.PROCESS PROCESS)) then (LET (STKP (PLVLFILEFLG T) (FX (fetch (PROCESS PROCFX) of PROCESS))) (BAKTRACE (if (ZEROP FX) then (* The currently active proc!) (FUNCTION \REMOTE.PROCESS.BACKTRACE) else (SETQ STKP (\MAKESTACKP NIL FX))) NIL NIL (CDR (OR (ASSOC COMMAND REMOTE.PROCESS.BACKTRACE.COMMANDS) (ASSOC 'BT REMOTE.PROCESS.BACKTRACE.COMMANDS))) BULK.DATA.STREAM) (if STKP then (RELSTK STKP))) '(RETURN) else '(ABORT NO.SUCH.PROCESS]) (\REMOTE.PROCESS.KILL [LAMBDA (COURIERSTREAM PROGRAM PROCEDURE PROCESS) (* cdl " 3-Dec-85 18:59") (if (NOT (SETQ PROCESS (FIND.PROCESS PROCESS))) then '(ABORT NO.SUCH.PROCESS) elseif (EQ PROCESS (TTY.PROCESS)) then '(ABORT TTY.PROCESS) elseif (fetch PROCSYSTEMP of PROCESS) then '(ABORT SYSTEM.PROCESS) else (DEL.PROCESS PROCESS) '(RETURN]) (\REMOTE.PROCESS.RESTART [LAMBDA (COURIERSTREAM PROGRAM PROCEDURE PROCESS) (* ; "Edited 18-Jul-88 10:18 by cdl") (if (SETQ PROCESS (FIND.PROCESS PROCESS)) then (RESTART.PROCESS PROCESS) '(RETURN) else '(ABORT NO.SUCH.PROCESS]) (\REMOTE.PROCESS.SUSPEND [LAMBDA (COURIERSTREAM PROGRAM PROCEDURE PROCESS) (* ; "Edited 18-Jul-88 10:19 by cdl") (if (SETQ PROCESS (FIND.PROCESS PROCESS)) then (if (NEQ PROCESS (THIS.PROCESS)) then (SUSPEND.PROCESS PROCESS)) '(RETURN) else '(ABORT NO.SUCH.PROCESS]) (\REMOTE.PROCESS.TTY [LAMBDA (COURIERSTREAM PROGRAM PROCEDURE PROCESS) (* ; "Edited 18-Jul-88 10:23 by cdl") (if PROCESS then (if (SETQ PROCESS (FIND.PROCESS PROCESS)) then (TTY.PROCESS PROCESS) '(RETURN) else '(ABORT NO.SUCH.PROCESS)) else `(RETURN ,(if (TTY.PROCESS) then (PROCESS.NAME (TTY.PROCESS]) (\REMOTE.PROCESS.WAKE [LAMBDA (COURIERSTREAM PROGRAM PROCEDURE PROCESS STATUS) (* ; "Edited 18-Jul-88 10:20 by cdl") (if (SETQ PROCESS (FIND.PROCESS PROCESS)) then (WAKE.PROCESS PROCESS STATUS) '(RETURN) else '(ABORT NO.SUCH.PROCESS]) (\REMOTE.PSW.SELECTED [LAMBDA (ITEM MENU BUTTON) (* cdl " 3-Dec-85 20:00") (with PROCESSDATA (WINDOWPROP (WFROMMENU MENU) 'PROCESSDATA) (if (AND SELECTED (NEQ ITEM SELECTED)) then (SHADEITEM SELECTED MENU WHITESHADE)) (SHADEITEM ITEM MENU SELECTIONSHADE) (SETQ SELECTED ITEM]) (\REMOTE.PSWOP.SELECTED [LAMBDA (ITEM MENU BUTTON) (* ; "Edited 18-Jul-88 11:24 by cdl") (DECLARE (GLOBALVARS PROCOP.WAKEMENU WAITINGCURSOR) (SPECVARS ITEM)) (ALLOW.BUTTON.EVENTS) (LET (VALUE PROCESS ERROR NEWPROCESSDATA COURIERSTREAM (WINDOW (WFROMMENU MENU))) (DECLARE (SPECVARS WINDOW)) (WITH.MONITOR (WINDOWPROP WINDOW 'LOCK) (SETQ COURIERSTREAM (WINDOWPROP WINDOW 'COURIERSTREAM)) [with PROCESSDATA (WINDOWPROP WINDOW 'PROCESSDATA) (if [NOT (EQUAL PROCESSES (fetch (PROCESSDATA PROCESSES) of (SETQ NEWPROCESSDATA (COURIER.CALL COURIERSTREAM 'PROCESS 'GET.PROCESS.DATA] then (if (MEMB SELECTED (fetch (PROCESSDATA PROCESSES) of NEWPROCESSDATA )) then (replace (PROCESSDATA SELECTED) of NEWPROCESSDATA with SELECTED)) (REMOTE.PSW.REDISPLAY WINDOW NEWPROCESSDATA)) (SELECTQ ITEM (WHO? (if (SETQ PROCESS (COURIER.CALL COURIERSTREAM 'PROCESS 'GET.TTY.PROCESS)) then (with REMOTE.PSW.MENUS (WINDOWPROP WINDOW 'MENU) (\REMOTE.PSW.SELECTED PROCESS PROCESSMENU)) else (PROMPTPRINT "No process has the tty!!!"))) (UPDATE NIL) (if SELECTED then (SELECTQ ITEM (KBD_ (if (SETQ ERROR (COURIER.CALL COURIERSTREAM 'PROCESS 'SET.TTY.PROCESS SELECTED 'RETURNERRORS)) then (REMOTE.PROCESS.ERROR ERROR))) (INFO (PROMPTPRINT "Not yet implemented")) (KILL (if (SETQ ERROR (COURIER.CALL COURIERSTREAM 'PROCESS 'KILL SELECTED 'RETURNERRORS)) then (REMOTE.PROCESS.ERROR ERROR) else (REMOTE.PSW.REDISPLAY WINDOW))) (RESTART (if (SETQ ERROR (COURIER.CALL COURIERSTREAM 'PROCESS 'RESTART SELECTED 'RETURNERRORS)) then (REMOTE.PROCESS.ERROR ERROR))) (WAKE (PROG NIL (if (SETQ ERROR (COURIER.CALL COURIERSTREAM 'PROCESS 'WAKE SELECTED (SELECTQ [MENU (OR PROCOP.WAKEMENU (SETQ PROCOP.WAKEMENU (create MENU ITEMS _ '((NIL 'NULL) T Other) TITLE _ "WakeUp Value" CENTERFLG _ T] (NIL (RETURN)) (NULL NIL) (T T) (Other (CAR (OR (LISTP (PROCESS.READ "Value to return to woken process: " )) (RETURN)))) NIL) 'RETURNERRORS)) then (REMOTE.PROCESS.ERROR ERROR)))) (SUSPEND (if (SETQ ERROR (COURIER.CALL COURIERSTREAM 'PROCESS 'SUSPEND SELECTED 'RETURNERRORS)) then (REMOTE.PROCESS.ERROR ERROR))) (if (ASSOC ITEM REMOTE.PROCESS.BACKTRACE.COMMANDS) then (RESETFORM (CURSOR WAITINGCURSOR) (REMOTE.PROCESS.BACKTRACE SELECTED ITEM WINDOW])]) ) (RPAQQ REMOTE.PSW.ITEMS (BT WHO? KILL BTV KBD_ RESTART BTV* INFO WAKE BTV! UPDATE SUSPEND)) (RPAQQ REMOTE.PROCESS.ERRORS ((NO.SUCH.PROCESS . "Process not found!") (TTY.PROCESS . "Can't, TTY process!") (SYSTEM.PROCESS . "Can't, SYSTEM process!") (T . " remote process error!"))) (RPAQQ REMOTE.PROCESS.BACKTRACE.COMMANDS ((BT . 0) (BTV . 1) (BTV* . 7) (BTV! . 39))) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS REMOTE.PSW.ITEMS REMOTE.PROCESS.ERRORS REMOTE.PROCESS.BACKTRACE.COMMANDS) ) (DECLARE%: DONTCOPY (DECLARE%: EVAL@COMPILE (RECORD PROCESSDATA (SELECTED PROCESSES)) (RECORD REMOTE.PSW.MENUS (COMMANDMENU PROCESSMENU)) ) (DECLARE%: EVAL@COMPILE (RPAQQ SELECTIONSHADE 520) (CONSTANTS (SELECTIONSHADE 520)) ) ) (FILESLOAD COURIERSERVE COURIERDEFS) (COURIERPROGRAM PROCESS (1199 0) TYPES [[PROCESSDATA (RECORD (SELECTED PROCESS) (PROCESSES (SEQUENCE PROCESS] (PROCESS ATOM) (STATUS ATOM) (COMMAND (ENUMERATION (BT 0) (BTV 1) (BTV* 7) (BTV! 39] INHERITS (INTERLISP) PROCEDURES ((GET.PROCESS.DATA 0 NIL RETURNS (PROCESSDATA) REPORTS NIL IMPLEMENTEDBY \REMOTE.GET.PROCESS.DATA) (BACKTRACE 1 (PROCESS COMMAND BULK.DATA.SINK) RETURNS NIL REPORTS NIL IMPLEMENTEDBY \REMOTE.PROCESS.BACKTRACE) (KILL 2 (PROCESS) RETURNS NIL REPORTS (NO.SUCH.PROCESS TTY.PROCESS SYSTEM.PROCESS) IMPLEMENTEDBY \REMOTE.PROCESS.KILL) (RESTART 3 (PROCESS) RETURNS NIL REPORTS (NO.SUCH.PROCESS) IMPLEMENTEDBY \REMOTE.PROCESS.RESTART) (WAKE 4 (PROCESS STATUS) RETURNS NIL REPORTS (NO.SUCH.PROCESS) IMPLEMENTEDBY \REMOTE.PROCESS.WAKE) (SUSPEND 5 (PROCESS) RETURNS NIL REPORTS (NO.SUCH.PROCESS) IMPLEMENTEDBY \REMOTE.PROCESS.SUSPEND) (GET.TTY.PROCESS 6 NIL RETURNS (PROCESS) REPORTS NIL IMPLEMENTEDBY \REMOTE.PROCESS.TTY) (SET.TTY.PROCESS 7 (PROCESS) RETURNS NIL REPORTS (NO.SUCH.PROCESS) IMPLEMENTEDBY \REMOTE.PROCESS.TTY)) ERRORS ((NO.SUCH.PROCESS 0) (TTY.PROCESS 1) (SYSTEM.PROCESS 3))) (COURIER.START.SERVER) (PUTPROPS REMOTEPSW COPYRIGHT ("Xerox Corporation & Stanford University" 1985 1986 1987 1988)) (DECLARE%: DONTCOPY (FILEMAP (NIL (1860 2513 (REMOTE.PROCESS.STATUS.WINDOW 1870 . 2511)) (2514 18392 ( REMOTE.PROCESS.BACKTRACE 2524 . 5193) (REMOTE.PSW.REDISPLAY 5195 . 9103) (REMOTE.PROCESS.ERROR 9105 . 9857) (\REMOTE.GET.PROCESS.DATA 9859 . 10129) (\REMOTE.PROCESS.BACKTRACE 10131 . 11208) ( \REMOTE.PROCESS.KILL 11210 . 11666) (\REMOTE.PROCESS.RESTART 11668 . 11957) (\REMOTE.PROCESS.SUSPEND 11959 . 12316) (\REMOTE.PROCESS.TTY 12318 . 12785) (\REMOTE.PROCESS.WAKE 12787 . 13140) ( \REMOTE.PSW.SELECTED 13142 . 13553) (\REMOTE.PSWOP.SELECTED 13555 . 18390))))) STOP