summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config.c18
-rw-r--r--src/config.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 5bff673..1fe29ba 100644
--- a/src/config.c
+++ b/src/config.c
@@ -282,6 +282,24 @@ mq_config_get_string(MqConfig *config, const gchar *name)
return value;
}
+gchar **
+mq_config_get_string_list(MqConfig *config, const gchar *name)
+{
+ gchar *group;
+ gchar *key;
+ gchar **value;
+
+ split_name(name, &group, &key);
+
+ /* TODO: Handle value parsing errors? */
+ value = g_key_file_get_string_list(config->key_file, group, key, NULL,
+ NULL);
+
+ g_free(group);
+
+ return value;
+}
+
static void
set_type_or_run_callbacks(MqConfig *config, const gchar *name,
gconstpointer value, enum type type)
diff --git a/src/config.h b/src/config.h
index 3a28d9e..d76ab3b 100644
--- a/src/config.h
+++ b/src/config.h
@@ -61,6 +61,9 @@ mq_config_get_double(MqConfig *config, const gchar *name);
gchar *
mq_config_get_string(MqConfig *config, const gchar *name);
+gchar **
+mq_config_get_string_list(MqConfig *config, const gchar *name);
+
void
mq_config_set_boolean(MqConfig *config, const gchar *name, gboolean value);