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.h | |
| 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.h')
| -rw-r--r-- | lib/yang.h | 28 | 
1 files changed, 5 insertions, 23 deletions
diff --git a/lib/yang.h b/lib/yang.h index 867ade9676..0cd6a4a6f2 100644 --- a/lib/yang.h +++ b/lib/yang.h @@ -186,29 +186,11 @@ extern int yang_snodes_iterate_subtree(const struct lys_node *snode,  				       void *arg);  /* - * Iterate over all libyang schema nodes from the given YANG module. + * Iterate over all libyang schema nodes from all loeaded modules of from the + * given YANG module.   *   * module - *    YANG module to operate on. - * - * cb - *    Function to call with each schema node. - * - * flags - *    YANG_ITER_* flags to control how the iteration is performed. - * - * arg - *    Arbitrary argument passed as the second parameter in each call to 'cb'. - * - * Returns: - *    The return value of the last called callback. - */ -extern int yang_snodes_iterate_module(const struct lys_module *module, -				      yang_iterate_cb cb, uint16_t flags, -				      void *arg); - -/* - * Iterate over all libyang schema nodes from all loaded YANG modules. + *    When set, iterate over all nodes of the specified module only.   *   * cb   *    Function to call with each schema node. @@ -222,8 +204,8 @@ extern int yang_snodes_iterate_module(const struct lys_module *module,   * Returns:   *    The return value of the last called callback.   */ -extern int yang_snodes_iterate_all(yang_iterate_cb cb, uint16_t flags, -				   void *arg); +extern int yang_snodes_iterate(const struct lys_module *module, +			       yang_iterate_cb cb, uint16_t flags, void *arg);  /*   * Build schema path or data path of the schema node.  | 
