validation CHANGE validating single module data
... instead of module array. It simplifies the API
considerably and in case several modules need to
be validated, the function can be called repeatedly
without any performance impact.
diff --git a/src/tree_data_helpers.c b/src/tree_data_helpers.c
index 599a5bc..8356961 100644
--- a/src/tree_data_helpers.c
+++ b/src/tree_data_helpers.c
@@ -87,18 +87,19 @@
}
const struct lys_module *
-lyd_mod_next_module(struct lyd_node *tree, const struct lys_module **modules, int mod_count, const struct ly_ctx *ctx,
- uint32_t *i, struct lyd_node **first)
+lyd_mod_next_module(struct lyd_node *tree, const struct lys_module *module, const struct ly_ctx *ctx, uint32_t *i,
+ struct lyd_node **first)
{
struct lyd_node *iter;
const struct lys_module *mod;
/* get the next module */
- if (modules && mod_count) {
- if (*i < (unsigned)mod_count) {
- mod = modules[(*i)++];
- } else {
+ if (module) {
+ if (*i) {
mod = NULL;
+ } else {
+ mod = module;
+ ++(*i);
}
} else {
do {