Rewrite STREAM-READ-CHAR and STREAM-READ-CHAR-NO-HANG.
[iolib.git] / src / streams / gray / conditions.lisp
blob5f60e72284b9b87146849af5b74cbe9fb0da2453
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Gray stream conditions.
4 ;;;
6 (in-package :iolib.streams)
8 (define-condition hangup (stream-error)
9 ()
10 (:report (lambda (c s)
11 (format s "Stream ~S hang up."
12 (stream-error-stream c))))
13 (:documentation "Condition signaled when the underlying device of a stream
14 is closed by the remote end while writing to it."))
16 (define-condition no-characters-to-unread (stream-error)
18 (:report (lambda (c s)
19 (format s "No uncommitted character to unread on stream ~S."
20 (stream-error-stream c))))
21 (:documentation "Condition signaled when UNREAD-CHAR is called on a stream either:
22 1) without having been preceded by a READ-CHAR, or
23 2) after a PEEK-CHAR"))