- The big forward port. I probably broke lots of stuff, so please look over any
[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_ircd_defs_h
9 #include "ircd_defs.h"       /* Needed for HOSTLEN */
10 #endif
11 #ifndef INCLUDED_stdarg_h
12 #include <stdarg.h>
13 #define INCLUDED_stdarg_h
14 #endif
15
16 struct Client;
17 struct StatDesc;
18
19 #ifdef DEBUGMODE
20
21 /*
22  * Macro's
23  */
24
25 #define Debug(x) debug x
26 #define LOGFILE LPATH
27
28 /*
29  * defined debugging levels
30  */
31 #define DEBUG_FATAL   0
32 #define DEBUG_ERROR   1  /* report_error() and other errors that are found */
33 #define DEBUG_NOTICE  3
34 #define DEBUG_DNS     4  /* used by all DNS related routines - a *lot* */
35 #define DEBUG_INFO    5  /* general useful info */
36 #define DEBUG_NUM     6  /* numerics */
37 #define DEBUG_SEND    7  /* everything that is sent out */
38 #define DEBUG_DEBUG   8  /* everything that is received */ 
39 #define DEBUG_MALLOC  9  /* malloc/free calls */
40 #define DEBUG_LIST   10  /* debug list use */
41 #define DEBUG_ENGINE 11  /* debug event engine; can dump gigabyte logs */
42
43 /*
44  * proto types
45  */
46
47 extern void vdebug(int level, const char *form, va_list vl);
48 extern void debug(int level, const char *form, ...);
49 extern void send_usage(struct Client *cptr, struct StatDesc *sd, int stat,
50                        char *param);
51
52 #else /* !DEBUGMODE */
53
54 #define Debug(x)
55 #define LOGFILE "/dev/null"
56
57 #endif /* !DEBUGMODE */
58
59 extern const char* debug_serveropts(void);
60 extern void debug_init(int use_tty);
61 extern void count_memory(struct Client *cptr, struct StatDesc *sd, int stat,
62                          char *param);
63
64 #endif /* INCLUDED_s_debug_h */