BEGIN_C_DECLS axl_bool valvula_init_ctx ( ValvulaCtx ctx)

Context based valvula library init.

Allows to init the valvula library status on the provided context object (ValvulaCtx).

To init valvula library use:

1 ValvulaCtx * ctx;
2 
3 // create an empty context
4 ctx = valvula_ctx_new ();
5 
6 // init the context
7 if (! valvula_init_ctx (ctx)) {
8  printf ("failed to init the library..\n");
9 }
10 
11 // do API calls before this function
12 
13 // terminate the context
14 valvula_exit_exit (ctx);
15 
16 // release the context
17 valvula_ctx_free (ctx);
Parameters
ctxAn already created context where the library initialization will take place.
Returns
axl_true if the context was initialized, otherwise axl_false is returned.

NOTE: This function is not thread safe, that is, calling twice from different threads on the same object will cause improper results. You can use valvula_init_check to ensure if you already initialized the context.

References valvula_thread_pool_get_num(), and valvula_thread_pool_init().