summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-14 21:51:24 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-14 21:51:24 +0000
commit966a8e3acc6244025d265db0af5e20365566f2a4 (patch)
treedd174ceff43e23a5e03a186ebe915316268747aa /include
parentfd4364a71cf3453926af85f5db3adac8bae79605 (diff)
redirect DEBUGP to 'debugp' function inside openpcd firmware
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1909 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'include')
-rw-r--r--include/librfid/rfid.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/librfid/rfid.h b/include/librfid/rfid.h
index f0ecc16..0b98be6 100644
--- a/include/librfid/rfid.h
+++ b/include/librfid/rfid.h
@@ -13,17 +13,30 @@ enum rfid_frametype {
RFID_MIFARE_FRAME,
};
-//#define DEBUG
+#define DEBUG_LIBRFID
-#ifdef DEBUG
+#ifdef DEBUG_LIBRFID
+
+#ifdef LIBRFID_FIRMWARE
+extern void debugp(const char *format, ...);
+extern const char *hexdump(const void *data, unsigned int len);
+#define rfid_hexdump(x, y) hexdump(x, y)
+#define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
+#define DEBUGPC(x, args ...) debugp(x, ## args)
+#else /* LIBRFID_FIRMWARE */
+extern const char *rfid_hexdump(const void *data, unsigned int len);
#define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
#define DEBUGPC(x, args ...) fprintf(stderr, x, ## args)
-#else
+#endif /* LIBRFID_FIRMWARE */
+
+#else /* DEBUG */
+extern const char *rfid_hexdump(const void *data, unsigned int len);
+
#define DEBUGP(x, args ...)
#define DEBUGPC(x, args ...)
-#endif
-extern const char *rfid_hexdump(const void *data, unsigned int len);
+#endif /* DEBUG */
+
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
personal git repositories of Harald Welte. Your mileage may vary