From 18a86e565efb0cae5ca2f3fd0add2a1ac08d1c37 Mon Sep 17 00:00:00 2001 From: Michal Vasko Date: Fri, 16 Apr 2021 11:50:13 +0200 Subject: [PATCH] schema tree REFACTOR rename internal function --- src/context.c | 2 +- src/schema_compile.c | 2 +- src/tree_schema.c | 2 +- src/tree_schema_helpers.c | 2 +- src/tree_schema_internal.h | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/context.c b/src/context.c index faa886a4c..b3c9c60ec 100644 --- a/src/context.c +++ b/src/context.c @@ -196,7 +196,7 @@ ly_ctx_load_module(struct ly_ctx *ctx, const char *name, const char *revision, c LY_CHECK_ARG_RET(ctx, ctx, name, NULL); - LY_CHECK_GOTO(ret = lysp_load_module(ctx, name, revision, 1, features, &unres, &result), cleanup); + LY_CHECK_GOTO(ret = lys_load_module(ctx, name, revision, 1, features, &unres, &result), cleanup); /* resolve unres and revert, if needed */ LY_CHECK_GOTO(ret = lys_compile_unres_glob(ctx, &unres), cleanup); diff --git a/src/schema_compile.c b/src/schema_compile.c index 572ea9e96..15a4857f0 100644 --- a/src/schema_compile.c +++ b/src/schema_compile.c @@ -281,7 +281,7 @@ lys_compile_import(struct lysc_ctx *ctx, struct lysp_import *imp_p) ly_in_free(in, 1); } if (!mod) { - if (lysp_load_module(ctx->ctx, imp_p->module->name, imp_p->module->revision, 0, NULL, ctx->unres, + if (lys_load_module(ctx->ctx, imp_p->module->name, imp_p->module->revision, 0, NULL, ctx->unres, (struct lys_module **)&mod)) { LOGERR(ctx->ctx, LY_ENOTFOUND, "Unable to reload \"%s\" module to import it into \"%s\", source data not found.", imp_p->module->name, ctx->cur_mod->name); diff --git a/src/tree_schema.c b/src/tree_schema.c index 05f8bf876..97bbe2a21 100644 --- a/src/tree_schema.c +++ b/src/tree_schema.c @@ -873,7 +873,7 @@ lys_resolve_import_include(struct lys_parser_ctx *pctx, struct lysp_module *pmod LY_ARRAY_FOR(pmod->imports, u) { imp = &pmod->imports[u]; if (!imp->module) { - LY_CHECK_RET(lysp_load_module(PARSER_CTX(pctx), imp->name, imp->rev[0] ? imp->rev : NULL, 0, NULL, + LY_CHECK_RET(lys_load_module(PARSER_CTX(pctx), imp->name, imp->rev[0] ? imp->rev : NULL, 0, NULL, pctx->unres, &imp->module)); } /* check for importing the same module twice */ diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c index cbe20a137..d5b5f6a88 100644 --- a/src/tree_schema_helpers.c +++ b/src/tree_schema_helpers.c @@ -666,7 +666,7 @@ lys_module_localfile(struct ly_ctx *ctx, const char *name, const char *revision, } LY_ERR -lysp_load_module(struct ly_ctx *ctx, const char *name, const char *revision, ly_bool need_implemented, +lys_load_module(struct ly_ctx *ctx, const char *name, const char *revision, ly_bool need_implemented, const char **features, struct lys_glob_unres *unres, struct lys_module **mod) { const char *module_data = NULL; diff --git a/src/tree_schema_internal.h b/src/tree_schema_internal.h index 2258c99bf..a32c9e381 100644 --- a/src/tree_schema_internal.h +++ b/src/tree_schema_internal.h @@ -284,7 +284,7 @@ LY_ERR lysp_type_find(const char *id, struct lysp_node *start_node, const struct LY_ERR lysp_check_enum_name(struct lys_parser_ctx *ctx, const char *name, size_t name_len); /** - * @brief Find and parse module of the given name. + * @brief Find and load a module of the given name. * * @param[in] ctx libyang context. * @param[in] name Name of the module to load. @@ -294,10 +294,10 @@ LY_ERR lysp_check_enum_name(struct lys_parser_ctx *ctx, const char *name, size_t * case the module of the latest revision can not be made implemented. * @param[in] features All the features to enable if implementing the module. * @param[in] unres Global unres structure for all newly implemented modules. - * @param[out] mod Parsed module structure. + * @param[out] mod Created module structure. * @return LY_ERR value. */ -LY_ERR lysp_load_module(struct ly_ctx *ctx, const char *name, const char *revision, ly_bool need_implemented, +LY_ERR lys_load_module(struct ly_ctx *ctx, const char *name, const char *revision, ly_bool need_implemented, const char **features, struct lys_glob_unres *unres, struct lys_module **mod); /**