add option to set configuration file to be used by default by libgnunetutil routines
authorChristian Grothoff <christian@grothoff.org>
Fri, 15 Apr 2016 17:42:28 +0000 (17:42 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 15 Apr 2016 17:42:28 +0000 (17:42 +0000)
src/include/gnunet_os_lib.h
src/util/program.c
src/util/service.c

index 1cb01d0384ee8173aae9fd4eaeefd0b7f9cf6977..5785bd67fc3defbe1a467bed1b50f41e3966e5ca 100644 (file)
@@ -250,6 +250,11 @@ struct GNUNET_OS_ProjectData
    */
   const char *homepage;
 
+  /**
+   * Configuration file name (in $XDG_CONFIG_HOME) to use.
+   */
+  const char *config_file;
+
 };
 
 
index 69dd455cdd54e817c59bd939b47138c1ae8439ce..a313ce87e61eedf385c3998b8b3a4c3e3361633a 100644 (file)
@@ -223,7 +223,7 @@ GNUNET_PROGRAM_run2 (int argc, char *const *argv, const char *binaryName,
                      "%s%s%s",
                      xdg,
                      DIR_SEPARATOR_STR,
-                     "gnunet.conf");
+                     GNUNET_OS_project_data_get ()->config_file);
   else
     cfg_fn = GNUNET_strdup (GNUNET_DEFAULT_USER_CONFIG_FILE);
   lpfx = GNUNET_strdup (binaryName);
index 76e540302d732f034cebe5f053615fb312015cc1..c7f96502142064f30b9178b6f6e43b53b4c6a1c5 100644 (file)
@@ -1427,7 +1427,7 @@ GNUNET_SERVICE_run (int argc, char *const *argv,
                      "%s%s%s",
                      xdg,
                      DIR_SEPARATOR_STR,
-                     "gnunet.conf");
+                     GNUNET_OS_project_data_get ()->config_file);
   else
     cfg_fn = GNUNET_strdup (GNUNET_DEFAULT_USER_CONFIG_FILE);
   memset (&sctx, 0, sizeof (sctx));