summaryrefslogtreecommitdiff
path: root/src/assuan-logging.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2004-11-24 16:49:32 +0000
committerWerner Koch <wk@gnupg.org>2004-11-24 16:49:32 +0000
commitc24914dca24b225f96dc99fb31ce8238c5251a02 (patch)
tree8092181c2baf33c86983ac5e922e7c1d8df2846f /src/assuan-logging.c
parent7fe365f5e0995515ca95aee10768d9e18bd817c3 (diff)
downloadlibassuan-c24914dca24b225f96dc99fb31ce8238c5251a02.tar.gz
* assuan-logging.c (_assuan_log_printf): New.
* assuan-domain-connect.c (LOG): Removed and replaced all callers by _assuan_log_printf. This is needed for C89 and gcc 2.95 which both don't have C99 style variable arg macros. * assuan-pipe-connect.c (LOG): Ditto. * assuan-socket-connect.c (LOG): Ditto. * assuan-socket.c[!_WIN32]: Fixed includes.
Diffstat (limited to 'src/assuan-logging.c')
-rw-r--r--src/assuan-logging.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/assuan-logging.c b/src/assuan-logging.c
index 5f42492..41ead32 100644
--- a/src/assuan-logging.c
+++ b/src/assuan-logging.c
@@ -1,5 +1,5 @@
/* assuan-logging.c - Default logging function.
- * Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ * Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
*
* This file is part of Assuan.
*
@@ -21,6 +21,7 @@
#include "assuan-defs.h"
#include <stdio.h>
#include <string.h>
+#include <stdarg.h>
static char prefix_buffer[80];
static FILE *_assuan_log;
@@ -64,3 +65,24 @@ assuan_get_assuan_log_prefix (void)
{
return prefix_buffer;
}
+
+
+void
+_assuan_log_printf (const char *format, ...)
+{
+ va_list arg_ptr;
+ FILE *fp;
+ const char *prf;
+
+ fp = assuan_get_assuan_log_stream ();
+ prf = assuan_get_assuan_log_prefix ();
+ if (*prf)
+ {
+ fputs (prf, fp);
+ fputs (": ", fp);
+ }
+
+ va_start (arg_ptr, format);
+ vfprintf (fp, format, arg_ptr );
+ va_end (arg_ptr);
+}