/[pcsclite]/trunk/PCSC/src/PCSC/debuglog.h
ViewVC logotype

Contents of /trunk/PCSC/src/PCSC/debuglog.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 201 - (hide annotations) (download)
Sat Dec 7 21:29:12 2002 UTC (10 years, 5 months ago) by rousseau
File MIME type: text/plain
File size: 2206 byte(s)
DebugLogC() uses 3 parameters not 2 (use DebugLogB() for that)
1 corcoran 11 /******************************************************************
2    
3     MUSCLE SmartCard Development ( http://www.linuxnet.com )
4 rousseau 121 Title : debuglog.h
5     Package: pcsc lite
6     Authors: David Corcoran, Ludovic Rousseau
7     Date : 7/27/99, updated 11 Aug, 2002
8     License: Copyright (C) 1999,2002 David Corcoran
9     <corcoran@linuxnet.com>
10     Purpose: This handles debugging.
11 corcoran 11
12 rousseau 121 $Id$
13    
14 corcoran 11 ********************************************************************/
15    
16     /*
17     * DebugLogA("text");
18 rousseau 24 * send "text" to syslog if USE_SYSLOG is defined
19     * print to stderr "text" if USE_SYSLOG is NOT defined
20 corcoran 11 *
21     * DebugLogB("text: %d", 1234)
22     * send "text: 1234" to syslog if USE_SYSLOG is defined
23     * print to stderr "text: 1234" is USE_SYSLOG is NOT defined
24     * the format string can be anything printf() can understand
25     *
26     * DebugXxd(msg, buffer, size)
27     * send to syslog (if USE_SYSLOG is defined) or print to stderr
28     * "msg" + a hex dump of size bytes of buffer[]
29     *
30     */
31    
32     #ifndef __debuglog_h__
33     #define __debuglog_h__
34    
35     #ifdef __cplusplus
36 rousseau 24 extern "C"
37     {
38     #endif
39 corcoran 11
40     #define DEBUGLOG_LOG_ENTRIES 1
41     #define DEBUGLOG_IGNORE_ENTRIES 2
42    
43 corcoran 14 #define DEBUGLOG_NO_DEBUG 0
44     #define DEBUGLOG_SYSLOG_DEBUG 1
45     #define DEBUGLOG_STDERR_DEBUG 2
46     #define DEBUGLOG_STDOUT_DEBUG 4
47    
48 rousseau 121 #define DEBUG_CATEGORY_NOTHING 0
49     #define DEBUG_CATEGORY_APDU 1
50     #define DEBUG_CATEGORY_SW 2
51    
52 corcoran 11 #ifdef PCSC_DEBUG
53     #define DebugLogA(fmt) debug_msg("%s:%d " fmt, __FILE__, __LINE__)
54     #define DebugLogB(fmt, data) debug_msg("%s:%d " fmt, __FILE__, __LINE__, data)
55 rousseau 201 #define DebugLogC(fmt, data1, data2) debug_msg("%s:%d " fmt, __FILE__, __LINE__, data1, data2)
56 corcoran 11 #define DebugXxd(msg, buffer, size) debug_xxd(msg, buffer, size)
57     #else
58     #define DebugLogA(fmt)
59     #define DebugLogB(fmt, data)
60 rousseau 201 #define DebugLogC(fmt, data1, data2)
61 corcoran 11 #define DebugXxd(msg, buffer, size)
62     #endif
63    
64 rousseau 121 void debug_msg(const char *fmt, ...);
65 rousseau 24 void debug_xxd(const char *msg, const unsigned char *buffer,
66     const int size);
67 corcoran 11
68 rousseau 121 void DebugLogSuppress(const int);
69     void DebugLogSetLogType(const int);
70     int DebugLogSetCategory(const int);
71     void DebugLogCategory(const int, const char *, const int);
72 corcoran 11
73 rousseau 121 char *pcsc_stringify_error(const long);
74 corcoran 11
75     #ifdef __cplusplus
76     }
77 rousseau 24 #endif
78 corcoran 11
79 rousseau 24 #endif /* __debuglog_h__ */
80 rousseau 121

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.5