+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;
+
+ UCI_HANDLE_ERR(ctx);
+ UCI_ASSERT(ctx, dir != NULL);
+
+ cdir = uci_strdup(ctx, dir);
+ if (ctx->confdir != uci_confdir)
+ free(ctx->confdir);
+ ctx->confdir = cdir;
+ 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;
+}
+