We already have that requirement in some base-layer modules, like
   the text module or time module. The text module has a
   pdf_text_context_init() which should be called once at program
   startup, preferably when no other threads are running (so that no
   other thread actually tries to call it).

We should not introduce that requirement!  If pdf_init() is supposed
to be called only once in the lifetime of the application then we
should provide the user a way to determine if it has been called
before in an atomic way.

A possible way to achieve that could be:

   
   /* Global symbol indicating if libgnupdf has been initialized:  */
   bool pdf_initialized = false;

  
   pdf_init()
   {

    ...

    /* Declare the library initialized.  */
    pdf_initialized = true;
   }

--
Jose E. Marchesi  <[email protected]>
                  http://www.jemarch.net
GNU Project       http://www.gnu.org

  



Reply via email to