[Pcsclite-cvs-commit] CVS PCSC/src

CVS User rousseau ludovic.rousseau@free.fr
Thu, 17 Mar 2005 00:53:53 -0700


Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv10687

Modified Files:
	debuglog.c 
Log Message:
change global variable names to use a capital first letter


--- /cvsroot/pcsclite/PCSC/src/debuglog.c	2005/02/28 15:15:22	1.36
+++ /cvsroot/pcsclite/PCSC/src/debuglog.c	2005/03/17 07:53:53	1.37
@@ -8,7 +8,7 @@
  * Copyright (C) 1999-2005
  *  Ludovic Rousseau <ludovic.rousseau@free.fr>
  *
- * $Id: debuglog.c,v 1.36 2005/02/28 15:15:22 rousseau Exp $
+ * $Id: debuglog.c,v 1.37 2005/03/17 07:53:53 rousseau Exp $
  */
 
 #include "config.h"
@@ -32,21 +32,21 @@
  * Should be bigger than 256*3+30 */
 #define DEBUG_BUF_SIZE 2048
 
-static int lSuppress = DEBUGLOG_LOG_ENTRIES;
-static int debug_msg_type = DEBUGLOG_NO_DEBUG;
-static int debug_category = DEBUG_CATEGORY_NOTHING;
+static char LogSuppress = DEBUGLOG_LOG_ENTRIES;
+static char LogMsgType = DEBUGLOG_NO_DEBUG;
+static char LogCategory = DEBUG_CATEGORY_NOTHING;
 
 /* default level is a bit verbose to be backward compatible */
-static int log_level = PCSC_LOG_INFO;
+static char LogLevel = PCSC_LOG_INFO;
 
 void log_msg(const int priority, const char *fmt, ...)
 {
 	char DebugBuffer[DEBUG_BUF_SIZE];
 	va_list argptr;
 
-	if ((lSuppress != DEBUGLOG_LOG_ENTRIES)
-		|| (priority < log_level) /* log priority lower than threshold? */
-		|| (DEBUGLOG_NO_DEBUG == debug_msg_type))
+	if ((LogSuppress != DEBUGLOG_LOG_ENTRIES)
+		|| (priority < LogLevel) /* log priority lower than threshold? */
+		|| (DEBUGLOG_NO_DEBUG == LogMsgType))
 		return;
 
 	va_start(argptr, fmt);
@@ -62,7 +62,7 @@
 	va_end(argptr);
 
 #ifndef WIN32
-	if (DEBUGLOG_SYSLOG_DEBUG == debug_msg_type)
+	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);
 	else
 #endif
@@ -77,9 +77,9 @@
 	char *c;
 	char *debug_buf_end;
 
-	if ((lSuppress != DEBUGLOG_LOG_ENTRIES)
-		|| (priority < log_level) /* log priority lower than threshold? */
-		|| (DEBUGLOG_NO_DEBUG == debug_msg_type))
+	if ((LogSuppress != DEBUGLOG_LOG_ENTRIES)
+		|| (priority < LogLevel) /* log priority lower than threshold? */
+		|| (DEBUGLOG_NO_DEBUG == LogMsgType))
 		return;
 
 	debug_buf_end = DebugBuffer + DEBUG_BUF_SIZE - 5;
@@ -94,7 +94,7 @@
 	}
 
 #ifndef WIN32
-	if (DEBUGLOG_SYSLOG_DEBUG == debug_msg_type)
+	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);
 	else
 #endif
@@ -103,7 +103,7 @@
 
 void DebugLogSuppress(const int lSType)
 {
-	lSuppress = lSType;
+	LogSuppress = lSType;
 }
 
 void DebugLogSetLogType(const int dbgtype)
@@ -113,18 +113,18 @@
 		case DEBUGLOG_NO_DEBUG:
 		case DEBUGLOG_SYSLOG_DEBUG:
 		case DEBUGLOG_STDERR_DEBUG:
-			debug_msg_type = dbgtype;
+			LogMsgType = dbgtype;
 			break;
 		default:
 			Log2(PCSC_LOG_CRITICAL, "unknown log type (%d), using stderr",
 				dbgtype);
-			debug_msg_type = DEBUGLOG_STDERR_DEBUG;
+			LogMsgType = DEBUGLOG_STDERR_DEBUG;
 	}
 }
 
 void DebugLogSetLevel(const int level)
 {
-	log_level = level;
+	LogLevel = level;
 	switch (level)
 	{
 		case PCSC_LOG_CRITICAL:
@@ -144,7 +144,7 @@
 			break;
 
 		default:
-			log_level = PCSC_LOG_INFO;
+			LogLevel = PCSC_LOG_INFO;
 			Log2(PCSC_LOG_CRITICAL, "unknown level (%d), using level=notice",
 				level);
 	}
@@ -159,30 +159,30 @@
 	 * typically use ~DEBUG_CATEGORY_APDU
 	 */
 	if (dbginfo < 0)
-		debug_category &= dbginfo;
+		LogCategory &= dbginfo;
 	else
-		debug_category |= dbginfo;
+		LogCategory |= dbginfo;
 
 	/* set to empty string */
 	text[0] = '\0';
 
-	if (debug_category & DEBUG_CATEGORY_APDU)
+	if (LogCategory & DEBUG_CATEGORY_APDU)
 		strlcat(text, " APDU", sizeof(text));
 
 	Log2(PCSC_LOG_INFO, "Debug options:%s", text);
 
-	return debug_category;
+	return LogCategory;
 }
 
 void DebugLogCategory(const int category, const unsigned char *buffer,
 	const int len)
 {
 	if ((category & DEBUG_CATEGORY_APDU)
-		&& (debug_category & DEBUG_CATEGORY_APDU))
+		&& (LogCategory & DEBUG_CATEGORY_APDU))
 		log_xxd(PCSC_LOG_INFO, "APDU: ", (const unsigned char *)buffer, len);
 
 	if ((category & DEBUG_CATEGORY_SW)
-		&& (debug_category & DEBUG_CATEGORY_APDU))
+		&& (LogCategory & DEBUG_CATEGORY_APDU))
 		log_xxd(PCSC_LOG_INFO, "SW: ", (const unsigned char *)buffer, len);
 }
 
@@ -322,8 +322,8 @@
 	char DebugBuffer[DEBUG_BUF_SIZE];
 	va_list argptr;
 
-	if ((lSuppress != DEBUGLOG_LOG_ENTRIES)
-		|| (DEBUGLOG_NO_DEBUG == debug_msg_type))
+	if ((LogSuppress != DEBUGLOG_LOG_ENTRIES)
+		|| (DEBUGLOG_NO_DEBUG == LogMsgType))
 		return;
 
 	va_start(argptr, fmt);
@@ -339,7 +339,7 @@
 	va_end(argptr);
 
 #ifndef WIN32
-	if (DEBUGLOG_SYSLOG_DEBUG == debug_msg_type)
+	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);
 	else
 #endif