blob: 3945ee60cafc918d4b01edb1870f9f041ebbf93a [file] [log] [blame]
Harald Welte52b1f982008-12-23 20:25:15 +00001#ifndef _DEBUG_H
2#define _DEBUG_H
3
Harald Welte3633a6d2008-12-26 00:06:02 +00004#define DEBUG
5
Harald Welte52b1f982008-12-23 20:25:15 +00006#define DRLL 0x0001
7#define DCC 0x0002
8#define DMM 0x0004
9#define DRR 0x0008
Harald Welte3633a6d2008-12-26 00:06:02 +000010#define DRSL 0x0010
11#define DNM 0x0020
Harald Weltebcae43f2008-12-27 21:45:37 +000012#define DSMS 0x0100
Harald Welted35b6a72008-12-29 04:06:41 +000013#define DPAG 0x0200
Harald Welte3633a6d2008-12-26 00:06:02 +000014#define DMI 0x1000
Harald Weltea3d04382008-12-27 17:02:56 +000015#define DMIB 0x2000
Harald Welte52b1f982008-12-23 20:25:15 +000016
17#ifdef DEBUG
Harald Welte6ddd1682009-02-06 12:38:29 +000018#define DEBUGP(ss, fmt, args...) debugp(ss, __FILE__, __LINE__, 0, fmt, ## args)
19#define DEBUGPC(ss, fmt, args...) debugp(ss, __FILE__, __LINE__, 1, fmt, ## args)
Harald Welte52b1f982008-12-23 20:25:15 +000020#else
Harald Weltead384642008-12-26 10:20:07 +000021#define DEBUGP(xss, fmt, args...)
Harald Welte6ddd1682009-02-06 12:38:29 +000022#define DEBUGPC(ss, fmt, args...)
Harald Welte52b1f982008-12-23 20:25:15 +000023#endif
24
Holger Freyther1ad732c2008-12-28 16:32:41 +000025#define static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
26
Holger Freytherca362a62009-01-04 21:05:01 +000027void hexdump(unsigned char *buf, int len);
Harald Welte6ddd1682009-02-06 12:38:29 +000028void debugp(unsigned int subsys, char *file, int line, int cont, const char *format, ...);
Holger Freyther5ee72ee2008-12-27 12:46:49 +000029void debug_parse_category_mask(const char* mask);
Holger Freytherb332f612008-12-27 12:46:51 +000030void debug_use_color(int use_color);
Harald Welteb0f47932008-12-30 14:59:01 +000031unsigned int debug_mask;
Harald Weltead384642008-12-26 10:20:07 +000032
Harald Welte52b1f982008-12-23 20:25:15 +000033#endif /* _DEBUG_H */