debug.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00033 #ifndef __debug_h__
00034 #define __debug_h__
00035
00036 #ifdef PCSC
00037
00038 #include "debuglog.h"
00039 #else
00040
00041 #ifdef __cplusplus
00042 extern "C"
00043 {
00044 #endif
00045
00046 enum {
00047 PCSC_LOG_DEBUG = 0,
00048 PCSC_LOG_INFO,
00049 PCSC_LOG_ERROR,
00050 PCSC_LOG_CRITICAL
00051 };
00052
00053 #include <stdio.h>
00054
00055
00056 #if !defined(__GNUC__) && !defined(__IBMC__)
00057 #define __FUNCTION__ ""
00058 #endif
00059
00060 #define Log0(priority) log_msg(priority, "%s:%d:%s()", __FILE__, __LINE__, __FUNCTION__)
00061 #define Log1(priority, fmt) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__)
00062 #define Log2(priority, fmt, data) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data)
00063 #define Log3(priority, fmt, data1, data2) log_msg(priority, "%s:%d:%s() " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2)
00064 #define LogXxd(priority, msg, buffer, size) log_xxd(priority, msg, buffer, size)
00065
00066 void log_msg(const int priority, const char *fmt, ...);
00067 void log_xxd(const int priority, const char *msg,
00068 const unsigned char *buffer, const int size);
00069
00070 #ifdef __cplusplus
00071 }
00072 #endif
00073
00074 #endif
00075
00076 #endif
00077