Skip to content
Snippets Groups Projects
Commit 3cd40c8f authored by ram's avatar ram
Browse files

.../systems-work/code/stream.lisp, 16-Jan-90 11:47:26, Edit by Wlott.

  Fixed bug in read-n-bytes: buffer was used where in-buffer should have been.

.../systems-work/code/stream.lisp, 23-Oct-89 16:45:49, Edit by Chiles.
  Picked up Chris's fix to make CLEAR-INPUT always return nil.

/usr1/lisp/ncode/stream.lisp, 25-Aug-89 11:46:56, Edit by Chiles.
  Added FILE-POSITION methods for string streams.
parent 217d4891
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
;;; file (VAXIO, SPIO, or VMIO) contains functions used by this file for ;;; file (VAXIO, SPIO, or VMIO) contains functions used by this file for
;;; a specific machine. ;;; a specific machine.
;;; ;;;
(in-package 'lisp) (in-package "LISP")
(export '(make-broadcast-stream make-synonym-stream (export '(make-broadcast-stream make-synonym-stream
make-broadcast-stream make-concatenated-stream make-two-way-stream make-broadcast-stream make-concatenated-stream make-two-way-stream
...@@ -278,7 +278,8 @@ ...@@ -278,7 +278,8 @@
"Clears any buffered input associated with the Stream." "Clears any buffered input associated with the Stream."
(let ((stream (in-synonym-of stream))) (let ((stream (in-synonym-of stream)))
(setf (stream-in-index stream) in-buffer-length) (setf (stream-in-index stream) in-buffer-length)
(funcall (stream-misc stream) stream :clear-input))) (funcall (stream-misc stream) stream :clear-input)
nil))
(defun read-byte (stream &optional (eof-errorp t) eof-value) (defun read-byte (stream &optional (eof-errorp t) eof-value)
"Returns the next byte of the Stream." "Returns the next byte of the Stream."
...@@ -301,7 +302,7 @@ ...@@ -301,7 +302,7 @@
(num-buffered (- in-buffer-length index))) (num-buffered (- in-buffer-length index)))
(declare (fixnum index num-buffered)) (declare (fixnum index num-buffered))
(cond (cond
((not buffer) ((not in-buffer)
(with-in-stream stream stream-n-bin buffer start numbytes eof-errorp)) (with-in-stream stream stream-n-bin buffer start numbytes eof-errorp))
((not (eql (%primitive get-vector-access-code in-buffer) 3)) ((not (eql (%primitive get-vector-access-code in-buffer) 3))
(error "N-Bin only works on 8-bit-like streams.")) (error "N-Bin only works on 8-bit-like streams."))
...@@ -762,6 +763,9 @@ ...@@ -762,6 +763,9 @@
(defun string-in-misc (stream operation &optional arg1 arg2) (defun string-in-misc (stream operation &optional arg1 arg2)
(case operation (case operation
(:file-position
(if (null arg1)
(string-input-stream-current stream)))
(:read-line (:read-line
(let ((string (string-input-stream-string stream)) (let ((string (string-input-stream-string stream))
(current (string-input-stream-current stream)) (current (string-input-stream-current stream))
...@@ -849,6 +853,9 @@ ...@@ -849,6 +853,9 @@
(defun string-out-misc (stream operation &optional arg1 arg2) (defun string-out-misc (stream operation &optional arg1 arg2)
(declare (ignore arg1 arg2)) (declare (ignore arg1 arg2))
(case operation (case operation
(:file-position
(if (null arg1)
(string-output-stream-index stream)))
(:charpos (:charpos
(do ((index (1- (the fixnum (string-output-stream-index stream))) (do ((index (1- (the fixnum (string-output-stream-index stream)))
(1- index)) (1- index))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment