+/***/
+
+/****f* silcutil/SilcLogAPI/SilcLogCb
+ *
+ * SYNOPSIS
+ *
+ * typedef bool (*SilcLogCb)(SilcLogType type, char *message,
+ * void *context);
+ *
+ * DESCRIPTION
+ *
+ * The logging custom callback function. The `type' is the channel ID
+ * that triggered the event, which allows you to use the same callback
+ * function for multiple logging channels.
+ * The `message' parameter points to a null-terminated buffer containing
+ * the received message, while `context' is the caller-specified context.
+ * The message must not be modified or freed by the callback function.
+ *
+ * SEE ALSO
+ * silc_log_set_callback
+ *
+ ***/
+typedef bool (*SilcLogCb)(SilcLogType type, char *message, void *context);
+
+/****f* silcutil/SilcLogAPI/SilcLogDebugCb
+ *
+ * SYNOPSIS
+ *
+ * typedef bool (*SilcLogDebugCb)(char *file, char *function, int line,
+ * char *message, void *context);
+ *
+ * DESCRIPTION
+ *
+ * The debug logging callback function. The default behaviour is to
+ * output messages to stderr. `file', `function', and `line' are the
+ * corresponding offsets in the source files. `message' points to a
+ * null-terminated buffer containing the debugging message, and `context'
+ * is the caller-specified context.
+ * The message must not be modified or freed by the callback function.
+ * If the function returns TRUE, SilcLog will assume the message as handled
+ * and won't run its default handler.
+ *
+ * SEE ALSO
+ * silc_debug, silc_log_set_debug_callbacks
+ *
+ ***/
+typedef bool (*SilcLogDebugCb)(char *file, char *function, int line,
+ char *message, void *context);
+
+/****f* silcutil/SilcLogAPI/SilcLogHexdumpCb
+ *
+ * SYNOPSIS
+ *
+ * typedef bool (*SilcDebugHexdumpCb)(char *file, char *function, int line,
+ * unsigned char *data, SilcUInt32 data_len,
+ * char *message, void *context;
+ *
+ * DESCRIPTION
+ *
+ * The hexdump logging callback function. The default behaviour is to
+ * print a formatted hexdump to stderr, and is commonly what you would
+ * like it to be. `file', `function', and `line' are the corresponding
+ * offsets in the source files. `data' is the begin of the buffer that
+ * should be hexdumped, which is `data_len' bytes long.
+ * The `message' parameter points to a null-terminated buffer containing
+ * the received message, while `context' is the caller-specified context.
+ * The message must not be modified or freed by the callback function.
+ * If the function returns TRUE, SilcLog will assume the message as handled
+ * and won't run its default handler.
+ *
+ * SEE ALSO
+ * silc_debug_hexdump, silc_log_set_debug_callbacks
+ *
+ ***/
+typedef bool (*SilcLogHexdumpCb)(char *file, char *function, int line,
+ unsigned char *data, SilcUInt32 data_len,
+ char *message, void *context);
+
+/* Global Variables */
+
+/****v* silcutil/SilcLogAPI/silc_log_timestamp
+ *
+ * NAME
+ *
+ * bool silc_log_timestamp -- enable/disable fast logging timestamp
+ *
+ * DESCRIPTION
+ *
+ * Causes SilcLog to add a timestamp as returned by silc_get_time().
+ * This may be useful for example if you run your application under a
+ * daemon helper like watchdog that adds its own timestamp. Defaults to
+ * true.
+ *
+ ***/
+extern DLLAPI bool silc_log_timestamp;
+
+/****v* silcutil/SilcLogAPI/silc_log_quick
+ *
+ * NAME
+ *
+ * bool silc_log_quick -- enable/disable fast logging output
+ *
+ * DESCRIPTION
+ *
+ * SilcLog makes use of libc stream buffering output, which means that it
+ * saves HD activity by buffering the logging messages and writing them
+ * all together every some minutes (default is 5 minutes).
+ * Setting this variable to TRUE will force SilcLog to write messages to the
+ * filesystem as soon as they are received. This increases the CPU activity
+ * notably on bigger servers, but reduces memory usage.
+ * If you want to change the logging style on-the-fly, make sure to call
+ * silc_log_flush_all() after setting this variable to TRUE.
+ *
+ ***/
+extern DLLAPI bool silc_log_quick;
+
+/****v* silcutil/SilcLogAPI/silc_log_flushdelay
+ *
+ * NAME
+ *
+ * long silc_log_flushdelay -- flushing time delay
+ *
+ * DESCRIPTION
+ *
+ * Sets the logfiles flushing delay in seconds. As for now, changing this
+ * value AFTER logfiles initialization won't take effect until previous
+ * delay time will expire; for example if you change from 300 seconds to
+ * 60 seconds you will have to wait up to 300 seconds for this change to
+ * take effect.
+ * This value must be greater than 2 seconds.
+ *
+ ***/
+extern DLLAPI long silc_log_flushdelay;
+
+/****v* silcutil/SilcLogAPI/silc_debug
+ *
+ * NAME
+ *
+ * bool silc_debug -- enable/disable debugging output
+ *
+ * DESCRIPTION
+ *
+ * If silc_debug is set to FALSE, debugging functions won't procude any
+ * output. This is useful when for example you compile in the debugging
+ * support but at a certain point you want to send the program in the
+ * background.
+ *
+ * SEE ALSO
+ * SILC_LOG_DEBUG
+ *
+ ***/
+extern DLLAPI bool silc_debug;
+
+/****v* silcutil/SilcLogAPI/silc_debug_hexdump
+ *
+ * NAME
+ *
+ * bool silc_debug_hexdump -- enable/disable debugging output
+ *
+ * DESCRIPTION
+ *
+ * If silc_debug_hexdump is set to FALSE, debugging functions won't produce
+ * any output. This is useful when for example you compile in the debugging
+ * support but at a certain point you want to send the program in the
+ * background.
+ *
+ * SEE ALSO
+ * SILC_LOG_HEXDUMP
+ *
+ ***/
+extern DLLAPI bool silc_debug_hexdump;
+
+/* Macros */
+
+#if defined(WIN32)
+#ifndef __FUNCTION__
+#define __FUNCTION__ ""
+#endif
+#endif
+
+/****d* silcutil/SilcLogAPI/SILC_ENABLE_DEBUG
+ *
+ * NAME
+ *
+ * #define SILC_ENABLE_DEBUG
+ *
+ * DESCRIPTION
+ *
+ * Use this macro to enable the debugging in your application. If
+ * SILC was compiled with debugging enabled, this macro enables it.
+ * Use this macro in your application's main header, or in place where
+ * you need to enable the debugging.
+ *
+ * NOTES
+ *
+ * You still can control the debugging with silc_debug variable, on
+ * whether to actually print the debugging or not. This macro is
+ * used to enable debugging, not to say it is printed or not.
+ *
+ * SOURCE
+ */
+#define SILC_ENABLE_DEBUG \
+ #ifndef SILC_DEBUG \
+ #define SILC_DEBUG 1 \
+ #endif
+/***/