+/***/
+
+/****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, uint32 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, uint32 data_len,
+ char *message, void *context);
+
+/* Global Variables */
+
+/****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 */
+
+#ifdef WIN32
+#define __FUNCTION__ ""
+#endif
+
+/****d* silcutil/SilcLogAPI/SILC_LOG_INFO
+ *
+ * NAME
+ *
+ * #define SILC_LOG_INFO(...)
+ *
+ * DESCRIPTION
+ *
+ * This macro is a wrapper to the main logging function.
+ * It supports variable argument list formatting, and *automatically*
+ * appends newline at the end of the string.
+ *
+ * NOTES
+ *
+ * This macro requires double parenthesis to ensure that the VA list
+ * formatting would work correctly.
+ *
+ * EXAMPLE
+ *
+ * SILC_LOG_INFO(("Today i feel %s", core->mood));
+ *
+ * SOURCE
+ */
+#define SILC_LOG_INFO(fmt) silc_log_output(SILC_LOG_INFO, silc_format fmt)
+/***/
+
+/****d* silcutil/SilcLogAPI/SILC_LOG_WARNING
+ *
+ * NAME
+ *
+ * #define SILC_LOG_WARNING(...)
+ *
+ * DESCRIPTION
+ *
+ * Wrapper to the WARNING logging channel.
+ * Please see the SILC_LOG_INFO macro.
+ *
+ * SEE ALSO
+ * SILC_LOG_INFO
+ *
+ * SOURCE
+ */
+#define SILC_LOG_WARNING(fmt) silc_log_output(SILC_LOG_WARNING, silc_format fmt)
+/***/