Restructure code, moving most code out of packet.c
[libradsec.git] / lib / debug.h
1 /* Copyright 2011 NORDUnet A/S. All rights reserved.
2    See the file COPYING for licensing information.  */
3
4 #define hd(p, l) { int i;               \
5     for (i = 1; i <= l; i++) {          \
6       printf ("%02x ", p[i-1]);         \
7       if (i % 8 == 0) printf (" ");     \
8       if (i % 16 == 0) printf ("\n"); } \
9     printf ("\n"); }
10
11 #if defined (__cplusplus)
12 extern "C" {
13 #endif
14
15 struct rs_packet;
16 struct rs_attr;
17 void rs_dump_packet (const struct rs_packet *pkt);
18 void rs_dump_attr (const struct rs_attr *attr);
19 int _rs_debug (const char *fmt, ...);
20
21 #if defined (DEBUG)
22 #define rs_debug(x) _rs_debug x
23 #else
24 #define rs_debug(x) do {;} while (0)
25 #endif
26
27 #if defined (__cplusplus)
28 }
29 #endif