added dfishers steal-port stuff

This commit is contained in:
marting 1999-09-16 16:09:40 +00:00
parent 0cdf8896be
commit 20081c537b
1 changed files with 9 additions and 3 deletions

View File

@ -21,7 +21,9 @@
((channel-cell-closer channel-cell) ((channel-cell-closer channel-cell)
(channel-cell-ref channel-cell))) (channel-cell-ref channel-cell)))
(lambda (channel-cell buffer start needed) (lambda (channel-cell buffer start needed)
(channel-read buffer start needed (channel-cell-ref channel-cell))))) (channel-read buffer start needed (channel-cell-ref channel-cell)))
(lambda (channel-cell owner)
(steal-channel! (channel-cell-ref) owner))))
(define (input-channel->port channel . maybe-buffer-size) (define (input-channel->port channel . maybe-buffer-size)
(real-input-channel->port channel maybe-buffer-size close-input-channel)) (real-input-channel->port channel maybe-buffer-size close-input-channel))
@ -51,7 +53,9 @@
((channel-cell-closer channel-cell) ((channel-cell-closer channel-cell)
(channel-cell-ref channel-cell))) (channel-cell-ref channel-cell)))
(lambda (channel-cell buffer start count) (lambda (channel-cell buffer start count)
(channel-write buffer start count (channel-cell-ref channel-cell))))) (channel-write buffer start count (channel-cell-ref channel-cell)))
(lambda (channel-cell owner)
(steal-channel! (channel-cell-ref channel-cell) owner))))
; Unbuffered channel output ports. Used for the default error port. ; Unbuffered channel output ports. Used for the default error port.
@ -65,7 +69,9 @@
(channel-cell-ref channel-cell))) (channel-cell-ref channel-cell)))
(lambda (channel-cell char) (lambda (channel-cell char)
(code-vector-set! buffer 0 (char->ascii char)) (code-vector-set! buffer 0 (char->ascii char))
(channel-write buffer 0 1 (channel-cell-ref channel-cell)))))) (channel-write buffer 0 1 (channel-cell-ref channel-cell)))
(lambda (channel-cell owner)
(steal-channel! (channel-cell-ref channel-cell) owner)))))
; Dispatch on the buffer size to make the appropriate port. A buffer ; Dispatch on the buffer size to make the appropriate port. A buffer
; size of zero creates an unbuffered port. Buffered output ports get a ; size of zero creates an unbuffered port. Buffered output ports get a