Renamed byte-vector to code-vector.
This commit is contained in:
parent
8ce0551795
commit
b39fd47d82
|
@ -494,7 +494,7 @@
|
||||||
output-port-forcers ;root-scheduler.scm
|
output-port-forcers ;root-scheduler.scm
|
||||||
|
|
||||||
steal-port! ; JMG: for scsh
|
steal-port! ; JMG: for scsh
|
||||||
|
fill-port-buffer! ; JMG: for read-delimited
|
||||||
call-with-current-input-port
|
call-with-current-input-port
|
||||||
call-with-current-output-port
|
call-with-current-output-port
|
||||||
call-with-current-noise-port))
|
call-with-current-noise-port))
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
(let ((index (port-index port)))
|
(let ((index (port-index port)))
|
||||||
(if read?
|
(if read?
|
||||||
(set-port-index! port (+ 1 index)))
|
(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)
|
((port-pending-eof? port)
|
||||||
(if read?
|
(if read?
|
||||||
(set-port-pending-eof?! port #f))
|
(set-port-pending-eof?! port #f))
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
(else
|
(else
|
||||||
(set-port-index! port (if read? 1 0))
|
(set-port-index! port (if read? 1 0))
|
||||||
(set-port-limit! port got)
|
(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)
|
(define (fill-port-buffer! port needed)
|
||||||
((port-handler-buffer-proc (port-handler port))
|
((port-handler-buffer-proc (port-handler port))
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
|
|
||||||
(define (write-char-handler char port)
|
(define (write-char-handler char port)
|
||||||
(cond ((< (port-index port) (port-limit port))
|
(cond ((< (port-index port) (port-limit port))
|
||||||
(byte-vector-set! (port-buffer port)
|
(code-vector-set! (port-buffer port)
|
||||||
(port-index port)
|
(port-index port)
|
||||||
(char->ascii char))
|
(char->ascii char))
|
||||||
(set-port-index! port (+ 1 (port-index port))))
|
(set-port-index! port (+ 1 (port-index port))))
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
((port-handler-buffer-proc (port-handler port)) (port-data port) char))
|
((port-handler-buffer-proc (port-handler port)) (port-data port) char))
|
||||||
(else
|
(else
|
||||||
(empty-port-buffer! port)
|
(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)))
|
(set-port-index! port 1)))
|
||||||
(unspecific))
|
(unspecific))
|
||||||
|
|
||||||
|
@ -294,7 +294,7 @@
|
||||||
(define (buffer-length buffer)
|
(define (buffer-length buffer)
|
||||||
(if (string? buffer)
|
(if (string? buffer)
|
||||||
(string-length buffer)
|
(string-length buffer)
|
||||||
(byte-vector-length buffer)))
|
(code-vector-length buffer)))
|
||||||
|
|
||||||
(define (read-more buffer start count port have)
|
(define (read-more buffer start count port have)
|
||||||
(let ((more ((port-handler-buffer-proc (port-handler port))
|
(let ((more ((port-handler-buffer-proc (port-handler port))
|
||||||
|
@ -322,8 +322,8 @@
|
||||||
(<= (+ start count)
|
(<= (+ start count)
|
||||||
(cond ((string? buffer)
|
(cond ((string? buffer)
|
||||||
(string-length buffer))
|
(string-length buffer))
|
||||||
((byte-vector? buffer)
|
((code-vector? buffer)
|
||||||
(byte-vector-length buffer))
|
(code-vector-length buffer))
|
||||||
(else
|
(else
|
||||||
-1)))))
|
-1)))))
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@
|
||||||
((= i count))
|
((= i count))
|
||||||
(proc data (if string?
|
(proc data (if string?
|
||||||
(string-ref buffer (+ start i))
|
(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.
|
; Empty the buffer if it contains anything.
|
||||||
|
@ -439,8 +439,8 @@
|
||||||
make-input-port handler data buffer index limit)))
|
make-input-port handler data buffer index limit)))
|
||||||
|
|
||||||
(define (okay-buffer? buffer index limit)
|
(define (okay-buffer? buffer index limit)
|
||||||
(and (byte-vector? buffer)
|
(and (code-vector? buffer)
|
||||||
(let ((length (byte-vector-length buffer)))
|
(let ((length (code-vector-length buffer)))
|
||||||
(integer? limit)
|
(integer? limit)
|
||||||
(<= 0 limit)
|
(<= 0 limit)
|
||||||
(<= limit length)
|
(<= limit length)
|
||||||
|
@ -491,7 +491,7 @@
|
||||||
(make-lock)
|
(make-lock)
|
||||||
#f ; locked?
|
#f ; locked?
|
||||||
data
|
data
|
||||||
(make-byte-vector 0 0)
|
(make-code-vector 0 0)
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
#f) ; pending-eof?
|
#f) ; pending-eof?
|
||||||
|
@ -515,7 +515,7 @@
|
||||||
(make-lock) ; wasted
|
(make-lock) ; wasted
|
||||||
#f ; locked?
|
#f ; locked?
|
||||||
(unspecific)
|
(unspecific)
|
||||||
(make-byte-vector 1 0)
|
(make-code-vector 1 0)
|
||||||
0
|
0
|
||||||
1 ; if 0 it would look unbuffered
|
1 ; if 0 it would look unbuffered
|
||||||
#f)) ; pending-eof?
|
#f)) ; pending-eof?
|
||||||
|
@ -634,9 +634,9 @@
|
||||||
(eof? (port-pending-eof? port))
|
(eof? (port-pending-eof? port))
|
||||||
(status ((port-handler-steal (port-handler port))
|
(status ((port-handler-steal (port-handler port))
|
||||||
(port-data port) owner)))
|
(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-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-pending-eof?! port #f)
|
||||||
(set-port-locked?! port #f)
|
(set-port-locked?! port #f)
|
||||||
(set-port-lock! port (make-lock))
|
(set-port-lock! port (make-lock))
|
||||||
|
|
Loading…
Reference in New Issue