#ifndef SILCLOG_H
#define SILCLOG_H
+/* Set TRUE/FALSE to enable/disable debugging */
+extern int silc_debug;
+
/* SILC Log types */
typedef enum {
SILC_LOG_INFO,
SilcLogType type;
} SilcLogTypeName;
+/* Log function callback. */
+typedef void (*SilcLogCb)(char *message);
+
+/* Debug function callback. */
+typedef void (*SilcDebugCb)(char *file, char *function,
+ int line, char *message);
+
+/* Debug hexdump function callback. */
+typedef void (*SilcDebugHexdumpCb)(char *file, char *function,
+ int line, unsigned char *data,
+ unsigned int data_len, char *message);
+
/* Default log filenames */
#define SILC_LOG_FILE_INFO "silcd.log"
#define SILC_LOG_FILE_WARNING "silcd_error.log"
char *warning, unsigned int warning_size,
char *error, unsigned int error_size,
char *fatal, unsigned int fatal_size);
+void silc_log_set_callbacks(SilcLogCb info, SilcLogCb warning,
+ SilcLogCb error, SilcLogCb fatal);
+void silc_log_reset_callbacks();
+void silc_log_set_debug_callbacks(SilcDebugCb debug,
+ SilcDebugHexdumpCb debug_hexdump);
+void silc_log_reset_debug_callbacks();
#endif