blob: 52e8e964797ee85fece62c0edfa8fb0f77fcc6f9 [file] [log] [blame]
Arnaud Patardca233082010-01-08 08:40:00 -05001#ifndef _DEBUG_H
2#define _DEBUG_H
3
Juan Cespedescac15c32003-01-31 18:58:58 +01004#include <features.h>
5
Juan Cespedescd8976d2009-05-14 13:47:58 +02006/* debug levels:
7 */
8enum {
Juan Cespedesc5c744a2009-07-23 18:22:58 +02009 DEBUG_EVENT = 010,
10 DEBUG_PROCESS = 020,
11 DEBUG_FUNCTION = 040
Juan Cespedescd8976d2009-05-14 13:47:58 +020012};
13
14void debug_(int level, const char *file, int line,
15 const char *fmt, ...) __attribute__((format(printf,4,5)));
Ian Wienand9a2ad352006-02-20 22:44:45 +010016
Ian Wienand9a2ad352006-02-20 22:44:45 +010017int xinfdump(long, void *, int);
18
Juan Cespedescd8976d2009-05-14 13:47:58 +020019# define debug(level, expr...) debug_(level, __FILE__, __LINE__, expr)
Juan Cespedescac15c32003-01-31 18:58:58 +010020
Arnaud Patardca233082010-01-08 08:40:00 -050021#endif