From ccfef94ec597381aa6cafe806abb8083fe21132c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 9 Oct 1999 17:59:42 +0000 Subject: [PATCH] config_section() and config_list_section() changed git-svn-id: http://svn.irssi.org/repos/irssi/trunk@38 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/lib-config/irssi-config.c | 22 ++++++++++------------ src/lib-config/irssi-config.h | 4 ++-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lib-config/irssi-config.c b/src/lib-config/irssi-config.c index dbfb5d41..2750397c 100644 --- a/src/lib-config/irssi-config.c +++ b/src/lib-config/irssi-config.c @@ -134,34 +134,32 @@ proplist_t config_clean_key(proplist_t prop, gchar *key) return prop; } -proplist_t config_section(proplist_t prop, gchar *section) +proplist_t config_section(proplist_t *prop, gchar *section) { - proplist_t ret, pkey, psect; + proplist_t ret, pkey; pkey = PLMakeString(section); - ret = PLGetDictionaryEntry(prop, pkey); + ret = PLGetDictionaryEntry(*prop, pkey); if (ret == NULL) { - psect = PLMakeDictionaryFromEntries(NULL, NULL); - prop = PLInsertDictionaryEntry(prop, pkey, psect); - ret = PLGetDictionaryEntry(prop, pkey); + ret = PLMakeDictionaryFromEntries(NULL, NULL); + *prop = PLInsertDictionaryEntry(*prop, pkey, ret); } PLRelease(pkey); return ret; } -proplist_t config_list_section(proplist_t prop, gchar *section) +proplist_t config_list_section(proplist_t *prop, gchar *section) { - proplist_t ret, pkey, psect; + proplist_t ret, pkey; pkey = PLMakeString(section); - ret = PLGetDictionaryEntry(prop, pkey); + ret = PLGetDictionaryEntry(*prop, pkey); if (ret == NULL) { - psect = PLMakeArrayFromElements(NULL); - prop = PLInsertDictionaryEntry(prop, pkey, psect); - ret = PLGetDictionaryEntry(prop, pkey); + ret = PLMakeArrayFromElements(NULL); + *prop = PLInsertDictionaryEntry(*prop, pkey, ret); } PLRelease(pkey); diff --git a/src/lib-config/irssi-config.h b/src/lib-config/irssi-config.h index 7a6b0c9f..2dc06c5e 100644 --- a/src/lib-config/irssi-config.h +++ b/src/lib-config/irssi-config.h @@ -15,8 +15,8 @@ proplist_t config_set_str(proplist_t prop, gchar *key, gchar *value); proplist_t config_set_int(proplist_t prop, gchar *key, gint value); proplist_t config_set_bool(proplist_t prop, gchar *key, gboolean value); -proplist_t config_section(proplist_t prop, gchar *section); -proplist_t config_list_section(proplist_t prop, gchar *section); +proplist_t config_section(proplist_t *prop, gchar *section); +proplist_t config_list_section(proplist_t *prop, gchar *section); proplist_t config_make_dict(proplist_t prop, gchar *section); proplist_t config_clean_key(proplist_t prop, gchar *key);