Skip to content
Snippets Groups Projects
Commit 58696f5b authored by ram's avatar ram
Browse files

Added :EOF support in listen method, and fixed a few comments.

parent 603858d9
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.11 1991/05/18 13:38:36 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/fd-stream.lisp,v 1.12 1991/05/18 19:06:01 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -37,14 +37,15 @@ ...@@ -37,14 +37,15 @@
;;;; Buffer manipulation routines. ;;;; Buffer manipulation routines.
(defvar *available-buffers* () (defvar *available-buffers* ()
"List of available buffers. Each buffer is an dynamic alien.") "List of available buffers. Each buffer is an sap pointing to
bytes-per-buffer of memory.")
(defconstant bytes-per-buffer (* 4 1024) (defconstant bytes-per-buffer (* 4 1024)
"Number of bytes per buffer.") "Number of bytes per buffer.")
;;; NEXT-AVAILABLE-BUFFER -- Internal. ;;; NEXT-AVAILABLE-BUFFER -- Internal.
;;; ;;;
;;; Returns the next available alien buffer, creating one if necessary. ;;; Returns the next available buffer, creating one if necessary.
;;; ;;;
(proclaim '(inline next-available-buffer)) (proclaim '(inline next-available-buffer))
;;; ;;;
...@@ -71,8 +72,8 @@ ...@@ -71,8 +72,8 @@
(fd -1 :type fixnum) ; The file descriptor (fd -1 :type fixnum) ; The file descriptor
(buffering :full) ; One of :none, :line, or :full (buffering :full) ; One of :none, :line, or :full
(char-pos nil) ; Character position if known. (char-pos nil) ; Character position if known.
(listen nil) ; T if we don't need to listen (listen nil) ; T if we don't need to listen. :EOF if we hit
; EOF.
;; The input buffer. ;; The input buffer.
(unread nil) (unread nil)
(ibuf-sap nil) (ibuf-sap nil)
...@@ -452,6 +453,7 @@ ...@@ -452,6 +453,7 @@
stream stream
(mach:get-unix-error-msg errno)))) (mach:get-unix-error-msg errno))))
((zerop count) ((zerop count)
(setf (fd-stream-listen stream) :eof)
(throw 'eof-input-catcher nil)) (throw 'eof-input-catcher nil))
(t (t
(incf (fd-stream-ibuf-tail stream) count)))))) (incf (fd-stream-ibuf-tail stream) count))))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment