]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Revert "Bug 28460 - Refactored dbus configuration access."
authorWill Thompson <will.thompson@collabora.co.uk>
Thu, 17 Jun 2010 14:14:22 +0000 (15:14 +0100)
committerWill Thompson <will.thompson@collabora.co.uk>
Thu, 17 Jun 2010 14:14:22 +0000 (15:14 +0100)
This reverts commit 6f9077ee870ad02119facf83d1293301b4535c3b, which
broke the build on Unix (see previous patch) and introduced a bunch of
warnings.

12 files changed:
cmake/dbus/CMakeLists.txt
dbus/Makefile.am
dbus/dbus-bus.c
dbus/dbus-config.c [deleted file]
dbus/dbus-config.h [deleted file]
dbus/dbus-internals.c
dbus/dbus-memory.c
dbus/dbus-sysdeps-unix.c
dbus/dbus-sysdeps-util-unix.c
dbus/dbus-sysdeps-win.c
dbus/dbus-sysdeps.c
dbus/dbus-test.c

index 08ea3b06a93da80201b5a9f1da57a93a1205c235..52cbf906227cf5b7981bb80b2d8e69a757abe358 100644 (file)
@@ -121,7 +121,6 @@ endif(UNIX)
 ### daemon or test programs (all symbols in here should 
 ### be underscore-prefixed)
 set (DBUS_SHARED_SOURCES
-       ${DBUS_DIR}/dbus-config.c
        ${DBUS_DIR}/dbus-dataslot.c
        ${DBUS_DIR}/dbus-file.c
        ${DBUS_DIR}/dbus-hash.c
@@ -156,7 +155,6 @@ set (DBUS_SHARED_HEADERS
 ### to be unless they move to DBUS_SHARED_SOURCES later)
 set (DBUS_UTIL_SOURCES
        ${DBUS_DIR}/dbus-auth-util.c
-       ${DBUS_DIR}/dbus-config.h
        ${DBUS_DIR}/dbus-credentials-util.c
        ${DBUS_DIR}/dbus-mainloop.c
        ${DBUS_DIR}/dbus-marshal-byteswap-util.c
index 41eed0f127bf381ee6449c46e12a3d9b5a0a0480..906b4c70230c10005e2e3450a9d3d93e241409e4 100644 (file)
@@ -184,8 +184,6 @@ DBUS_LIB_SOURCES=                           \
 ### daemon or test programs (all symbols in here should 
 ### be underscore-prefixed)
 DBUS_SHARED_SOURCES=                           \
-       dbus-config.c                           \
-       dbus-config.h                           \
        dbus-dataslot.c                         \
        dbus-dataslot.h                         \
        dbus-file.c                 \
index d160a2daa6535387ff0c41a876f559c1d98b34c6..92ec20ed4375ef6a67438ac32d8bb0ff56f1ffcd 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <config.h>
 #include "dbus-bus.h"
-#include "dbus-config.h"
 #include "dbus-protocol.h"
 #include "dbus-internals.h"
 #include "dbus-message.h"
@@ -279,7 +278,7 @@ init_connections_unlocked (void)
 
       if (bus_connection_addresses[DBUS_BUS_STARTER] != NULL)
         {
-          s = _dbus_config_starter_bus_type();
+          s = _dbus_getenv ("DBUS_STARTER_BUS_TYPE");
               
           if (s != NULL)
             {
diff --git a/dbus/dbus-config.c b/dbus/dbus-config.c
deleted file mode 100644 (file)
index e73288c..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-config.c client config api implementation
- *
- * Copyright (C) 2010  Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#include "dbus-config.h"
-#include "dbus-sysdeps.h"
-
-char *
-_dbus_config_block_on_abort ()
-{
-  return _dbus_getenv ("DBUS_BLOCK_ON_ABORT");
-}
-
-char *
-_dbus_config_common_program_files()
-{
-  return _dbus_getenv ("CommonProgramFiles");
-}
-
-char *
-_dbus_config_datadir ()
-{
-  return _dbus_getenv ("DBUS_DATADIR");
-}
-
-char *
-_dbus_config_debug_output ()
-{
-  return _dbus_getenv ("DBUS_DEBUG_OUTPUT");
-}
-
-char *
-_dbus_config_disable_mem_pools()
-{ 
-  return _dbus_getenv ("DBUS_DISABLE_MEM_POOLS");
-}
-
-char *
-_dbus_config_homedrive ()
-{
-  return _dbus_getenv("HOMEDRIVE");
-}
-
-char *
-_dbus_config_homepath ()
-{
-  return _dbus_getenv("HOMEPATH");
-}
-
-char *
-_dbus_config_fatal_warnings ()
-{
-  return _dbus_getenv ("DBUS_FATAL_WARNINGS");
-}        
-
-char *
-_dbus_config_malloc_fail_nth ()
-{ 
-  return _dbus_getenv ("DBUS_MALLOC_FAIL_NTH");
-}
-
-char *
-_dbus_config_malloc_fail_greater_than ()
-{ 
-  return _dbus_getenv ("DBUS_MALLOC_FAIL_GREATER_THAN");
-}
-
-char *
-_dbus_config_malloc_guards ()
-{ 
-  return _dbus_getenv ("DBUS_MALLOC_GUARDS");
-}
-
-char *
-_dbus_config_malloc_backtraces ()
-{
-  return _dbus_getenv ("DBUS_MALLOC_BACKTRACES");
-}
-
-char *
-_dbus_config_starter_bus_type ()
-{
-  return _dbus_getenv ("DBUS_STARTER_BUS_TYPE");
-}
-
-char *
-_dbus_config_test_malloc_failures ()
-{
-  return _dbus_getenv ("DBUS_TEST_MALLOC_FAILURES");
-}
-
-char *
-_dbus_config_test_homedir ()
-{
-  return _dbus_getenv ("DBUS_TEST_HOMEDIR");
-}
-
-char *
-_dbus_config_test_data ()
-{
-  return _dbus_getenv ("DBUS_TEST_DATA");
-}
-
-char *
-_dbus_config_xdg_data_home ()
-{
-  return _dbus_getenv ("XDG_DATA_HOME");
-}
-
-char *
-_dbus_config_xdg_data_dirs ()
-{
-  return _dbus_getenv ("XDG_DATA_DIRS");
-}
-
-char *
-_dbus_config_verbose ()
-{
-  return _dbus_getenv ("DBUS_VERBOSE");
-}
diff --git a/dbus/dbus-config.h b/dbus/dbus-config.h
deleted file mode 100644 (file)
index fc825ac..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-config.h client config api header
- *
- * Copyright (C) 2010  Ralf Habacker <ralf.habacker@freenet.de>
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifndef DBUS_CONFIG_H
-#define DBUS_CONFIG_H
-
-// session bus address 
-// system bus address 
-// activation bus address 
-
-char *
-_dbus_config_block_on_abort ();
-char *
-_dbus_config_common_program_files ();
-char *
-_dbus_config_datadir ();
-char *
-_dbus_config_debug_output ();
-char *
-_dbus_config_disable_mem_pools ();
-char *
-_dbus_config_fatal_warnings ();
-char *
-_dbus_config_homedrive ();
-char *
-_dbus_config_homepath ();
-char *
-_dbus_config_malloc_backtraces ();
-char *
-_dbus_config_malloc_fail_nth ();
-char *
-_dbus_config_malloc_fail_greater_than ();
-char *
-_dbus_config_malloc_guards ();
-char *
-_dbus_config_starter_bus_type ();
-char *
-_dbus_config_test_malloc_failures ();
-char *
-_dbus_config_test_homedir ();
-char *
-_dbus_config_test_data ();
-char *
-_dbus_config_verbose ();
-char *
-_dbus_config_xdg_data_home ();
-char *
-_dbus_config_xdg_data_dirs ();
-
-#endif
index 5edc92c4f29600878f7e60133b3f31547dc9deb5..1ab6731a7b2da8040d5628667bacb1ac008141f3 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 #include <config.h>
-#include "dbus-config.h"
 #include "dbus-internals.h"
 #include "dbus-protocol.h"
 #include "dbus-marshal-basic.h"
@@ -208,7 +207,7 @@ init_warnings(void)
   if (!warn_initted)
     {
       const char *s;
-      s = _dbus_config_fatal_warnings ();
+      s = _dbus_getenv ("DBUS_FATAL_WARNINGS");
       if (s && *s)
         {
           if (*s == '0')
@@ -314,7 +313,7 @@ _dbus_verbose_init (void)
 {
   if (!verbose_initted)
     {
-      const char *p = _dbus_config_verbose ();
+      const char *p = _dbus_getenv ("DBUS_VERBOSE");
       verbose = p != NULL && *p == '1';
       verbose_initted = TRUE;
 #ifdef DBUS_USE_OUTPUT_DEBUG_STRING
@@ -1004,7 +1003,7 @@ _dbus_test_oom_handling (const char             *description,
   _dbus_verbose ("\n=================\n%s: about %d mallocs total\n=================\n",
                  description, approx_mallocs);
 
-  setting = _dbus_config_test_malloc_failures ();
+  setting = _dbus_getenv ("DBUS_TEST_MALLOC_FAILURES");
   if (setting != NULL)
     {
       DBusString str;
index 57320abaf190c9198003743e600be7f367933a8b..a37759c0f10144a9b8e76ea612b480b6a3e76084 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 #include <config.h>
-#include "dbus-config.h"
 #include "dbus-memory.h"
 #include "dbus-internals.h"
 #include "dbus-sysdeps.h"
@@ -129,33 +128,33 @@ _dbus_initialize_malloc_debug (void)
     {
       debug_initialized = TRUE;
       
-      if (_dbus_config_malloc_fail_nth () != NULL)
+      if (_dbus_getenv ("DBUS_MALLOC_FAIL_NTH") != NULL)
        {
-         fail_nth = atoi (_dbus_config_malloc_fail_nth ());
+         fail_nth = atoi (_dbus_getenv ("DBUS_MALLOC_FAIL_NTH"));
           fail_alloc_counter = fail_nth;
           _dbus_verbose ("Will fail malloc every %d times\n", fail_nth);
        }
       
-      if (_dbus_config_malloc_fail_greater_than () != NULL)
+      if (_dbus_getenv ("DBUS_MALLOC_FAIL_GREATER_THAN") != NULL)
         {
-          fail_size = atoi (_dbus_config_malloc_fail_greater_than ());
+          fail_size = atoi (_dbus_getenv ("DBUS_MALLOC_FAIL_GREATER_THAN"));
           _dbus_verbose ("Will fail mallocs over %ld bytes\n",
                          (long) fail_size);
         }
 
-      if (_dbus_config_malloc_guards () != NULL)
+      if (_dbus_getenv ("DBUS_MALLOC_GUARDS") != NULL)
         {
           guards = TRUE;
           _dbus_verbose ("Will use malloc guards\n");
         }
 
-      if (_dbus_config_disable_mem_pools () != NULL)
+      if (_dbus_getenv ("DBUS_DISABLE_MEM_POOLS") != NULL)
         {
           disable_mem_pools = TRUE;
           _dbus_verbose ("Will disable memory pools\n");
         }
 
-      if (_dbus_config_malloc_backtraces () != NULL)
+      if (_dbus_getenv ("DBUS_MALLOC_BACKTRACES") != NULL)
         {
           backtrace_on_fail_alloc = TRUE;
           _dbus_verbose ("Will backtrace on failing a malloc\n");
index c9b0081fd4e23f9bf65ad5f2ad6269ff1c0699da..ebe9bdd8d53b60181e20e05e236cb75a9f50edb1 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <config.h>
 
-#include "dbus-config.h"
 #include "dbus-internals.h"
 #include "dbus-sysdeps.h"
 #include "dbus-sysdeps-unix.h"
@@ -3256,8 +3255,8 @@ _dbus_get_standard_session_servicedirs (DBusList **dirs)
   if (!_dbus_string_init (&servicedir_path))
     return FALSE;
 
-  xdg_data_home = _dbus_config_xdg_data_home ();
-  xdg_data_dirs = _dbus_config_xdg_data_dirs ();
+  xdg_data_home = _dbus_getenv ("XDG_DATA_HOME");
+  xdg_data_dirs = _dbus_getenv ("XDG_DATA_DIRS");
 
   if (xdg_data_dirs != NULL)
     {
@@ -3344,7 +3343,7 @@ _dbus_get_standard_system_servicedirs (DBusList **dirs)
   if (!_dbus_string_init (&servicedir_path))
     return FALSE;
 
-  xdg_data_dirs = _dbus_config_xdg_data_dirs ();
+  xdg_data_dirs = _dbus_getenv ("XDG_DATA_DIRS");
 
   if (xdg_data_dirs != NULL)
     {
@@ -3458,7 +3457,7 @@ _dbus_append_keyring_directory_for_credentials (DBusString      *directory,
   {
     const char *override;
     
-    override = _dbus_config_test_homedir ();
+    override = _dbus_getenv ("DBUS_TEST_HOMEDIR");
     if (override != NULL && *override != '\0')
       {
         _dbus_string_set_length (&homedir, 0);
index a8891b452c55f66f67242ce1a8581265f9ef009a..5904950de69c6441a8a5597637b0770aa47db4a2 100644 (file)
@@ -115,7 +115,7 @@ _dbus_become_daemon (const DBusString *pidfile,
           dup2 (dev_null_fd, 0);
           dup2 (dev_null_fd, 1);
           
-          s = _dbus_config_debug_output ();
+          s = _dbus_getenv ("DBUS_DEBUG_OUTPUT");
           if (s == NULL || *s == '\0')
             dup2 (dev_null_fd, 2);
           else
index ec7fd12ea6f3d454bfad5847932c9c118db4836c..aad342ca6ed561c2f38ca3ef326445c75f03989e 100644 (file)
@@ -36,7 +36,6 @@
 #endif
 #endif
 
-#include "dbus-config.h"
 #include "dbus-internals.h"
 #include "dbus-sysdeps.h"
 #include "dbus-threads.h"
@@ -2803,7 +2802,7 @@ _dbus_get_standard_session_servicedirs (DBusList **dirs)
 #ifdef DBUS_WINCE
   {
     /* On Windows CE, we adjust datadir dynamically to installation location.  */
-    const char *data_dir = _dbus_config_datadir ();
+    const char *data_dir = _dbus_getenv ("DBUS_DATADIR");
 
     if (data_dir != NULL)
       {
@@ -3103,13 +3102,13 @@ _dbus_append_keyring_directory_for_credentials (DBusString      *directory,
   if (!_dbus_string_init (&homedir))
     return FALSE;
 
-  homedrive = _dbus_config_homedrive ();
+  homedrive = _dbus_getenv("HOMEDRIVE");
   if (homedrive != NULL && *homedrive != '\0')
     {
       _dbus_string_append(&homedir,homedrive);
     }
 
-  homepath = _dbus_config_homepath ();
+  homepath = _dbus_getenv("HOMEPATH");
   if (homepath != NULL && *homepath != '\0')
     {
       _dbus_string_append(&homedir,homepath);
@@ -3119,7 +3118,7 @@ _dbus_append_keyring_directory_for_credentials (DBusString      *directory,
   {
     const char *override;
     
-    override = _dbus_config_test_homedir ();
+    override = _dbus_getenv ("DBUS_TEST_HOMEDIR");
     if (override != NULL && *override != '\0')
       {
         _dbus_string_set_length (&homedir, 0);
index ea3a95664d645ff33f95b3efc382e4d71c236d97..bab516dea24eaa20771d7051bd20185ce53c6943 100644 (file)
@@ -23,7 +23,6 @@
  */
 
 #include <config.h>
-#include "dbus-config.h"
 #include "dbus-internals.h"
 #include "dbus-sysdeps.h"
 #include "dbus-threads.h"
@@ -84,7 +83,7 @@ _dbus_abort (void)
   
   _dbus_print_backtrace ();
   
-  s = _dbus_config_block_on_abort ();
+  s = _dbus_getenv ("DBUS_BLOCK_ON_ABORT");
   if (s && *s)
     {
       /* don't use _dbus_warn here since it can _dbus_abort() */
index b8644de4ea60e0770e2054f327d048c1aab0e3e5..99becb0e4742718e0e1fbe344c1e49128cad5936 100644 (file)
@@ -22,7 +22,6 @@
  */
 
 #include <config.h>
-#include "dbus-config.h"
 #include "dbus-test.h"
 #include "dbus-sysdeps.h"
 #include "dbus-internals.h"
@@ -104,7 +103,7 @@ dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *speci
     die ("debug threads init");
   
   if (test_data_dir == NULL)
-    test_data_dir = _dbus_config_test_data ();
+    test_data_dir = _dbus_getenv ("DBUS_TEST_DATA");
 
   if (test_data_dir != NULL)
     printf ("Test data in %s\n", test_data_dir);