types CHANGE add lys_set_implemented2()
Use the new function as an types plugins API wrapper around
lys_set_implemented_r() which is supposed to be internal.
The functionality is needed for the types which may cause changing the
status of some module from imported to implemented (such as identityref
with LY_TYPE_STORE_IMPLEMENT flag set)
diff --git a/src/plugins_types.c b/src/plugins_types.c
index e84eb97..017bf28 100644
--- a/src/plugins_types.c
+++ b/src/plugins_types.c
@@ -681,6 +681,12 @@
}
API LY_ERR
+lys_set_implemented2(struct lys_module *mod, const char **features, struct lys_glob_unres *unres)
+{
+ return lys_set_implemented_r(mod, features, unres);
+}
+
+API LY_ERR
ly_type_identity_isderived(struct lysc_ident *base, struct lysc_ident *der)
{
LY_ARRAY_COUNT_TYPE u;
@@ -763,7 +769,7 @@
} else if (!mod->implemented) {
/* non-implemented module */
if (options & LY_TYPE_STORE_IMPLEMENT) {
- ret = lys_set_implemented_r((struct lys_module *)mod, NULL, unres);
+ ret = lys_set_implemented2((struct lys_module *)mod, NULL, unres);
LY_CHECK_GOTO(ret != LY_SUCCESS, cleanup);
} else {
ret = ly_err_new(err, LY_EVALID, LYVE_DATA, NULL, NULL,
diff --git a/src/plugins_types.h b/src/plugins_types.h
index 9a2a89a..80fb604 100644
--- a/src/plugins_types.h
+++ b/src/plugins_types.h
@@ -145,6 +145,18 @@
const char *prefix, size_t prefix_len, LY_PREFIX_FORMAT format, void *prefix_data);
/**
+ * @brief Implement a module (just like ::lys_set_implemented()), but keep maintaining unresolved items.
+ *
+ * Use only in implementations of ::ly_type_store_clb which provide all the necessary parameters for this function.
+ *
+ * @param[in] mod Module to implement.
+ * @param[in] features Array of features to enable.
+ * @param[in,out] unres Global unres to add to.
+ * @return LY_ERR value.
+ */
+LY_ERR lys_set_implemented2(struct lys_module *mod, const char **features, struct lys_glob_unres *unres);
+
+/**
* @brief Get format-specific prefix for a module.
*
* Use only in implementations of ::ly_type_print_clb which provide all the necessary parameters for this function.