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