Skip to content

Commit 21c11c2

Browse files
committed
tree data UPDATE schema node getter func
1 parent 838829d commit 21c11c2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/tree_data.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,14 @@ LIBYANG_API_DECL LY_ERR lyd_any_value_str(const struct lyd_node *any, char **val
11331133
LIBYANG_API_DECL LY_ERR lyd_any_copy_value(struct lyd_node *trg, const union lyd_any_value *value,
11341134
LYD_ANYDATA_VALUETYPE value_type);
11351135

1136+
/**
1137+
* @brief Get schema node of a data node. Useful especially for opaque nodes.
1138+
*
1139+
* @param[in] node Data node to use.
1140+
* @return Schema node represented by data @p node, NULL if there is none.
1141+
*/
1142+
const struct lysc_node *lyd_node_schema(const struct lyd_node *node);
1143+
11361144
/**
11371145
* @brief Create a new inner node in the data tree.
11381146
*

src/tree_data_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ lyd_any_copy_value(struct lyd_node *trg, const union lyd_any_value *value, LYD_A
10911091
return LY_SUCCESS;
10921092
}
10931093

1094-
const struct lysc_node *
1094+
LIBYANG_API_DEF const struct lysc_node *
10951095
lyd_node_schema(const struct lyd_node *node)
10961096
{
10971097
const struct lysc_node *schema = NULL;

src/tree_data_internal.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ const struct lys_module *lyd_mod_next_module(struct lyd_node *tree, const struct
116116
*/
117117
const struct lys_module *lyd_data_next_module(struct lyd_node **next, struct lyd_node **first);
118118

119-
/**
120-
* @brief Get schema node of a data node. Useful especially for opaque nodes.
121-
*
122-
* @param[in] node Data node to use.
123-
* @return Schema node represented by data @p node, NULL if there is none.
124-
*/
125-
const struct lysc_node *lyd_node_schema(const struct lyd_node *node);
126-
127119
/**
128120
* @brief Set dflt flag for a NP container if applicable, recursively for parents.
129121
*

0 commit comments

Comments
 (0)