debug.h

Go to the documentation of this file.
00001 /*
00002  * MUSCLE SmartCard Development ( http://www.linuxnet.com )
00003  *
00004  * Copyright (C) 1999-2004
00005  *  David Corcoran <corcoran@linuxnet.com>
00006  * Copyright (C) 1999-2005
00007  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
00008  *
00009  * $Id: debuglog.h 1835 2006-01-25 10:42:23Z rousseau $
00010  */
00011 
00033 #ifndef __debug_h__
00034 #define __debug_h__
00035 
00036 #ifdef PCSC
00037 /* use syslog, etc. if we are included from a file for pcscd */
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 /* You can't do #ifndef __FUNCTION__ */
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                          /* __debug_h__ */
00077 

Generated on Mon Aug 17 01:00:08 2009 for pcsc-lite by  doxygen 1.5.9