diff options
author | pommicket <pommicket@gmail.com> | 2025-09-12 14:44:41 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-09-12 14:45:26 -0400 |
commit | 45393c79ab36bb64b933b44983a1cd8dffc0ebac (patch) | |
tree | 3efcdfd61a60ce02d08f4ff5d5ca0b445c1964a4 /examples | |
parent | 81c1cecf40b0733446fb0d945505155d87bf74c6 (diff) |
Implement pom_conf_next_key, pom_conf_next_unread_key
Diffstat (limited to 'examples')
-rw-r--r-- | examples/read_conf.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/examples/read_conf.c b/examples/read_conf.c index 966f0a2..78e4847 100644 --- a/examples/read_conf.c +++ b/examples/read_conf.c @@ -22,7 +22,16 @@ int main(int argc, char **argv) { const pom_item *item; pom_item_iter *iter = NULL; while ((item = pom_conf_next_item(conf, &iter))) { - printf("Key: %s, Value: %s\n", item->key, item->value); + printf("Key: %s, Value: %s\n", item->key, item->value); + } + pom_unread_key_iter *unread = NULL; + const char *key; + while ((key = pom_conf_next_unread_key(conf, &unread))) { + printf("Unrecognized key: %s\n", key); + } + pom_key_iter *keys = NULL; + while ((key = pom_conf_next_key(conf, &keys))) { + printf("Top-level key: %s\n", key); } pom_conf_free(conf); } |