On Tue, Jan 06, 2009 at 18:00:24 +0100, [email protected] 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

Attachment: signature.asc
Description: Digital signature

Reply via email to