}
static int
-uci_fill_ptr(struct uci_context *ctx, struct uci_ptr *ptr, struct uci_element *e, bool complete)
+uci_fill_ptr(struct uci_context *ctx, struct uci_ptr *ptr, struct uci_element *e)
{
UCI_ASSERT(ctx, ptr != NULL);
UCI_ASSERT(ctx, e != NULL);
ptr->package = ptr->p->e.name;
ptr->flags |= UCI_LOOKUP_DONE;
- if (complete)
- ptr->flags |= UCI_LOOKUP_COMPLETE;
return 0;
}
ctx->internal = !pctx->merge;
UCI_NESTED(uci_add_section, ctx, pctx->package, type, &pctx->section);
} else {
- uci_fill_ptr(ctx, &ptr, &pctx->package->e, false);
+ uci_fill_ptr(ctx, &ptr, &pctx->package->e);
e = uci_lookup_list(&pctx->package->sections, name);
if (e)
ptr.s = uci_to_section(e);
value = next_arg(ctx, str, false, false);
assert_eol(ctx, str);
- uci_fill_ptr(ctx, &ptr, &pctx->section->e, false);
+ uci_fill_ptr(ctx, &ptr, &pctx->section->e);
e = uci_lookup_list(&pctx->section->options, name);
if (e)
ptr.o = uci_to_option(e);
return filename;
}
-void uci_file_commit(struct uci_context *ctx, struct uci_package **package, bool overwrite)
+static void uci_file_commit(struct uci_context *ctx, struct uci_package **package, bool overwrite)
{
struct uci_package *p = *package;
FILE *f = NULL;
/* open the config file for writing now, so that it is locked */
f = uci_open_stream(ctx, p->path, SEEK_SET, true, true);
- /* flush unsaved changes and reload from history file */
+ /* flush unsaved changes and reload from delta file */
UCI_TRAP_SAVE(ctx, done);
- if (p->has_history) {
+ if (p->has_delta) {
if (!overwrite) {
name = uci_strdup(ctx, p->e.name);
path = uci_strdup(ctx, p->path);
- /* dump our own changes to the history file */
- if (!uci_list_empty(&p->history))
+ /* dump our own changes to the delta file */
+ if (!uci_list_empty(&p->delta))
UCI_INTERNAL(uci_save, ctx, p);
/*
UCI_INTERNAL(uci_import, ctx, f, name, &p, true);
p->path = path;
- p->has_history = true;
+ p->has_delta = true;
*package = p;
/* freed together with the uci_package */
path = NULL;
}
- /* flush history */
- if (!uci_load_history(ctx, p, true))
+ /* flush delta */
+ if (!uci_load_delta(ctx, p, true))
goto done;
}
if (package) {
package->path = filename;
- package->has_history = confdir;
- uci_load_history(ctx, package, false);
+ package->has_delta = confdir;
+ uci_load_delta(ctx, package, false);
}
done: