]> pilppa.org Git - uci.git/blobdiff - libuci.c
add support for listing config files
[uci.git] / libuci.c
index cb0bc360ab442ee1b0cc4617c6b3674d945df212..190267354dc675b6b92bd33947c2f40ac0679a83 100644 (file)
--- a/libuci.c
+++ b/libuci.c
@@ -94,6 +94,18 @@ struct uci_context *uci_alloc(void)
        return ctx;
 }
 
+void uci_free(struct uci_context *ctx)
+{
+       struct uci_config *cfg;
+
+       uci_cleanup(ctx);
+       uci_foreach_entry(config, &ctx->root, cfg) {
+               uci_drop_file(cfg);
+       }
+       free(ctx);
+       return;
+}
+
 int uci_cleanup(struct uci_context *ctx)
 {
        UCI_HANDLE_ERR(ctx);