;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: June 2003
;;;;
-;;;; $Id: byte-stream.lisp,v 1.1 2003/07/05 02:32:08 kevin Exp $
+;;;; $Id$
;;;;
;;;; Works for CMUCL, SBCL, and AllergoCL only
;;;;
(in-package #:kmrcl)
+;; Intial CMUCL version by OnShored. Ported to SBCL by Kevin Rosenberg
+
#+(or cmu sbcl)
(progn
(defstruct (byte-array-output-stream
(let ((byte-array (byte-array-input-stream-byte-array stream))
(index (byte-array-input-stream-current stream)))
(cond ((= index (byte-array-input-stream-end stream))
- (eof-or-lose stream eof-errorp eof-value))
+ #+cmu
+ (eof-or-lose stream eof-errorp eof-value)
+ #+sbcl
+ (sb-impl::eof-or-lose stream eof-errorp eof-value)
+ )
(t
(setf (byte-array-input-stream-current stream) (1+ index))
(aref byte-array index)))))
(let ((byte-array (byte-array-input-stream-byte-array stream))
(index (byte-array-input-stream-current stream)))
(cond ((= index (byte-array-input-stream-end stream))
- (eof-or-lose stream eof-errorp eof-value))
+ #+cmu
+ (eof-or-lose stream eof-errorp eof-value)
+ #+sbcl
+ (sb-impl::eof-or-lose stream eof-errorp eof-value)
+ )
(t
(setf (byte-array-input-stream-current stream) (1+ index))
(aref byte-array index)))))
) ;; progn
+
+;;; Simple streams implementation by Kevin Rosenberg
+
#+allegro
(progn
(defmethod excl:device-extend ((stream extendable-buffer-output-stream)
need action)
+ (declare (ignore action))
(let* ((len (file-position stream))
(new-len (max (+ len need) (* 2 len)))
(old-buf (slot-value stream 'excl::buffer))