Doxyfy s_debug.h and s_debug.c.
[ircu2.10.12-pk.git] / include / s_debug.h
1 /*
2  * s_debug.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_s_debug_h
7 #define INCLUDED_s_debug_h
8 #ifndef INCLUDED_config_h
9 #include "config.h"          /* Needed for DEBUGMODE */
10 #endif
11 #ifndef INCLUDED_ircd_defs_h
12 #include "ircd_defs.h"       /* Needed for HOSTLEN */
13 #endif
14 #ifndef INCLUDED_stdarg_h
15 #include <stdarg.h>
16 #define INCLUDED_stdarg_h
17 #endif
18
19 struct Client;
20 struct StatDesc;
21
22 #ifdef DEBUGMODE
23
24 /*
25  * Macro's
26  */
27
28 /** If DEBUGMODE is defined, output the debug message.
29  * @param x A two-or-more element list containing level, format and arguments.
30  */
31 #define Debug(x) debug x
32 #define LOGFILE LPATH /**< Path to debug log file. */
33
34 /*
35  * defined debugging levels
36  */
37 #define DEBUG_FATAL   0  /**< fatal error */
38 #define DEBUG_ERROR   1  /**< report_error() and other errors that are found */
39 #define DEBUG_NOTICE  3  /**< somewhat useful, but non-critical, messages */
40 #define DEBUG_DNS     4  /**< used by all DNS related routines - a *lot* */
41 #define DEBUG_INFO    5  /**< general useful info */
42 #define DEBUG_SEND    7  /**< everything that is sent out */
43 #define DEBUG_DEBUG   8  /**< everything that is received */ 
44 #define DEBUG_MALLOC  9  /**< malloc/free calls */
45 #define DEBUG_LIST   10  /**< debug list use */
46 #define DEBUG_ENGINE 11  /**< debug event engine; can dump gigabyte logs */
47
48 /*
49  * proto types
50  */
51
52 extern void vdebug(int level, const char *form, va_list vl);
53 extern void debug(int level, const char *form, ...);
54 extern void send_usage(struct Client *cptr, const struct StatDesc *sd,
55                        char *param);
56
57 #else /* !DEBUGMODE */
58
59 #define Debug(x)
60 #define LOGFILE "/dev/null"
61
62 #endif /* !DEBUGMODE */
63
64 extern const char* debug_serveropts(void);
65 extern void debug_init(int use_tty);
66 extern void count_memory(struct Client *cptr, const struct StatDesc *sd,
67                          char *param);
68
69 #endif /* INCLUDED_s_debug_h */