OUTPUT-OPEN?, and WRITE-CHARS.
#| -*-Scheme-*-
-$Id: fileio.scm,v 1.9 1995/01/31 19:34:39 cph Exp $
+$Id: fileio.scm,v 1.10 1996/05/13 23:59:22 cph Exp $
-Copyright (c) 1991-95 Massachusetts Institute of Technology
+Copyright (c) 1991-96 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
`((BUFFERED-INPUT-CHARS ,operation/buffered-input-chars)
(CHAR-READY? ,operation/char-ready?)
(CHARS-REMAINING ,operation/chars-remaining)
+ (CLOSE-INPUT ,operation/close-input)
(DISCARD-CHAR ,operation/discard-char)
(DISCARD-CHARS ,operation/discard-chars)
(EOF? ,operation/eof?)
(INPUT-BLOCKING-MODE ,operation/input-blocking-mode)
(INPUT-BUFFER-SIZE ,operation/input-buffer-size)
(INPUT-CHANNEL ,operation/input-channel)
+ (INPUT-OPEN? ,operation/input-open?)
(INPUT-TERMINAL-MODE ,operation/input-terminal-mode)
(LENGTH ,operation/length)
(PEEK-CHAR ,operation/peek-char)
(SET-INPUT-TERMINAL-MODE ,operation/set-input-terminal-mode)))
(output-operations
`((BUFFERED-OUTPUT-CHARS ,operation/buffered-output-chars)
+ (CLOSE-OUTPUT ,operation/close-output)
(FLUSH-OUTPUT ,operation/flush-output)
(OUTPUT-BLOCKING-MODE ,operation/output-blocking-mode)
(OUTPUT-BUFFER-SIZE ,operation/output-buffer-size)
(OUTPUT-CHANNEL ,operation/output-channel)
+ (OUTPUT-OPEN? ,operation/output-open?)
(OUTPUT-TERMINAL-MODE ,operation/output-terminal-mode)
(SET-OUTPUT-BLOCKING-MODE ,operation/set-output-blocking-mode)
(SET-OUTPUT-BUFFER-SIZE ,operation/set-output-buffer-size)
(SET-OUTPUT-TERMINAL-MODE ,operation/set-output-terminal-mode)
(WRITE-CHAR ,operation/write-char)
+ (WRITE-CHARS ,operation/write-chars)
(WRITE-STRING ,operation/write-string)
(WRITE-SUBSTRING ,operation/write-substring)))
(other-operations
#| -*-Scheme-*-
-$Id: genio.scm,v 1.6 1995/09/13 19:56:13 cph Exp $
+$Id: genio.scm,v 1.7 1996/05/13 23:59:15 cph Exp $
-Copyright (c) 1991-95 Massachusetts Institute of Technology
+Copyright (c) 1991-96 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
`((BUFFERED-INPUT-CHARS ,operation/buffered-input-chars)
(CHAR-READY? ,operation/char-ready?)
(CHARS-REMAINING ,operation/chars-remaining)
+ (CLOSE-INPUT ,operation/close-input)
(DISCARD-CHAR ,operation/discard-char)
(DISCARD-CHARS ,operation/discard-chars)
(EOF? ,operation/eof?)
(INPUT-BLOCKING-MODE ,operation/input-blocking-mode)
(INPUT-BUFFER-SIZE ,operation/input-buffer-size)
(INPUT-CHANNEL ,operation/input-channel)
+ (INPUT-OPEN? ,operation/input-open?)
(INPUT-TERMINAL-MODE ,operation/input-terminal-mode)
(PEEK-CHAR ,operation/peek-char)
(READ-CHAR ,operation/read-char)
(SET-INPUT-TERMINAL-MODE ,operation/set-input-terminal-mode)))
(output-operations
`((BUFFERED-OUTPUT-CHARS ,operation/buffered-output-chars)
+ (CLOSE-OUTPUT ,operation/close-output)
(FLUSH-OUTPUT ,operation/flush-output)
(OUTPUT-BLOCKING-MODE ,operation/output-blocking-mode)
(OUTPUT-BUFFER-SIZE ,operation/output-buffer-size)
(OUTPUT-CHANNEL ,operation/output-channel)
+ (OUTPUT-OPEN? ,operation/output-open?)
(OUTPUT-TERMINAL-MODE ,operation/output-terminal-mode)
(SET-OUTPUT-BLOCKING-MODE ,operation/set-output-blocking-mode)
(SET-OUTPUT-BUFFER-SIZE ,operation/set-output-buffer-size)
(SET-OUTPUT-TERMINAL-MODE ,operation/set-output-terminal-mode)
(WRITE-CHAR ,operation/write-char)
+ (WRITE-CHARS ,operation/write-chars)
(WRITE-STRING ,operation/write-string)
(WRITE-SUBSTRING ,operation/write-substring)))
(other-operations
(output-buffer/write-substring-block (port/output-buffer port)
string start end))
+(define (operation/write-chars port string start end)
+ (output-buffer/write-substring (port/output-buffer port) string start end))
+
(define (operation/output-buffer-size port)
(output-buffer/size (port/output-buffer port)))
;; Must close output-buffer first, because it may need to flush
;; buffered data, and there might only be one channel for both the
;; input and output buffers.
+ (operation/close-output port)
+ (operation/close-input port))
+
+(define (operation/close-output port)
(let ((output-buffer (port/output-buffer port)))
(if output-buffer
- (output-buffer/close output-buffer)))
+ (output-buffer/close output-buffer))))
+
+(define (operation/close-input port)
(let ((input-buffer (port/input-buffer port)))
(if input-buffer
- (input-buffer/close input-buffer))))
\ No newline at end of file
+ (input-buffer/close input-buffer))))
+
+(define (operation/output-open? port)
+ (let ((output-buffer (port/output-buffer port)))
+ (and output-buffer
+ (channel-open? (output-buffer/channel output-buffer)))))
+
+(define (operation/input-open? port)
+ (let ((input-buffer (port/input-buffer port)))
+ (and input-buffer
+ (channel-open? (input-buffer/channel input-buffer)))))
\ No newline at end of file
#| -*-Scheme-*-
-$Id: ttyio.scm,v 1.4 1993/10/21 14:52:43 cph Exp $
+$Id: ttyio.scm,v 1.5 1996/05/13 23:59:27 cph Exp $
-Copyright (c) 1991-93 Massachusetts Institute of Technology
+Copyright (c) 1991-96 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(INPUT-BLOCKING-MODE ,operation/input-blocking-mode)
(INPUT-BUFFER-SIZE ,operation/input-buffer-size)
(INPUT-CHANNEL ,operation/input-channel)
+ (INPUT-OPEN? ,operation/input-open?)
(INPUT-TERMINAL-MODE ,operation/input-terminal-mode)
(OUTPUT-BLOCKING-MODE ,operation/output-blocking-mode)
(OUTPUT-BUFFER-SIZE ,operation/output-buffer-size)
(OUTPUT-CHANNEL ,operation/output-channel)
+ (OUTPUT-OPEN? ,operation/output-open?)
(OUTPUT-TERMINAL-MODE ,operation/output-terminal-mode)
(PEEK-CHAR ,(lambda (port) (hook/peek-char port)))
(WRITE-SELF ,operation/write-self)
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.270 1996/04/24 04:17:17 cph Exp $
+$Id: runtime.pkg,v 14.271 1996/05/13 23:59:34 cph Exp $
Copyright (c) 1988-96 Massachusetts Institute of Technology
operation/input-blocking-mode
operation/input-buffer-size
operation/input-channel
+ operation/input-open?
operation/input-terminal-mode
operation/output-blocking-mode
operation/output-buffer-size
operation/output-channel
+ operation/output-open?
operation/output-terminal-mode
operation/set-input-blocking-mode
operation/set-input-buffer-size
operation/char-ready?
operation/chars-remaining
operation/close
+ operation/close-input
+ operation/close-output
operation/discard-char
operation/discard-chars
operation/eof?
operation/input-blocking-mode
operation/input-buffer-size
operation/input-channel
+ operation/input-open?
operation/input-terminal-mode
operation/output-blocking-mode
operation/output-buffer-size
operation/output-channel
+ operation/output-open?
operation/output-terminal-mode
operation/peek-char
operation/read-char
operation/set-output-buffer-size
operation/set-output-terminal-mode
operation/write-char
+ operation/write-chars
operation/write-string
operation/write-substring)
(initialization (initialize-package!)))
output-buffer/size
output-buffer/write-char-block
output-buffer/write-string-block
+ output-buffer/write-substring
output-buffer/write-substring-block
set-channel-port!)
(export (runtime file-i/o-port)