schema internal MAINTENANCE removed new_mods set
... because it is not necessary to have it in the ::lys_parser_ctx.
And it is not used at all in the yang_parse_sub/module or
yin_parse_sub/module functions. In other functions
(lys_resolve_import_include, lys_parse_submodule,
lysp_load_submodules), new_mods is passed as a parameter.
diff --git a/src/tree_schema_internal.h b/src/tree_schema_internal.h
index 279fcbf..33abb83 100644
--- a/src/tree_schema_internal.h
+++ b/src/tree_schema_internal.h
@@ -147,7 +147,6 @@
struct ly_set tpdfs_nodes; /**< set of typedef nodes */
struct ly_set grps_nodes; /**< set of grouping nodes */
struct lysp_module *parsed_mod; /**< (sub)module being parsed */
- struct ly_set *new_mods; /**< all modules added to context */
};
/**
@@ -158,7 +157,6 @@
struct ly_set tpdfs_nodes; /**< set of typedef nodes */
struct ly_set grps_nodes; /**< set of grouping nodes */
struct lysp_module *parsed_mod; /**< (sub)module being parsed */
- struct ly_set *new_mods; /**< all modules added to context */
struct ly_in *in; /**< input handler for the parser */
uint64_t indent; /**< current position on the line for YANG indentation */
uint32_t depth; /**< current number of nested blocks, see ::LY_MAX_BLOCK_DEPTH */
@@ -177,7 +175,6 @@
struct ly_set tpdfs_nodes; /**< set of typedef nodes */
struct ly_set grps_nodes; /**< set of grouping nodes */
struct lysp_module *parsed_mod;/**< (sub)module being parsed */
- struct ly_set *new_mods; /**< all modules added to context */
struct lyxml_ctx *xmlctx; /**< context for xml parser */
};
@@ -314,9 +311,10 @@
*
* @param[in] pctx main parser context
* @param[in] pmod Parsed module with the includes array to be processed.
+ * @param[in,out] new_mods Set of all the new mods added to the context. Includes this module and all of its imports.
* @return LY_ERR value.
*/
-LY_ERR lysp_load_submodules(struct lys_parser_ctx *pctx, struct lysp_module *pmod);
+LY_ERR lysp_load_submodules(struct lys_parser_ctx *pctx, struct lysp_module *pmod, struct ly_set *new_mods);
/**
* @brief Free a parsed restriction.
@@ -590,11 +588,12 @@
* @param[in] main_ctx Parser context of the main module.
* @param[in] custom_check Callback to check the parsed schema before it is accepted.
* @param[in] check_data Caller's data to pass to the custom_check callback.
+ * @param[in] new_mods Set of all the new mods added to the context. Includes this module and all of its imports.
* @param[out] submodule Parsed submodule.
* @return LY_ERR value.
*/
LY_ERR lys_parse_submodule(struct ly_ctx *ctx, struct ly_in *in, LYS_INFORMAT format, struct lys_parser_ctx *main_ctx,
- lys_custom_check custom_check, void *check_data, struct lysp_submodule **submodule);
+ lys_custom_check custom_check, void *check_data, struct ly_set *new_mods, struct lysp_submodule **submodule);
/**
* @brief Fill filepath value if available in input handler @p in