pdf-devel
[Top][All Lists]
Advanced

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

Re: [pdf-devel] pdf_get_dict_entry()


From: jemarch
Subject: Re: [pdf-devel] pdf_get_dict_entry()
Date: Fri, 14 Sep 2007 19:49:54 +0200
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.1.50 (powerpc-unknown-linux-gnu) MULE/5.0 (SAKAKI)

   > Are there preallocated name objects ?
   >
   > We lack a library initialization function for the moment.
   > This seems to be the right time to write one. The routine can
   > create a global variable containing the preallocated name
   > objects. I will put that routine in pdf_base.
   A specialized lookup function with a C-string as second argument
   might be even more convenient. 

I am writing initialization code in order to preallocate the standard
names. Those names will be useful for other purposes.

   I'm now using a small wrapper, that's fine for my first efforts.

Ok. To use the preallocated names you will be able to use PDF_N_SIZE,
PDF_N_ENCODE, and so on.

   Additional questions:
   How will function objects be used ( called ) ?
   Is pdf_apply_function( const pdf_obj *, int n_in, const double 
   in[] , int n_out, double out[] ) an acceptable signature?

After initialized, we will want to call somewhat like:

   pdf_obj_t pdf_apply_function (pdf_function_t function, pdf_obj_t
   inputs);

The returned object would be a PDF array with the results. `inputs'
would be a PDF array with the actual inputs.

   How shall errors be reported?

If we use a PDF array to report the results, we could return an array
such as:

   [error ERROR_NUMBER]

where `error' is a PDF name and ERROR_NUMBER is a suitable error
code. 

We could generalize this mechanism in order to use it in other parts
of the library. We could define the following function in
`pdf_error.[ch]':

int pdf_check_error (pdf_obj_t obj);

and then:

   result = pdf_apply_function (...);
   if (pdf_check_error (result))
   {
     /* Handle the error,
       maybe printing pdf_error_description (result) */
   }

With such schema we could define error conditions (and the associated
error descriptions) in `pdf_error.h'.

What do you think?

   > BTW, If you are actually implementing the function common
   > data type, please confirm it. I could then go forward for the
   > lexer and the parser.
   Now that's fast... Aehm, yes, I'll give it a try.

Thanks!

-- 
Jose E. Marchesi  <address@hidden>
                  <address@hidden>

GNU Spain         http://es.gnu.org
GNU Project       http://www.gnu.org




reply via email to

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