all repos — openbox @ d2a628a48768f67e6f9f3da038ce7b975615195a

openbox fork - make it a bit more like ryudo

add ob_debug for printing stuff only when debug is enabled
Dana Jansens danakj@orodu.net
commit

d2a628a48768f67e6f9f3da038ce7b975615195a

parent

bcc090ec83fe26b6b3afa144033c38021f49c400

2 files changed, 29 insertions(+), 0 deletions(-)

jump to
A 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); + } +}
A openbox/debug.h

@@ -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