1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

config_section() and config_list_section() changed

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@38 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 1999-10-09 17:59:42 +00:00 committed by cras
parent 95c6a0d9f6
commit ccfef94ec5
2 changed files with 12 additions and 14 deletions

View File

@ -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);

View File

@ -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);