rearranged default code to be outside of copying in xml_get inner loop, and that no defaults are computed if no yang binding is made

This commit is contained in:
Olof hagsand 2020-09-09 15:52:54 +02:00
parent 8f8b49331f
commit 804b329301
10 changed files with 251 additions and 166 deletions

View file

@ -141,12 +141,12 @@ typedef struct clixon_xml_vec clixon_xvec; /* struct defined in clicon_xml_vec.c
/*
* xml_flag() flags:
*/
#define XML_FLAG_MARK 0x01 /* Marker for dynamic algorithms, eg expand */
#define XML_FLAG_ADD 0x02 /* Node is added (commits) or parent added rec*/
#define XML_FLAG_DEL 0x04 /* Node is deleted (commits) or parent deleted rec */
#define XML_FLAG_CHANGE 0x08 /* Node is changed (commits) or child changed rec */
#define XML_FLAG_NONE 0x10 /* Node is added as NONE */
#define XML_FLAG_DEFAULT 0x20 /* Added when a value is set as default @see xml_default */
#define XML_FLAG_MARK 0x01 /* Marker for dynamic algorithms, eg expand */
#define XML_FLAG_ADD 0x02 /* Node is added (commits) or parent added rec*/
#define XML_FLAG_DEL 0x04 /* Node is deleted (commits) or parent deleted rec */
#define XML_FLAG_CHANGE 0x08 /* Node is changed (commits) or child changed rec */
#define XML_FLAG_NONE 0x10 /* Node is added as NONE */
#define XML_FLAG_DEFAULT 0x20 /* Added when a value is set as default @see xml_default */
/*
* Prototypes

View file

@ -66,7 +66,7 @@ int xml_tree_prune_flagged(cxobj *xt, int flag, int test);
int xml_namespace_change(cxobj *x, char *ns, char *prefix);
int xml_default(cxobj *x);
int xml_default_recurse(cxobj *xn);
int xml_default_yspec(yang_stmt *yspec, cxobj *xn);
int xml_global_defaults(clicon_handle h, cxobj *xn, cvec *nsc, const char *xpath, yang_stmt *yspec);
int xml_nopresence_default(cxobj *xt);
int xml_nopresence_default_mark(cxobj *x, void *arg);
int xml_sanity(cxobj *x, void *arg);
@ -77,5 +77,6 @@ int assign_namespace_element(cxobj *x0, cxobj *x1, cxobj *x1p);
int assign_namespace_body(cxobj *x0, char *x0bstr, cxobj *x1);
int xml_merge(cxobj *x0, cxobj *x1, yang_stmt *yspec, char **reason);
int yang_enum_int_value(cxobj *node, int32_t *val);
int xml_copy_marked(cxobj *x0, cxobj *x1);
#endif /* _CLIXON_XML_MAP_H_ */