[Top][All Lists]
[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 09:34:04 -0300 |
> I was thinking in a scheme like the following:
>
> Base Layer Modules:
>
> pdf_<module-name>[_<module-component>].[ch]
>
> Object Layer Modules:
>
> pdf_o_<module-name>[_<module-component>].[ch]
>
> Document Layer Modules:
>
> pdf_d_<module-name>[_<module-component>].[ch]
>
> Page Layer Modules:
>
> pdf_p_<module-name>[_<module-component>].[ch]
>
> What do you think?
Sure, I like it. If everyone agrees change names ASAP :-)
> BTW, to avoid confusions with the PDF stream objects it is better to
> consistently call the base layer streams as "stms".
Yes, I was thinking of directly changing the name of the stms module to
'buffer'/'sink' module or something. The names got me confused at first.
> Note that the processing of a PDF file (maybe linearized) will involve the
> use of several stms. For example, the presence of a object stream will
> require to use an extra stm with a different filter chain installed to allow
> the parser to read the objects contained into it.
Exactly.
> 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 ?
>
> Yes. Each module should be able to define several error conditions on top of
> a generic mechanism provided by the error module (the module-specific error
> conditions can be implemented in pdf_error.h and not in pdf_<module>).
>
> I would suggest to design the generic mechanisms first. Maybe maintaining a
> global data structure containing a stack of error events (ala errno).
This is what I have so far:
--- pdf_error.h ---
/* Time-stamp: <2007-12-13 09:28:59 gerel> */
#ifndef PDF_ERROR_H
#define PDF_ERROR_H
#define PDF_ERROR 1
enum pdf_error_t
{
/* foo module errros */
PDF_EINVCHAR = 0,
PDF_EINVSYNTAX,
PDF_EEOF,
/* memory module errors */
PDF_EOUTOFMEM
/* general errors */
PDF_EFATAL
};
extern enum pdf_error_t pdf_errno;
extern void pdf_perror (const char *str);
/* Print a message with `fprintf (stderr, FORMAT, ...)';
if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
extern void pdf_error (int status, int errnum, const char *format, ...);
extern void pdf_error_at_line (int status, int errnum, const char *fname,
unsigned int lineno, const char *format, ...);
/* If NULL, error will flush stdout, then print on stderr the program
name, a colon and a space. Otherwise, error will call this
function without parameters instead. */
extern void (*error_print_progname) (void);
/* This variable is incremented each time `error' is called. */
extern unsigned int pdf_error_message_count;
/* Sometimes we want to have at most one error per line. This
variable controls whether this mode is selected or not. */
extern int pdf_error_one_per_line;
#endif /* PDF_ERROR_H */
--- pdf_error.h ---
> BTW, you will need a wiki account in order to write down the
> architecture/design of the error module. I will create one and send you the
> login information.
Thanks, I just logged in.
-gerel
Re: [pdf-devel] I'm Back at last, jemarch, 2007/12/13
- Re: [pdf-devel] I'm Back at last,
gerel <=
Re: [pdf-devel] I'm Back at last, Hardy Falk, 2007/12/13