context CHANGE module retrieval API changed
Getting names of all (sub)modules is no longer
possible, it was a source of potential
ambiguities. For any task involving all the
(sub)modules, iterator should be used.
diff --git a/src/libyang.h b/src/libyang.h
index c3f78f5..271664f 100644
--- a/src/libyang.h
+++ b/src/libyang.h
@@ -99,14 +99,12 @@
*
* Context can hold multiple revisons of the same schema.
*
- * Context holds all modules and their submodules internally. The list of available module names is
- * provided via ly_ctx_get_module_names() functions. Similarly, caller can get also a list of submodules
- * names of a specific module using ly_ctx_get_submodule_names() function. The returned names can be
- * subsequently used to get the (sub)module structures using ly_ctx_get_module() and ly_ctx_get_submodule().
- * Alternatively, the ly_ctx_info() function can be used to get complex information about the schemas in the context
- * in the form of data tree defined by
+ * Context holds all modules and their submodules internally. To get a specific module or submodule, use
+ * ly_ctx_get_module() and ly_ctx_get_submodule(). If you need to do something with all the modules or
+ * submodules in the context, it is advised to iterate over them using ly_ctx_get_module_iter(), it is
+ * the most efficient way. Alternatively, the ly_ctx_info() function can be used to get complex information
+ * about the schemas in the context in the form of data tree defined by
* <a href="https://tools.ietf.org/html/draft-ietf-netconf-yang-library-04">ietf-yang-library</a> schema.
- * Also, if all the modules need to be iterated over, it can be done effectively using ly_ctx_get_module_iter().
*
* Modules held by a context cannot be removed one after one. The only way how to \em change modules in the
* context is to create a new context and remove the old one. To remove a context, there is ly_ctx_destroy()
@@ -125,11 +123,9 @@
* - ly_ctx_get_module_clb()
* - ly_ctx_load_module()
* - ly_ctx_info()
- * - ly_ctx_get_module_names()
* - ly_ctx_get_module_iter()
* - ly_ctx_get_module()
* - ly_ctx_get_module_by_ns()
- * - ly_ctx_get_submodule_names()
* - ly_ctx_get_submodule()
* - ly_ctx_get_node()
* - ly_ctx_destroy()
@@ -613,17 +609,6 @@
struct lyd_node *ly_ctx_info(struct ly_ctx *ctx);
/**
- * @brief Get the names of the loaded modules.
- *
- * @param[in] ctx Context with the modules.
- * @return NULL-terminated array of the module names,
- * NULL on error. The returned array must be freed by the caller, do not free
- * names in the array. Also remember that the names will be freed with freeing
- * the context.
- */
-const char **ly_ctx_get_module_names(const struct ly_ctx *ctx);
-
-/**
* @brief Iterate over all modules in a context.
*
* @param[in] ctx Context with the modules.
@@ -633,18 +618,6 @@
const struct lys_module *ly_ctx_get_module_iter(const struct ly_ctx *ctx, uint32_t *idx);
/**
- * @brief Get the names of the loaded submodules of the specified module.
- *
- * @param[in] ctx Context with the modules.
- * @param[in] module_name Name of the parent module.
- * @return NULL-terminated array of submodule names of the parent module,
- * NULL on error. The returned array must be freed by the caller, do not free
- * names in the array. Also remember that the names will be freed with freeing
- * the context.
- */
-const char **ly_ctx_get_submodule_names(const struct ly_ctx *ctx, const char *module_name);
-
-/**
* @brief Get pointer to the schema tree of the module of the specified name.
*
* @param[in] ctx Context to work in.