summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-09-12 14:44:41 -0400
committerpommicket <pommicket@gmail.com>2025-09-12 14:45:26 -0400
commit45393c79ab36bb64b933b44983a1cd8dffc0ebac (patch)
tree3efcdfd61a60ce02d08f4ff5d5ca0b445c1964a4 /examples
parent81c1cecf40b0733446fb0d945505155d87bf74c6 (diff)
Implement pom_conf_next_key, pom_conf_next_unread_key
Diffstat (limited to 'examples')
-rw-r--r--examples/read_conf.c11
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);
}