We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The program creates node in order l1, l2, l3 and the tries to adjust the order to be l2, l1, l3.
#include <stdio.h> #include <stdlib.h> #include <libyang/libyang.h> int main(int argc, char **argv) { struct ly_ctx *ctx = ly_ctx_new("."); const struct lys_module *test_module = ly_ctx_load_module(ctx, "test-module", NULL); if (NULL == test_module){ puts("load module failed"); return 1; } struct lyd_node *l1 = lyd_new(NULL, test_module, "list"); lyd_new_leaf(l1, test_module, "key", "A"); struct lyd_node *l2 = lyd_new(NULL, test_module, "list"); lyd_new_leaf(l2, test_module, "key", "B"); struct lyd_node *l3 = lyd_new(NULL, test_module, "list"); lyd_new_leaf(l3, test_module, "key", "C"); lyd_insert_after(l1, l2); lyd_insert_after(l2, l3); /* ERROR*/ lyd_insert_after(l2, l1); /* THIS WORK as expected lyd_insert_before(l1, l2); */ lyd_free_withsiblings(l1); ly_ctx_destroy(ctx, NULL); return 0; }
It might be related to the fact that reordered nodes has no parent (top-level nodes)
The program sets pointer like this:
The expected state(in comment):
test-module.yang
module test-module { namespace "urn:ietf:params:xml:ns:yang:test-module"; prefix tm; organization "organization"; description "example yang module"; list list { key "key"; leaf key { type string; } } }
The text was updated successfully, but these errors were encountered:
6b66fe0
data tree BUGFIX lyd_insert_*() on nodes already connected somewhere
20a5f29
Wrong detection if the node is already connected somewhere and if lyd_unlink() is supposed to be done. Fixes #19
7fc4534
rkrejci
No branches or pull requests
The program creates node in order l1, l2, l3 and the tries to adjust the order to be l2, l1, l3.
It might be related to the fact that reordered nodes has no parent (top-level nodes)
The program sets pointer like this:
The expected state(in comment):
test-module.yang
The text was updated successfully, but these errors were encountered: