aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 17:37:45 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 17:37:45 +0100
commitcb1f2e0c01f33f6a1d6b0dd3415e7b5d716309f6 (patch)
tree3ea7d024a9262ba561b97cd0491f66196a4b6deb /src
parentb6c3adcaaaee10721cb568e439ef7a1b41dc5564 (diff)
downloadmpd-cb1f2e0c01f33f6a1d6b0dd3415e7b5d716309f6.tar.gz
mpd-cb1f2e0c01f33f6a1d6b0dd3415e7b5d716309f6.tar.xz
mpd-cb1f2e0c01f33f6a1d6b0dd3415e7b5d716309f6.zip
conf: added config_add_param()
The function config_add_param() allows adding new configuration parameters.
Diffstat (limited to 'src')
-rw-r--r--src/conf.c10
-rw-r--r--src/conf.h7
2 files changed, 17 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c
index 9dfebc059..7560c02ba 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -23,6 +23,7 @@
#include <glib.h>
+#include <assert.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -349,6 +350,15 @@ void config_read_file(const char *file)
fclose(fp);
}
+void
+config_add_param(const char *name, struct config_param *param)
+{
+ struct config_entry *entry = config_entry_get(name);
+ assert(entry != NULL);
+
+ entry->params = g_slist_append(entry->params, param);
+}
+
struct config_param *
config_get_next_param(const char *name, const struct config_param * last)
{
diff --git a/src/conf.h b/src/conf.h
index 42ac6f228..5e191815f 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -91,6 +91,13 @@ void config_global_finish(void);
void config_read_file(const char *file);
+/**
+ * Adds a new configuration parameter. The name must be registered
+ * with registerConfigParam().
+ */
+void
+config_add_param(const char *name, struct config_param *param);
+
/* don't free the returned value
set _last_ to NULL to get first entry */
struct config_param *