(FILECREATED "16-JUL-83 12:30:46" {PHYLUM}<LISPCORE>SOURCES>IMAGEIO.;5 8257 changes to: (VARS IMAGEIOCOMS) (FNS IMAGESTREAMP \DisplayEventFn \DisplayGetFileName \DisplayInit \DisplayOpenFile \GetOFDFromDisplayStream) previous date: "15-JUL-83 17:28:03" {PHYLUM}<KAPLAN>LISP>IMAGEIO.;1) (* Copyright (c) 1983 by Xerox Corporation) (PRETTYCOMPRINT IMAGEIOCOMS) (RPAQQ IMAGEIOCOMS [(FNS IMAGESTREAMP IMAGESTREAMTYPE IMAGESTREAMTYPEP) (FNS \IMAGEIOINIT) (INITRECORDS IMAGEOPS) (DECLARE: DONTEVAL@LOAD DOCOPY (P (\IMAGEIOINIT))) (DECLARE: DONTCOPY (EXPORT (MACROS IMAGEOP \DISPLAYSTREAMP) (RECORDS IMAGEOPS) (GLOBALVARS \NOIMAGEOPS))) (COMS (* Implementation of display stream resident "files") (FNS \DisplayEventFn \DisplayGetFileName \DisplayInit \DisplayOpenFile \GetOFDFromDisplayStream) (GLOBALVARS DisplayFDEV) (DECLARE: DONTEVAL@LOAD DOCOPY (P (\DisplayInit]) (DEFINEQ (IMAGESTREAMP [LAMBDA NARGS (* rmk: "16-JUL-83 12:30") (PROG [STYPE (STREAM (DTESTFAIL (AND (IGREATERP NARGS 0) (ARG NARGS 1)) (QUOTE STREAM] (SETQ STYPE (fetch (IMAGEOPS IMAGETYPE) of (fetch (STREAM IMAGEOPS) of STREAM))) (RETURN (AND (COND ((IGREATERP NARGS 1) (EQMEMB (ARG NARGS 1) STYPE)) (T STYPE)) STREAM]) (IMAGESTREAMTYPE [LAMBDA (STREAM) (* rmk: "14-JUL-83 21:21") (fetch (IMAGEOPS IMAGETYPE) of (fetch (STREAM IMAGEOPS) of (DTESTFAIL STREAM (QUOTE STREAM]) (IMAGESTREAMTYPEP [LAMBDA (STREAM TYPE) (* rmk: "14-JUL-83 21:22") (EQMEMB TYPE (fetch (IMAGEOPS IMAGETYPE) of (fetch (STREAM IMAGEOPS) of (DTESTFAIL STREAM (QUOTE STREAM]) ) (DEFINEQ (\IMAGEIOINIT [LAMBDA NIL (* rmk: "14-JUL-83 21:24") (SETQ \NOIMAGEOPS (create IMAGEOPS IMAGETYPE ← NIL IMCLOSEFN ←(FUNCTION NILL]) ) (/DECLAREDATATYPE (QUOTE IMAGEOPS) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER))) (DECLARE: DONTEVAL@LOAD DOCOPY (\IMAGEIOINIT) ) (DECLARE: DONTCOPY (* FOLLOWING DEFINITIONS EXPORTED) (DECLARE: EVAL@COMPILE (PUTPROPS IMAGEOP MACRO [ARGS (CONS (QUOTE SPREADAPPLY*) (CONS (COND [(EQ (CAR (LISTP (CAR ARGS))) (QUOTE QUOTE)) (LIST (QUOTE fetch) (LIST (QUOTE IMAGEOPS) (CADAR ARGS)) (QUOTE of) (LIST (QUOTE fetch) (QUOTE (STREAM IMAGEOPS)) (QUOTE of) (CADR ARGS] (T (HELP "IMAGEOP - OPNAME not quoted:" ARGS))) (CDDR ARGS]) (PUTPROPS \DISPLAYSTREAMP MACRO ((X) (type? DISPLAYSTREAM X))) ) [DECLARE: EVAL@COMPILE (DATATYPE IMAGEOPS (IMAGETYPE IMCLOSEFN IMXPOSITION IMYPOSITION IMFONT IMLEFTMARGIN IMRIGHTMARGIN IMLINEFEED IMDRAWLINE IMDRAWCURVE IMDRAWCIRCLE IMDRAWELLIPSE IMBLTSHADE) ) ] (/DECLAREDATATYPE (QUOTE IMAGEOPS) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER))) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS \NOIMAGEOPS) ) (* END EXPORTED DEFINITIONS) ) (* Implementation of display stream resident "files") (DEFINEQ (\DisplayEventFn [LAMBDA (FDEV EVENT) (* bvm: "25-MAY-83 12:32") (SELECTQ EVENT (BEFORELOGOUT (DISPLAYBEFOREEXIT (QUOTE LOGOUT))) (AFTERLOGOUT (DISPLAYAFTERENTRY (QUOTE LOGOUT))) (BEFOREMAKESYS (DISPLAYBEFOREEXIT (QUOTE MAKESYS))) (AFTERMAKESYS (DISPLAYAFTERENTRY (QUOTE MAKESYS))) ((BEFORESYSOUT BEFORESAVEVM) (DISPLAYBEFOREEXIT (QUOTE SYSOUT))) ((AFTERSYSOUT AFTERSAVEVM) (DISPLAYAFTERENTRY (QUOTE SYSOUT))) NIL]) (\DisplayGetFileName [LAMBDA (NAME RECOG FD) (* rrb "19-JUL-80 10:29") (* the name of a display stream is itself.) NAME]) (\DisplayInit [LAMBDA NIL (* bvm: " 3-JUN-83 23:38") (* Initializes global variables for the Display device) (* Display Streams are referred to only by themselves so they do not need directory operations. Most of the fields in the DisplayDevice are empty to avoid something bad happening.) (DECLARE (GLOBALVARS DisplayFDEV)) (SETQ DisplayFDEV (create FDEV DEVICENAME ←(FUNCTION DISPLAY) RESETABLE ← NIL RANDOMACCESSP ← NIL PAGEMAPPED ← NIL CLOSEFILE ←(FUNCTION NILL) DELETEFILE ←(FUNCTION NILL) GETFILEINFO ←(FUNCTION NILL) OPENFILE ←(FUNCTION \DisplayOpenFile) READPAGES ←(FUNCTION \ILLEGAL.DEVICEOP) SETFILEINFO ←(FUNCTION NILL) GENERATEFILES ←(FUNCTION \GENERATENOFILES) TRUNCATEFILE ←(FUNCTION NILL) WRITEPAGES ←(FUNCTION \ILLEGAL.DEVICEOP) GETFILENAME ←(FUNCTION \DisplayGetFileName) REOPENFILE ←(FUNCTION \DisplayOpenFile) EVENTFN ←(FUNCTION \DisplayEventFn) DIRECTORYNAMEP ←(FUNCTION NILL) HOSTNAMEP ←(FUNCTION NILL) BIN ←(FUNCTION \ILLEGAL.DEVICEOP) BOUT ←(FUNCTION \DSPPRINTCHAR) PEEKBIN ←(FUNCTION \ILLEGAL.DEVICEOP) BACKFILEPTR ←(FUNCTION \PAGEDBACKFILEPTR) BLOCKIN ←(FUNCTION \ILLEGAL.DEVICEOP) BLOCKOUT ←(FUNCTION \NONPAGEDBOUTS))) (\DEFINEDEVICE NIL DisplayFDEV]) (\DisplayOpenFile [LAMBDA (NAME ACCESS RECOG OTHERINFO OLDSTREAM) (* rmk: " 1-JUN-82 22:22") (* opens the display stream "name" Display Streams are always open for output and never for input so this function just creates (if necessary) an STREAM and returns it.) (COND ((NEQ ACCESS (QUOTE OUTPUT)) (LISPERROR "FILE WON'T OPEN" NAME)) ((fetch \SFOFD of NAME)) (T (PROG1 (replace \SFOFD of NAME with (create STREAMOFDISPLAYSTREAM FULLFILENAME ← NAME DEVICE ← DisplayFDEV DISPLAYSTREAM ← NAME ACCESS ←(QUOTE OUTPUT) OUTCHARFN ←(FUNCTION \DSPPRINTCHAR))) (* put copy of the display Stream into F1 so that the FULLFILENAME field can be changed to T if this is used as the tty device.) (\SFFIXLINELENGTH NAME]) (\GetOFDFromDisplayStream [LAMBDA (DS ACCESS NOERROR) (* bvm: "26-DEC-81 21:27") (* returns the STREAM for a DISPLAYSTREAM If it doesn't have one, it creates one. This is called by \GETOFD to allow DisplayStreams to be used like open output files.) (COND [(AND ACCESS (NEQ ACCESS (QUOTE OUTPUT))) (COND (NOERROR NIL) (T (LISPERROR "FILE NOT OPEN" DS] (T (\DisplayOpenFile DS (QUOTE OUTPUT]) ) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS DisplayFDEV) ) (DECLARE: DONTEVAL@LOAD DOCOPY (\DisplayInit) ) (PRETTYCOMPRINT IMAGEIOCOMS) (RPAQQ IMAGEIOCOMS [(FNS IMAGESTREAMP IMAGESTREAMTYPE IMAGESTREAMTYPEP) (FNS \IMAGEIOINIT) (INITRECORDS IMAGEOPS) (DECLARE: DONTEVAL@LOAD DOCOPY (P (\IMAGEIOINIT))) (DECLARE: DONTCOPY (EXPORT (MACROS IMAGEOP \DISPLAYSTREAMP) (RECORDS IMAGEOPS) (GLOBALVARS \NOIMAGEOPS))) [COMS (* Implementation of display stream resident "files") (FNS \DisplayEventFn \DisplayGetFileName \DisplayInit \DisplayOpenFile \GetOFDFromDisplayStream) (GLOBALVARS DisplayFDEV) (DECLARE: DONTEVAL@LOAD DOCOPY (P (\DisplayInit] (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA) (NLAML) (LAMA IMAGESTREAMP]) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDTOVAR NLAMA ) (ADDTOVAR NLAML ) (ADDTOVAR LAMA IMAGESTREAMP) ) (PUTPROPS IMAGEIO COPYRIGHT ("Xerox Corporation" 1983)) (DECLARE: DONTCOPY (FILEMAP (NIL (981 1927 (IMAGESTREAMP 991 . 1442) (IMAGESTREAMTYPE 1444 . 1668) (IMAGESTREAMTYPEP 1670 . 1925)) (1928 2153 (\IMAGEIOINIT 1938 . 2151)) (3504 7174 (\DisplayEventFn 3514 . 4039) ( \DisplayGetFileName 4041 . 4276) (\DisplayInit 4278 . 5837) (\DisplayOpenFile 5839 . 6687) ( \GetOFDFromDisplayStream 6689 . 7172))))) STOP