Config iteration
This commit is contained in:
parent
ac6abd7c10
commit
77fd1763e0
3 changed files with 66 additions and 4 deletions
|
|
@ -57,6 +57,13 @@ Config *config_load(const char *filename) {
|
|||
return cfg;
|
||||
}
|
||||
|
||||
ConfigEntry *config_get_next(ConfigEntry *entry, int *index) {
|
||||
if (!entry)
|
||||
return NULL;
|
||||
|
||||
return (0 == (*index)++) ? entry : entry->next;
|
||||
}
|
||||
|
||||
/* Get value for a key */
|
||||
const char *config_get(Config *cfg, const char *key) {
|
||||
for (ConfigEntry *e = cfg->head; e; e = e->next) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue