From d452cc572ba13d01c8a96f311a1db5f99e25caf7 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 7 Oct 2008 10:01:38 -0400 Subject: Forgot to add debug.c --- server/util/debug.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 server/util/debug.c diff --git a/server/util/debug.c b/server/util/debug.c new file mode 100644 index 00000000..0814bb7b --- /dev/null +++ b/server/util/debug.c @@ -0,0 +1,20 @@ +#define _GNU_SOURCE +#include +#include +#include + +int debug_level = 2; + +void debug_fn(const char *format, ...) +{ + va_list ap; + char *s = NULL; + + va_start(ap, format); + vasprintf(&s, format, ap); + va_end(ap); + + /*write(state.fd, s, strlen(s));*/ + fprintf(stderr, s); + free(s); +} -- cgit