summaryrefslogtreecommitdiff
path: root/c_src/util.h
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2016-02-14 09:35:26 +0100
committerLinus Nordberg <linus@nordu.net>2016-04-25 13:14:11 +0200
commit2776d2972d30e3391569401fdce57a4452fc76a7 (patch)
tree97dc0e47bad0b1f3feec8eea85d41ff527ac4082 /c_src/util.h
parentb2a3e6dc5cf7c987c1f2ac1349d26ad76fb55d3c (diff)
Make debug printing prettier.
Diffstat (limited to 'c_src/util.h')
-rw-r--r--c_src/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/c_src/util.h b/c_src/util.h
index 976ee8e..4af8005 100644
--- a/c_src/util.h
+++ b/c_src/util.h
@@ -11,6 +11,9 @@
#define DEBUG_READ 0
#define DEBUG_PORT 0
+#define dprintf(level,args) do { if (DEBUG_ ## level) { fprintf args; } } while (0)
+#define dprinthex(level,data,size) do { if (DEBUG_ ## level) { print_hex(data, size); } } while (0)
+
void
set_error(char **error, const char * __restrict, ...) __attribute__ ((__format__ (__printf__, 2, 3)));