summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb85a36)
raw | patch | inline | side by side (parent: eb85a36)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 4 Jan 2012 19:36:05 +0000 (20:36 +0100) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 4 Jan 2012 19:36:05 +0000 (20:36 +0100) |
src/conf.c | patch | blob | history | |
src/conf.h | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index 5f35d205d5d70369a0918d2f5cd4e349d2af5b1c..4496abe92a5ee03fe91ec0360e1968381777eb4d 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
return retval;
}
+char *
+build_user_conf_filename(void)
+{
+ return g_build_filename(g_get_home_dir(), "." PACKAGE, "config", NULL);
+}
+
+char *
+build_system_conf_filename(void)
+{
+ return g_build_filename(SYSCONFDIR, PACKAGE, "config", NULL);
+}
+
char *
build_user_key_binding_filename(void)
{
/* check for user configuration ~/.ncmpc/config */
if (filename == NULL) {
- filename = g_build_filename(g_get_home_dir(),
- "." PACKAGE, "config", NULL);
+ filename = build_user_conf_filename();
if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR)) {
g_free(filename);
filename = NULL;
/* check for global configuration SYSCONFDIR/ncmpc/config */
if (filename == NULL) {
- filename = g_build_filename(SYSCONFDIR, PACKAGE, "config", NULL);
+ filename = build_system_conf_filename();
if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR)) {
g_free(filename);
filename = NULL;
diff --git a/src/conf.h b/src/conf.h
index b8e4ed232d59bf94fde477f09b0002c2fcf12087..55bc21b3262b28605bced675d489713792c480dc 100644 (file)
--- a/src/conf.h
+++ b/src/conf.h
int check_user_conf_dir(void);
+char *build_user_conf_filename(void);
+char *build_system_conf_filename(void);
+
char *build_user_key_binding_filename(void);
int read_configuration(void);