summaryrefslogtreecommitdiffstats
path: root/src/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/context.h')
-rw-r--r--src/context.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/context.h b/src/context.h
index 331a89f..a6367f5 100644
--- a/src/context.h
+++ b/src/context.h
@@ -1,9 +1,10 @@
/**
* @file context.h
* @author Radek Krejci <rkrejci@cesnet.cz>
+ * @author Michal Vasko <mvasko@cesnet.cz>
* @brief internal context structures and functions
*
- * Copyright (c) 2015 - 2020 CESNET, z.s.p.o.
+ * Copyright (c) 2015 - 2023 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.
@@ -196,6 +197,8 @@ struct ly_ctx;
#define LY_CTX_ENABLE_IMP_FEATURES 0x0100 /**< By default, all features of newly implemented imported modules of
a module that is being loaded are disabled. With this flag they all become
enabled. */
+#define LY_CTX_LEAFREF_EXTENDED 0x0200 /**< By default, path attribute of leafref accepts only path as defined in RFC 7950.
+ By using this option, the path attribute will also allow using XPath functions as deref() */
/** @} contextoptions */
@@ -370,6 +373,18 @@ LIBYANG_API_DECL LY_ERR ly_ctx_unset_options(struct ly_ctx *ctx, uint16_t option
LIBYANG_API_DECL uint16_t ly_ctx_get_change_count(const struct ly_ctx *ctx);
/**
+ * @brief Get the hash of all the modules in the context. Since order of the modules is significant,
+ * even when 2 contexts have the same modules but loaded in a different order, the hash will differ.
+ *
+ * Hash consists of all module names (1), their revisions (2), all enabled features (3), and their
+ * imported/implemented state (4).
+ *
+ * @param[in] ctx Context to be examined.
+ * @return Context modules hash.
+ */
+LIBYANG_API_DECL uint32_t ly_ctx_get_modules_hash(const struct ly_ctx *ctx);
+
+/**
* @brief Callback for freeing returned module data in #ly_module_imp_clb.
*
* @param[in] module_data Data to free.
@@ -630,7 +645,8 @@ LIBYANG_API_DECL struct lys_module *ly_ctx_load_module(struct ly_ctx *ctx, const
* If the data identifier can be limited to the existence and changes of this context, the following
* last 2 parameters can be used:
*
- * "%u" as @p content_id_format and ::ly_ctx_get_change_count() as its parameter.
+ * "%u" as @p content_id_format and ::ly_ctx_get_change_count() as its parameter;
+ * "%u" as @p content_id_format and ::ly_ctx_get_modules_hash() as its parameter.
*
* @param[in] ctx Context with the modules.
* @param[out] root Generated yang-library data.