diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-08-03 18:15:54 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-08-12 15:28:42 +0100 |
commit | 2ac4002084864e2530ce7908efb00a8697e85d07 (patch) | |
tree | 9b669ac24a8d11c114fb1e887042b971ae8bed5a /cogl/cogl-debug.c | |
parent | 5012bcf1d1fb09a0bece1e3d417ed7c4e3d6cd0c (diff) | |
download | cogl-2ac4002084864e2530ce7908efb00a8697e85d07.tar.gz |
cogl: Add support for reading a cogl.conf config file
When cogl initializes we now check for a cogl/cogl.conf in any of the
system config dirs (determined using $XDG_CONFIG_DIRS on linux) we then
also check the user's config directory (determined using XDG_CONFIG_HOME
on linux) for a cogl/cogl.conf file. Options specified in the user
config file have priority over the system config options.
The config file has an .ini style syntax with a mandatory [global]
section and we currently understand 3 keynames: COGL_DEBUG, COGL_DRIVER
and COGL_RENDERER which have the same semantics as the corresponding
environment variables.
Options set using the environment variables have priority over options
set in the config files. To allow users to undo the enabling of debug
options in config files this patch also adds a check for COGL_NO_DEBUG
environment variable which will disable the specified options which may
have been enabled in config files.
Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl-debug.c')
-rw-r--r-- | cogl/cogl-debug.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cogl/cogl-debug.c b/cogl/cogl-debug.c index 51163486..bc22f78e 100644 --- a/cogl/cogl-debug.c +++ b/cogl/cogl-debug.c @@ -126,7 +126,7 @@ _cogl_parse_debug_string_for_keys (const char *value, } } -static void +void _cogl_parse_debug_string (const char *value, gboolean enable, gboolean ignore_help) @@ -223,6 +223,15 @@ _cogl_debug_check_environment (void) FALSE /* don't ignore help */); env_string = NULL; } + + env_string = g_getenv ("COGL_NO_DEBUG"); + if (env_string != NULL) + { + _cogl_parse_debug_string (env_string, + FALSE /* disable the flags */, + FALSE /* don't ignore help */); + env_string = NULL; + } } static gboolean |