From e83615d534222818ead5957d19056db55037f505 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Mon, 24 Apr 2006 01:29:05 -0500 Subject: [PATCH] moo_debug_enabled() --- moo/mooutils/mooutils-misc.c | 16 ++++++++++++++++ moo/mooutils/mooutils-misc.h | 1 + 2 files changed, 17 insertions(+) diff --git a/moo/mooutils/mooutils-misc.c b/moo/mooutils/mooutils-misc.c index 4948a66f..6c5db7fd 100644 --- a/moo/mooutils/mooutils-misc.c +++ b/moo/mooutils/mooutils-misc.c @@ -1381,3 +1381,19 @@ moo_data_dir_type_get_type (void) return type; } + + +gboolean +moo_debug_enabled (void) +{ + static gboolean enabled; + static gboolean been_here; + + if (!been_here) + { + been_here = TRUE; + enabled = g_getenv ("MOO_DEBUG") != NULL; + } + + return enabled; +} diff --git a/moo/mooutils/mooutils-misc.h b/moo/mooutils/mooutils-misc.h index ce68644a..94e2f330 100644 --- a/moo/mooutils/mooutils-misc.h +++ b/moo/mooutils/mooutils-misc.h @@ -48,6 +48,7 @@ void moo_reset_log_func (void); void moo_segfault (void); +gboolean moo_debug_enabled (void) G_GNUC_CONST; #define MOO_TYPE_DATA_DIR_TYPE (moo_data_dir_type_get_type ())