vfs: check userland buffers before reading them.
[haiku.git] / headers / private / bluetooth / debug.h
blob6b1f8d0362042ba223cef6b4dbb0a751ed2472ad
1 #ifndef _BLUETOOTH_DEBUG_SERVER_H_
2 #define _BLUETOOTH_DEBUG_SERVER_H_
4 #ifndef DEBUG
5 #define DEBUG 3
6 #endif
8 #include <Debug.h>
9 #include <stdio.h>
11 #undef TRACE
12 #undef PRINT
13 #if DEBUG > 0
14 inline void ERROR(const char *fmt, ...)
16 va_list ap;
17 va_start(ap, fmt);
18 printf("### ERROR: ");
19 vprintf(fmt, ap); va_end(ap);
21 /*
22 inline void PRINT(int level, const char *fmt, ...)
24 va_list ap;
25 if (level > DEBUG)
26 return;
27 va_start(ap, fmt);
28 vprintf(fmt, ap);
29 va_end(ap);
32 inline void PRINT(const char *fmt, ...)
34 va_list ap;
35 va_start(ap, fmt);
36 vprintf(fmt, ap);
37 va_end(ap);
38 }*/
40 #if DEBUG >= 2
41 #define TRACE(a...) printf("TRACE %s : %s\n", __PRETTY_FUNCTION__, a)
42 #else
43 #define TRACE(a...) ((void)0)
44 #endif
46 #if DEBUG >= 3
47 #define END() printf("ENDING %s\n",__PRETTY_FUNCTION__)
48 #define CALLED() printf("CALLED %s\n",__PRETTY_FUNCTION__)
49 #else
50 #define END() ((void)0)
51 #define CALLED() ((void)0)
52 #endif
53 #else
54 #define END() ((void)0)
55 #define CALLED() ((void)0)
56 #define ERROR(a...) fprintf(stderr, a)
57 #define TRACE(a...) ((void)0)
58 #endif
60 #define PRINT(l, a...) printf(l, a)
62 #endif /* _BLUETOOTH_DEBUG_SERVER_H_ */