rest of the ~rewrite?

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@172 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-04-26 08:10:09 +00:00 committed by cras
commit d29ca0b107
32 changed files with 2049 additions and 1536 deletions

View file

@ -43,6 +43,22 @@ void config_node_remove(CONFIG_NODE *parent, CONFIG_NODE *node)
g_free(node);
}
/* Remove n'th node from a list */
void config_node_list_remove(CONFIG_NODE *node, int index)
{
GSList *tmp;
g_return_if_fail(node != NULL);
g_return_if_fail(is_node_list(node));
for (tmp = node->value; tmp != NULL; tmp = tmp->next, index--) {
if (index == 0) {
config_node_remove(node, tmp->data);
break;
}
}
}
void config_nodes_remove_all(CONFIG_REC *rec)
{
g_return_if_fail(rec != NULL);
@ -120,3 +136,12 @@ int config_set_bool(CONFIG_REC *rec, const char *section, const char *key, int v
{
return config_set_str(rec, section, key, value ? "yes" : "no");
}
/* Add all values in `array' to `node' */
void config_node_add_list(CONFIG_NODE *node, char **array)
{
char **tmp;
for (tmp = array; *tmp != NULL; tmp++)
config_node_set_str(node, NULL, *tmp);
}