From f156f9a4f120a055b023ce8e60fac3012e0c185f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sat, 21 Aug 2010 01:05:29 +0200 Subject: Added conf_get_string_list() to conf.[ch]. --- conf.c | 12 ++++++++++++ conf.h | 1 + 2 files changed, 13 insertions(+) diff --git a/conf.c b/conf.c index eb978e7..8e39a89 100644 --- a/conf.c +++ b/conf.c @@ -14,6 +14,18 @@ gchar *conf_get_string(const gchar *group, const gchar *key) { return s; } +gchar **conf_get_string_list(const gchar *group, const gchar *key, gsize *length) { + GError *error = NULL; + + gchar **s = g_key_file_get_string_list(kf, group, key, length, &error); + if(s == NULL) { + g_warning(error->message); + g_error_free(error); + } + + return s; +} + gint conf_get_int(const gchar *group, const gchar *key) { GError *error = NULL; diff --git a/conf.h b/conf.h index 7506373..0ed1ca2 100644 --- a/conf.h +++ b/conf.h @@ -4,6 +4,7 @@ #include gchar *conf_get_string(const gchar *group, const gchar *key); +gchar **conf_get_string_list(const gchar *group, const gchar *key, gsize *length); gint conf_get_int(const gchar *group, const gchar *key); gboolean conf_load(); void conf_free(); -- cgit v1.2.3