libyang CHANGE add LY_VALUE_CANON
Add a separate value format of the canonical representation of the type.
The print callback API of the type plugins was modified to reflect the
need of creating canonical representation of the value.
diff --git a/src/tree_data_helpers.c b/src/tree_data_helpers.c
index 73a5750..76539a5 100644
--- a/src/tree_data_helpers.c
+++ b/src/tree_data_helpers.c
@@ -420,6 +420,7 @@
}
LY_ARRAY_FREE(prefixes);
break;
+ case LY_VALUE_CANON:
case LY_VALUE_SCHEMA:
case LY_VALUE_JSON:
break;
@@ -477,6 +478,7 @@
LY_CHECK_ERR_GOTO(!ns->uri, LOGMEM(ctx); ret = LY_EMEM, cleanup);
}
break;
+ case LY_VALUE_CANON:
case LY_VALUE_JSON:
assert(!prefix_data);
*prefix_data_p = NULL;
@@ -579,6 +581,7 @@
}
}
break;
+ case LY_VALUE_CANON:
case LY_VALUE_SCHEMA_RESOLVED:
case LY_VALUE_JSON:
if (!*prefix_data_p) {
@@ -601,6 +604,8 @@
ly_format2str(LY_VALUE_FORMAT format)
{
switch (format) {
+ case LY_VALUE_CANON:
+ return "canonical";
case LY_VALUE_SCHEMA:
return "schema imports";
case LY_VALUE_SCHEMA_RESOLVED: