diff options
author | Max Kellermann <max@duempel.org> | 2009-01-18 17:54:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-18 17:54:46 +0100 |
commit | 9c6b2a32f510778252f3a9c79725334aaec4d80b (patch) | |
tree | 84be4ae5ca15520ef686bbfbaa0bb9787c640247 /src/conf.c | |
parent | a3f03f3ccdefc8704d112405dca5db10a2f6cf94 (diff) | |
download | mpd-9c6b2a32f510778252f3a9c79725334aaec4d80b.tar.gz mpd-9c6b2a32f510778252f3a9c79725334aaec4d80b.tar.xz mpd-9c6b2a32f510778252f3a9c79725334aaec4d80b.zip |
conf: added config_get_path()
config_get_path() is an simpler interface than parseConfigFilePath().
Diffstat (limited to 'src/conf.c')
-rw-r--r-- | src/conf.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c index f71ace7f2..adc8ad876 100644 --- a/src/conf.c +++ b/src/conf.c @@ -387,6 +387,24 @@ config_get_string(const char *name, const char *default_value) return param->value; } +const char * +config_get_path(const char *name) +{ + struct config_param *param = config_get_param(name); + char *path; + + if (param == NULL) + return NULL; + + path = parsePath(param->value); + if (path == NULL) + g_error("error parsing \"%s\" at line %i\n", + name, param->line); + + g_free(param->value); + return param->value = path; +} + struct block_param * getBlockParam(struct config_param * param, const char *name) { |