[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pdf-devel] Handling errors in pdf_stm_read_char/peer_char
From: |
Michael Gold |
Subject: |
[pdf-devel] Handling errors in pdf_stm_read_char/peer_char |
Date: |
Mon, 12 Jan 2009 00:19:46 -0500 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Tue, Jan 06, 2009 at 18:00:24 +0100, address@hidden wrote:
> In the meanwhile, did you try to make the tokeniser to use a reading
> stream? Would be a nice try out of the get_char and peek_char
> operations in the streams.
I have this working now, but I don't see any way for those functions to
indicate errors. There's a special return value PDF_EOF, but the
tokeniser should differentiate between errors and EOF, and should also
be able to recover from some errors. For example, we might get
EWOULDBLOCK when reading a PDF over HTTP and want to continue parsing
when more data is available.
I think redefining the functions as
pdf_status_t
pdf_stm_{read,peek}_char (pdf_stm_t stm,
pdf_char_t *ch)
would be the best way to report errors, since it makes the usage
obvious. pdf_stm_read and pdf_stm_write would need similar changes.
Comments?
-- Michael
signature.asc
Description: Digital signature