Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 1 | /** |
| 2 | * @file path.h |
| 3 | * @author Michal Vasko <mvasko@cesnet.cz> |
| 4 | * @brief Path structure and manipulation routines. |
| 5 | * |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 6 | * Copyright (c) 2020 - 2023 CESNET, z.s.p.o. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 7 | * |
| 8 | * This source code is licensed under BSD 3-Clause License (the "License"). |
| 9 | * You may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
| 11 | * |
| 12 | * https://opensource.org/licenses/BSD-3-Clause |
| 13 | */ |
| 14 | |
| 15 | #ifndef LY_PATH_H_ |
| 16 | #define LY_PATH_H_ |
| 17 | |
Radek Krejci | ad97c5f | 2020-06-30 09:19:28 +0200 | [diff] [blame] | 18 | #include <stddef.h> |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 19 | #include <stdint.h> |
| 20 | |
| 21 | #include "log.h" |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 22 | #include "tree.h" |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 23 | #include "tree_data.h" |
| 24 | |
Radek Krejci | ad97c5f | 2020-06-30 09:19:28 +0200 | [diff] [blame] | 25 | struct ly_ctx; |
Radek Krejci | 0aa1f70 | 2021-04-01 16:16:19 +0200 | [diff] [blame] | 26 | struct lys_module; |
| 27 | struct lysc_ext_instance; |
| 28 | struct lysc_node; |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 29 | struct lyxp_expr; |
| 30 | |
| 31 | enum ly_path_pred_type { |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 32 | LY_PATH_PREDTYPE_POSITION, /**< position predicate - [2] */ |
| 33 | LY_PATH_PREDTYPE_LIST, /**< keys predicate - [key1='val1'][key2='val2']... */ |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 34 | LY_PATH_PREDTYPE_LEAFLIST, /**< leaflist value predicate - [.='value'] */ |
| 35 | LY_PATH_PREDTYPE_LIST_VAR /**< keys predicate with variable instead of value - [key1=$USER]... */ |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | /** |
Christian Hopps | 61213e0 | 2021-04-12 20:41:32 -0400 | [diff] [blame] | 39 | * @brief Structure for simple path predicate. |
| 40 | */ |
| 41 | struct ly_path_predicate { |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 42 | enum ly_path_pred_type type; /**< Predicate type (see YANG ABNF) */ |
Christian Hopps | 61213e0 | 2021-04-12 20:41:32 -0400 | [diff] [blame] | 43 | union { |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 44 | uint64_t position; /**< position value for the position-predicate */ |
Christian Hopps | 61213e0 | 2021-04-12 20:41:32 -0400 | [diff] [blame] | 45 | struct { |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 46 | const struct lysc_node *key; /**< key node of the predicate, NULL in case of a leaf-list predicate */ |
| 47 | union { |
| 48 | struct lyd_value value; /**< stored value representation according to the key's type (realtype ref) */ |
| 49 | char *variable; /**< XPath variable used instead of the value */ |
| 50 | }; |
Christian Hopps | 61213e0 | 2021-04-12 20:41:32 -0400 | [diff] [blame] | 51 | }; |
| 52 | }; |
| 53 | }; |
| 54 | |
| 55 | /** |
| 56 | * @brief Structure for holding one segment of resolved path on schema including |
| 57 | * simple predicates. Is used as a [sized array](@ref sizedarrays). |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 58 | */ |
| 59 | struct ly_path { |
| 60 | const struct lysc_node *node; /**< Schema node representing the path segment, first node has special meaning: |
| 61 | - is a top-level node - path is absolute, |
| 62 | - is inner node - path is relative */ |
Michal Vasko | 8cc3f66 | 2022-03-29 11:25:51 +0200 | [diff] [blame] | 63 | const struct lysc_ext_instance *ext; /**< Extension instance of @p node, if any */ |
| 64 | struct ly_path_predicate *predicates; /**< [Sized array](@ref sizedarrays) of the path segment's predicates */ |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | /** |
| 68 | * @defgroup path_begin_options Path begin options. |
| 69 | * @{ |
| 70 | */ |
| 71 | #define LY_PATH_BEGIN_ABSOLUTE 0x01 /**< path must be absolute */ |
aPiecek | b0445f2 | 2021-06-24 11:34:07 +0200 | [diff] [blame] | 72 | #define LY_PATH_BEGIN_EITHER 0x02 /**< path be be either absolute or relative */ |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 73 | /** @} */ |
| 74 | |
| 75 | /** |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 76 | * @defgroup path_prefix_options Path prefix options. |
| 77 | * @{ |
| 78 | */ |
Michal Vasko | 32ca49b | 2023-02-17 15:11:35 +0100 | [diff] [blame] | 79 | #define LY_PATH_PREFIX_OPTIONAL 0x10 /**< prefixes in the path are optional (XML path) */ |
Michal Vasko | 8b06a5e | 2020-08-06 12:13:08 +0200 | [diff] [blame] | 80 | #define LY_PATH_PREFIX_MANDATORY 0x20 /**< prefixes in the path are mandatory (XML instance-identifier) */ |
Michal Vasko | 32ca49b | 2023-02-17 15:11:35 +0100 | [diff] [blame] | 81 | #define LY_PATH_PREFIX_FIRST 0x40 /**< prefixes in the path are mandatory only in the first node of absolute path (JSON path) */ |
| 82 | #define LY_PATH_PREFIX_STRICT_INHERIT 0x80 /**< prefixes in the path are mandatory in case they differ from the |
Michal Vasko | 8b06a5e | 2020-08-06 12:13:08 +0200 | [diff] [blame] | 83 | previous prefixes, otherwise they are prohibited (JSON instance-identifier) */ |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 84 | /** @} */ |
| 85 | |
| 86 | /** |
| 87 | * @defgroup path_pred_options Path predicate options. |
| 88 | * @{ |
| 89 | */ |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 90 | #define LY_PATH_PRED_KEYS 0x0100 /** expected predicate only - [node='value']* */ |
| 91 | #define LY_PATH_PRED_SIMPLE 0x0200 /** expected predicates - ( [node='value'] | [node=$VAR] )*; [.='value']; [1] */ |
| 92 | #define LY_PATH_PRED_LEAFREF 0x0400 /** expected predicates only leafref - [node=current()/../../../node/node]; |
| 93 | at least 1 ".." and 1 "node" after */ |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 94 | /** @} */ |
| 95 | |
| 96 | /** |
| 97 | * @brief Parse path into XPath token structure and perform all additional checks. |
| 98 | * |
| 99 | * @param[in] ctx libyang context. |
Michal Vasko | aef00cb | 2020-10-16 11:58:57 +0200 | [diff] [blame] | 100 | * @param[in] ctx_node Optional context node, used for logging. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 101 | * @param[in] str_path Path to parse. |
| 102 | * @param[in] path_len Length of @p str_path. |
Michal Vasko | ed725d7 | 2021-06-23 12:03:45 +0200 | [diff] [blame] | 103 | * @param[in] lref Whether leafref is being parsed or not. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 104 | * @param[in] begin Begin option (@ref path_begin_options). |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 105 | * @param[in] prefix Prefix option (@ref path_prefix_options). |
| 106 | * @param[in] pred Predicate option (@ref path_pred_options). |
| 107 | * @param[out] expr Parsed path. |
| 108 | * @return LY_ERR value. |
| 109 | */ |
Michal Vasko | 6b26e74 | 2020-07-17 15:02:10 +0200 | [diff] [blame] | 110 | LY_ERR ly_path_parse(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *str_path, size_t path_len, |
Michal Vasko | 32ca49b | 2023-02-17 15:11:35 +0100 | [diff] [blame] | 111 | ly_bool lref, uint16_t begin, uint16_t prefix, uint16_t pred, struct lyxp_expr **expr); |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 112 | |
| 113 | /** |
| 114 | * @brief Parse predicate into XPath token structure and perform all additional checks. |
| 115 | * |
| 116 | * @param[in] ctx libyang context. |
Michal Vasko | aef00cb | 2020-10-16 11:58:57 +0200 | [diff] [blame] | 117 | * @param[in] cur_node Optional current (original context) node, used for logging. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 118 | * @param[in] str_path Path to parse. |
| 119 | * @param[in] path_len Length of @p str_path. |
| 120 | * @param[in] prefix Prefix option (@ref path_prefix_options). |
| 121 | * @param[in] pred Predicate option (@ref path_pred_options). |
| 122 | * @param[out] expr Parsed path. |
| 123 | * @return LY_ERR value. |
| 124 | */ |
Michal Vasko | 6b26e74 | 2020-07-17 15:02:10 +0200 | [diff] [blame] | 125 | LY_ERR ly_path_parse_predicate(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const char *str_path, |
Michal Vasko | 32ca49b | 2023-02-17 15:11:35 +0100 | [diff] [blame] | 126 | size_t path_len, uint16_t prefix, uint16_t pred, struct lyxp_expr **expr); |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 127 | |
| 128 | /** |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 129 | * @defgroup path_oper_options Path operation options. |
| 130 | * @{ |
| 131 | */ |
| 132 | #define LY_PATH_OPER_INPUT 0x01 /**< if any RPC/action is traversed, its input nodes are used */ |
| 133 | #define LY_PATH_OPER_OUTPUT 0x02 /**< if any RPC/action is traversed, its output nodes are used */ |
| 134 | /** @} */ |
| 135 | |
| 136 | /* lref */ |
| 137 | |
| 138 | /** |
| 139 | * @defgroup path_target_options Path target options. |
| 140 | * @{ |
| 141 | */ |
| 142 | #define LY_PATH_TARGET_SINGLE 0x10 /**< last (target) node must identify an exact instance */ |
| 143 | #define LY_PATH_TARGET_MANY 0x20 /**< last (target) node may identify all instances (of leaf-list/list) */ |
| 144 | /** @} */ |
| 145 | |
| 146 | /** |
Michal Vasko | ed725d7 | 2021-06-23 12:03:45 +0200 | [diff] [blame] | 147 | * @brief Compile path into ly_path structure. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 148 | * |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 149 | * @param[in] ctx libyang context. |
Michal Vasko | ed725d7 | 2021-06-23 12:03:45 +0200 | [diff] [blame] | 150 | * @param[in] cur_mod Current module of the path (where it was "instantiated"). Used for nodes in schema-nodeid |
Radek Krejci | 84d7fd7 | 2021-07-14 18:32:21 +0200 | [diff] [blame] | 151 | * without a prefix for ::LY_VALUE_SCHEMA and ::LY_VALUE_SCHEMA_RESOLVED format. |
Michal Vasko | 6b26e74 | 2020-07-17 15:02:10 +0200 | [diff] [blame] | 152 | * @param[in] ctx_node Optional context node. |
Michal Vasko | 8cc3f66 | 2022-03-29 11:25:51 +0200 | [diff] [blame] | 153 | * @param[in] top_ext Extension instance containing the definition of the data being created. It is used to find the top-level |
Radek Krejci | d5d3743 | 2021-03-12 13:46:40 +0100 | [diff] [blame] | 154 | * node inside the extension instance instead of a module. Note that this is the case not only if the @p ctx_node is NULL, |
| 155 | * but also if the relative path starting in @p ctx_node reaches the document root via double dots. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 156 | * @param[in] expr Parsed path. |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 157 | * @param[in] oper Oper option (@ref path_oper_options). |
| 158 | * @param[in] target Target option (@ref path_target_options). |
Michal Vasko | 0884d21 | 2021-10-14 09:21:46 +0200 | [diff] [blame] | 159 | * @param[in] limit_access_tree Whether to limit accessible tree. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 160 | * @param[in] format Format of the path. |
Michal Vasko | c8a230d | 2020-08-14 12:17:10 +0200 | [diff] [blame] | 161 | * @param[in] prefix_data Format-specific data for resolving any prefixes (see ::ly_resolve_prefix). |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 162 | * @param[out] path Compiled path. |
| 163 | * @return LY_ERR value. |
| 164 | */ |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 165 | LY_ERR ly_path_compile(const struct ly_ctx *ctx, const struct lys_module *cur_mod, const struct lysc_node *ctx_node, |
Michal Vasko | 32ca49b | 2023-02-17 15:11:35 +0100 | [diff] [blame] | 166 | const struct lysc_ext_instance *top_ext, const struct lyxp_expr *expr, uint16_t oper, uint16_t target, |
Michal Vasko | 0884d21 | 2021-10-14 09:21:46 +0200 | [diff] [blame] | 167 | ly_bool limit_access_tree, LY_VALUE_FORMAT format, void *prefix_data, struct ly_path **path); |
Michal Vasko | ed725d7 | 2021-06-23 12:03:45 +0200 | [diff] [blame] | 168 | |
| 169 | /** |
| 170 | * @brief Compile path into ly_path structure. Any predicates of a leafref are only checked, not compiled. |
| 171 | * |
| 172 | * @param[in] ctx libyang context. |
| 173 | * @param[in] ctx_node Context node. |
Michal Vasko | 8cc3f66 | 2022-03-29 11:25:51 +0200 | [diff] [blame] | 174 | * @param[in] top_ext Extension instance containing the definition of the data being created. It is used to find the top-level |
Michal Vasko | ed725d7 | 2021-06-23 12:03:45 +0200 | [diff] [blame] | 175 | * node inside the extension instance instead of a module. Note that this is the case not only if the @p ctx_node is NULL, |
| 176 | * but also if the relative path starting in @p ctx_node reaches the document root via double dots. |
| 177 | * @param[in] expr Parsed path. |
| 178 | * @param[in] oper Oper option (@ref path_oper_options). |
| 179 | * @param[in] target Target option (@ref path_target_options). |
| 180 | * @param[in] format Format of the path. |
| 181 | * @param[in] prefix_data Format-specific data for resolving any prefixes (see ::ly_resolve_prefix). |
Michal Vasko | ed725d7 | 2021-06-23 12:03:45 +0200 | [diff] [blame] | 182 | * @param[out] path Compiled path. |
Michal Vasko | ed725d7 | 2021-06-23 12:03:45 +0200 | [diff] [blame] | 183 | * @return LY_ERR value. |
| 184 | */ |
| 185 | LY_ERR ly_path_compile_leafref(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, |
Michal Vasko | 32ca49b | 2023-02-17 15:11:35 +0100 | [diff] [blame] | 186 | const struct lysc_ext_instance *top_ext, const struct lyxp_expr *expr, uint16_t oper, uint16_t target, |
Michal Vasko | 24fc4d1 | 2021-07-12 14:41:20 +0200 | [diff] [blame] | 187 | LY_VALUE_FORMAT format, void *prefix_data, struct ly_path **path); |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 188 | |
| 189 | /** |
| 190 | * @brief Compile predicate into ly_path_predicate structure. Only simple predicates (not leafref) are supported. |
| 191 | * |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 192 | * @param[in] ctx libyang context. |
Michal Vasko | 6b26e74 | 2020-07-17 15:02:10 +0200 | [diff] [blame] | 193 | * @param[in] cur_node Optional current (original context) node. |
Michal Vasko | 5d24f6c | 2020-10-13 13:49:06 +0200 | [diff] [blame] | 194 | * @param[in] cur_mod Current module of the path (where it was "instantiated"). Used for nodes without a prefix |
Radek Krejci | 84d7fd7 | 2021-07-14 18:32:21 +0200 | [diff] [blame] | 195 | * for ::LY_VALUE_SCHEMA and ::LY_VALUE_SCHEMA_RESOLVED format. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 196 | * @param[in] ctx_node Context node, node for which the predicate is defined. |
| 197 | * @param[in] expr Parsed path. |
| 198 | * @param[in,out] tok_idx Index in @p expr, is adjusted for parsed tokens. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 199 | * @param[in] format Format of the path. |
Michal Vasko | c8a230d | 2020-08-14 12:17:10 +0200 | [diff] [blame] | 200 | * @param[in] prefix_data Format-specific data for resolving any prefixes (see ::ly_resolve_prefix). |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 201 | * @param[out] predicates Compiled predicates. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 202 | * @return LY_ERR value. |
| 203 | */ |
Michal Vasko | 6b26e74 | 2020-07-17 15:02:10 +0200 | [diff] [blame] | 204 | LY_ERR ly_path_compile_predicate(const struct ly_ctx *ctx, const struct lysc_node *cur_node, const struct lys_module *cur_mod, |
Michal Vasko | dd528af | 2022-08-08 14:35:07 +0200 | [diff] [blame] | 205 | const struct lysc_node *ctx_node, const struct lyxp_expr *expr, uint32_t *tok_idx, LY_VALUE_FORMAT format, |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 206 | void *prefix_data, struct ly_path_predicate **predicates); |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 207 | |
| 208 | /** |
| 209 | * @brief Resolve at least partially the target defined by ly_path structure. Not supported for leafref! |
| 210 | * |
| 211 | * @param[in] path Path structure specifying the target. |
| 212 | * @param[in] start Starting node for relative paths, can be any for absolute paths. |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 213 | * @param[in] vars Array of defined variables to use in predicates, may be NULL. |
Michal Vasko | 00cbf53 | 2020-06-15 13:58:47 +0200 | [diff] [blame] | 214 | * @param[out] path_idx Last found path segment index, can be NULL, set to 0 if not found. |
| 215 | * @param[out] match Last found matching node, can be NULL, set to NULL if not found. |
| 216 | * @return LY_ENOTFOUND if no nodes were found, |
| 217 | * @return LY_EINCOMPLETE if some node was found but not the last one, |
| 218 | * @return LY_SUCCESS when the last node in the path was found, |
| 219 | * @return LY_ERR on another error. |
| 220 | */ |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 221 | LY_ERR ly_path_eval_partial(const struct ly_path *path, const struct lyd_node *start, const struct lyxp_var *vars, |
| 222 | LY_ARRAY_COUNT_TYPE *path_idx, struct lyd_node **match); |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 223 | |
| 224 | /** |
| 225 | * @brief Resolve the target defined by ly_path structure. Not supported for leafref! |
| 226 | * |
| 227 | * @param[in] path Path structure specifying the target. |
| 228 | * @param[in] start Starting node for relative paths, can be any for absolute paths. |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 229 | * @param[in] vars Array of defined variables to use in predicates, may be NULL. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 230 | * @param[out] match Found matching node, can be NULL, set to NULL if not found. |
| 231 | * @return LY_ENOTFOUND if no nodes were found, |
| 232 | * @return LY_SUCCESS when the last node in the path was found, |
| 233 | * @return LY_ERR on another error. |
| 234 | */ |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 235 | LY_ERR ly_path_eval(const struct ly_path *path, const struct lyd_node *start, const struct lyxp_var *vars, |
| 236 | struct lyd_node **match); |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 237 | |
| 238 | /** |
| 239 | * @brief Duplicate ly_path structure. |
| 240 | * |
| 241 | * @param[in] ctx libyang context. |
| 242 | * @param[in] path Path to duplicate. |
| 243 | * @param[out] dup Duplicated path. |
| 244 | * @return LY_ERR value. |
| 245 | */ |
| 246 | LY_ERR ly_path_dup(const struct ly_ctx *ctx, const struct ly_path *path, struct ly_path **dup); |
| 247 | |
| 248 | /** |
| 249 | * @brief Free ly_path_predicate structure. |
| 250 | * |
| 251 | * @param[in] ctx libyang context. |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 252 | * @param[in] predicates Predicates ([sized array](@ref sizedarrays)) to free. |
| 253 | */ |
Michal Vasko | 9018996 | 2023-02-28 12:10:34 +0100 | [diff] [blame] | 254 | void ly_path_predicates_free(const struct ly_ctx *ctx, struct ly_path_predicate *predicates); |
Michal Vasko | 004d315 | 2020-06-11 19:59:22 +0200 | [diff] [blame] | 255 | |
| 256 | /** |
| 257 | * @brief Free ly_path structure. |
| 258 | * |
| 259 | * @param[in] ctx libyang context. |
| 260 | * @param[in] path The structure ([sized array](@ref sizedarrays)) to free. |
| 261 | */ |
| 262 | void ly_path_free(const struct ly_ctx *ctx, struct ly_path *path); |
| 263 | |
| 264 | #endif /* LY_PATH_H_ */ |