diff options
Diffstat (limited to 'examples/read_conf.c')
-rw-r--r-- | examples/read_conf.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/examples/read_conf.c b/examples/read_conf.c index d96e190..8f290f6 100644 --- a/examples/read_conf.c +++ b/examples/read_conf.c @@ -1,24 +1,18 @@ #include <stdlib.h> -#include <string.h> -#include <inttypes.h> - #include <pom.h> -int main(int argc, char **argv) { +int main(void) { pom_error *error; - pom_settings settings = {0}; - strcpy(settings.error_lang, "fr"); - pom_conf *conf = pom_load_path(&settings, argc >= 2 ? argv[1] : "conf.pom", &error); + pom_conf *conf = pom_load_path(NULL, "conf.pom", &error); if (!conf) { pom_error_print(error); free(error); return EXIT_FAILURE; } - char **list = pom_conf_get_list(conf, "things"); - for (size_t i = 0; list[i]; i++) { - printf("%s\n",list[i]); - } - free(list); - pom_conf_print(conf); + const char *indentation_type = pom_conf_get(conf, "indentation-type"); + if (indentation_type) + printf("Indenting with %s\n", indentation_type); + else + printf("No indentation type set!\n"); pom_conf_free(conf); } |