Lots of moving stuff around - hopefully I didn't break too much :)

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@632 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-08-26 15:39:44 +00:00 committed by cras
commit e395e87ded
160 changed files with 3954 additions and 2959 deletions

View file

@ -291,3 +291,19 @@ char **config_node_get_list(CONFIG_NODE *node)
g_string_free(values, TRUE);
return ret;
}
/* Returns n'th node from list. */
CONFIG_NODE *config_node_index(CONFIG_NODE *node, int index)
{
GSList *tmp;
g_return_val_if_fail(node != NULL, NULL);
g_return_val_if_fail(is_node_list(node), NULL);
for (tmp = node->value; tmp != NULL; tmp = tmp->next, index--) {
if (index == 0)
return tmp->data;
}
return NULL;
}