From: Christophe Rhodes Date: Tue, 4 Feb 2003 17:11:31 +0000 (+0000) Subject: 0.7.12.19: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=562dd7fc01e2756b57439cb4ddfbc52e575728fb;p=sbcl.git 0.7.12.19: Merge Gray streams OAOOness (Rudi Schlatte sbcl-devel 2002-02-03) ... export relevant symbols from SB!KERNEL --- diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 5509244..77e058e 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -1094,10 +1094,15 @@ is a good idea, but see SB-SYS re. blurring of boundaries." "LINE-LENGTH" "ANSI-STREAM" "ANSI-STREAM-BIN" "ANSI-STREAM-BOUT" + "ANSI-STREAM-CLOSE" + "ANSI-STREAM-ELEMENT-TYPE" "ANSI-STREAM-IN" "ANSI-STREAM-IN-BUFFER" "ANSI-STREAM-IN-INDEX" + "ANSI-STREAM-INPUT-STREAM-P" "ANSI-STREAM-MISC" "ANSI-STREAM-N-BIN" + "ANSI-STREAM-OPEN-STREAM-P" "ANSI-STREAM-OUT" "ANSI-STREAM-SOUT" + "ANSI-STREAM-OUTPUT-STREAM-P" "LIST-TO-VECTOR*" "LOGICAL-HOST" "LOGICAL-HOST-DESIGNATOR" #!+long-float "LONG-FLOAT-EXPONENT" diff --git a/src/code/stream.lisp b/src/code/stream.lisp index a91ecfa..c96d81d 100644 --- a/src/code/stream.lisp +++ b/src/code/stream.lisp @@ -59,16 +59,16 @@ ;;; stream manipulation functions -(defun input-stream-p (stream) - (declare (type stream stream)) +(declaim (inline ansi-stream-input-stream-p)) +(defun ansi-stream-input-stream-p (stream) + (declare (type ansi-stream stream)) #!+high-security (when (synonym-stream-p stream) (setf stream (symbol-value (synonym-stream-symbol stream)))) - (and (ansi-stream-p stream) - (not (eq (ansi-stream-in stream) #'closed-flame)) + (and (not (eq (ansi-stream-in stream) #'closed-flame)) ;;; KLUDGE: It's probably not good to have EQ tests on function ;;; values like this. What if someone's redefined the function? ;;; Is there a better way? (Perhaps just VALID-FOR-INPUT and @@ -76,37 +76,60 @@ (or (not (eq (ansi-stream-in stream) #'ill-in)) (not (eq (ansi-stream-bin stream) #'ill-bin))))) -(defun output-stream-p (stream) +(defun input-stream-p (stream) (declare (type stream stream)) + (and (ansi-stream-p stream) + (ansi-stream-input-stream-p stream))) + +(declaim (inline ansi-stream-output-stream-p)) +(defun ansi-stream-output-stream-p (stream) + (declare (type ansi-stream stream)) #!+high-security (when (synonym-stream-p stream) (setf stream (symbol-value (synonym-stream-symbol stream)))) - (and (ansi-stream-p stream) - (not (eq (ansi-stream-in stream) #'closed-flame)) + (and (not (eq (ansi-stream-in stream) #'closed-flame)) (or (not (eq (ansi-stream-out stream) #'ill-out)) (not (eq (ansi-stream-bout stream) #'ill-bout))))) -(defun open-stream-p (stream) +(defun output-stream-p (stream) (declare (type stream stream)) + + (and (ansi-stream-p stream) + (ansi-stream-output-stream-p stream))) + +(declaim (inline ansi-stream-open-stream-p)) +(defun ansi-stream-open-stream-p (stream) + (declare (type ansi-stream stream)) (not (eq (ansi-stream-in stream) #'closed-flame))) -(defun stream-element-type (stream) - (declare (type stream stream)) +(defun open-stream-p (stream) + (ansi-stream-open-stream-p stream)) + +(declaim (inline ansi-stream-element-type)) +(defun ansi-stream-element-type (stream) + (declare (type ansi-stream stream)) (funcall (ansi-stream-misc stream) stream :element-type)) +(defun stream-element-type (stream) + (ansi-stream-element-type stream)) + (defun interactive-stream-p (stream) (declare (type stream stream)) (funcall (ansi-stream-misc stream) stream :interactive-p)) -(defun close (stream &key abort) - (declare (type stream stream)) +(declaim (inline ansi-stream-close)) +(defun ansi-stream-close (stream abort) + (declare (type ansi-stream stream)) (when (open-stream-p stream) (funcall (ansi-stream-misc stream) stream :close abort)) t) +(defun close (stream &key abort) + (ansi-stream-close stream abort)) + (defun set-closed-flame (stream) (setf (ansi-stream-in stream) #'closed-flame) (setf (ansi-stream-bin stream) #'closed-flame) diff --git a/src/pcl/gray-streams.lisp b/src/pcl/gray-streams.lisp index c09524a..3603055 100644 --- a/src/pcl/gray-streams.lisp +++ b/src/pcl/gray-streams.lisp @@ -21,7 +21,7 @@ which returns CHARACTER.")) (defmethod stream-element-type ((stream ansi-stream)) - (funcall (ansi-stream-misc stream) stream :element-type)) + (ansi-stream-element-type stream)) (defmethod stream-element-type ((stream fundamental-character-stream)) 'character) @@ -34,7 +34,7 @@ called on the stream.")) (defmethod pcl-open-stream-p ((stream ansi-stream)) - (not (eq (ansi-stream-in stream) #'closed-flame))) + (ansi-stream-open-stream-p stream)) (defmethod pcl-open-stream-p ((stream fundamental-stream)) (stream-open-p stream)) @@ -51,9 +51,7 @@ to clean up the side effects of having created the stream.")) (defmethod pcl-close ((stream ansi-stream) &key abort) - (when (open-stream-p stream) - (funcall (ansi-stream-misc stream) stream :close abort)) - t) + (ansi-stream-close stream abort)) (defmethod pcl-close ((stream fundamental-stream) &key abort) (declare (ignore abort)) @@ -69,9 +67,7 @@ (:documentation "Can STREAM perform input operations?")) (defmethod input-stream-p ((stream ansi-stream)) - (and (not (eq (ansi-stream-in stream) #'closed-flame)) - (or (not (eq (ansi-stream-in stream) #'ill-in)) - (not (eq (ansi-stream-bin stream) #'ill-bin))))) + (ansi-stream-input-stream-p stream)) (defmethod input-stream-p ((stream fundamental-input-stream)) t) @@ -83,9 +79,7 @@ (:documentation "Can STREAM perform output operations?")) (defmethod output-stream-p ((stream ansi-stream)) - (and (not (eq (ansi-stream-in stream) #'closed-flame)) - (or (not (eq (ansi-stream-out stream) #'ill-out)) - (not (eq (ansi-stream-bout stream) #'ill-bout))))) + (ansi-stream-output-stream-p stream)) (defmethod output-stream-p ((stream fundamental-output-stream)) t) diff --git a/version.lisp-expr b/version.lisp-expr index 83a50fd..a38b349 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.12.18" +"0.7.12.19"