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 
00034 #ifndef __debug_h__
00035 #define __debug_h__
00036 
00037 #ifdef PCSC
00038 /* use syslog, etc. if we are included from a file for pcscd */
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 /* You can't do #ifndef __FUNCTION__ */
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                          /* __debug_h__ */
00078 

Generated on Fri Mar 14 00:09:28 2008 for pcsc-lite by  doxygen 1.4.7