diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2010-06-14 18:27:04 +0200 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2010-06-14 18:27:04 +0200 |
commit | 6f9077ee870ad02119facf83d1293301b4535c3b (patch) | |
tree | d66fafdb3c68af7501efcefdf4f777ddd6eac45c /dbus/dbus-internals.c | |
parent | 9280395330c833dd98d0811d31349c26a84b2f6a (diff) | |
download | dbus-6f9077ee870ad02119facf83d1293301b4535c3b.tar.gz |
Bug 28460 - Refactored dbus configuration access.
Libdbus uses several config variables. On unix these settings are read from
environment variables by using _dbus_getenv.
On other platforms like wince there are no environment variables available and
_dbus_getenv needs an emulation for those plattforms (see
dbus/dbus-sysdeps-wince-glue.c)
To cleanup this emulation the appended patch adds a config api by adding
_dbus_config_... functions.
Also having all client config related functions listed in one header file
provides a good overview about which config attributes are available.
The default implementation retrieves the config values from environment
variables. For other os this could be easily extended or replaced by.
Diffstat (limited to 'dbus/dbus-internals.c')
-rw-r--r-- | dbus/dbus-internals.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 1ab6731a..5edc92c4 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -22,6 +22,7 @@ */ #include <config.h> +#include "dbus-config.h" #include "dbus-internals.h" #include "dbus-protocol.h" #include "dbus-marshal-basic.h" @@ -207,7 +208,7 @@ init_warnings(void) if (!warn_initted) { const char *s; - s = _dbus_getenv ("DBUS_FATAL_WARNINGS"); + s = _dbus_config_fatal_warnings (); if (s && *s) { if (*s == '0') @@ -313,7 +314,7 @@ _dbus_verbose_init (void) { if (!verbose_initted) { - const char *p = _dbus_getenv ("DBUS_VERBOSE"); + const char *p = _dbus_config_verbose (); verbose = p != NULL && *p == '1'; verbose_initted = TRUE; #ifdef DBUS_USE_OUTPUT_DEBUG_STRING @@ -1003,7 +1004,7 @@ _dbus_test_oom_handling (const char *description, _dbus_verbose ("\n=================\n%s: about %d mallocs total\n=================\n", description, approx_mallocs); - setting = _dbus_getenv ("DBUS_TEST_MALLOC_FAILURES"); + setting = _dbus_config_test_malloc_failures (); if (setting != NULL) { DBusString str; |