Splitted SILC core library. Core library includes now only
[silc.git] / lib / silcutil / silclog.h
similarity index 82%
rename from lib/silccore/silclog.h
rename to lib/silcutil/silclog.h
index a98e4af44fa62c6a04b3daf2f9aca6a32f933a84..cd34639f3d1fc994cd0c45ad54b3e11ec7361b5a 100644 (file)
@@ -21,6 +21,9 @@
 #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,
@@ -35,6 +38,18 @@ typedef struct {
   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"
@@ -100,5 +115,11 @@ void silc_log_set_files(char *info, unsigned int info_size,
                        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