dictionary REFACTOR unify functions pattern to return LY_ERR
Change API functions manipulating with libyang dictionary to return
LY_ERR value as a primary indicator of the result and the value from the
dictionary is returned via optional output parameter.
diff --git a/src/tree_data_free.c b/src/tree_data_free.c
index 176d39f..333c5d6 100644
--- a/src/tree_data_free.c
+++ b/src/tree_data_free.c
@@ -77,7 +77,7 @@
}
static void
-ly_free_attr(const struct ly_ctx *ctx, struct lyd_attr *attr, ly_bool siblings)
+lyd_free_attr(const struct ly_ctx *ctx, struct lyd_attr *attr, ly_bool siblings)
{
struct lyd_attr *iter;
LY_ARRAY_COUNT_TYPE u;
@@ -128,15 +128,15 @@
}
API void
-ly_free_attr_single(const struct ly_ctx *ctx, struct lyd_attr *attr)
+lyd_free_attr_single(const struct ly_ctx *ctx, struct lyd_attr *attr)
{
- ly_free_attr(ctx, attr, 0);
+ lyd_free_attr(ctx, attr, 0);
}
API void
-ly_free_attr_siblings(const struct ly_ctx *ctx, struct lyd_attr *attr)
+lyd_free_attr_siblings(const struct ly_ctx *ctx, struct lyd_attr *attr)
{
- ly_free_attr(ctx, attr, 1);
+ lyd_free_attr(ctx, attr, 1);
}
void
@@ -197,7 +197,7 @@
}
if (!node->schema) {
- ly_free_attr_siblings(LYD_CTX(node), opaq->attr);
+ lyd_free_attr_siblings(LYD_CTX(node), opaq->attr);
} else {
/* free the node's metadata */
lyd_free_meta_siblings(node->meta);