Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2007 Pekka Riikonen
+ Copyright (C) 1997 - 2008 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
-/****h* silcutil/SILC Logging Interface
+/****h* silcutil/Logging Interface
*
* DESCRIPTION
*
#ifndef SILCLOG_H
#define SILCLOG_H
-/****d* silcutil/SilcLogAPI/SilcLogType
+/****d* silcutil/SilcLogType
*
* NAME
*
#include "silclog_i.h"
-/****f* silcutil/SilcLogAPI/SilcLogCb
+/****f* silcutil/SilcLogCb
*
* SYNOPSIS
*
***/
typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message, void *context);
-/****f* silcutil/SilcLogAPI/SilcLogDebugCb
+/****f* silcutil/SilcLogDebugCb
*
* SYNOPSIS
*
typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
char *message, void *context);
-/****f* silcutil/SilcLogAPI/SilcLogHexdumpCb
+/****f* silcutil/SilcLogHexdumpCb
*
* SYNOPSIS
*
/* Macros */
-/****d* silcutil/SilcLogAPI/SILC_LOG_INFO
+/****d* silcutil/SILC_LOG_INFO
*
* NAME
*
#define SILC_LOG_INFO(fmt) silc_log_output(SILC_LOG_INFO, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_WARNING
+/****d* silcutil/SILC_LOG_WARNING
*
* NAME
*
#define SILC_LOG_WARNING(fmt) silc_log_output(SILC_LOG_WARNING, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_ERROR
+/****d* silcutil/SILC_LOG_ERROR
*
* NAME
*
#define SILC_LOG_ERROR(fmt) silc_log_output(SILC_LOG_ERROR, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_FATAL
+/****d* silcutil/SILC_LOG_FATAL
*
* NAME
*
#define SILC_LOG_FATAL(fmt) silc_log_output(SILC_LOG_FATAL, silc_format fmt)
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_DEBUG
+/****d* silcutil/SILC_LOG_DEBUG
*
* NAME
*
#endif /* SILC_DEBUG */
/***/
-/****d* silcutil/SilcLogAPI/SILC_LOG_HEXDUMP
+/****d* silcutil/SILC_LOG_HEXDUMP
*
* NAME
*
#endif /* SILC_DEBUG */
/***/
-/****d* silcutil/SilcLogAPI/SILC_ASSERT
- *
- * NAME
- *
- * #define SILC_ASSERT(experssion)
- *
- * DESCRIPTION
- *
- * Assert macro that prints error message to stderr and calls abort()
- * if the `expression' is false (ie. compares equal to zero). If
- * SILC_DEBUG is not defined this macro has no effect.
- *
- * SOURCE
- */
-#if defined(SILC_DEBUG)
-#define SILC_ASSERT(expr) assert((expr));
-#else
-#define SILC_ASSERT(expr) do { } while(0)
-#endif /* SILC_DEBUG */
-/***/
-
-/****d* silcutil/SilcLogAPI/SILC_VERIFY
- *
- * NAME
- *
- * #define SILC_VERIFY(experssion)
- *
- * DESCRIPTION
- *
- * Verification macro that prints error message to stderr and calls
- * abort() if the `expression' is false (ie. compares equal to zero)
- * on debug builds (SILC_DEBUG defined), and prints error message to
- * stderr on release builds (SILC_DEBUG undefined) but does not abort().
- * This macro is always compiled even if debugging (SILC_DEBUG) is not
- * defined.
- *
- * SOURCE
- */
-#if defined(SILC_DEBUG)
-#define SILC_VERIFY(expr) assert((expr));
-#else
-#define SILC_VERIFY(expr) \
- if (silc_unlikely(!(expr))) { \
- SILC_LOG_ERROR(("SILC_VERIFY %s:%s:%d", \
- __FILE__, __FUNCTION__, __LINE__)); \
- silc_set_errno_reason_nofail(SILC_ERR_ASSERT, "SILC_VERIFY %s:%s:%d", \
- __FILE__, __FUNCTION__, __LINE__); \
- }
-#endif /* SILC_DEBUG */
-/***/
-
/* Prototypes */
-/****f* silcutil/SilcLogAPI/silc_log_set_file
+/****f* silcutil/silc_log_set_file
*
* SYNOPSIS
*
SilcBool silc_log_set_file(SilcLogType type, char *filename,
SilcUInt32 maxsize, SilcSchedule scheduler);
-/****f* silcutil/SilcLogAPI/silc_log_get_file
+/****f* silcutil/silc_log_get_file
*
* SYNOPSIS
*
***/
char *silc_log_get_file(SilcLogType type);
-/****f* silcutil/SilcLogAPI/silc_log_set_callback
+/****f* silcutil/silc_log_set_callback
*
* SYNOPSIS
*
***/
void silc_log_set_callback(SilcLogType type, SilcLogCb cb, void *context);
-/****f* silcutil/SilcLogAPI/silc_log_reset_callbacks
+/****f* silcutil/silc_log_reset_callbacks
*
* SYNOPSIS
*
***/
void silc_log_reset_callbacks(void);
-/****f* silcutil/SilcLogAPI/silc_log_flush_all
+/****f* silcutil/silc_log_flush_all
*
* SYNOPSIS
*
***/
void silc_log_flush_all(void);
-/****f* silcutil/SilcLogAPI/silc_log_reset_all
+/****f* silcutil/silc_log_reset_all
*
* SYNOPSIS
*
***/
void silc_log_reset_all(void);
-/****f* silcutil/SilcLogAPI/silc_log_set_debug_callbacks
+/****f* silcutil/silc_log_set_debug_callbacks
*
* SYNOPSIS
*
SilcLogHexdumpCb hexdump_cb,
void *hexdump_context);
-/****f* silcutil/SilcLogAPI/silc_log_reset_debug_callbacks
+/****f* silcutil/silc_log_reset_debug_callbacks
*
* SYNOPSIS
*
***/
void silc_log_reset_debug_callbacks(void);
-/****f* silcutil/SilcLogAPI/silc_log_set_debug_string
+/****f* silcutil/silc_log_set_debug_string
*
* SYNOPSIS
*
***/
void silc_log_set_debug_string(const char *debug_string);
-/****f* silcutil/SilcLogAPI/silc_log_timestamp
+/****f* silcutil/silc_log_timestamp
*
* NAME
*
***/
void silc_log_timestamp(SilcBool enable);
-/****f* silcutil/SilcLogAPI/silc_log_flushdelay
+/****f* silcutil/silc_log_flushdelay
*
* NAME
*
***/
void silc_log_flushdelay(SilcUInt32 flushdelay);
-/****f* silcutil/SilcLogAPI/silc_log_quick
+/****f* silcutil/silc_log_quick
*
* NAME
*
***/
void silc_log_quick(SilcBool enable);
-/****v* silcutil/SilcLogAPI/silc_log_debug
+/****v* silcutil/silc_log_debug
*
* NAME
*
***/
void silc_log_debug(SilcBool enable);
-/****v* silcutil/SilcLogAPI/silc_log_debug_hexdump
+/****v* silcutil/silc_log_debug_hexdump
*
* NAME
*