5 #include "json-debug.h"
7 static unsigned int json_debug_flags = 0;
8 static gboolean json_debug_flags_set = FALSE;
10 #ifdef JSON_ENABLE_DEBUG
11 static const GDebugKey json_debug_keys[] = {
12 { "parser", JSON_DEBUG_PARSER },
13 { "gobject", JSON_DEBUG_GOBJECT },
14 { "path", JSON_DEBUG_PATH }
16 #endif /* JSON_ENABLE_DEBUG */
19 _json_get_debug_flags (void)
21 #ifdef JSON_ENABLE_DEBUG
24 if (json_debug_flags_set)
25 return json_debug_flags;
27 env_str = g_getenv ("JSON_DEBUG");
28 if (env_str != NULL && *env_str != '\0')
30 json_debug_flags |= g_parse_debug_string (env_str,
32 G_N_ELEMENTS (json_debug_keys));
35 json_debug_flags_set = TRUE;
36 #endif /* JSON_ENABLE_DEBUG */
38 return json_debug_flags;