X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=libuci.c;h=66e6d23860fd57559d1f3606803fa512c36ba6ce;hp=569a67688e0941d4d2fcef78dc28ab39be0fbea2;hb=1ac34884c1cc4e808674d8901c97e31776e8fc5c;hpb=96d35364c9159c96b164369d0d0c5147b0c73a24 diff --git a/libuci.c b/libuci.c index 569a676..66e6d23 100644 --- a/libuci.c +++ b/libuci.c @@ -41,6 +41,7 @@ static const char *uci_errstr[] = { #include "util.c" #include "list.c" +#include "history.c" #include "file.c" /* exported functions */ @@ -70,6 +71,7 @@ void uci_free_context(struct uci_context *ctx) free(ctx->savedir); UCI_TRAP_SAVE(ctx, ignore); + ctx->internal = true; uci_cleanup(ctx); uci_foreach_element_safe(&ctx->root, tmp, e) { struct uci_package *p = uci_to_package(e); @@ -85,18 +87,6 @@ ignore: return; } -int uci_add_history_path(struct uci_context *ctx, const char *dir) -{ - struct uci_element *e; - - UCI_HANDLE_ERR(ctx); - UCI_ASSERT(ctx, dir != NULL); - e = uci_alloc_generic(ctx, UCI_TYPE_PATH, dir, sizeof(struct uci_element)); - uci_list_add(&ctx->history_path, &e->list); - - return 0; -} - int uci_set_confdir(struct uci_context *ctx, const char *dir) { char *cdir; @@ -111,20 +101,6 @@ int uci_set_confdir(struct uci_context *ctx, const char *dir) return 0; } -int uci_set_savedir(struct uci_context *ctx, const char *dir) -{ - char *sdir; - - UCI_HANDLE_ERR(ctx); - UCI_ASSERT(ctx, dir != NULL); - - sdir = uci_strdup(ctx, dir); - if (ctx->savedir != uci_savedir) - free(ctx->savedir); - ctx->savedir = sdir; - return 0; -} - int uci_cleanup(struct uci_context *ctx) { UCI_HANDLE_ERR(ctx);