From d2a628a48768f67e6f9f3da038ce7b975615195a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 10 Jul 2003 04:32:33 +0000 Subject: [PATCH] add ob_debug for printing stuff only when debug is enabled --- openbox/debug.c | 21 +++++++++++++++++++++ openbox/debug.h | 8 ++++++++ 2 files changed, 29 insertions(+) create mode 100644 openbox/debug.c create mode 100644 openbox/debug.h 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 +#include +#include +#include + +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 index 00000000..695e968f --- /dev/null +++ b/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 -- 2.39.2