From 5976d82fa7f13e4fbad576e926459179aaa83f82 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 22 Sep 2001 14:53:54 +0000 Subject: config_node_next() - Returns the next non-comment node in list. Use this function when reading blocks/lists in config file. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1811 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/lib-config/get.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/lib-config/get.c') diff --git a/src/lib-config/get.c b/src/lib-config/get.c index 98e2a30b..21b97251 100644 --- a/src/lib-config/get.c +++ b/src/lib-config/get.c @@ -308,3 +308,17 @@ CONFIG_NODE *config_node_index(CONFIG_NODE *node, int index) return NULL; } + +/* Returns the next non-comment node in list */ +GSList *config_node_next(GSList *list) +{ + list = list->next; + while (list != NULL) { + CONFIG_NODE *node = list->data; + + if (node->type != NODE_TYPE_COMMENT) + break; + list = list->next; + } + return list; +} -- cgit v1.2.3