X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=libuci.c;h=7805d746f01197582e2d7c453471616212a83394;hp=569a67688e0941d4d2fcef78dc28ab39be0fbea2;hb=031b620e1f3a16078da45ce00352508764902786;hpb=96d35364c9159c96b164369d0d0c5147b0c73a24 diff --git a/libuci.c b/libuci.c index 569a676..7805d74 100644 --- a/libuci.c +++ b/libuci.c @@ -39,8 +39,10 @@ static const char *uci_errstr[] = { [UCI_ERR_UNKNOWN] = "Unknown error", }; +#include "uci_internal.h" #include "util.c" #include "list.c" +#include "history.c" #include "file.c" /* exported functions */ @@ -70,6 +72,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 +88,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 +102,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);