[Pcsclite-cvs-commit] CVS HandlerTest/Host

CVS User rousseau ludovic.rousseau@free.fr
Fri, 22 Apr 2005 09:00:31 +0000


Update of /cvsroot/pcsclite/HandlerTest/Host
In directory haydn:/tmp/cvs-serv7716

Modified Files:
	debug.c debug.h 
Log Message:
Use the new pcscd log API
debug_msg -> log_msg
debug_xxd -> log_xxd


--- /cvsroot/pcsclite/HandlerTest/Host/debug.c	2004/07/27 13:27:42	1.4
+++ /cvsroot/pcsclite/HandlerTest/Host/debug.c	2005/04/22 09:00:30	1.5
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.c,v 1.4 2004/07/27 13:27:42 rousseau Exp $
+ * $Id: debug.c,v 1.5 2005/04/22 09:00:30 rousseau Exp $
  * GCdebug.c: log (or not) messages
  * Copyright (C) 2001 Ludovic Rousseau <ludovic.rousseau@free.fr>
  * 
@@ -18,7 +18,7 @@
 
 static char DebugBuffer[DEBUG_BUF_SIZE];
 
-void debug_msg(char *fmt, ...)
+void log_msg(const int priority, char *fmt, ...)
 {
 	va_list argptr;
 
@@ -27,9 +27,10 @@
 	va_end(argptr);
 
 	fprintf(stdout, "%s\n", DebugBuffer);
-} /* debug_msg */
+} /* log_msg */
 
-void debug_xxd(const char *msg, const unsigned char *buffer, const int len)
+void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
+	const int len)
 {
 	int i;
 	unsigned char *c, *debug_buf_end;
@@ -46,5 +47,5 @@
 	}
 
 	fprintf(stdout, "%s\n", DebugBuffer);
-} /* debug_xxd */
+} /* log_xxd */
 
--- /cvsroot/pcsclite/HandlerTest/Host/debug.h	2004/01/27 14:48:42	1.2
+++ /cvsroot/pcsclite/HandlerTest/Host/debug.h	2005/04/22 09:00:31	1.3
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.h,v 1.2 2004/01/27 14:48:42 rousseau Exp $
+ * $Id: debug.h,v 1.3 2005/04/22 09:00:31 rousseau Exp $
  * gcdebug.h: log (or not) messages using syslog
  * Copyright (C) 2001 Ludovic Rousseau <ludovic.rousseau@free.fr>
  * 
@@ -31,12 +31,13 @@
 #define __FUNCTION__ ""
 #endif
 
-#define DEBUG(fmt) debug_msg("%s:%d:%s " fmt, __FILE__, __LINE__, __FUNCTION__)
-#define DEBUG2(fmt, data) debug_msg("%s:%d:%s " fmt, __FILE__, __LINE__, __FUNCTION__, data)
-#define DEBUG3(fmt, data1, data2) debug_msg("%s:%d:%s " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2)
-
-void debug_msg(char *fmt, ...);
-void debug_xxd(const char *msg, const unsigned char *buffer, const int size);
+#define DEBUG(fmt) log_msg(0, "%s:%d:%s " fmt, __FILE__, __LINE__, __FUNCTION__)
+#define DEBUG2(fmt, data) log_msg(0, "%s:%d:%s " fmt, __FILE__, __LINE__, __FUNCTION__, data)
+#define DEBUG3(fmt, data1, data2) log_msg(0, "%s:%d:%s " fmt, __FILE__, __LINE__, __FUNCTION__, data1, data2)
+
+void log_msg(const int priority, char *fmt, ...);
+void log_xxd(const int priority, const char *msg, const unsigned char *buffer,
+	const int size);
 
 #endif