]> Dogcows Code - chaz/openbox/blobdiff - openbox/debug.c
add ob_debug for printing stuff only when debug is enabled
[chaz/openbox] / openbox / debug.c
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);
+    }
+}
This page took 0.019896 seconds and 4 git commands to generate.