diff options
Diffstat (limited to 'examples/read_conf.c')
-rw-r--r-- | examples/read_conf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/read_conf.c b/examples/read_conf.c index ed33e21..966f0a2 100644 --- a/examples/read_conf.c +++ b/examples/read_conf.c @@ -1,5 +1,6 @@ #include <stdlib.h> #include <string.h> +#include <inttypes.h> #include "pom.h" @@ -11,6 +12,13 @@ int main(int argc, char **argv) { free(error); return EXIT_FAILURE; } + printf("number.one: %s\n", pom_conf_get(conf, "number.one")); + printf("number.tow: %s\n", pom_conf_get_or_default(conf, "number.tow", "(none)")); + printf("has thing? %d\n", pom_conf_has(conf, "thing")); + const char *file; uint64_t line; + if (pom_conf_location(conf, "thing", &file, &line)) { + printf("\tthing location: %s:%" PRIu64 "\n", file,line); + } const pom_item *item; pom_item_iter *iter = NULL; while ((item = pom_conf_next_item(conf, &iter))) { |