\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)
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)
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))
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))
(: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)
(: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)