plugins ext FEATURE initial schema-mount support
Only for XML data for now. Includes lots of other
changes needed to support this extension.
diff --git a/src/plugins_exts.c b/src/plugins_exts.c
index df797f9..eb688d5 100644
--- a/src/plugins_exts.c
+++ b/src/plugins_exts.c
@@ -1,9 +1,10 @@
/**
* @file plugins_exts.c
* @author Radek Krejci <rkrejci@cesnet.cz>
- * @brief Internally implemented YANG extensions.
+ * @author Michal Vasko <mvasko@cesnet.cz>
+ * @brief helper functions for extension plugins
*
- * Copyright (c) 2019 CESNET, z.s.p.o.
+ * Copyright (c) 2019 - 2022 CESNET, z.s.p.o.
*
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
@@ -69,3 +70,14 @@
{
return ctx->pmod;
}
+
+LIBYANG_API_DEF LY_ERR
+lyplg_ext_get_data(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, void **ext_data, ly_bool *ext_data_free)
+{
+ if (!ctx->ext_clb) {
+ lyplg_ext_log(ext, LY_LLERR, LY_EINVAL, NULL, "Failed to get extension data, no callback set.");
+ return LY_EINVAL;
+ }
+
+ return ctx->ext_clb(ext, ctx->ext_clb_data, ext_data, ext_data_free);
+}