diff options
Diffstat (limited to 'examples/read_conf.c')
-rw-r--r-- | examples/read_conf.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/examples/read_conf.c b/examples/read_conf.c index 18802e3..c4cabfc 100644 --- a/examples/read_conf.c +++ b/examples/read_conf.c @@ -12,21 +12,10 @@ int main(int argc, char **argv) { free(error); return EXIT_FAILURE; } - pom_conf *conf2 = pom_load_string("<inline>", "foo=bar\r\n[j.number]\n" - "one = I\n" - "five = V\n", &error); - if (!conf2) { - pom_conf_free(conf); - pom_error_print(error); - free(error); - return EXIT_FAILURE; - } - pom_conf *copy = pom_conf_copy(conf); - pom_conf_merge(copy,pom_conf_section(conf2,"j")); - pom_conf *copy2 = pom_conf_copy(copy); - pom_conf_print(copy2); + uint64_t value; + const char *s = pom_conf_get_uint(conf, "number.best", &value); + printf("%" PRIu64 "\n", value); + if (s) printf(" -> %s\n",s); + pom_conf_print(conf); pom_conf_free(conf); - pom_conf_free(copy); - pom_conf_free(copy2); - pom_conf_free(conf2); } |