diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2020-10-22 22:19:10 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2020-10-23 18:18:22 -0300 |
| commit | 8d869d378bf10ee02e4aed66c9c3c16f15fe0c26 (patch) | |
| tree | 04dadc1e6681ffa3f4939da8367889d62f95cdb5 /lib/yang.c | |
| parent | 9bde0b256919ff3987ea60101229fec195324102 (diff) | |
lib: combine two YANG schema iteration functions into one
Combine yang_snodes_iterate_module() and yang_snodes_iterate_all()
into an unified yang_snodes_iterate() function, where the first
"module" parameter is optional. There's no point in having two
separate YANG schema iteration functions anymore now that they are
too similar.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/yang.c')
| -rw-r--r-- | lib/yang.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/lib/yang.c b/lib/yang.c index 46012acf51..c59cb642f0 100644 --- a/lib/yang.c +++ b/lib/yang.c @@ -227,8 +227,8 @@ next: return ret; } -int yang_snodes_iterate_module(const struct lys_module *module, - yang_iterate_cb cb, uint16_t flags, void *arg) +int yang_snodes_iterate(const struct lys_module *module, yang_iterate_cb cb, + uint16_t flags, void *arg) { const struct lys_module *module_iter; uint32_t idx = 0; @@ -252,25 +252,6 @@ int yang_snodes_iterate_module(const struct lys_module *module, return ret; } -int yang_snodes_iterate_all(yang_iterate_cb cb, uint16_t flags, void *arg) -{ - struct yang_module *module; - int ret = YANG_ITER_CONTINUE; - - RB_FOREACH (module, yang_modules, &yang_modules) { - struct lys_node *snode; - - LY_TREE_FOR (module->info->data, snode) { - ret = yang_snodes_iterate_subtree(snode, NULL, cb, - flags, arg); - if (ret == YANG_ITER_STOP) - return ret; - } - } - - return ret; -} - void yang_snode_get_path(const struct lys_node *snode, enum yang_path_type type, char *xpath, size_t xpath_len) { |
