0.7.12.19:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 4 Feb 2003 17:11:31 +0000 (17:11 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 4 Feb 2003 17:11:31 +0000 (17:11 +0000)
Merge Gray streams OAOOness (Rudi Schlatte sbcl-devel 2002-02-03)
... export relevant symbols from SB!KERNEL

package-data-list.lisp-expr
src/code/stream.lisp
src/pcl/gray-streams.lisp
version.lisp-expr

index 5509244..77e058e 100644 (file)
@@ -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"
index a91ecfa..c96d81d 100644 (file)
 \f
 ;;; 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
        (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)
index c09524a..3603055 100644 (file)
@@ -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)
index 83a50fd..a38b349 100644 (file)
@@ -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"