Removed YANG_ORDERING_WHEN_LAST compile-time option (obsolete since 5.4)

This commit is contained in:
Olof hagsand 2022-11-07 10:47:08 +01:00
parent 1683723b1d
commit d5c657bde3
3 changed files with 4 additions and 19 deletions

View file

@ -80,6 +80,8 @@ Developers may need to change their code
### Minor features
* Removed `YANG_ORDERING_WHEN_LAST` compile-time option (obsolete since 5.4)
* See https://github.com/clicon/clixon/issues/287
* Removed `JSON_CDATA_STRIP` compile-time option (obsolete since 5.4)
* Added fuzz code for xpath
* List-pagination: Follow ietf-draft 100%: Removed list-pagination "presence"

View file

@ -127,17 +127,6 @@
*/
#undef LIST_PAGINATION_REMAINING
/*!
* RFC 7950 generally does not specify an XML/JSON encoding order of sub-elements of list or
* containers. See sections 7.5.7 and 7.8.5
* There are some exceptions, eg rpc/action input/output or list key elements
* Clixon by default encodes them in yang order.
* Set this option if you want sub-elements with WHEN sub-statements last
* See https://github.com/clicon/clixon/issues/287
* Consider enabling this option permanently after 5.4
*/
#define YANG_ORDERING_WHEN_LAST
/*! Use Ancestor config cache
* The cache uses two yang stmt flag bits. One to say it is active, the second its value
*/

View file

@ -3673,7 +3673,6 @@ yang_extension_value(yang_stmt *ys,
return retval;
}
#ifdef YANG_ORDERING_WHEN_LAST
/* Sort substatements with when:s last */
static int
yang_sort_subelements_fn(const void* arg1,
@ -3694,7 +3693,6 @@ yang_sort_subelements_fn(const void* arg1,
return -1;
else return ys1->_ys_vector_i - ys2->_ys_vector_i;
}
#endif
/*! Experimental code for sorting YANG children
*
@ -3707,19 +3705,15 @@ yang_sort_subelements_fn(const void* arg1,
int
yang_sort_subelements(yang_stmt *ys)
{
int retval = -1;
int retval = -1;
yang_stmt *yc = NULL;
#ifdef YANG_ORDERING_WHEN_LAST
if ((yang_keyword_get(ys) == Y_CONTAINER ||
yang_keyword_get(ys) == Y_LIST)){
yang_stmt *yc = NULL;
/* This enumerates _ys_vector_i in ys->ys_stmt vector */
while ((yc = yn_each(ys, yc)) != NULL) ;
qsort(ys->ys_stmt, ys->ys_len, sizeof(ys), yang_sort_subelements_fn);
}
#endif
retval = 0;
// done:
return retval;