r4823: Auto commit for Debian build
[kmrcl.git] / buff-input.lisp
index 53f76e018d538471b8cff0d139f941b0c2fc3710..3d678431776039b30db330cb0588bc26c85496da 100644 (file)
@@ -7,17 +7,19 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: buff-input.lisp,v 1.2 2002/10/06 13:30:17 kevin Exp $
+;;;; $Id: buff-input.lisp,v 1.7 2003/05/06 01:45:44 kevin Exp $
 ;;;;
 ;;;;
-;;;; This file, part of Kmrcl, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
 ;;;;
-;;;; Kmrcl users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the GNU General Public License.
+;;;; KMRCL users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
 (in-package :kmrcl)
 
 ;;;; *************************************************************************
 
 (in-package :kmrcl)
 
-(declaim (optimize (speed 3) (safety 0) (space 0) (debug 0)))
+(eval-when (:compile-toplevel)
+  (declaim (optimize (speed 3) (safety 0) (space 0) (debug 0))))
 
 (defconstant +max-field+ 10000)
 (defconstant +max-fields-per-line+ 20)
 
 (defconstant +max-field+ 10000)
 (defconstant +max-fields-per-line+ 20)
@@ -38,7 +40,8 @@
       (setf (aref bufs i) (make-array max-field-len :element-type 'character :fill-pointer 0 :adjustable nil)))
     bufs))
 
       (setf (aref bufs i) (make-array max-field-len :element-type 'character :fill-pointer 0 :adjustable nil)))
     bufs))
 
-(defun read-buffered-fields (fields strm &optional (field-delim +field-delim+))
+(defun read-buffered-fields (fields strm &optional (field-delim +field-delim+)
+                            (eof 'eof))
   "Read a line from a stream into a field buffers"
   (declare (type base-char field-delim)
           (type vector fields))
   "Read a line from a stream into a field buffers"
   (declare (type base-char field-delim)
           (type vector fields))
@@ -46,7 +49,7 @@
   (do ((ifield 0 (1+ ifield))
        (linedone nil)
        (eof nil))
   (do ((ifield 0 (1+ ifield))
        (linedone nil)
        (eof nil))
-      (linedone (if eof 'eof fields))
+      (linedone (if eof eof fields))
     (declare (type fixnum ifield)
             (type boolean linedone eof))
     (let ((field (aref fields ifield)))
     (declare (type fixnum ifield)
             (type boolean linedone eof))
     (let ((field (aref fields ifield)))
@@ -86,9 +89,6 @@
   (buffers)
   (field-lengths))
 
   (buffers)
   (field-lengths))
 
-(defmethod print-object ((f field-buffers) s)
-  (format s "#<~d>~%" (field-buffers-nfields f)))
-   
 (defun make-fields-buffer2 (&optional (max-fields +max-fields-per-line+) 
                                   (max-field-len +max-field+))
   (let ((bufs (make-array max-fields :element-type 'vector :fill-pointer nil :adjustable nil))
 (defun make-fields-buffer2 (&optional (max-fields +max-fields-per-line+) 
                                   (max-field-len +max-field+))
   (let ((bufs (make-array max-fields :element-type 'vector :fill-pointer nil :adjustable nil))