[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pdf-devel] Updated tokeniser/parser patch

From: Michael Gold
Subject: [pdf-devel] Updated tokeniser/parser patch
Date: Wed, 21 Jan 2009 23:57:19 -0500
User-agent: Mutt/1.5.18 (2008-05-17)


Here's an updated version of my previous patch, which adds a parser in
addition to the tokeniser, and also makes major changes to pdf-obj.[ch].
There's still some incomplete stuff (like the pdf_obj_dict_ functions)
but it would probably be OK to merge once I complete the copyright
assignment. The next component to add would be a reader that can read
the xref table and resolve indirect object references.

Sample programs are included (util/toktest.c and util/parsetest.c), as
well as unit tests for the tokeniser.

One annoying thing I noticed was that pdf_list_t needs a heap allocation
to use an iterator, which means that pdf_obj_equal_p could fail with an
ENOMEM error (but currently has no way to return that error). It would
be nice if the iterator could be kept on the stack -- struct
pdf_list_iterator_s only contains one member anyway.

The gnulib list code will also need to be changed to return ENOMEM when
necessary -- currently it just calls abort() when malloc fails.

A message was posted a few days ago about error management in type 4
functions. My parser already handles syntax errors (for now, it just
returns PDF_EBADFILE), and it would be fairly easy to make the parser
read type 4 functions if it would help.

-- Michael

Attachment: gnupdf-parser.diff
Description: Text Data

Attachment: signature.asc
Description: Digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]