- (prepare-for-fast-read-char stream
- (let ((res (make-string 80))
- (len 80)
- (index 0))
- (loop
- (let ((ch (fast-read-char nil nil)))
- (cond (ch
- (when (char= ch #\newline)
- (done-with-fast-read-char)
- (return (values (shrink-vector res index) nil)))
- (when (= index len)
- (setq len (* len 2))
- (let ((new (make-string len)))
- (replace new res)
- (setq res new)))
- (setf (schar res index) ch)
- (incf index))
- ((zerop index)
- (done-with-fast-read-char)
- (return (values (eof-or-lose stream
- eof-error-p
- eof-value)
- t)))
- ;; Since FAST-READ-CHAR already hit the eof char, we
- ;; shouldn't do another READ-CHAR.
- (t
- (done-with-fast-read-char)
- (return (values (shrink-vector res index) t))))))))
- ;; must be Gray streams FUNDAMENTAL-STREAM
- (multiple-value-bind (string eof) (stream-read-line stream)
- (if (and eof (zerop (length string)))
- (values (eof-or-lose stream eof-error-p eof-value) t)
- (values string eof))))))
-
-;;; We proclaim them INLINE here, then proclaim them MAYBE-INLINE at EOF,
+ (ansi-stream-read-line stream eof-error-p eof-value recursive-p)
+ ;; must be Gray streams FUNDAMENTAL-STREAM
+ (multiple-value-bind (string eof) (stream-read-line stream)
+ (if (and eof (zerop (length string)))
+ (values (eof-or-lose stream eof-error-p eof-value) t)
+ (values string eof))))))
+
+;;; We proclaim them INLINE here, then proclaim them NOTINLINE later on,