mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 09:02:13 +02:00
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
This commit is contained in:
parent
bb507a8b85
commit
5976d82fa7
2 changed files with 16 additions and 0 deletions
|
|
@ -308,3 +308,17 @@ CONFIG_NODE *config_node_index(CONFIG_NODE *node, int index)
|
||||||
|
|
||||||
return NULL;
|
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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,8 @@ const char *config_list_find(CONFIG_REC *rec, const char *section, const char *k
|
||||||
CONFIG_NODE *config_list_find_node(CONFIG_REC *rec, const char *section, const char *key, const char *value, const char *value_key);
|
CONFIG_NODE *config_list_find_node(CONFIG_REC *rec, const char *section, const char *key, const char *value, const char *value_key);
|
||||||
/* Returns n'th node from list. */
|
/* Returns n'th node from list. */
|
||||||
CONFIG_NODE *config_node_index(CONFIG_NODE *node, int index);
|
CONFIG_NODE *config_node_index(CONFIG_NODE *node, int index);
|
||||||
|
/* Returns the next non-comment node in list */
|
||||||
|
GSList *config_node_next(GSList *list);
|
||||||
|
|
||||||
/* Setting values */
|
/* Setting values */
|
||||||
int config_set_str(CONFIG_REC *rec, const char *section, const char *key, const char *value);
|
int config_set_str(CONFIG_REC *rec, const char *section, const char *key, const char *value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue