add missing include statement
[project/uci.git] / libuci.c
index 569a676..7805d74 100644 (file)
--- a/libuci.c
+++ b/libuci.c
@@ -39,8 +39,10 @@ static const char *uci_errstr[] = {
        [UCI_ERR_UNKNOWN] =   "Unknown error",
 };
 
        [UCI_ERR_UNKNOWN] =   "Unknown error",
 };
 
+#include "uci_internal.h"
 #include "util.c"
 #include "list.c"
 #include "util.c"
 #include "list.c"
+#include "history.c"
 #include "file.c"
 
 /* exported functions */
 #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);
                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);
        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;
 }
 
        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;
 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;
 }
 
        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);
 int uci_cleanup(struct uci_context *ctx)
 {
        UCI_HANDLE_ERR(ctx);