X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=buff-input.lisp;h=3d678431776039b30db330cb0588bc26c85496da;hb=23502ca70f35ba1f3a03dd623ca21a92a6064e14;hp=53f76e018d538471b8cff0d139f941b0c2fc3710;hpb=0e5343fda28c559f11e003805727f4c625d178f3;p=kmrcl.git diff --git a/buff-input.lisp b/buff-input.lisp index 53f76e0..3d67843 100644 --- a/buff-input.lisp +++ b/buff-input.lisp @@ -7,17 +7,19 @@ ;;;; 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) -(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) @@ -38,7 +40,8 @@ (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)) @@ -46,7 +49,7 @@ (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))) @@ -86,9 +89,6 @@ (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))