* operation, no callback function will be called back to the upper layer.
* This must be remembered when implementing the operation layer.
*
+ * EXAMPLE
+ *
+ * SilcAsyncOperation async_call(Callback callback, void *cb_context)
+ * {
+ * SilcAsyncOperation op;
+ * OpContext ctx;
+ *
+ * // Allocate async operation so that caller can control us, like abort
+ * op = silc_async_alloc(async_call_abort, NULL, ctx);
+ * ctx->callback = callback;
+ *
+ * ...
+ *
+ * // Return async operation for upper layer
+ * return op;
+ * }
+ *
+ * // This callback is called when silc_async_abort is called by upper layer.
+ * // The callback given to async_call must not be called after this.
+ * void async_call_abort(SilcAsyncOperation op, void *context)
+ * {
+ * OpContext ctx = context;
+ * ctx->aborted = TRUE;
+ * ctx->callback = NULL;
+ * }
+ *
***/
#ifndef SILCASYNC_H
*
* Fast operations are supported on: x86, x86_64, ia64, PPC
*
+ * EXAMPLE
+ *
+ * SilcAtomic32 refcnt;
+ *
+ * // Initialize atomic variable
+ * silc_atomic_init32(&refcnt, 0);
+ *
+ * // Increment referene counter by one
+ * silc_atomic_add_int32(&refcnt, 1);
+ *
+ * // Uninitialize atomic variable
+ * silc_atomic_uninit32(&refcnt);
+ *
***/
#ifndef SILCATOMIC_H
* in multithreaded environment with a same SilcBuffer context without
* concurrency control.
*
+ * EXAMPLE
+ *
+ * SilcBufferStruct buffer;
+ *
+ * memset(&buffer, 0, sizeof(buffer));
+ * ret = silc_buffer_format(&buffer,
+ * SILC_STR_UI_INT(intval),
+ * SILC_STR_CHAR(charval),
+ * SILC_STR_UI_INT(intval),
+ * SILC_STR_SHORT(str_len),
+ * SILC_STR_DATA(str, str_len),
+ * SILC_STR_END);
+ * if (ret < 0)
+ * error;
+ *
***/
#ifndef SILCBUFFMT_H
* Condition variables enable threads to suspend execution and yield
* the processors until some predicate on some shared data is satisfied.
*
+ * EXAMPLE
+ *
+ * Thread 1:
+ *
+ * // Wait for signal
+ * silc_mutex_lock(lock);
+ * while (c->a == NULL)
+ * silc_cond_wait(cond, lock);
+ * ...
+ * silc_mutex_unlock(lock);
+ *
+ * Thread 2:
+ *
+ * // Signal
+ * silc_mutex_lock(lock);
+ * c->a = context;
+ * silc_cond_signal(cond);
+ * silc_mutex_unlock(lock);
+ *
***/
#ifndef SILCCOND_H
* SILC Dynamic List is not thread-safe. If the same list context must be
* used in multithreaded environment concurrency control must be employed.
*
+ * EXAMPLE
+ *
+ * SilcDList list = silc_dlist_init();
+ *
+ * silc_dlist_add(list, entry1);
+ * silc_dlist_add(list, entry2);
+ *
+ * // Traverse the list from the beginning to the end
+ * silc_dlist_start(list)
+ * while ((entry = silc_dlist_get(list)) != SILC_LIST_END) {
+ * ...
+ * }
+ *
+ * silc_dlist_uninit(list);
+ *
***/
/****s* silcutil/SilcDListAPI/SilcDList
* Platform independent iterface for loading and using shared objects and
* dynamically linked libraries (DLLs).
*
+ * EXAMPLE
+ *
+ * SilcDll dll;
+ * SilcFuncCb function;
+ *
+ * dll = silc_dll_load("/path/to/my.so");
+ * function = silc_dll_getsym(dll, "my_function");
+ *
+ * // Call the funtion
+ * function(arg1, arg2);
+ *
+ * silc_dll_close(dll);
+ *
***/
#ifndef SILCDLL_H
*/
/****h* silcutil/SILC Timer Interface
+ *
+ * DESCRIPTION
*
* SILC Timer interface provides a simple way to measure time intervals.
* The SILC Timer works with microsecond resolution, depending on platform.
*
+ * EXAMPLE
+ *
+ * SilcTimerStruct timer;
+ *
+ * silc_timer_start(&timer);
+ * ... time passes ...
+ * silc_timer_stop(&timer);
+ * silc_timer_value(&timer, &elapsed_sec, &elapsed_usec);
+ *
***/
#ifndef SILCTIMER_H