BEGIN_C_DECLS axl_bool myqtt_init_ctx ( MyQttCtx ctx)

Context based myqtt library init.

Allows to init the myqtt library status on the provided context object (MyQttCtx).

To init myqtt library use:

1 MyQttCtx * ctx;
2 
3 // create an empty context
4 ctx = myqtt_ctx_new ();
5 
6 // init the context
7 if (! myqtt_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 myqtt_exit_exit (ctx);
15 
16 // release the context
17 myqtt_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 myqtt_init_check to ensure if you already initialized the context.

References myqtt_conf_get(), myqtt_conf_set(), myqtt_init_check(), MYQTT_IO_WAIT_SELECT, myqtt_io_waiting_get_current(), myqtt_mutex_create(), MYQTT_SOFT_SOCK_LIMIT, myqtt_support_add_search_path(), myqtt_support_add_search_path_ref(), myqtt_support_build_filename(), myqtt_thread_pool_get_num(), and myqtt_thread_pool_init().

Referenced by myqttd_init().