commit | 66d508c7a51437db85e940778427518c5f5b7a2e | [log] [tgz] |
---|---|---|
author | Michal Vasko <mvasko@cesnet.cz> | Wed Jul 21 16:07:09 2021 +0200 |
committer | Michal Vasko <mvasko@cesnet.cz> | Wed Jul 21 16:07:09 2021 +0200 |
tree | ef6e881b66a713cb0fa767359b95d7aa47a145c6 | |
parent | 81008a54c185b40c5e73558ac20e4b4730742b1e [diff] [blame] |
tree data FEATURE function for unlinking siblings
diff --git a/src/tree_data.c b/src/tree_data.c index ccce0f7..a2c3ef3 100644 --- a/src/tree_data.c +++ b/src/tree_data.c
@@ -2737,6 +2737,17 @@ } API void +lyd_unlink_siblings(struct lyd_node *node) +{ + struct lyd_node *next, *elem, *first = NULL; + + LY_LIST_FOR_SAFE(node, next, elem) { + lyd_unlink_tree(elem); + lyd_insert_node(NULL, &first, elem, 1); + } +} + +API void lyd_unlink_tree(struct lyd_node *node) { struct lyd_node *iter;