X-Git-Url: http://git.jankratochvil.net/?p=udpgate.git;a=blobdiff_plain;f=src%2Fconfiguration.c;h=8be581b94c46b46feecb31025bf2c0224df5cfe7;hp=95430648caa3f39a07319e48a6bbd4f0036dc0b3;hb=449337bb425c193812b143c14a53a5f0f9197320;hpb=841083f5a7a6501423467275c5086e8d3a648621 diff --git a/src/configuration.c b/src/configuration.c index 9543064..8be581b 100644 --- a/src/configuration.c +++ b/src/configuration.c @@ -23,14 +23,15 @@ #include #include #include +#include #include #include #include -#include #include +#include #include "configuration.h" /* self */ -#include "configuration-pathname.h" +#include "pathname.h" #include "network.h" #include "main.h" @@ -45,6 +46,19 @@ #define LOCATION_LINK "/proc/self/exe" /* for Linux kernel */ +static G_CONST_RETURN gchar *configuration_pathname(void) +{ +static const gchar *static_pathname; + + return pathname_find(&static_pathname, + G_STRINGIFY(SYSCONFDIR) "/sysconfig",PACKAGE, + G_STRINGIFY(SYSCONFDIR) "/default",PACKAGE, + G_STRINGIFY(SYSCONFDIR) "",PACKAGE, + /* 'getenv("HOME")' may return NULL and terminate the list prematurely. */ + getenv("HOME"),"." PACKAGE "rc", + NULL); +} + static GHashTable *configuration_hash_new(void) { return g_hash_table_new_full(g_str_hash,g_str_equal,