diff --git a/scheme/interfaces.scm b/scheme/interfaces.scm index af3c53a..5859855 100644 --- a/scheme/interfaces.scm +++ b/scheme/interfaces.scm @@ -494,7 +494,7 @@ output-port-forcers ;root-scheduler.scm steal-port! ; JMG: for scsh - + fill-port-buffer! ; JMG: for read-delimited call-with-current-input-port call-with-current-output-port call-with-current-noise-port)) diff --git a/scheme/rts/port.scm b/scheme/rts/port.scm index 23ab1b2..99d3c4d 100644 --- a/scheme/rts/port.scm +++ b/scheme/rts/port.scm @@ -106,7 +106,7 @@ (let ((index (port-index port))) (if read? (set-port-index! port (+ 1 index))) - (ascii->char (byte-vector-ref (port-buffer port) index)))) + (ascii->char (code-vector-ref (port-buffer port) index)))) ((port-pending-eof? port) (if read? (set-port-pending-eof?! port #f)) @@ -121,7 +121,7 @@ (else (set-port-index! port (if read? 1 0)) (set-port-limit! port got) - (ascii->char (byte-vector-ref (port-buffer port) 0))))))))) + (ascii->char (code-vector-ref (port-buffer port) 0))))))))) (define (fill-port-buffer! port needed) ((port-handler-buffer-proc (port-handler port)) @@ -135,7 +135,7 @@ (define (write-char-handler char port) (cond ((< (port-index port) (port-limit port)) - (byte-vector-set! (port-buffer port) + (code-vector-set! (port-buffer port) (port-index port) (char->ascii char)) (set-port-index! port (+ 1 (port-index port)))) @@ -143,7 +143,7 @@ ((port-handler-buffer-proc (port-handler port)) (port-data port) char)) (else (empty-port-buffer! port) - (byte-vector-set! (port-buffer port) 0 (char->ascii char)) + (code-vector-set! (port-buffer port) 0 (char->ascii char)) (set-port-index! port 1))) (unspecific)) @@ -294,7 +294,7 @@ (define (buffer-length buffer) (if (string? buffer) (string-length buffer) - (byte-vector-length buffer))) + (code-vector-length buffer))) (define (read-more buffer start count port have) (let ((more ((port-handler-buffer-proc (port-handler port)) @@ -322,8 +322,8 @@ (<= (+ start count) (cond ((string? buffer) (string-length buffer)) - ((byte-vector? buffer) - (byte-vector-length buffer)) + ((code-vector? buffer) + (code-vector-length buffer)) (else -1))))) @@ -366,7 +366,7 @@ ((= i count)) (proc data (if string? (string-ref buffer (+ start i)) - (ascii->char (byte-vector-ref buffer (+ start i)))))))) + (ascii->char (code-vector-ref buffer (+ start i)))))))) ;---------------- ; Empty the buffer if it contains anything. @@ -439,8 +439,8 @@ make-input-port handler data buffer index limit))) (define (okay-buffer? buffer index limit) - (and (byte-vector? buffer) - (let ((length (byte-vector-length buffer))) + (and (code-vector? buffer) + (let ((length (code-vector-length buffer))) (integer? limit) (<= 0 limit) (<= limit length) @@ -491,7 +491,7 @@ (make-lock) #f ; locked? data - (make-byte-vector 0 0) + (make-code-vector 0 0) 0 0 #f) ; pending-eof? @@ -515,7 +515,7 @@ (make-lock) ; wasted #f ; locked? (unspecific) - (make-byte-vector 1 0) + (make-code-vector 1 0) 0 1 ; if 0 it would look unbuffered #f)) ; pending-eof? @@ -634,9 +634,9 @@ (eof? (port-pending-eof? port)) (status ((port-handler-steal (port-handler port)) (port-data port) owner))) - (set-port-buffer! port (make-byte-vector (byte-vector-length buffer) 0)) + (set-port-buffer! port (make-code-vector (code-vector-length buffer) 0)) (set-port-index! port 0) - (set-port-limit! port (if (input-port? port) 0 (byte-vector-length buffer))) + (set-port-limit! port (if (input-port? port) 0 (code-vector-length buffer))) (set-port-pending-eof?! port #f) (set-port-locked?! port #f) (set-port-lock! port (make-lock))