summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2009-10-10 21:39:44 +0000
committerLinus Walleij <triad@df.lth.se>2009-10-10 21:39:44 +0000
commit8f6e0d9db0580deb1fdabd980cd5e0088600c8d7 (patch)
treec8fa2f713c60af9de1303ed95171ab8f907492fb /src/util.h
parent12ce6b0c6332cda8c82bd018762b986cc973b0de (diff)
downloadlibmtp-8f6e0d9db0580deb1fdabd980cd5e0088600c8d7.tar.gz
Move debugmacros to util.h
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 8066a60..dec9617 100644
--- a/src/util.h
+++ b/src/util.h
@@ -26,4 +26,27 @@
void data_dump(FILE *f, void *buf, uint32_t nbytes);
void data_dump_ascii (FILE *f, void *buf, uint32_t n, uint32_t dump_boundry);
+/**
+ * Info macro
+ */
+#define LIBMTP_INFO(format, args...) \
+ do { \
+ if (LIBMTP_debug != 0) \
+ fprintf(stdout, "LIBMTP %s[%d]: " format, __FUNCTION__, __LINE__, ##args); \
+ else \
+ fprintf(stdout, format, ##args); \
+ } while (0)
+
+/**
+ * Error macro
+ */
+#define LIBMTP_ERROR(format, args...) \
+ do { \
+ if (LIBMTP_debug != 0) \
+ fprintf(stderr, "LIBMTP %s[%d]: " format, __FUNCTION__, __LINE__, ##args); \
+ else \
+ fprintf(stderr, format, ##args); \
+ } while (0)
+
+
#endif //__MTP__UTIL__H