[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pdf-devel] libcurl initialization requirements
From: |
Aleksander Morgado |
Subject: |
Re: [pdf-devel] libcurl initialization requirements |
Date: |
Wed, 17 Feb 2010 20:59:38 +0100 |
> 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.
>
Well, a second call to pdf_text_init() for example will not
re-initialize the text module. I guess we should just make sure things
are not initialized twice.
> 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;
> }
>
What about:
bool pdf_is_init(void);
Instead of the global variable?
Re: [pdf-devel] libcurl initialization requirements, jemarch, 2010/02/17