From 839e0104e994bd4941693203fca39a659894bb57 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 06 Oct 2017 00:38:25 -0400 Subject: mq_config_get_string_list(): New function --- (limited to 'src/config.c') 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) -- cgit v0.9.1