summaryrefslogtreecommitdiff
path: root/cesar/cp/eoc/inc/dbg_print.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/cp/eoc/inc/dbg_print.h')
-rw-r--r--cesar/cp/eoc/inc/dbg_print.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/cesar/cp/eoc/inc/dbg_print.h b/cesar/cp/eoc/inc/dbg_print.h
new file mode 100644
index 0000000000..b1c5ad1c62
--- /dev/null
+++ b/cesar/cp/eoc/inc/dbg_print.h
@@ -0,0 +1,63 @@
+#ifndef cp_eoc_inc_dbg_print_h
+#define cp_eoc_inc_dbg_print_h
+
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/eoc/inc/dbg_print.h
+ * \brief Define macros for printing sta status (associated, authenticated,
+ * white_list).
+ * \ingroup cp_eoc
+ */
+
+#include "config/cp/eoc/dbg/print/level.h"
+
+/* CONFIG_CP_EOC_DBG_PRINT_LEVEL == 0
+ * => no messages will be printed
+ */
+#if (CONFIG_CP_EOC_DBG_PRINT_LEVEL == 0)
+#define DBG_PRINTC(args...) { while (0); }
+#define DBG_PRINT_2(args...) { while (0); }
+#define DBG_PRINT(args...) { while (0); }
+
+
+/* CONFIG_CP_EOC_DBG_PRINT_LEVEL == 1
+ * => messages will be printed without a path to the file and the line number.
+ */
+#elif (CONFIG_CP_EOC_DBG_PRINT_LEVEL == 1)
+#include "stdio.h"
+#define DBG_PRINTC(args...) \
+ { \
+ printf(args);\
+ }
+#define DBG_PRINT_2(args...) { while (0); }
+#define DBG_PRINT(args...) {\
+ printf (args);\
+ printf ("\n");\
+}
+
+
+/* CONFIG_CP_EOC_DBG_PRINT_LEVEL == 2
+ * => messages will be printed with a path to the file and the line number.
+ */
+#elif (CONFIG_CP_EOC_DBG_PRINT_LEVEL == 2)
+#include "stdio.h"
+#define DBG_PRINTC(args...) \
+ { \
+ printf(args);\
+ }
+#define DBG_PRINT_2(args...) DBG_PRINT(args)
+#define DBG_PRINT(args...) {\
+ printf ("DBG: ");\
+ printf (__FILE__);\
+ printf(", line: %d\n ", __LINE__);\
+ printf (args);\
+ printf ("\n");\
+}
+#endif /* CONFIG_CP_EOC_DBG_PRINT_LEVEL */
+#endif /* cp_eoc_inc_dbg_print_h */