*/
struct fr_edit_list_s {
/*
- * List of edits to be made, in order.
+ * List of undo changes to be made, in order.
*/
- fr_dlist_head_t list;
+ fr_dlist_head_t undo;
/*
* VPs which were inserted, and then over-written by a
* same VP, but we can create a VP, and then later edit
* its children.
*/
- while ((e = fr_dlist_pop_tail(&el->list)) != NULL) {
+ while ((e = fr_dlist_pop_tail(&el->undo)) != NULL) {
edit_undo(e);
/*
* Don't free "e", it will be cleaned up when we
* record FR_EDIT_VALUE changes to the children. It's
* not yet clear how best to track this.
*/
- for (e = fr_dlist_head(&el->list);
+ for (e = fr_dlist_head(&el->undo);
e != NULL;
- e = fr_dlist_next(&el->list, e)) {
+ e = fr_dlist_next(&el->undo, e)) {
fr_assert(e->vp != NULL);
if (e->vp != vp) continue;
fr_pair_remove(list, vp);
fr_pair_append(&el->deleted_pairs, vp);
- fr_dlist_remove(&el->list, e);
+ fr_dlist_remove(&el->undo, e);
talloc_free(e);
return 0;
}
* which has been deleted!
*/
e->op = FR_EDIT_DELETE;
- fr_dlist_remove(&el->list, e);
+ fr_dlist_remove(&el->undo, e);
goto delete;
}
} /* loop over existing edits */
break;
}
- fr_dlist_insert_tail(&el->list, e);
+ fr_dlist_insert_tail(&el->undo, e);
return 0;
}
* and errors if so.
*/
if (edit_record(el, FR_EDIT_DELETE, to_replace, list, NULL) < 0) {
- fr_edit_t *e = fr_dlist_pop_tail(&el->list);
+ fr_edit_t *e = fr_dlist_pop_tail(&el->undo);
fr_assert(e != NULL);
fr_assert(e->vp == vp);
fr_assert(el != NULL);
- for (e = fr_dlist_head(&el->list);
+ for (e = fr_dlist_head(&el->undo);
e != NULL;
- e = fr_dlist_next(&el->list, e)) {
+ e = fr_dlist_next(&el->undo, e)) {
switch (e->op) {
case FR_EDIT_INVALID:
fr_assert(0);
el = talloc_zero_pooled_object(ctx, fr_edit_list_t, hint, hint * sizeof(fr_edit_t));
if (!el) return NULL;
- fr_dlist_init(&el->list, fr_edit_t, entry);
+ fr_dlist_init(&el->undo, fr_edit_t, entry);
fr_pair_list_init(&el->deleted_pairs);