[SmartcardServices-Changes] [35] trunk/SmartCardServices/src/PCSC/debuglog.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 30 02:39:20 PDT 2009


Revision: 35
          http://trac.macosforge.org/projects/smartcardservices/changeset/35
Author:   ludovic.rousseau at gmail.com
Date:     2009-07-30 02:39:18 -0700 (Thu, 30 Jul 2009)
Log Message:
-----------
remove WIN32 support

Modified Paths:
--------------
    trunk/SmartCardServices/src/PCSC/debuglog.c

Modified: trunk/SmartCardServices/src/PCSC/debuglog.c
===================================================================
--- trunk/SmartCardServices/src/PCSC/debuglog.c	2009-07-30 09:07:46 UTC (rev 34)
+++ trunk/SmartCardServices/src/PCSC/debuglog.c	2009-07-30 09:39:18 UTC (rev 35)
@@ -43,8 +43,7 @@
  */
 
 #include "config.h"
-
-#ifndef WIN32
+#ifdef HAVE_SYSLOG_H
 #include <syslog.h>
 #endif
 #include <unistd.h>
@@ -87,18 +86,9 @@
 		return;
 
 	va_start(argptr, fmt);
-#ifndef WIN32
 	vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
-#else
-#if HAVE_VSNPRINTF
-	vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
-#else
-	vsprintf(DebugBuffer, fmt, argptr);
-#endif
-#endif
 	va_end(argptr);
 
-#ifndef WIN32
 	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);
 	else
@@ -131,9 +121,6 @@
 		else
 			fprintf(stderr, "%s\n", DebugBuffer);
 	}
-#else
-	fprintf(stderr, "%s\n", DebugBuffer);
-#endif
 } /* log_msg */
 
 void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
@@ -164,11 +151,9 @@
 	if ((c >= debug_buf_end) && (i < len))
 		c[-3] = c[-2] = c[-1] = '.';
 
-#ifndef WIN32
 	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);
 	else
-#endif
 		fprintf(stderr, "%s\n", DebugBuffer);
 } /* log_xxd */
 
@@ -194,8 +179,6 @@
 			LogMsgType = DEBUGLOG_STDERR_DEBUG;
 	}
 
-	/* no color under Windows */
-#ifndef WIN32
 	/* log to stderr and stderr is a tty? */
 	if (DEBUGLOG_STDERR_DEBUG == LogMsgType && isatty(fileno(stderr)))
 	{
@@ -219,7 +202,6 @@
 			}
 		}
 	}
-#endif
 }
 
 void DebugLogSetLevel(const int level)
@@ -288,6 +270,7 @@
  * defined only for pcscd
  */
 #ifdef PCSCD
+void debug_msg(const char *fmt, ...);
 void debug_msg(const char *fmt, ...)
 {
 	char DebugBuffer[DEBUG_BUF_SIZE];
@@ -298,25 +281,16 @@
 		return;
 
 	va_start(argptr, fmt);
-#ifndef WIN32
 	vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
-#else
-#if HAVE_VSNPRINTF
-	vsnprintf(DebugBuffer, DEBUG_BUF_SIZE, fmt, argptr);
-#else
-	vsprintf(DebugBuffer, fmt, argptr);
-#endif
-#endif
 	va_end(argptr);
 
-#ifndef WIN32
 	if (DEBUGLOG_SYSLOG_DEBUG == LogMsgType)
 		syslog(LOG_INFO, "%s", DebugBuffer);
 	else
-#endif
 		fprintf(stderr, "%s\n", DebugBuffer);
 } /* debug_msg */
 
+void debug_xxd(const char *msg, const unsigned char *buffer, const int len);
 void debug_xxd(const char *msg, const unsigned char *buffer, const int len)
 {
 	log_xxd(PCSC_LOG_ERROR, msg, buffer, len);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/smartcardservices-changes/attachments/20090730/a35a1352/attachment-0001.html>


More information about the SmartcardServices-Changes mailing list