pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] I'm Back at last


From: gerel
Subject: Re: [pdf-devel] I'm Back at last
Date: Thu, 13 Dec 2007 21:44:47 -0300

 >    > 3. For pdf_error I'm considering writing wrappers for those functions
 >    > available on lib/error.c and to write new ones for gnupdf as
 >    > needed. OTOH, I'm pretty new on the project to know which error types
 >    > should be added. I guess we should analyse each module on each layer and
 >    > decide from there, don't you ?
 > 
 >    Some observations from pdf_function.c: Error reporting from a leaf module
 >    tends to be cryptic for a mere user. For example, a pdf function
 >    dictionary may miss a required key, the dictionary data may be
 >    inconsistent in various ways, a type 4 function definition may have a
 >    syntax error in its sublangage, and so on.
 > 
 >    There are errors at function call time,too.  A PDF shading function may be
 >    called millions of times, reporting each error is probably not useful.
 >    I'd need some way to defer error reporting.  What about a pdf dictionary
 >    as "error object" ?  It might be passed freely, accreting context as it
 >    moves?
 > 
 > Would be good to have some global data structure able to stack errors of
 > several severities.

If I understood your point, the idea I have in mind is to define _general_ error
types and error reporting procedures for describing user-level problems.  OTOH
for those errors that aren't of much use to users and are reported for
debugging purposes, instead of filling every source file with:

#ifdef DEBUG
....
#endif

statements I'd suggest to write some procedure/macro let's say "PDF_DEBUG" and
use it on every place needed. And then in case we're compiling source
--with-no-debug just define "PDF_DEBUG" to ' ' (void).

Note that I'm just talking about error reporting here, error checking and
recovering is subject to the caller procedure.

I hope I answered your doubts. If not, sorry :-/


-gerel





reply via email to

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