diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-26 15:39:44 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-26 15:39:44 +0000 |
commit | e395e87dedd9aa85f05e5c74330a76f1ef700371 (patch) | |
tree | 1184487b13038499f1771e4c553222f85b8524d2 /src/lib-config/get.c | |
parent | 3d124da13b8da5c0b535abfe6265fc471d9d2ebd (diff) | |
download | irssi-e395e87dedd9aa85f05e5c74330a76f1ef700371.zip |
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
Diffstat (limited to 'src/lib-config/get.c')
-rw-r--r-- | src/lib-config/get.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib-config/get.c b/src/lib-config/get.c index c4cde5b8..4db6b4b7 100644 --- a/src/lib-config/get.c +++ b/src/lib-config/get.c @@ -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; +} |