}
#include "list.c"
-#include "parse.c"
+#include "file.c"
/* externally visible functions */
void uci_free(struct uci_context *ctx)
{
- struct uci_config *cfg;
+ struct uci_element *e, *tmp;
uci_cleanup(ctx);
- uci_foreach_entry(config, &ctx->root, cfg) {
- uci_drop_config(cfg);
+ uci_foreach_element_safe(&ctx->root, tmp, e) {
+ uci_free_package(uci_to_package(e));
}
free(ctx);
return;
int uci_cleanup(struct uci_context *ctx)
{
UCI_HANDLE_ERR(ctx);
- uci_parse_cleanup(ctx);
+ uci_file_cleanup(ctx);
return 0;
}