(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP") (FILECREATED "20-Jan-93 13:45:35" {DSK}lde>lispcore>library>CHARDEVICE.;2 24926 changes to%: (VARS CHARDEVICECOMS) (RECORDS SGTTY MODEM-LINES) previous date%: " 1-May-92 15:09:57" {DSK}lde>lispcore>library>CHARDEVICE.;1) (PRETTYCOMPRINT CHARDEVICECOMS) (RPAQQ CHARDEVICECOMS ((FNS \CHAR-DEVICE-INIT \CHAR-DEV-EVENTFN \CHAR-ERROR) (P (\CHAR-DEVICE-INIT)) (COMS (* ;; "File manipulation (Open, close, etc)") (FNS \CHAR-DEV-OPENFILE \CHAR-DEV-CLOSEFILE)) (COMS (* ;; "UNBUFFERED Stream methods (BIN, BOUT, etc)") (FNS \CHAR-DEV-BIN \CHAR-DEV-BOUT \CHAR-BINS \CHAR-BOUTS \CHAR-DEV-PEEKBIN \CHAR-DEV-READP)) (COMS (* ;; "BUFFERED Stream methods (BINS, BOUTS, GETNEXTBUFFER, etc.)") (FNS \CHAR-FILLBUFFER)) (COMS (* ;; "Structures for using IOCTL with various character devices:") (FNS IOCTL) (* ;; "TTY (and TERMIO??) device:") (COMS (RECORDS SGTTY) (CONSTANTS (TIOCGETP (\MAKENUMBER 16390 29704)) (TIOCSETP (\MAKENUMBER 32774 29705)) (TIOCSETN (\MAKENUMBER 32774 29706)) (TIOCEXCL (\MAKENUMBER 8192 29709)) (TIOCNXCL (\MAKENUMBER 8192 29710)) (TIOCHPCL (\MAKENUMBER 8192 29698)) (TIOCGETD (\MAKENUMBER 16388 29696)) (TIOCSETD (\MAKENUMBER 32772 29697)) (TIOCFLUSH (\MAKENUMBER 32772 29712)) (TIOCSTI (\MAKENUMBER 32769 29810)) (TIOCSBRK (\MAKENUMBER 8192 29819)) (TIOCCBRK (\MAKENUMBER 8192 29818)) (TIOCOUTQ (\MAKENUMBER 16388 29811)) (FIONREAD (\MAKENUMBER 16388 26239)) (TIOCMODG (\MAKENUMBER 16388 29699)) (TIOCMODS (\MAKENUMBER 32772 29700)) (TIOCSETC (\MAKENUMBER 32774 29713)) (TIOCGETC (\MAKENUMBER 16390 29714)) (TCXONC (\MAKENUMBER 8192 21510)) (TCFLSH (\MAKENUMBER 8192 21511)) (TCGETS (\MAKENUMBER 16418 21512)) (TCSETS (\MAKENUMBER 32802 21513)) (TCSETSW (\MAKENUMBER 32802 21514)) (TCSETSF (\MAKENUMBER 32802 21515)) (TCSNDBRK (\MAKENUMBER 8192 21516)) (TCDRAIN (\MAKENUMBER 8192 21517)) (TIOCGWINSZ (\MAKENUMBER 16392 29800)) (TIOCSWINSZ (\MAKENUMBER 32776 29799)) (TIOCSSIZE (\MAKENUMBER 32776 29733)) (TIOCGSIZE (\MAKENUMBER 16392 29734)) (TIOCMBIS (\MAKENUMBER 32772 29804)) (TIOCMBIC (\MAKENUMBER 32772 29803)) (TIOCGSOFTCAR (\MAKENUMBER 16388 29796)) (TIOCPKT (\MAKENUMBER 32772 29808)) (TIOCREMOTE (\MAKENUMBER 32772 29801)) (TIOCOUTQ (\MAKENUMBER 16388 29811)) (TIOCMGET (\MAKENUMBER 16388 29802)) (TIOCMSET (\MAKENUMBER 32772 29805)) (TIOCUCNTL (\MAKENUMBER 32772 29798)) (TIOCSSOFTCAR (\MAKENUMBER 32772 29797))) (CONSTANTS (B0 0) (B50 1) (B75 2) (B110 3) (B134 4) (B150 5) (B200 6) (B300 7) (B600 8) (B1200 9) (B1800 10) (B2400 11) (B4800 12) (B9600 13) (B19200 14)) (CONSTANTS (FREAD 1) (FWRITE 2)) (CONSTANTS (TIOCPKT_DATA 0) (TIOCPKT_FLUSHREAD 1) (TIOCPKT_FLUSHWRITE 2) (TIOCPKT_STOP 4) (TIOCPKT_START 8) (TIOCPKT_NOSTOP 16) (TIOCPKT_DOSTOP 32) (TIOCPKT_IOCTL 64) (TIOCM_LE 1) (TIOCM_DTR 2) (TIOCM_RTS 4) (TIOCM_ST 8) (TIOCM_SR 16) (TIOCM_CTS 32) (TIOCM_CAR 64) (TIOCM_RI 128) (TIOCM_DSR 256)) (RECORDS MODEM-LINES)) (INITRECORDS SGTTY)) [COMS (* ;; "Changes to \INITSUBRS to support the character deice:") (ADDVARS (\INITSUBRS (CHAR-OPENFILE 200) (CHAR-BIN 201) (CHAR-BOUT 202) (CHAR-IOCTL 203) (CHAR-CLOSEFILE 204) (CHAR-EOFP 205) (CHAR-READP 206) (CHAR-BINS 207) (CHAR-BOUTS 208) (CHAR-FILLBUFFER 209] (COMS (* ;; "DSEBUGGING FNS") (FNS RP BAUD-RATE CHARS-AVAILABLE BINS-BAUD)))) (DEFINEQ (\CHAR-DEVICE-INIT (LAMBDA NIL (* ; "Edited 12-Sep-89 16:09 by jds") (SETQ \CHAR-DEVICE-FDEV (create FDEV BIN _ (FUNCTION \CHAR-DEV-BIN) BOUT _ (FUNCTION \CHAR-DEV-BOUT) OPENFILE _ (FUNCTION \CHAR-DEV-OPENFILE) EVENTFN _ (FUNCTION \CHAR-DEV-EVENTFN) REOPENFILE _ (FUNCTION \CHAR-DEV-OPENFILE) CLOSEFILE _ (FUNCTION \CHAR-DEV-CLOSEFILE) BLOCKIN _ (FUNCTION \CHAR-BINS) BLOCKOUT _ (FUNCTION \CHAR-BOUTS) READP _ (FUNCTION \CHAR-DEV-READP) PEEKBIN _ (FUNCTION \CHAR-DEV-PEEKBIN))) (\DEFINEDEVICE (QUOTE CHAR) \CHAR-DEVICE-FDEV)) ) (\CHAR-DEV-EVENTFN (LAMBDA (FDEV EVENT) NIL)) (\CHAR-ERROR (LAMBDA (ERRNO STREAM) (SELECTQ ERRNO (1 (ERROR "Not Owner: " STREAM)) (2 (\LISPERROR "FILE NOT FOUND" STREAM)) (9 (ERROR "Bad file number: " (FETCH (STREAM F1) of STREAM))) (ERROR "Unix error number: " ERRNO))) ) ) (\CHAR-DEVICE-INIT) (* ;; "File manipulation (Open, close, etc)") (DEFINEQ (\CHAR-DEV-OPENFILE [LAMBDA (NAME ACCESS RECOG OTHERINFO FDEV) (* ; "Edited 4-Aug-89 13:49 by jds") (LET ([UNIX-NAME (SUBSTRING NAME (ADD1 (STRPOS "}" NAME] (ERRNO (CREATECELL \FIXP)) IODESCRIPTOR ACCESS-VALUE STREAM) (SETQ STREAM (create STREAM BINABLE _ NIL BOUTABLE _ NIL DEVICE _ FDEV FULLFILENAME _ NAME USERCLOSEABLE _ T USERVISIBLE _ T EOLCONVENTION _ LF.EOLC F1 _ IODESCRIPTOR)) (SELECTQ ACCESS (INPUT (replace (STREAM STRMBINFN) of STREAM with (FUNCTION \CHAR-DEV-BIN)) (SETQ ACCESS-VALUE 0)) (OUTPUT (replace (STREAM STRMBOUTFN) of STREAM with (FUNCTION \CHAR-DEV-BOUT )) (SETQ ACCESS-VALUE 1)) (BOTH (replace (STREAM STRMBINFN) of STREAM with (FUNCTION \CHAR-DEV-BIN)) (replace (STREAM STRMBOUTFN) of STREAM with (FUNCTION \CHAR-DEV-BOUT)) (SETQ ACCESS-VALUE 2)) (APPEND (\ILLEGAL.ARG ACCESS)) (\ILLEGAL.ARG ACCESS)) (COND ((SETQ IODESCRIPTOR (SUBRCALL CHAR-OPENFILE UNIX-NAME ACCESS-VALUE ERRNO)) (* ;; "Open happened, so put things together.") (replace (STREAM F1) of STREAM with IODESCRIPTOR)) (T (\CHAR-ERROR ERRNO NAME))) STREAM]) (\CHAR-DEV-CLOSEFILE [LAMBDA (STREAM) (* ; "Edited 2-Aug-89 15:49 by jds") (LET ((ERRNO (CREATECELL \FIXP)) IODESCRIPTOR ACCESS-VALUE) (COND ((SUBRCALL CHAR-CLOSEFILE (fetch (STREAM F1) of STREAM) ERRNO) (* ;; "Close happened, so put things together.") ) (T (CL:ERROR "Char-device close failed with error number ~d.~%%" ERRNO))) STREAM]) ) (* ;; "UNBUFFERED Stream methods (BIN, BOUT, etc)") (DEFINEQ (\CHAR-DEV-BIN (LAMBDA (STREAM) (* ; "Edited 12-Sep-89 16:08 by jds") (COND ((fetch F3 of STREAM) (PROG1 (fetch F3 of STREAM) (replace F3 of STREAM with NIL))) (T (LET ((ERRNO (CREATECELL \FIXP)) CH) (while (NOT (SETQ CH (SUBRCALL CHAR-BIN (fetch (STREAM F1) of STREAM) ERRNO))) do (COND ((IEQP ERRNO 35) (* ; "EWOULDBLOCK -- need to wait a bit, as there's nothing waiting to come.") (BLOCK)) (T (\CHAR-ERROR ERRNO STREAM)))) CH)))) ) (\CHAR-DEV-BOUT [LAMBDA (STREAM CCODE) (* ; "Edited 2-Aug-89 15:48 by jds") [LET ((ERRNO (CREATECELL \FIXP))) (WHILE (NOT (SUBRCALL CHAR-BOUT (FETCH (STREAM F1) OF STREAM) CCODE ERRNO)) DO (COND ((IEQP ERRNO 35) (* ; "EWOULDBLOCK") (BLOCK)) (T (\CHAR-ERROR ERRNO STREAM] CCODE]) (\CHAR-BINS [LAMBDA (STREAM BASE OFFSET NBYTES) (* ; "Edited 3-Aug-89 13:42 by jds") (LET ((ERRNO (\CREATECELL \FIXP)) (CHARS-READ 0) (BYTES-TO-READ NBYTES) THIS-READ) [WHILE (< CHARS-READ NBYTES) DO (COND ((SETQ THIS-READ (SUBRCALL CHAR-BINS (FETCH (STREAM F1) OF STREAM) BASE OFFSET BYTES-TO-READ ERRNO)) (AND (ILESSP (SETQ CHARS-READ (+ CHARS-READ THIS-READ)) NBYTES) (BLOCK)) (SETQ BYTES-TO-READ (- BYTES-TO-READ THIS-READ)) (SETQ OFFSET (+ OFFSET THIS-READ))) ((IEQP ERRNO 35) (BLOCK)) (T (\CHAR-ERROR ERRNO STREAM] NBYTES]) (\CHAR-BOUTS [LAMBDA (STREAM BASE OFFSET NBYTES) (* ; "Edited 3-Aug-89 13:43 by jds") (LET ((ERRNO (\CREATECELL \FIXP)) (CHARS-WRITTEN 0) (BYTES-TO-WRITE NBYTES) THIS-WRITE) [WHILE (< CHARS-WRITTEN NBYTES) DO (COND ((SETQ THIS-WRITE (SUBRCALL CHAR-BOUTS (FETCH (STREAM F1) OF STREAM) BASE OFFSET BYTES-TO-WRITE ERRNO)) (SETQ CHARS-WRITTEN (+ CHARS-WRITTEN THIS-WRITE)) (SETQ BYTES-TO-WRITE (- BYTES-TO-WRITE THIS-WRITE)) (SETQ OFFSET (+ OFFSET THIS-WRITE)) (BLOCK)) ((IEQP ERRNO 35) (BLOCK)) (T (\CHAR-ERROR ERRNO STREAM] NBYTES]) (\CHAR-DEV-PEEKBIN (LAMBDA (STREAM NOERRORFLG) (* ; "Edited 12-Sep-89 16:09 by jds") (COND ((fetch F3 of STREAM)) (T (replace F3 of STREAM with (\BIN STREAM))))) ) (\CHAR-DEV-READP (LAMBDA (STREAM) (* ; "Edited 12-Sep-89 15:32 by jds") (* ;; "READP method for CHAR streams. T if there's an input char available.") (LET ((RESULT (\CREATECELL \FIXP))) (IOCTL STREAM FIONREAD RESULT) (ILESSP 0 RESULT))) ) ) (* ;; "BUFFERED Stream methods (BINS, BOUTS, GETNEXTBUFFER, etc.)") (DEFINEQ (\CHAR-FILLBUFFER [LAMBDA (STREAM BUFFER) (* ; "Edited 3-Aug-89 11:43 by jds") (LET ((ERRNO (\CREATECELL \FIXP)) CHARS-READ) [CL:TAGBODY READ-LOOP (COND ((SETQ CHARS-READ (SUBRCALL CHAR-BINS (FETCH (STREAM F1) OF STREAM) BUFFER 0 512)) ASDF) ((IEQP ERRNO 35) (BLOCK) (GO READ-LOOP)) ((\CHAR-ERROR ERRNO STREAM] CHARS-READ]) ) (* ;; "Structures for using IOCTL with various character devices:") (DEFINEQ (IOCTL [LAMBDA (STREAM REQUEST DATA) (* ; "Edited 2-Aug-89 15:49 by jds") (LET ((ERRNO (CREATECELL \FIXP))) (OR (SUBRCALL CHAR-IOCTL (fetch (STREAM F1) of STREAM) REQUEST DATA ERRNO) ERRNO]) ) (* ;; "TTY (and TERMIO??) device:") (DECLARE%: EVAL@COMPILE (DATATYPE SGTTY ((INPUT-SPEED BYTE) (OUTPUT-SPEED BYTE) (ERASE-CHAR BYTE) (KILL-CHAR BYTE) (FLAGS WORD))) ) (/DECLAREDATATYPE 'SGTTY '(BYTE BYTE BYTE BYTE WORD) '((SGTTY 0 (BITS . 7)) (SGTTY 0 (BITS . 135)) (SGTTY 1 (BITS . 7)) (SGTTY 1 (BITS . 135)) (SGTTY 2 (BITS . 15))) '4) (DECLARE%: EVAL@COMPILE (RPAQ TIOCGETP (\MAKENUMBER 16390 29704)) (RPAQ TIOCSETP (\MAKENUMBER 32774 29705)) (RPAQ TIOCSETN (\MAKENUMBER 32774 29706)) (RPAQ TIOCEXCL (\MAKENUMBER 8192 29709)) (RPAQ TIOCNXCL (\MAKENUMBER 8192 29710)) (RPAQ TIOCHPCL (\MAKENUMBER 8192 29698)) (RPAQ TIOCGETD (\MAKENUMBER 16388 29696)) (RPAQ TIOCSETD (\MAKENUMBER 32772 29697)) (RPAQ TIOCFLUSH (\MAKENUMBER 32772 29712)) (RPAQ TIOCSTI (\MAKENUMBER 32769 29810)) (RPAQ TIOCSBRK (\MAKENUMBER 8192 29819)) (RPAQ TIOCCBRK (\MAKENUMBER 8192 29818)) (RPAQ TIOCOUTQ (\MAKENUMBER 16388 29811)) (RPAQ FIONREAD (\MAKENUMBER 16388 26239)) (RPAQ TIOCMODG (\MAKENUMBER 16388 29699)) (RPAQ TIOCMODS (\MAKENUMBER 32772 29700)) (RPAQ TIOCSETC (\MAKENUMBER 32774 29713)) (RPAQ TIOCGETC (\MAKENUMBER 16390 29714)) (RPAQ TCXONC (\MAKENUMBER 8192 21510)) (RPAQ TCFLSH (\MAKENUMBER 8192 21511)) (RPAQ TCGETS (\MAKENUMBER 16418 21512)) (RPAQ TCSETS (\MAKENUMBER 32802 21513)) (RPAQ TCSETSW (\MAKENUMBER 32802 21514)) (RPAQ TCSETSF (\MAKENUMBER 32802 21515)) (RPAQ TCSNDBRK (\MAKENUMBER 8192 21516)) (RPAQ TCDRAIN (\MAKENUMBER 8192 21517)) (RPAQ TIOCGWINSZ (\MAKENUMBER 16392 29800)) (RPAQ TIOCSWINSZ (\MAKENUMBER 32776 29799)) (RPAQ TIOCSSIZE (\MAKENUMBER 32776 29733)) (RPAQ TIOCGSIZE (\MAKENUMBER 16392 29734)) (RPAQ TIOCMBIS (\MAKENUMBER 32772 29804)) (RPAQ TIOCMBIC (\MAKENUMBER 32772 29803)) (RPAQ TIOCGSOFTCAR (\MAKENUMBER 16388 29796)) (RPAQ TIOCPKT (\MAKENUMBER 32772 29808)) (RPAQ TIOCREMOTE (\MAKENUMBER 32772 29801)) (RPAQ TIOCOUTQ (\MAKENUMBER 16388 29811)) (RPAQ TIOCMGET (\MAKENUMBER 16388 29802)) (RPAQ TIOCMSET (\MAKENUMBER 32772 29805)) (RPAQ TIOCUCNTL (\MAKENUMBER 32772 29798)) (RPAQ TIOCSSOFTCAR (\MAKENUMBER 32772 29797)) (CONSTANTS (TIOCGETP (\MAKENUMBER 16390 29704)) (TIOCSETP (\MAKENUMBER 32774 29705)) (TIOCSETN (\MAKENUMBER 32774 29706)) (TIOCEXCL (\MAKENUMBER 8192 29709)) (TIOCNXCL (\MAKENUMBER 8192 29710)) (TIOCHPCL (\MAKENUMBER 8192 29698)) (TIOCGETD (\MAKENUMBER 16388 29696)) (TIOCSETD (\MAKENUMBER 32772 29697)) (TIOCFLUSH (\MAKENUMBER 32772 29712)) (TIOCSTI (\MAKENUMBER 32769 29810)) (TIOCSBRK (\MAKENUMBER 8192 29819)) (TIOCCBRK (\MAKENUMBER 8192 29818)) (TIOCOUTQ (\MAKENUMBER 16388 29811)) (FIONREAD (\MAKENUMBER 16388 26239)) (TIOCMODG (\MAKENUMBER 16388 29699)) (TIOCMODS (\MAKENUMBER 32772 29700)) (TIOCSETC (\MAKENUMBER 32774 29713)) (TIOCGETC (\MAKENUMBER 16390 29714)) (TCXONC (\MAKENUMBER 8192 21510)) (TCFLSH (\MAKENUMBER 8192 21511)) (TCGETS (\MAKENUMBER 16418 21512)) (TCSETS (\MAKENUMBER 32802 21513)) (TCSETSW (\MAKENUMBER 32802 21514)) (TCSETSF (\MAKENUMBER 32802 21515)) (TCSNDBRK (\MAKENUMBER 8192 21516)) (TCDRAIN (\MAKENUMBER 8192 21517)) (TIOCGWINSZ (\MAKENUMBER 16392 29800)) (TIOCSWINSZ (\MAKENUMBER 32776 29799)) (TIOCSSIZE (\MAKENUMBER 32776 29733)) (TIOCGSIZE (\MAKENUMBER 16392 29734)) (TIOCMBIS (\MAKENUMBER 32772 29804)) (TIOCMBIC (\MAKENUMBER 32772 29803)) (TIOCGSOFTCAR (\MAKENUMBER 16388 29796)) (TIOCPKT (\MAKENUMBER 32772 29808)) (TIOCREMOTE (\MAKENUMBER 32772 29801)) (TIOCOUTQ (\MAKENUMBER 16388 29811)) (TIOCMGET (\MAKENUMBER 16388 29802)) (TIOCMSET (\MAKENUMBER 32772 29805)) (TIOCUCNTL (\MAKENUMBER 32772 29798)) (TIOCSSOFTCAR (\MAKENUMBER 32772 29797))) ) (DECLARE%: EVAL@COMPILE (RPAQQ B0 0) (RPAQQ B50 1) (RPAQQ B75 2) (RPAQQ B110 3) (RPAQQ B134 4) (RPAQQ B150 5) (RPAQQ B200 6) (RPAQQ B300 7) (RPAQQ B600 8) (RPAQQ B1200 9) (RPAQQ B1800 10) (RPAQQ B2400 11) (RPAQQ B4800 12) (RPAQQ B9600 13) (RPAQQ B19200 14) (CONSTANTS (B0 0) (B50 1) (B75 2) (B110 3) (B134 4) (B150 5) (B200 6) (B300 7) (B600 8) (B1200 9) (B1800 10) (B2400 11) (B4800 12) (B9600 13) (B19200 14)) ) (DECLARE%: EVAL@COMPILE (RPAQQ FREAD 1) (RPAQQ FWRITE 2) (CONSTANTS (FREAD 1) (FWRITE 2)) ) (DECLARE%: EVAL@COMPILE (RPAQQ TIOCPKT_DATA 0) (RPAQQ TIOCPKT_FLUSHREAD 1) (RPAQQ TIOCPKT_FLUSHWRITE 2) (RPAQQ TIOCPKT_STOP 4) (RPAQQ TIOCPKT_START 8) (RPAQQ TIOCPKT_NOSTOP 16) (RPAQQ TIOCPKT_DOSTOP 32) (RPAQQ TIOCPKT_IOCTL 64) (RPAQQ TIOCM_LE 1) (RPAQQ TIOCM_DTR 2) (RPAQQ TIOCM_RTS 4) (RPAQQ TIOCM_ST 8) (RPAQQ TIOCM_SR 16) (RPAQQ TIOCM_CTS 32) (RPAQQ TIOCM_CAR 64) (RPAQQ TIOCM_RI 128) (RPAQQ TIOCM_DSR 256) (CONSTANTS (TIOCPKT_DATA 0) (TIOCPKT_FLUSHREAD 1) (TIOCPKT_FLUSHWRITE 2) (TIOCPKT_STOP 4) (TIOCPKT_START 8) (TIOCPKT_NOSTOP 16) (TIOCPKT_DOSTOP 32) (TIOCPKT_IOCTL 64) (TIOCM_LE 1) (TIOCM_DTR 2) (TIOCM_RTS 4) (TIOCM_ST 8) (TIOCM_SR 16) (TIOCM_CTS 32) (TIOCM_CAR 64) (TIOCM_RI 128) (TIOCM_DSR 256)) ) (DECLARE%: EVAL@COMPILE (BLOCKRECORD MODEM-LINES ((NIL WORD) (NIL BITS 7) (DSR FLAG) (RI FLAG) (CAR FLAG) (CTS FLAG) (SR FLAG) (ST FLAG) (RTS FLAG) (DTR FLAG) (LE FLAG))) ) (/DECLAREDATATYPE 'SGTTY '(BYTE BYTE BYTE BYTE WORD) '((SGTTY 0 (BITS . 7)) (SGTTY 0 (BITS . 135)) (SGTTY 1 (BITS . 7)) (SGTTY 1 (BITS . 135)) (SGTTY 2 (BITS . 15))) '4) (* ;; "Changes to \INITSUBRS to support the character deice:") (ADDTOVAR \INITSUBRS (CHAR-OPENFILE 200) (CHAR-BIN 201) (CHAR-BOUT 202) (CHAR-IOCTL 203) (CHAR-CLOSEFILE 204) (CHAR-EOFP 205) (CHAR-READP 206) (CHAR-BINS 207) (CHAR-BOUTS 208) (CHAR-FILLBUFFER 209)) (* ;; "DSEBUGGING FNS") (DEFINEQ (RP [LAMBDA (X BASE) (LET ((*PRINT-BASE* BASE)) (PRINT X]) (BAUD-RATE [LAMBDA (FF) (LET ((CHARS 0) (STARTTIME (IDATE)) ENDTIME) (for I from 1 to 10000 do (BIN FF)) (SETQ ENDTIME (IDATE)) (- ENDTIME STARTTIME]) (CHARS-AVAILABLE [LAMBDA (STREAM) (LET ((RESULT (\CREATECELL \FIXP))) (IOCTL STREAM FIONREAD RESULT) RESULT]) (BINS-BAUD [LAMBDA (FF) (* ; "Edited 3-Aug-89 14:19 by jds") (LET ((CHARS 0) (RESULT NIL) COUNT TC) (while (< CHARS 10000) do (SETQ TC (\BINS FF SB 0 512)) (add CHARS TC]) ) (PUTPROPS CHARDEVICE COPYRIGHT (NONE)) (DECLARE%: DONTCOPY (FILEMAP (NIL (7990 8819 (\CHAR-DEVICE-INIT 8000 . 8531) (\CHAR-DEV-EVENTFN 8533 . 8582) (\CHAR-ERROR 8584 . 8817)) (8899 11044 (\CHAR-DEV-OPENFILE 8909 . 10534) (\CHAR-DEV-CLOSEFILE 10536 . 11042)) ( 11105 15738 (\CHAR-DEV-BIN 11115 . 11553) (\CHAR-DEV-BOUT 11555 . 12183) (\CHAR-BINS 12185 . 13705) ( \CHAR-BOUTS 13707 . 15322) (\CHAR-DEV-PEEKBIN 15324 . 15491) (\CHAR-DEV-READP 15493 . 15736)) (15815 16581 (\CHAR-FILLBUFFER 15825 . 16579)) (16658 16954 (IOCTL 16668 . 16952)) (24090 24864 (RP 24100 . 24177) (BAUD-RATE 24179 . 24402) (CHARS-AVAILABLE 24404 . 24545) (BINS-BAUD 24547 . 24862))))) STOP