summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2008-09-05 14:03:28 +0000
committerFlavio Cruz <flaviocruz@gmail.com>2008-09-05 14:03:28 +0000
commitd5e46abc76282171f01a51bde68506a62098c02c (patch)
tree053f73bb225fc7c9b1cfef36309db82cd4b08e32
parente79bd41d544c2f7f7a322ed70aaea3e712d76e8e (diff)
Add flags optional argument.
-rw-r--r--streams/input.lisp20
1 files changed, 7 insertions, 13 deletions
diff --git a/streams/input.lisp b/streams/input.lisp
index 12a6539c8..590ac6540 100644
--- a/streams/input.lisp
+++ b/streams/input.lisp
@@ -3,12 +3,6 @@
(defconstant +default-read-ahead+ 512)
-(defun %create-adjustable-array (&optional (size 0))
- (make-array size
- :fill-pointer size
- :adjustable t
- :element-type '(unsigned-byte 8)))
-
(defclass hurd-input-stream (hurd-stream fundamental-binary-input-stream)
((cache :initform (%create-adjustable-array +default-read-ahead+)
:accessor cache)
@@ -139,15 +133,15 @@
(+ start this-size)
end)))))))
-(defmethod make-hurd-input-stream ((file string))
+(defmethod make-hurd-input-stream ((file string) &optional (flags '(:read)))
(make-hurd-input-stream
- (file-name-lookup file :flags '(:read))))
+ (file-name-lookup file :flags flags)))
-(defmethod make-hurd-input-stream ((port number))
- (make-instance 'hurd-input-stream
- :port port))
+(defmethod make-hurd-input-stream ((port number) &optional flags)
+ (declare (ignore flags))
+ (make-instance 'hurd-input-stream :port port))
-(defmacro with-hurd-input-stream ((stream-name file) &body body)
- `(with-stream (,stream-name (make-hurd-input-stream ,file))
+(defmacro with-hurd-input-stream ((stream-name file &optional (flags ''(:read))) &body body)
+ `(with-stream (,stream-name (make-hurd-input-stream ,file ,flags))
,@body))