summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2012-07-18 07:01:59 +0000
committerXuefer <xuefer@gmail.com>2012-07-18 07:01:59 +0000
commit0af13b375cfb7b435db70701f1191d5160bce604 (patch)
tree2c1f7e9ff7ac1e379c9138df411ab2dc9ba495e4 /util
parente4f59e6562ab2089c83ce6afbe1e2019b02a5654 (diff)
downloadxcache-0af13b375cfb7b435db70701f1191d5160bce604.tar.gz
xcache-0af13b375cfb7b435db70701f1191d5160bce604.zip
split trace
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@990 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'util')
-rw-r--r--util/xc_stack.c3
-rw-r--r--util/xc_trace.c21
2 files changed, 23 insertions, 1 deletions
diff --git a/util/xc_stack.c b/util/xc_stack.c
index 244339c..7407583 100644
--- a/util/xc_stack.c
+++ b/util/xc_stack.c
@@ -1,6 +1,7 @@
#include <stdlib.h>
-#include <assert.h>
+#include "xc_trace.h"
#include "xc_stack.h"
+
typedef xc_stack_t* S;
void xc_stack_init_ex(S stack, int initsize)
diff --git a/util/xc_trace.c b/util/xc_trace.c
new file mode 100644
index 0000000..09105d2
--- /dev/null
+++ b/util/xc_trace.c
@@ -0,0 +1,21 @@
+#include "xc_trace.h"
+#include <stdio.h>
+#include <stdarg.h>
+
+int xc_vtrace(const char *fmt, va_list args) /* {{{ */
+{
+ return vfprintf(stderr, fmt, args);
+}
+/* }}} */
+int xc_trace(const char *fmt, ...) /* {{{ */
+{
+ va_list args;
+ int ret;
+
+ va_start(args, fmt);
+ ret = xc_vtrace(fmt, args);
+ va_end(args);
+ return ret;
+}
+/* }}} */
+