data tree CHANGE move macros to functions to cleanup API
Remove lyd_node_children() since it is just an old duplication of
LYD_CHILD and LYD_CHILD_NO_KEYS macros. As a consequence, these macros
are converted to the functions together with LYD_PARENT (same names, but
lowercase) since they have similar functionality in the API.
diff --git a/src/validation.c b/src/validation.c
index d00ad46..daa340b 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -391,7 +391,7 @@
/* add into diff */
if ((match->schema->nodetype == LYS_CONTAINER) && !(match->schema->flags & LYS_PRESENCE)) {
/* we do not want to track NP container changes, but remember any removed children */
- LY_LIST_FOR(LYD_CHILD(match), iter) {
+ LY_LIST_FOR(lyd_child(match), iter) {
lyd_val_diff_add(iter, LYD_DIFF_OP_DELETE, diff);
}
} else {
@@ -553,7 +553,7 @@
/* find iter instance in children */
assert(iter->nodetype & (LYS_CONTAINER | LYS_LEAF));
- lyd_find_sibling_val(lyd_node_children(node, 0), iter, NULL, 0, &node);
+ lyd_find_sibling_val(lyd_child(node), iter, NULL, 0, &node);
--depth;
}
@@ -997,11 +997,11 @@
LY_LIST_FOR(first, node) {
/* validate all children recursively */
- LY_CHECK_RET(lyd_validate_final_r(lyd_node_children(node, 0), node->schema, NULL, val_opts, op));
+ LY_CHECK_RET(lyd_validate_final_r(lyd_child(node), node->schema, NULL, val_opts, op));
/* set default for containers */
if ((node->schema->nodetype == LYS_CONTAINER) && !(node->schema->flags & LYS_PRESENCE)) {
- LY_LIST_FOR(lyd_node_children(node, 0), next) {
+ LY_LIST_FOR(lyd_child(node), next) {
if (!(next->flags & LYD_DEFAULT)) {
break;
}
@@ -1193,7 +1193,7 @@
}
/* move tree_iter */
- tree_iter = lyd_node_children(match, 0);
+ tree_iter = lyd_child(match);
/* move depth */
--cur_depth;
@@ -1268,7 +1268,7 @@
LY_CHECK_GOTO(ret = lyd_validate_must(op_node, op), cleanup);
/* final validation of all the descendants */
- LY_CHECK_GOTO(ret = lyd_validate_final_r(lyd_node_children(op_node, 0), op_node->schema, NULL, 0, op), cleanup);
+ LY_CHECK_GOTO(ret = lyd_validate_final_r(lyd_child(op_node), op_node->schema, NULL, 0, op), cleanup);
cleanup:
/* restore operation tree */