plugins types CHANGE compare function callback
The function now has a new context parameter that may be needed when
getting the canonical value. Type API version number has increased.
diff --git a/src/tree_data.c b/src/tree_data.c
index 59b44d8..0d10d72 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1589,6 +1589,8 @@
LIBYANG_API_DEF LY_ERR
lyd_compare_meta(const struct lyd_meta *meta1, const struct lyd_meta *meta2)
{
+ const struct ly_ctx *ctx;
+
if (!meta1 || !meta2) {
if (meta1 == meta2) {
return LY_SUCCESS;
@@ -1597,11 +1599,12 @@
}
}
- if ((meta1->annotation->module->ctx != meta2->annotation->module->ctx) || (meta1->annotation != meta2->annotation)) {
+ ctx = meta1->annotation->module->ctx;
+ if ((ctx != meta2->annotation->module->ctx) || (meta1->annotation != meta2->annotation)) {
return LY_ENOT;
}
- return meta1->value.realtype->plugin->compare(&meta1->value, &meta2->value);
+ return meta1->value.realtype->plugin->compare(ctx, &meta1->value, &meta2->value);
}
/**