* SYNOPSIS
*
* typedef SilcBool (*SilcLogCb)(SilcLogType type, char *message,
- * void *context);
+ * void *context);
*
* DESCRIPTION
*
* 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 was
+ * handled and won't run its default handler.
*
* SEE ALSO
* silc_log_set_callback
* SYNOPSIS
*
* typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
- * char *message, void *context);
+ * char *message, void *context);
*
* DESCRIPTION
*
*
***/
typedef SilcBool (*SilcLogDebugCb)(char *file, char *function, int line,
- char *message, void *context);
+ char *message, void *context);
/****f* silcutil/SilcLogAPI/SilcLogHexdumpCb
*
* SYNOPSIS
*
- * typedef SilcBool (*SilcDebugHexdumpCb)(char *file, char *function, int line,
- * unsigned char *data,
- * SilcUInt32 data_len,
- * char *message, void *context;
+ * typedef SilcBool
+ * (*SilcDebugHexdumpCb)(char *file, char *function, int line,
+ * unsigned char *data,
+ * SilcUInt32 data_len,
+ * char *message, void *context;
*
* DESCRIPTION
*
*
***/
typedef SilcBool (*SilcLogHexdumpCb)(char *file, char *function, int line,
- unsigned char *data, SilcUInt32 data_len,
- char *message, void *context);
+ unsigned char *data, SilcUInt32 data_len,
+ char *message, void *context);
/* Macros */
* DESCRIPTION
*
* Assert macro that prints error message to stderr and calls abort()
- * if the `expression' is is false (ie. compares equal to zero). If
- * SILC_DEBUG is not defined this macro as no effect.
+ * if the `expression' is false (ie. compares equal to zero). If
+ * SILC_DEBUG is not defined this macro has no effect.
*
* SOURCE
*/
#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 (!(expr)) \
+ SILC_LOG_ERROR(("SILC_VERIFY %s:%d", __FUNCTION__, __LINE__));
+#endif /* SILC_DEBUG */
+/***/
+
/* Prototypes */
/****f* silcutil/SilcLogAPI/silc_log_set_file