#include #include #include #include "pom.h" int main(int argc, char **argv) { pom_error *error; pom_conf *conf = pom_load_path(argc >= 2 ? argv[1] : "conf.pom", &error); if (!conf) { pom_error_print(error); free(error); return EXIT_FAILURE; } pom_conf *conf2 = pom_load_string("", "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); pom_conf_free(conf); pom_conf_free(copy); pom_conf_free(copy2); pom_conf_free(conf2); }