]> Dogcows Code - chaz/openbox/commitdiff
add ob_debug for printing stuff only when debug is enabled
authorDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 04:32:33 +0000 (04:32 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 04:32:33 +0000 (04:32 +0000)
openbox/debug.c [new file with mode: 0644]
openbox/debug.h [new file with mode: 0644]

diff --git a/openbox/debug.c b/openbox/debug.c
new file mode 100644 (file)
index 0000000..61ea33b
--- /dev/null
@@ -0,0 +1,21 @@
+#include <glib.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+static gboolean show;
+
+void ob_debug_show_output(gboolean enable)
+{
+    show = enable;
+}
+
+void ob_debug(char *a, ...)
+{
+    va_list vl;
+
+    if (show) {
+        va_start(vl, a);
+        vfprintf(stderr, a, vl);
+    }
+}
diff --git a/openbox/debug.h b/openbox/debug.h
new file mode 100644 (file)
index 0000000..695e968
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef __ob__debug_h
+#define __ob__debug_h
+
+void ob_debug_show_output(gboolean enable);
+
+void ob_debug(char *a, ...);
+
+#endif
This page took 0.026664 seconds and 4 git commands to generate.