Skip to content

Commit 97e6e75

Browse files
committed
context REVERT remove the added internal module get function
It is not needed.
1 parent 01e29e0 commit 97e6e75

2 files changed

Lines changed: 1 addition & 39 deletions

File tree

src/context.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ ly_ctx_new(const char *search_dir, uint32_t options, struct ly_ctx **new_ctx)
340340
}
341341

342342
/* create dummy in */
343-
rc = ly_in_new_memory(internal_modules[0].data, &in);
343+
rc = ly_in_new_memory(sep, &in);
344344
LY_CHECK_GOTO(rc, cleanup);
345345

346346
/* load internal modules */
@@ -1574,28 +1574,3 @@ ly_ctx_destroy(struct ly_ctx *ctx)
15741574

15751575
free(ctx);
15761576
}
1577-
1578-
LIBYANG_API_DEF LY_ERR
1579-
lys_internal_module_get_yang(const char *module_name, const char *revision, const char **data_yang)
1580-
{
1581-
uint32_t i;
1582-
1583-
LY_CHECK_ARG_RET(NULL, module_name, data_yang, LY_EINVAL);
1584-
1585-
*data_yang = NULL;
1586-
1587-
for (i = 0; i < LY_INTERNAL_MODS_COUNT; ++i) {
1588-
if (strcmp(module_name, internal_modules[i].name)) {
1589-
continue;
1590-
}
1591-
1592-
if (revision && strcmp(revision, internal_modules[i].revision)) {
1593-
continue;
1594-
}
1595-
1596-
*data_yang = internal_modules[i].data;
1597-
break;
1598-
}
1599-
1600-
return *data_yang ? LY_SUCCESS : LY_ENOTFOUND;
1601-
}

src/context.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -749,19 +749,6 @@ LIBYANG_API_DECL ly_bool ly_ctx_is_printed(const struct ly_ctx *ctx);
749749
*/
750750
LIBYANG_API_DECL void ly_ctx_destroy(struct ly_ctx *ctx);
751751

752-
/**
753-
* @brief Get YANG raw data of an internal library module.
754-
*
755-
* @param[in] module_name Module name to get.
756-
* @param[in] revision Optional module revision, NULL for any.
757-
* @param[out] data_yang Module YANG data.
758-
* @return LY_SUCCESS on success;
759-
* @return LY_ENOTFOUND if the specified module was not found;
760-
* @return LY_ERR on error.
761-
*/
762-
LIBYANG_API_DECL LY_ERR lys_internal_module_get_yang(const char *module_name, const char *revision,
763-
const char **data_yang);
764-
765752
/** @} context */
766753

767754
#ifdef __cplusplus

0 commit comments

Comments
 (0)