(FILECREATED "30-Jul-86 12:43:00" {ERIS}<LISPCORE>LIBRARY>CLSTREAMS.;35 87540 changes to: (FUNCTIONS CLOSE OPEN %%INITIALIZE-SYNONYM-IMAGEOPS WITH-INPUT-FROM-STRING MAKE-FILL-POINTER-OUTPUT-STREAM WITH-OUTPUT-TO-STRING MAKE-STRING-OUTPUT-STREAM GET-OUTPUT-STREAM-STRING %%MAKE-INITIAL-STRING-STREAM-CONTENTS) (VARS CLSTREAMSCOMS) previous date: "28-Jul-86 17:21:31" {ERIS}<LISPCORE>LIBRARY>CLSTREAMS.;29) (* Copyright (c) 1985, 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT CLSTREAMSCOMS) (RPAQQ CLSTREAMSCOMS ((* * "Implements a number of stream functions from CommonLisp. See CLtL chapter 21" ) (COMS (* "documented functions and macros") (FUNCTIONS OPEN CLOSE) (FUNCTIONS STREAM-ELEMENT-TYPE INPUT-STREAM-P OUTPUT-STREAM-P) (FUNCTIONS FILE-STREAM-POSITION) (FUNCTIONS MAKE-SYNONYM-STREAM MAKE-BROADCAST-STREAM MAKE-CONCATENATED-STREAM MAKE-TWO-WAY-STREAM MAKE-ECHO-STREAM MAKE-STRING-INPUT-STREAM) (FUNCTIONS %%MAKE-INITIAL-STRING-STREAM-CONTENTS) (DECLARE: DOCOPY (FUNCTIONS WITH-OPEN-STREAM WITH-INPUT-FROM-STRING WITH-OUTPUT-TO-STRING WITH-OPEN-FILE)) (FUNCTIONS MAKE-STRING-OUTPUT-STREAM MAKE-FILL-POINTER-OUTPUT-STREAM GET-OUTPUT-STREAM-STRING)) (COMS (* "helpers") (FUNCTIONS %%NEW-FILE PREDICT-NAME)) (COMS (* "methods for the special devices") (FNS %%BROADCAST-STREAM-DEVICE-BOUT %%BROADCAST-STREAM-DEVICE-CLOSEFILE %%BROADCAST-STREAM-DEVICE-FORCEOUTPUT %%BROADCAST-STREAM-DEVICE-OPENFILE) (FNS %%CONCATENATED-STREAM-DEVICE-BIN %%CONCATENATED-STREAM-DEVICE-CLOSEFILE %%CONCATENATED-STREAM-DEVICE-EOFP %%CONCATENATED-STREAM-DEVICE-OPENFILE %%CONCATENATED-STREAM-DEVICE-PEEKBIN) (FNS %%ECHO-STREAM-DEVICE-BIN) (FNS %%SYNONYM-STREAM-DEVICE-BIN %%SYNONYM-STREAM-DEVICE-BOUT %%SYNONYM-STREAM-DEVICE-CLOSEFILE %%SYNONYM-STREAM-DEVICE-EOFP %%SYNONYM-STREAM-DEVICE-FORCEOUTPUT %%SYNONYM-STREAM-DEVICE-GETFILEINFO %%SYNONYM-STREAM-DEVICE-OPENFILE %%SYNONYM-STREAM-DEVICE-PEEKBIN %%SYNONYM-STREAM-DEVICE-READP %%SYNONYM-STREAM-DEVICE-SETFILEINFO) (FNS %%TWO-WAY-STREAM-DEVICE-BIN %%TWO-WAY-STREAM-DEVICE-BOUT %%TWO-WAY-STREAM-DEVICE-CLOSEFILE %%TWO-WAY-STREAM-DEVICE-EOFP %%TWO-WAY-STREAM-DEVICE-FORCEOUTPUT %%TWO-WAY-STREAM-DEVICE-OPENFILE %%TWO-WAY-STREAM-DEVICE-PEEKBIN) (FUNCTIONS %%FILL-POINTER-STREAM-DEVICE-CLOSEFILE %%FILL-POINTER-STREAM-DEVICE-GETFILEPTR)) (COMS (* "helper stuff") (FNS %%SYNONYM-STREAM-DEVICE-GET-STREAM)) (COMS (* "package initialization") (VARIABLES *TRACE-OUTPUT* *DEBUG-IO* *QUERY-IO* *TERMINAL-IO* *ERROR-OUTPUT* *STANDARD-OUTPUT* *STANDARD-INPUT*) (FUNCTIONS %%INITIALIZE-SYNONYM-IMAGEOPS %%INITIALIZE-STANDARD-STREAMS) (FNS %%INITIALIZE-CLSTREAM-TYPES) (DECLARE: DONTEVAL@LOAD DOCOPY (*) (P (%%INITIALIZE-CLSTREAM-TYPES) (%%INITIALIZE-STANDARD-STREAMS) (%%INITIALIZE-SYNONYM-IMAGEOPS)))) (PROP FILETYPE CLSTREAMS) (SETFS FILE-STREAM-POSITION))) (* * "Implements a number of stream functions from CommonLisp. See CLtL chapter 21") (* "documented functions and macros") (DEFUN OPEN (FILENAME &KEY (DIRECTION :INPUT) (ELEMENT-TYPE (QUOTE STRING-CHAR)) (IF-EXISTS NIL EXISTS-P) (IF-DOES-NOT-EXIST NIL DOES-NOT-EXIST-P)) (* * "Return a stream which reads from or writes to Filename. Defined keywords: :direction (one of :input, :output or :probe :element-type), Type of object to read or write, default String-Char, :if-exists (one of :error, :new-version, :overwrite, :append or nil), :if-does-not-exist (one of :error, :create or nil). See the manual for details.") (CL:UNLESS (MEMQ DIRECTION (QUOTE (:INPUT :OUTPUT :IO :PROBE))) (CL:ERROR "~S isn't a valid direction for open." DIRECTION)) (CL:UNLESS (MEMQ ELEMENT-TYPE (QUOTE (STRING-CHAR UNSIGNED-BYTE CHARACTER :DEFAULT))) (CL:ERROR "~S isn't an implemented element-type for open." ELEMENT-TYPE)) (LET ((PATHNAME (PATHNAME FILENAME)) (FOR-INPUT (MEMQ DIRECTION (QUOTE (:IO :INPUT)))) (FOR-OUTPUT (MEMQ DIRECTION (QUOTE (:IO :OUTPUT)))) (STREAM NIL)) (* * "Do hairy defaulting of :if-exists and :if-does-not-exist keywords.") (CL:UNLESS EXISTS-P (SETQ IF-EXISTS (CL:IF (EQ (PATHNAME-VERSION PATHNAME) :NEWEST) :NEW-VERSION :ERROR))) (CL:UNLESS DOES-NOT-EXIST-P (SETQ IF-DOES-NOT-EXIST (COND ((OR (MEMQ IF-EXISTS (QUOTE (:OVERWRITE :APPEND))) (EQ DIRECTION :INPUT)) :ERROR) ((EQ DIRECTION :PROBE) NIL) (T :CREATE)))) (LOOP (* "See if the file exists and handle the existential keywords.") (LET ((NAMESTRING (PREDICT-NAME PATHNAME))) (if NAMESTRING then (* "file exists") (if FOR-OUTPUT then (CASE IF-EXISTS (:ERROR (CERROR "write it anyway." "File ~A already exists." NAMESTRING) (SETQ STREAM (OPENSTREAM NAMESTRING (QUOTE OUTPUT))) (RETURN NIL)) ((:NEW-VERSION :SUPERSEDE :RENAME :RENAME-AND-DELETE) (SETQ STREAM (OPENSTREAM PATHNAME (QUOTE OUTPUT) (QUOTE NEW))) (RETURN NIL)) (:OVERWRITE (SETQ STREAM (OPENSTREAM NAMESTRING (QUOTE OUTPUT) (QUOTE OLD))) (RETURN NIL)) (:APPEND (SETQ STREAM (OPENSTREAM NAMESTRING (QUOTE APPEND) (QUOTE OLD))) (RETURN NIL)) ((NIL) (RETURN-FROM OPEN NIL)) (T (CL:ERROR "~S is not a valid value for :if-exists." IF-EXISTS))) elseif FOR-INPUT then (SETQ STREAM (OPENSTREAM NAMESTRING (QUOTE INPUT) (QUOTE OLD))) (RETURN NIL) else (SETQ STREAM (create STREAM FULLFILENAME ← NAMESTRING)) (RETURN NIL)) else (* "file does not exist") (if FOR-OUTPUT then (CASE IF-DOES-NOT-EXIST (:ERROR (CERROR "prompt for a new name." "File ~A does not exist." PATHNAME) (FORMAT *QUERY-IO* "~&New file name: ") (SETQ PATHNAME (PATHNAME (READ-LINE *QUERY-IO*) ))) (:CREATE (SETQ STREAM (OPENSTREAM PATHNAME (QUOTE OUTPUT) (QUOTE NEW))) (RETURN NIL)) ((NIL) (RETURN-FROM OPEN NIL)) (T (CL:ERROR "~S is not a valid value for :if-does-not-exist." IF-DOES-NOT-EXIST))) elseif FOR-INPUT then (CASE IF-DOES-NOT-EXIST (:ERROR (CERROR "prompt for a new name." "File ~A does not exist." PATHNAME) (FORMAT *QUERY-IO* "~&New file name: ") (SETQ PATHNAME (PATHNAME (READ-LINE *QUERY-IO*) ))) (:CREATE (%%NEW-FILE PATHNAME)) ((NIL) (RETURN-FROM OPEN NIL)) (T (CL:ERROR "~S is not a valid value for :if-does-not-exist." IF-DOES-NOT-EXIST))) else (* "Open for probe.") (RETURN NIL))))) STREAM)) (DEFUN CLOSE (STREAM &KEY ABORT) (* * "Close a stream. If ABORT, then don't keep the file") (if (STREAMP STREAM) then (if (OPENP STREAM) then (* * "determine 'deletability' of stream's file before closing, as that trashes the info") (LET ((ABORTABLE (AND (DIRTYABLE STREAM) (NOT (APPENDONLY STREAM))))) (CLOSEF STREAM) (if (AND ABORT ABORTABLE) then (* "eventually we will change device CLOSEF methods to take an ABORT arg. For now, simulate it.") (DELFILE (NAMESTRING STREAM))))) else (ERROR "Closing a non-stream" STREAM)) T) (DEFUN STREAM-ELEMENT-TYPE (STREAM) (QUOTE UNSIGNED-BYTE)) (DEFUN INPUT-STREAM-P (STREAM) (CL:WHEN (NOT (STREAMP STREAM)) (\ILLEGAL.ARG STREAM)) (* * "we return T instead of the stream because Symbolics does") (AND (\IOMODEP STREAM (QUOTE INPUT) T) T)) (DEFUN OUTPUT-STREAM-P (STREAM) (CL:WHEN (NOT (STREAMP STREAM)) (\ILLEGAL.ARG STREAM)) (* * "we return T instead of the stream because Symbolics does") (AND (\IOMODEP STREAM (QUOTE OUTPUT) T) T)) (DEFUN FILE-STREAM-POSITION (STREAM) (GETFILEPTR STREAM)) (DEFUN MAKE-SYNONYM-STREAM (SYMBOL) (* * "A CommonLisp function for shadowing a stream. See CLtL p. 329") (OPENSTREAM (QUOTE {SYNONYM-STREAM-DEVICE}) (QUOTE BOTH) NIL NIL (BQUOTE ((SYMBOL (\, SYMBOL)))))) (DEFUN MAKE-BROADCAST-STREAM (&REST STREAMS) (* * "CommonLisp function to make a `splitter' stream. See CLtL p329") (OPENSTREAM (QUOTE {BROADCAST-STREAM-DEVICE}) (QUOTE OUTPUT) NIL NIL (BQUOTE ((STREAMS (\, STREAMS)))) NIL)) (DEFUN MAKE-CONCATENATED-STREAM (&REST STREAMS) (* * A CommonLisp function for concatenating several input streams together. See CLtL p. 329) (OPENSTREAM (QUOTE {CONCATENATED-STREAM-DEVICE}) (QUOTE INPUT) NIL NIL (BQUOTE ((STREAMS (\, STREAMS)))) NIL)) (DEFUN MAKE-TWO-WAY-STREAM (INPUT-STREAM OUTPUT-STREAM) (* * "A CommonLisp function for splicing together two streams. See CLtL p. 329") (OPENSTREAM (QUOTE {TWO-WAY-STREAM-DEVICE}) (QUOTE BOTH) NIL NIL (BQUOTE ((INPUT-STREAM (\, INPUT-STREAM)) (OUTPUT-STREAM (\, OUTPUT-STREAM)))))) (DEFUN MAKE-ECHO-STREAM (INPUT-STREAM OUTPUT-STREAM) (* * "A CommonLisp function for splicing together two streams. See CLtL p. 329") (OPENSTREAM (QUOTE {ECHO-STREAM-DEVICE}) (QUOTE BOTH) NIL NIL (BQUOTE ((INPUT-STREAM (\, INPUT-STREAM)) (OUTPUT-STREAM (\, OUTPUT-STREAM)))))) (DEFUN MAKE-STRING-INPUT-STREAM (STRING &OPTIONAL (START 0 STARTP) (END NIL ENDP)) (* * "A CommonLisp function for producing a stream from a string. See CLtL p. 330") (OPENSTRINGSTREAM (if (OR STARTP ENDP) then (SUBSEQ STRING START (if ENDP then END else (CL:LENGTH STRING))) else STRING) (QUOTE INPUT))) (DEFUN %%MAKE-INITIAL-STRING-STREAM-CONTENTS NIL (MAKE-ARRAY 128 :ELEMENT-TYPE (QUOTE STRING-CHAR) :ADJUSTABLE T :FILL-POINTER 0)) (DECLARE: DOCOPY (DEFMACRO WITH-OPEN-STREAM ((VAR STREAM) &BODY (BODY DECLS)) (LET ((ABORTP (GENSYM))) (BQUOTE (LET (((\, VAR) (\, STREAM)) ((\, ABORTP) T)) (\,@ DECLS) (UNWIND-PROTECT (MULTIPLE-VALUE-PROG1 (PROGN (\,@ BODY)) (SETQ (\, ABORTP) NIL)) (CL:WHEN (\, VAR) (CLOSE (\, VAR) :ABORT (\, ABORTP)))))))) (DEFMACRO WITH-INPUT-FROM-STRING ((VAR STRING &KEY (INDEX NIL INDEXP) (START 0 STARTP) (END NIL ENDP)) &BODY (BODY DECLS)) (BQUOTE (LET (((\, VAR) (MAKE-STRING-INPUT-STREAM (\, STRING) (\,@ (if STARTP then (if ENDP then (LIST START END) else (LIST START)) else (if ENDP then (LIST NIL END))))))) (\,@ DECLS) (UNWIND-PROTECT (PROG1 (PROGN (\,@ BODY)) (\,@ (if INDEXP then (BQUOTE ((SETF (\, INDEX) (+ (\, START) (GETFILEPTR (\, VAR)))))) else NIL))) (CLOSE (\, VAR)))))) (DEFMACRO WITH-OUTPUT-TO-STRING ((VAR &OPTIONAL (STRING NIL STRINGP)) &BODY (FORMS DECLS)) (if STRINGP then (BQUOTE (LET (((\, VAR) (MAKE-FILL-POINTER-OUTPUT-STREAM (\, STRING)))) (\,@ DECLS) (UNWIND-PROTECT (PROGN (\,@ FORMS)) (CLOSE (\, VAR))))) else (BQUOTE (LET (((\, VAR) (MAKE-STRING-OUTPUT-STREAM))) (\,@ DECLS) (UNWIND-PROTECT (PROGN (\,@ FORMS) (GET-OUTPUT-STREAM-STRING (\, VAR))) (CLOSE (\, VAR))))))) (DEFMACRO WITH-OPEN-FILE ((VAR &REST OPEN-ARGS) &BODY (FORMS DECLS)) (* * "Bindspec is of the form (Stream File-Name . Options). The file whose name is File-Name is opened using the Options and bound to the variable Stream. The Forms are executed, and when they terminate, normally or otherwise, the file is closed.") (LET ((ABORTP (GENSYM))) (BQUOTE (LET (((\, VAR) (OPEN (\,@ OPEN-ARGS))) ((\, ABORTP) T)) (\,@ DECLS) (UNWIND-PROTECT (MULTIPLE-VALUE-PROG1 (PROGN (\,@ FORMS)) (SETQ (\, ABORTP) NIL)) (CL:WHEN (\, VAR) (CLOSE (\, VAR) :ABORT (\, ABORTP)))))))) ) (DEFUN MAKE-STRING-OUTPUT-STREAM NIL (* * "A function for producing a string stream. See also the function get-output-stream-string. Also, see CLtL p. 330") (MAKE-FILL-POINTER-OUTPUT-STREAM)) (DEFUN MAKE-FILL-POINTER-OUTPUT-STREAM (&OPTIONAL (STRING (%%MAKE-INITIAL-STRING-STREAM-CONTENTS))) (DECLARE (GLOBALVARS \FILL-POINTER-STREAM-DEVICE)) (if (NOT (ARRAY-HAS-FILL-POINTER-P STRING)) then (\ILLEGAL.ARG STRING) else (LET ((STREAM (create STREAM DEVICE ← \FILL-POINTER-STREAM-DEVICE F1 ← STRING ACCESS ← (QUOTE OUTPUT)))) (STREAMPROP STREAM (QUOTE STRING-OUTPUT-STREAM) T) (replace (STREAM OUTCHARFN) of STREAM with (if (ADJUSTABLE-ARRAY-P STRING) then (FUNCTION (LAMBDA (STREAM BYTE) (VECTOR-PUSH-EXTEND (CL:CHARACTER BYTE) (fetch (STREAM F1) of STREAM)))) else (FUNCTION (LAMBDA (STREAM BYTE) (VECTOR-PUSH (CL:CHARACTER BYTE) (fetch (STREAM F1) of STREAM)))))) (replace (STREAM STRMBOUTFN) of STREAM with (FUNCTION \OUTCHAR)) STREAM))) (DEFUN GET-OUTPUT-STREAM-STRING (STRING-OUTPUT-STREAM) (* * "A CommonLisp function for getting the contents of the buffer created by a call to make-string-output-stream. See CLtL p. 330") (if (NOT (STREAMPROP STRING-OUTPUT-STREAM (QUOTE STRING-OUTPUT-STREAM))) then (ERROR "Stream not a string-output-stream" STRING-OUTPUT-STREAM) else (PROG1 (fetch (STREAM F1) of STRING-OUTPUT-STREAM) (replace (STREAM F1) of STRING-OUTPUT-STREAM with ( %%MAKE-INITIAL-STRING-STREAM-CONTENTS ))))) (* "helpers") (DEFUN %%NEW-FILE (FILENAME) (CLOSEF (OPENSTREAM FILENAME (QUOTE OUTPUT) (QUOTE NEW)))) (DEFUN PREDICT-NAME (PATHNAME) (LET ((PATH (PROBE-FILE PATHNAME))) (IF PATH THEN (NAMESTRING PATH)))) (* "methods for the special devices") (DEFINEQ (%%BROADCAST-STREAM-DEVICE-BOUT [LAMBDA (STREAM BYTE) (* hdj "17-Apr-86 18:08") (* * The BOUT method for the broadcast-stream device) (for S in (fetch F1 of STREAM) do (\BOUT S BYTE)) BYTE]) (%%BROADCAST-STREAM-DEVICE-CLOSEFILE [LAMBDA (STREAM) (* hdj "26-Mar-86 16:28") (* * The CLOSEFILE method for the broadcast-stream device) (replace ACCESS of STREAM with NIL) (replace F1 of STREAM with NIL) STREAM]) (%%BROADCAST-STREAM-DEVICE-FORCEOUTPUT [LAMBDA (stream waitForFinish?) (* smL "14-Aug-85 15:55") (* * The FORCEOUTPUT method for the broadcast-stream device) (for s in (fetch F1 of stream) do (FORCEOUTPUT s waitForFinish?]) (%%BROADCAST-STREAM-DEVICE-OPENFILE [LAMBDA (NAME ACCESS RECOG PARAMETERS DEVICE) (* hdj "17-Apr-86 18:07") (* * The OPENFILE method for the broadcast-stream device) (SELECTQ ACCESS ((INPUT BOTH APPEND) NIL) (create STREAM DEVICE ← DEVICE F1 ←(CADR (ASSOC (QUOTE STREAMS) PARAMETERS]) ) (DEFINEQ (%%CONCATENATED-STREAM-DEVICE-BIN [LAMBDA (stream) (* smL "14-Aug-85 16:52") (* * The BIN method for the concatenated-stream device) (while (fetch F1 of stream) do [if (EOFP (CAR (fetch F1 of stream))) then (CLOSEF (pop (fetch F1 of stream))) else (RETURN (\BIN (CAR (fetch F1 of stream] finally (* the EOF case) (\EOF.ACTION stream]) (%%CONCATENATED-STREAM-DEVICE-CLOSEFILE [LAMBDA (stream) (* smL "14-Aug-85 16:53") (* * The CLOSEFILE method for the concatenated-stream device) (replace ACCESS of stream with NIL) (for s in (fetch F1 of stream) do (CLOSEF s)) (replace F1 of stream with NIL) stream]) (%%CONCATENATED-STREAM-DEVICE-EOFP [LAMBDA (stream) (* smL "14-Aug-85 16:53") (* * The EOFP method for the concatenated-stream device) (while (fetch F1 of stream) do (if (EOFP (CAR (fetch F1 of stream))) then (CLOSEF (pop (fetch F1 of stream))) else (RETURN NIL)) finally (* the EOF case) (RETURN T]) (%%CONCATENATED-STREAM-DEVICE-OPENFILE [LAMBDA (NAME ACCESS RECOG PARAMETERS DEVICE) (* hdj "21-Apr-86 14:33") (* * The OPENFILE method for the concatenated-stream device) (SELECTQ ACCESS ((OUTPUT BOTH APPEND) NIL) (create STREAM DEVICE ← DEVICE F1 ←(CADR (ASSOC (QUOTE STREAMS) PARAMETERS]) (%%CONCATENATED-STREAM-DEVICE-PEEKBIN [LAMBDA (stream noErrorFlg?) (* smL "14-Aug-85 16:53") (* * The PEEKBIN method for the concatenated-stream device) (while (fetch F1 of stream) do [if (EOFP (CAR (fetch F1 of stream))) then (CLOSEF (pop (fetch F1 of stream))) else (RETURN (\PEEKBIN (CAR (fetch F1 of stream] finally (* the EOF case) (if noErrorFlg? then (RETURN NIL) else (\EOF.ACTION stream]) ) (DEFINEQ (%%ECHO-STREAM-DEVICE-BIN [LAMBDA (STREAM) (* hdj "21-Apr-86 18:33") (* * The BIN method for the echo-stream device) (LET ((BYTE (%%TWO-WAY-STREAM-DEVICE-BIN STREAM))) (\BOUT STREAM BYTE) BYTE]) ) (DEFINEQ (%%SYNONYM-STREAM-DEVICE-BIN [LAMBDA (STREAM) (* hdj "19-Mar-86 17:19") (* * The BIN method for the synonym-stream device.) (\BIN (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM]) (%%SYNONYM-STREAM-DEVICE-BOUT [LAMBDA (STREAM BYTE) (* hdj "19-Mar-86 17:20") (* * The BOUT method for the synonym-stream device.) (\BOUT (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM) BYTE]) (%%SYNONYM-STREAM-DEVICE-CLOSEFILE [LAMBDA (STREAM) (* hdj "19-Mar-86 17:14") (* * the CLOSEFILE method for the synonym-stream device) (replace F1 of STREAM with NIL) STREAM]) (%%SYNONYM-STREAM-DEVICE-EOFP [LAMBDA (STREAM) (* hdj "19-Mar-86 17:20") (* * The EOFP method for the synonym-stream device.) (\EOFP (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM]) (%%SYNONYM-STREAM-DEVICE-FORCEOUTPUT [LAMBDA (STREAM WAITFORFINISH) (* hdj "19-Mar-86 17:09") (* * The FORCEOUTPUT method for the synonym-stream device.) (FORCEOUTPUT (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM) WAITFORFINISH]) (%%SYNONYM-STREAM-DEVICE-GETFILEINFO [LAMBDA (STREAM ATTRIBUTE DEVICE) (* hdj "19-Mar-86 17:10") (* * The GETFILEINFO method for the synonym-stream device.) (GETFILEINFO (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM) ATTRIBUTE]) (%%SYNONYM-STREAM-DEVICE-OPENFILE [LAMBDA (NAME ACCESS RECOG PARAMETERS DEVICE) (* hdj "19-Mar-86 17:14") (* * the OPENFILE method for the synonym-stream device) (create STREAM DEVICE ← DEVICE F1 ←(CADR (ASSOC (QUOTE SYMBOL) PARAMETERS]) (%%SYNONYM-STREAM-DEVICE-PEEKBIN [LAMBDA (STREAM NOERRORFLG?) (* hdj "19-Mar-86 17:12") (* * The PEEKBIN method for the synonym-stream device) (\PEEKBIN (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM) NOERRORFLG?]) (%%SYNONYM-STREAM-DEVICE-READP [LAMBDA (STREAM FLG) (* hdj "19-Mar-86 17:14") (* * The READP method for the synonym-stream device.) (READP (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM]) (%%SYNONYM-STREAM-DEVICE-SETFILEINFO [LAMBDA (STREAM ATTRIBUTE VALUE DEVICE) (* hdj "19-Mar-86 17:17") (* * The SETFILEINFO method for the synonym-stream device.) (SETFILEINFO (%%SYNONYM-STREAM-DEVICE-GET-STREAM STREAM) ATTRIBUTE VALUE]) ) (DEFINEQ (%%TWO-WAY-STREAM-DEVICE-BIN [LAMBDA (stream) (* smL "14-Aug-85 16:44") (* * The BIN method for the two-way-stream device) (\BIN (fetch F1 of stream]) (%%TWO-WAY-STREAM-DEVICE-BOUT [LAMBDA (stream byte) (* smL "14-Aug-85 16:45") (* * The BOUT method for the two-way-stream device) (\BOUT (fetch F2 of stream) byte]) (%%TWO-WAY-STREAM-DEVICE-CLOSEFILE [LAMBDA (stream) (* smL "14-Aug-85 17:02") (* * The CLOSEFILE method for the two-way-stream device) (replace ACCESS of stream with NIL) (CLOSEF? (fetch F1 of stream)) (replace F1 of stream with NIL) (CLOSEF? (fetch F2 of stream)) (replace F2 of stream with NIL) stream]) (%%TWO-WAY-STREAM-DEVICE-EOFP [LAMBDA (stream) (* smL "14-Aug-85 16:47") (* * The EOFP method for the two-way-stream device) (\EOFP (fetch F1 of stream]) (%%TWO-WAY-STREAM-DEVICE-FORCEOUTPUT [LAMBDA (stream waitForFinish?) (* smL "14-Aug-85 16:49") (* * the FORCEOUTPUT method for the two-way-stream device) (FORCEOUTPUT (fetch F2 of stream) waitForFinish?]) (%%TWO-WAY-STREAM-DEVICE-OPENFILE [LAMBDA (NAME ACCESS RECOG PARAMETERS DEVICE) (* hdj "21-Apr-86 18:17") (* * The OPENFILE method for the two-way-stream device) (SELECTQ ACCESS ((INPUT OUTPUT APPEND) NIL) (create STREAM DEVICE ← DEVICE F1 ←(CADR (ASSOC (QUOTE INPUT-STREAM) PARAMETERS)) F2 ←(CADR (ASSOC (QUOTE OUTPUT-STREAM) PARAMETERS]) (%%TWO-WAY-STREAM-DEVICE-PEEKBIN [LAMBDA (stream noErrorFlg?) (* smL "14-Aug-85 16:46") (* * The PEEKBIN method for the two-way-stream device) (\PEEKBIN (fetch F1 of stream) noErrorFlg?]) ) (DEFUN %%FILL-POINTER-STREAM-DEVICE-CLOSEFILE (STREAM) (* * "the CLOSEFILE method for the fill-pointer-string-stream device") (replace F1 of STREAM with NIL) STREAM) (DEFUN %%FILL-POINTER-STREAM-DEVICE-GETFILEPTR (STREAM) (CL:LENGTH (fetch (STREAM F1) of STREAM))) (* "helper stuff") (DEFINEQ (%%SYNONYM-STREAM-DEVICE-GET-STREAM [LAMBDA (stream) (* hdj "19-Mar-86 14:59") (* * given a synonym-stream, find out what it is currently tracking) (* * this should be a macro) (SYMBOL-VALUE (fetch (STREAM F1) of stream]) ) (* "package initialization") (DEFVAR *TRACE-OUTPUT* ) (DEFVAR *DEBUG-IO* ) (DEFVAR *QUERY-IO* ) (DEFVAR *TERMINAL-IO* ) (DEFVAR *ERROR-OUTPUT* ) (DEFVAR *STANDARD-OUTPUT* ) (DEFVAR *STANDARD-INPUT* ) (DEFUN %%INITIALIZE-SYNONYM-IMAGEOPS NIL (SETQ \SYNONYM-STREAM-IMAGEOPS (create IMAGEOPS IMAGETYPE ← (QUOTE SYNONYM) IMCLOSEFN ← (FUNCTION (LAMBDA (STREAM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMCLOSEFN ) SYN-STREAM SYN-STREAM)))) IMXPOSITION ← (FUNCTION (LAMBDA (STREAM XPOSITION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMXPOSITION ) SYN-STREAM SYN-STREAM XPOSITION)))) IMYPOSITION ← (FUNCTION (LAMBDA (STREAM YPOSITION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMYPOSITION ) SYN-STREAM SYN-STREAM YPOSITION)))) IMFONT ← (FUNCTION (LAMBDA (STREAM FONT) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMFONT) SYN-STREAM SYN-STREAM FONT)))) IMLEFTMARGIN ← (FUNCTION (LAMBDA (STREAM XPOSITION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMLEFTMARGIN ) SYN-STREAM SYN-STREAM XPOSITION)))) IMRIGHTMARGIN ← (FUNCTION (LAMBDA (STREAM YPOSITION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMRIGHTMARGIN ) SYN-STREAM SYN-STREAM YPOSITION)))) IMLINEFEED ← (FUNCTION (LAMBDA (STREAM DELTAY) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMLINEFEED ) SYN-STREAM SYN-STREAM DELTAY)))) IMDRAWLINE ← (FUNCTION (LAMBDA (STREAM X1 Y1 X2 Y2 WIDTH OPERATION COLOR DASHING) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMDRAWLINE) SYN-STREAM SYN-STREAM X1 Y1 X2 Y2 WIDTH OPERATION COLOR DASHING)))) IMDRAWCURVE ← (FUNCTION (LAMBDA (STREAM KNOTS CLOSED BRUSH DASHING ) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMDRAWCURVE) SYN-STREAM SYN-STREAM KNOTS CLOSED BRUSH DASHING)))) IMDRAWCIRCLE ← (FUNCTION (LAMBDA (STREAM CENTERX CENTRY RADIUS BRUSH DASHING) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMDRAWCIRCLE) SYN-STREAM SYN-STREAM CENTERX CENTRY RADIUS BRUSH DASHING)))) IMDRAWELLIPSE ← (FUNCTION (LAMBDA (STREAM CENTERX CENTERY SEMIMINORRADIUS SEMIMAJORRADIUS ORIENTATION BRUSH DASHING) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMDRAWELLIPSE) SYN-STREAM SYN-STREAM CENTERX CENTERY SEMIMINORRADIUS SEMIMAJORRADIUS ORIENTATION BRUSH DASHING)))) IMFILLCIRCLE ← (FUNCTION (LAMBDA (STREAM CENTERX CENTERY RADIUS TEXTURE) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMFILLCIRCLE) SYN-STREAM SYN-STREAM CENTERX CENTERY RADIUS TEXTURE)))) IMBLTSHADE ← (FUNCTION (LAMBDA (TEXTURE STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT OPERATION CLIPPINGREGION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMBLTSHADE) SYN-STREAM TEXTURE SYN-STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT OPERATION CLIPPINGREGION)))) IMBITBLT ← (FUNCTION (LAMBDA (SOURCEBM SOURCELEFT SOURCEBOTTOM STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMBITBLT) SYN-STREAM SOURCEBM SOURCELEFT SOURCEBOTTOM STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM)))) IMNEWPAGE ← (FUNCTION (LAMBDA (STREAM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMNEWPAGE ) SYN-STREAM)))) IMMOVETO ← (FUNCTION (LAMBDA (STREAM X Y) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMMOVETO ) SYN-STREAM SYN-STREAM X Y))) ) IMSCALE ← (FUNCTION (LAMBDA (STREAM SCALE) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMSCALE) SYN-STREAM SYN-STREAM SCALE)) )) IMTERPRI ← (FUNCTION (LAMBDA (STREAM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMTERPRI ) SYN-STREAM SYN-STREAM)))) IMTOPMARGIN ← (FUNCTION (LAMBDA (STREAM YPOSITION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMTOPMARGIN ) SYN-STREAM SYN-STREAM YPOSITION)))) IMBOTTOMMARGIN ← (FUNCTION (LAMBDA (STREAM YPOSITION ) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMBOTTOMMARGIN ) SYN-STREAM SYN-STREAM YPOSITION)))) IMSPACEFACTOR ← (FUNCTION (LAMBDA (STREAM FACTOR) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMSPACEFACTOR ) SYN-STREAM SYN-STREAM FACTOR)))) IMFONTCREATE ← (QUOTE SYNONYM) IMOPERATION ← (FUNCTION (LAMBDA (STREAM OPERATION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMOPERATION ) SYN-STREAM SYN-STREAM OPERATION)))) IMCOLOR ← (FUNCTION (LAMBDA (STREAM COLOR) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMCOLOR) SYN-STREAM SYN-STREAM COLOR)) )) IMSTRINGWIDTH ← (FUNCTION (LAMBDA (STREAM STRING RDTBL) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMSTRINGWIDTH) SYN-STREAM SYN-STREAM STRING RDTBL)))) IMCHARWIDTH ← (FUNCTION (LAMBDA (STREAM CHARCODE) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMCHARWIDTH ) SYN-STREAM SYN-STREAM CHARCODE)))) IMCHARWIDTHY ← (FUNCTION (LAMBDA (STREAM A B CHARCODE) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMCHARWIDTHY) SYN-STREAM SYN-STREAM A B CHARCODE)))) IMBACKCOLOR ← (FUNCTION (LAMBDA (STREAM COLOR) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMBACKCOLOR ) SYN-STREAM SYN-STREAM COLOR)))) IMBITMAPSIZE ← (FUNCTION (LAMBDA (STREAM BITMAP DIMENSION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMBITMAPSIZE ) SYN-STREAM SYN-STREAM BITMAP DIMENSION)))) IMCLIPPINGREGION ← (FUNCTION (LAMBDA (STREAM REGION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMCLIPPINGREGION ) SYN-STREAM SYN-STREAM REGION)) )) IMRESET ← (FUNCTION (LAMBDA (STREAM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMRESET) SYN-STREAM SYN-STREAM)))) IMDRAWPOLYGON ← (FUNCTION (LAMBDA (STREAM POINTS CLOSED BRUSH DASHING) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMDRAWPOLYGON) SYN-STREAM SYN-STREAM POINTS CLOSED BRUSH DASHING)))) IMFILLPOLYGON ← (FUNCTION (LAMBDA (STREAM POINTS TEXTURE OPERATION WINDINGNUMBER) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMFILLPOLYGON) SYN-STREAM SYN-STREAM POINTS TEXTURE OPERATION WINDINGNUMBER)))) IMSCALEDBITBLT ← (FUNCTION (LAMBDA (STREAM SOURCE SOURCELEFT SOURCEBOTTOM DESTINATION DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM SCALE) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMSCALEDBITBLT) STREAM SYN-STREAM SOURCE SOURCELEFT SOURCEBOTTOM DESTINATION DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM SCALE))) ) IMWRITEPIXEL ← (FUNCTION (LAMBDA (STREAM STREAM X Y VALUE) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMWRITEPIXEL) SYN-STREAM SYN-STREAM X Y VALUE)))) IMCHARSET ← (FUNCTION (LAMBDA (STREAM CHARSET) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM)))) (IMAGEOP (QUOTE IMCHARSET) SYN-STREAM SYN-STREAM CHARSET))) IMROTATE ← (FUNCTION (LAMBDA (STREAM ROTATION) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMROTATE ) SYN-STREAM SYN-STREAM ROTATION)))) IMDRAWARC ← (FUNCTION (LAMBDA (STREAM CENTERX CENTERY RADIUS STARTANGLE DEGREES BRUSH DASHING) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMDRAWARC) SYN-STREAM SYN-STREAM CENTERX CENTERY RADIUS STARTANGLE DEGREES BRUSH DASHING)))) IMTRANSLATE ← (FUNCTION (LAMBDA (STREAM TX TY) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMTRANSLATE ) SYN-STREAM SYN-STREAM TX TY)))) IMSCALE2 ← (FUNCTION (LAMBDA (STREAM SX SY) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMSCALE2 ) SYN-STREAM SYN-STREAM SX SY) ))) IMPUSHSTATE ← (FUNCTION (LAMBDA (STREAM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM)))) (IMAGEOP (QUOTE IMPUSHSTATE ) SYN-STREAM SYN-STREAM))) IMPOPSTATE ← (FUNCTION (LAMBDA (STREAM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMPOPSTATE ) SYN-STREAM SYN-STREAM)))) IMDEFAULTSTATE ← (FUNCTION (LAMBDA (STREAM) (LET ((SYN-STREAM ( %%SYNONYM-STREAM-DEVICE-GETSTREAM STREAM))) (IMAGEOP (QUOTE IMDEFAULTSTATE ) SYN-STREAM SYN-STREAM))))) )) (DEFUN %%INITIALIZE-STANDARD-STREAMS NIL (*) (SETQ *QUERY-IO* (MAKE-TWO-WAY-STREAM (MAKE-SYNONYM-STREAM (QUOTE \LINEBUF.OFD)) (MAKE-SYNONYM-STREAM (QUOTE \TERM.OFD )))) (SETQ *DEBUG-IO* *QUERY-IO*) (SETQ *TERMINAL-IO* *QUERY-IO*) (SETQ *ERROR-OUTPUT* (MAKE-SYNONYM-STREAM (QUOTE \TERM.OFD)) ) (SETQ *STANDARD-OUTPUT* (MAKE-SYNONYM-STREAM (QUOTE \PRIMOUT.OFD ))) (SETQ *STANDARD-INPUT* (MAKE-SYNONYM-STREAM (QUOTE \PRIMIN.OFD ))) (SETQ *TRACE-OUTPUT* (MAKE-SYNONYM-STREAM (QUOTE \TERM.OFD)) )) (DEFINEQ (%%INITIALIZE-CLSTREAM-TYPES [LAMBDA NIL (* hdj "26-Jun-86 19:23") (* * "Initialize the CLSTREAMS package. This sets up some file devices for the functions make-two-way-stream-device, etc. See CLtL chapter 21") (DECLARE (GLOBALVARS \FILL-POINTER-STREAM-DEVICE)) (\DEFINEDEVICE (QUOTE BROADCAST-STREAM-DEVICE) (create FDEV DEVICENAME ← (QUOTE BROADCAST-STREAM-DEVICE) RESETABLE ← NIL RANDOMACCESSP ← NIL NODIRECTORIES ← T BUFFERED ← NIL PAGEMAPPED ← NIL FDBINABLE ← NIL FDBOUTABLE ← NIL FDEXTENDABLE ← NIL DEVICEINFO ← NIL HOSTNAMEP ← (FUNCTION NILL) EVENTFN ← (FUNCTION NILL) DIRECTORYNAMEP ← (FUNCTION NILL) OPENFILE ← (FUNCTION %%BROADCAST-STREAM-DEVICE-OPENFILE) REOPENFILE ← (FUNCTION NILL) CLOSEFILE ← (FUNCTION %%BROADCAST-STREAM-DEVICE-CLOSEFILE) GETFILENAME ← (FUNCTION NILL) DELETEFILE ← (FUNCTION NILL) GENERATEFILES ← (FUNCTION \GENERATENOFILES) RENAMEFILE ← (FUNCTION NILL) BIN ← (FUNCTION NILL) BOUT ← (FUNCTION %%BROADCAST-STREAM-DEVICE-BOUT) PEEKBIN ← (FUNCTION NILL) READP ← (FUNCTION NILL) EOFP ← (FUNCTION TRUE) BLOCKIN ← (FUNCTION \GENERIC.BINS) BLOCKOUT ← (FUNCTION NILL) FORCEOUTPUT ← (FUNCTION %%BROADCAST-STREAM-DEVICE-FORCEOUTPUT) GETFILEINFO ← (FUNCTION NILL) SETFILEINFO ← (FUNCTION NILL))) (\DEFINEDEVICE (QUOTE CONCATENATED-STREAM-DEVICE) (create FDEV DEVICENAME ← (QUOTE CONCATENATED-STREAM-DEVICE) RESETABLE ← NIL RANDOMACCESSP ← NIL NODIRECTORIES ← T BUFFERED ← NIL PAGEMAPPED ← NIL FDBINABLE ← NIL FDBOUTABLE ← NIL FDEXTENDABLE ← NIL DEVICEINFO ← NIL HOSTNAMEP ← (FUNCTION NILL) EVENTFN ← (FUNCTION NILL) DIRECTORYNAMEP ← (FUNCTION NILL) OPENFILE ← (FUNCTION %%CONCATENATED-STREAM-DEVICE-OPENFILE) REOPENFILE ← (FUNCTION NILL) CLOSEFILE ← (FUNCTION %%CONCATENATED-STREAM-DEVICE-CLOSEFILE) GETFILENAME ← (FUNCTION NILL) DELETEFILE ← (FUNCTION NILL) GENERATEFILES ← (FUNCTION \GENERATENOFILES) RENAMEFILE ← (FUNCTION NILL) BIN ← (FUNCTION %%CONCATENATED-STREAM-DEVICE-BIN) BOUT ← (FUNCTION NILL) PEEKBIN ← (FUNCTION %%CONCATENATED-STREAM-DEVICE-PEEKBIN) READP ← (FUNCTION \GENERIC.READP) EOFP ← (FUNCTION %%CONCATENATED-STREAM-DEVICE-EOFP) BLOCKIN ← (FUNCTION \GENERIC.BINS) BLOCKOUT ← (FUNCTION NILL) FORCEOUTPUT ← (FUNCTION NILL) GETFILEINFO ← (FUNCTION NILL) SETFILEINFO ← (FUNCTION NILL))) (\DEFINEDEVICE (QUOTE TWO-WAY-STREAM-DEVICE) (create FDEV DEVICENAME ← (QUOTE TWO-WAY-STREAM-DEVICE) RESETABLE ← NIL RANDOMACCESSP ← NIL NODIRECTORIES ← T BUFFERED ← NIL PAGEMAPPED ← NIL FDBINABLE ← NIL FDBOUTABLE ← NIL FDEXTENDABLE ← NIL DEVICEINFO ← NIL HOSTNAMEP ← (FUNCTION NILL) EVENTFN ← (FUNCTION NILL) DIRECTORYNAMEP ← (FUNCTION NILL) OPENFILE ← (FUNCTION %%TWO-WAY-STREAM-DEVICE-OPENFILE) REOPENFILE ← (FUNCTION NILL) CLOSEFILE ← (FUNCTION %%TWO-WAY-STREAM-DEVICE-CLOSEFILE) GETFILENAME ← (FUNCTION NILL) DELETEFILE ← (FUNCTION NILL) GENERATEFILES ← (FUNCTION \GENERATENOFILES) RENAMEFILE ← (FUNCTION NILL) BIN ← (FUNCTION %%TWO-WAY-STREAM-DEVICE-BIN) BOUT ← (FUNCTION %%TWO-WAY-STREAM-DEVICE-BOUT) PEEKBIN ← (FUNCTION %%TWO-WAY-STREAM-DEVICE-PEEKBIN) READP ← (FUNCTION \GENERIC.READP) EOFP ← (FUNCTION %%TWO-WAY-STREAM-DEVICE-EOFP) BLOCKIN ← (FUNCTION \GENERIC.BINS) BLOCKOUT ← (FUNCTION \GENERIC.BOUTS) FORCEOUTPUT ← (FUNCTION %%TWO-WAY-STREAM-DEVICE-FORCEOUTPUT) GETFILEINFO ← (FUNCTION NILL) SETFILEINFO ← (FUNCTION NILL))) (\DEFINEDEVICE (QUOTE ECHO-STREAM-DEVICE) (create FDEV using (\GETDEVICEFROMNAME (QUOTE TWO-WAY-STREAM-DEVICE)) DEVICENAME ← (QUOTE ECHO-STREAM-DEVICE) BIN ← (FUNCTION %%ECHO-STREAM-DEVICE-BIN))) (\DEFINEDEVICE (QUOTE SYNONYM-STREAM-DEVICE) (create FDEV DEVICENAME ← (QUOTE SYNONYM-STREAM-DEVICE) RESETABLE ← NIL RANDOMACCESSP ← NIL NODIRECTORIES ← T BUFFERED ← NIL PAGEMAPPED ← NIL FDBINABLE ← NIL FDBOUTABLE ← NIL FDEXTENDABLE ← NIL DEVICEINFO ← NIL HOSTNAMEP ← (FUNCTION NILL) EVENTFN ← (FUNCTION NILL) DIRECTORYNAMEP ← (FUNCTION NILL) OPENFILE ← (FUNCTION %%SYNONYM-STREAM-DEVICE-OPENFILE) REOPENFILE ← (FUNCTION NILL) CLOSEFILE ← (FUNCTION %%SYNONYM-STREAM-DEVICE-CLOSEFILE) GETFILENAME ← (FUNCTION NILL) DELETEFILE ← (FUNCTION NILL) GENERATEFILES ← (FUNCTION \GENERATENOFILES) RENAMEFILE ← (FUNCTION NILL) BIN ← (FUNCTION %%SYNONYM-STREAM-DEVICE-BIN) BOUT ← (FUNCTION %%SYNONYM-STREAM-DEVICE-BOUT) PEEKBIN ← (FUNCTION %%SYNONYM-STREAM-DEVICE-PEEKBIN) READP ← (FUNCTION \GENERIC.READP) EOFP ← (FUNCTION %%SYNONYM-STREAM-DEVICE-EOFP) BLOCKIN ← (FUNCTION \GENERIC.BINS) BLOCKOUT ← (FUNCTION \GENERIC.BOUTS) FORCEOUTPUT ← (FUNCTION %%SYNONYM-STREAM-DEVICE-FORCEOUTPUT) GETFILEINFO ← (FUNCTION %%SYNONYM-STREAM-DEVICE-GETFILEINFO) SETFILEINFO ← (FUNCTION %%SYNONYM-STREAM-DEVICE-SETFILEINFO))) (SETQ \FILL-POINTER-STREAM-DEVICE (create FDEV DEVICENAME ← (QUOTE FILL-POINTER-STREAM-DEVICE) RESETABLE ← NIL RANDOMACCESSP ← NIL NODIRECTORIES ← T BUFFERED ← NIL PAGEMAPPED ← NIL FDBINABLE ← NIL FDBOUTABLE ← NIL FDEXTENDABLE ← NIL DEVICEINFO ← NIL HOSTNAMEP ← (FUNCTION NILL) EVENTFN ← (FUNCTION NILL) DIRECTORYNAMEP ← (FUNCTION NILL) OPENFILE ← (FUNCTION NILL) REOPENFILE ← (FUNCTION NILL) CLOSEFILE ← (FUNCTION %%FILL-POINTER-STREAM-DEVICE-CLOSEFILE) GETFILENAME ← (FUNCTION NILL) DELETEFILE ← (FUNCTION NILL) GENERATEFILES ← (FUNCTION \GENERATENOFILES) RENAMEFILE ← (FUNCTION NILL) BIN ← (FUNCTION \ILLEGAL.DEVICEOP) BOUT ← (FUNCTION NILL) PEEKBIN ← (FUNCTION \ILLEGAL.DEVICEOP) READP ← (FUNCTION \ILLEGAL.DEVICEOP) EOFP ← (FUNCTION NILL) BLOCKIN ← (FUNCTION \ILLEGAL.DEVICEOP) BLOCKOUT ← (FUNCTION \GENERIC.BOUTS) FORCEOUTPUT ← (FUNCTION NILL) GETFILEPTR ← (FUNCTION %%FILL-POINTER-STREAM-DEVICE-GETFILEPTR) SETFILEINFO ← (FUNCTION \ILLEGAL.DEVICEOP]) ) (DECLARE: DONTEVAL@LOAD DOCOPY (%%INITIALIZE-CLSTREAM-TYPES) (%%INITIALIZE-STANDARD-STREAMS) (%%INITIALIZE-SYNONYM-IMAGEOPS) ) (PUTPROPS CLSTREAMS FILETYPE COMPILE-FILE) (DEFSETF FILE-STREAM-POSITION SETFILEPTR) (PUTPROPS CLSTREAMS COPYRIGHT ("Xerox Corporation" 1985 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (22842 24324 (%%BROADCAST-STREAM-DEVICE-BOUT 22852 . 23147) ( %%BROADCAST-STREAM-DEVICE-CLOSEFILE 23149 . 23576) (%%BROADCAST-STREAM-DEVICE-FORCEOUTPUT 23578 . 23883) (%%BROADCAST-STREAM-DEVICE-OPENFILE 23885 . 24322)) (24325 26954 ( %%CONCATENATED-STREAM-DEVICE-BIN 24335 . 24915) (%%CONCATENATED-STREAM-DEVICE-CLOSEFILE 24917 . 25317) (%%CONCATENATED-STREAM-DEVICE-EOFP 25319 . 25849) (%%CONCATENATED-STREAM-DEVICE-OPENFILE 25851 . 26295) (%%CONCATENATED-STREAM-DEVICE-PEEKBIN 26297 . 26952)) (26955 27265 (%%ECHO-STREAM-DEVICE-BIN 26965 . 27263)) (27266 31181 (%%SYNONYM-STREAM-DEVICE-BIN 27276 . 27634) (%%SYNONYM-STREAM-DEVICE-BOUT 27636 . 28014) (%%SYNONYM-STREAM-DEVICE-CLOSEFILE 28016 . 28387) (%%SYNONYM-STREAM-DEVICE-EOFP 28389 . 28750) (%%SYNONYM-STREAM-DEVICE-FORCEOUTPUT 28752 . 29159) (%%SYNONYM-STREAM-DEVICE-GETFILEINFO 29161 . 29564) (%%SYNONYM-STREAM-DEVICE-OPENFILE 29566 . 30008) (%%SYNONYM-STREAM-DEVICE-PEEKBIN 30010 . 30403) (%%SYNONYM-STREAM-DEVICE-READP 30405 . 30768) (%%SYNONYM-STREAM-DEVICE-SETFILEINFO 30770 . 31179)) (31182 33464 (%%TWO-WAY-STREAM-DEVICE-BIN 31192 . 31427) (%%TWO-WAY-STREAM-DEVICE-BOUT 31429 . 31677) (%%TWO-WAY-STREAM-DEVICE-CLOSEFILE 31679 . 32137) (%%TWO-WAY-STREAM-DEVICE-EOFP 32139 . 32373) (%%TWO-WAY-STREAM-DEVICE-FORCEOUTPUT 32375 . 32652) (%%TWO-WAY-STREAM-DEVICE-OPENFILE 32654 . 33193) (%%TWO-WAY-STREAM-DEVICE-PEEKBIN 33195 . 33462)) (33815 34265 ( %%SYNONYM-STREAM-DEVICE-GET-STREAM 33825 . 34263)) (78918 87232 (%%INITIALIZE-CLSTREAM-TYPES 78928 . 87230))))) STOP