summaryrefslogtreecommitdiff
path: root/openbox/debug.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-07-10 04:32:33 +0000
committerDana Jansens <danakj@orodu.net>2003-07-10 04:32:33 +0000
commitd2a628a48768f67e6f9f3da038ce7b975615195a (patch)
treee6e5e10d62453f75ce94e864ab147ce43d068c15 /openbox/debug.c
parentbcc090ec83fe26b6b3afa144033c38021f49c400 (diff)
add ob_debug for printing stuff only when debug is enabled
Diffstat (limited to 'openbox/debug.c')
-rw-r--r--openbox/debug.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/openbox/debug.c b/openbox/debug.c
new file mode 100644
index 00000000..61ea33bf
--- /dev/null
+++ b/openbox/debug.c
@@ -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);
+ }
+}