summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>1999-10-09 17:59:42 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>1999-10-09 17:59:42 +0000
commitccfef94ec597381aa6cafe806abb8083fe21132c (patch)
tree2ee9f247e8ab412e28e7de71f7333b0b005de482
parent95c6a0d9f61f5c0b45baa483cf244600610a61f5 (diff)
downloadirssi-ccfef94ec597381aa6cafe806abb8083fe21132c.zip
config_section() and config_list_section() changed
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@38 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/lib-config/irssi-config.c22
-rw-r--r--src/lib-config/irssi-config.h4
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);