summaryrefslogtreecommitdiffstats
path: root/src/plugins_exts.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:23:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:23:18 +0000
commitb90161ccd3b318f3314a23cb10c387651ad35831 (patch)
treea47dc087160299ce02d728cbf031d84af6281537 /src/plugins_exts.h
parentAdding upstream version 2.1.30. (diff)
downloadlibyang2-b90161ccd3b318f3314a23cb10c387651ad35831.tar.xz
libyang2-b90161ccd3b318f3314a23cb10c387651ad35831.zip
Adding upstream version 2.1.148.upstream/2.1.148upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/plugins_exts.h')
-rw-r--r--src/plugins_exts.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/plugins_exts.h b/src/plugins_exts.h
index f005391..a2783ff 100644
--- a/src/plugins_exts.h
+++ b/src/plugins_exts.h
@@ -594,6 +594,14 @@ LIBYANG_API_DECL void lyplg_ext_compile_log_path(const char *path, const struct
LY_LOG_LEVEL level, LY_ERR err_no, const char *format, ...);
/**
+ * @brief Log a message from an extension plugin using the compiled extension instance and a generated error item.
+ *
+ * @param[in] err Error item to log.
+ * @param[in] ext Compiled extension instance.
+ */
+LIBYANG_API_DEF void lyplg_ext_compile_log_err(const struct ly_err_item *err, const struct lysc_ext_instance *ext);
+
+/**
* @brief YANG schema compilation context getter for libyang context.
*
* @param[in] ctx YANG schema compilation context.
@@ -915,7 +923,10 @@ typedef void (*lyplg_ext_compile_free_clb)(const struct ly_ctx *ctx, struct lysc
LIBYANG_API_DECL void lyplg_ext_cfree_instance_substatements(const struct ly_ctx *ctx, struct lysc_ext_substmt *substmts);
/**
- * @brief Extension plugin implementing various aspects of a YANG extension
+ * @brief Extension plugin implementing various aspects of a YANG extension.
+ *
+ * Every plugin should have at least either ::parse() or ::compile() callback defined but other than that **all**
+ * the callbacks are **optional**.
*/
struct lyplg_ext {
const char *id; /**< plugin identification (mainly for distinguish incompatible versions
@@ -1030,11 +1041,10 @@ LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_get_parent_ref(const struct lysc_
/**
* @brief Allocate a new context for a particular instance of the yangmnt:mount-point extension.
- * Caller is responsible for destroying the resulting context.
+ * Caller is responsible for **freeing** the created context.
*
* @param[in] ext Compiled extension instance.
- * @param[out] ctx A context with modules loaded from the list found in
- * the extension data.
+ * @param[out] ctx Context with modules loaded from the list found in the extension data.
* @return LY_ERR value.
*/
LIBYANG_API_DECL LY_ERR lyplg_ext_schema_mount_create_context(const struct lysc_ext_instance *ext, struct ly_ctx **ctx);