Length of xml vector in many structs changed from to since it is a vector size, not byte size. This includes transaction_data_t

This commit is contained in:
Olof hagsand 2020-04-21 10:16:55 +02:00
parent 5be5b02a84
commit 04017c97ba
23 changed files with 57 additions and 54 deletions

View file

@ -85,13 +85,13 @@ int api_path2xml(char *api_path, yang_stmt *yspec, cxobj *xtop,
cxobj **xpathp, yang_stmt **ypathp, cxobj **xerr);
int xml2api_path_1(cxobj *x, cbuf *cb);
#if defined(__GNUC__) && __GNUC__ >= 3
int clixon_xml_find_api_path(cxobj *xt, yang_stmt *yt, cxobj ***xvec, size_t *xlen, char *format,
int clixon_xml_find_api_path(cxobj *xt, yang_stmt *yt, cxobj ***xvec, int *xlen, char *format,
...) __attribute__ ((format (printf, 5, 6)));;
int clixon_xml_find_instance_id(cxobj *xt, yang_stmt *yt, cxobj ***xvec, size_t *xlen, char *format,
int clixon_xml_find_instance_id(cxobj *xt, yang_stmt *yt, cxobj ***xvec, int *xlen, char *format,
...) __attribute__ ((format (printf, 5, 6)));;
#else
int clixon_xml_find_api_path(cxobj *xt, yang_stmt *yt, clixon_xvec **xvec, char *format, ...);
int clixon_xml_find_instance_id(cxobj *xt, yang_stmt *yt, clixon_xvec **xvec, char *format, ...);
int clixon_xml_find_api_path(cxobj *xt, yang_stmt *yt, cxobj ***xvec, int *xlen, char *format, ...);
int clixon_xml_find_instance_id(cxobj *xt, yang_stmt *yt, cxobj ***xvec, int *xlen, char *format, ...);
#endif
#endif /* _CLIXON_PATH_H_ */

View file

@ -226,9 +226,9 @@ int xml_copy_one(cxobj *xn0, cxobj *xn1);
int xml_copy(cxobj *x0, cxobj *x1);
cxobj *xml_dup(cxobj *x0);
int cxvec_dup(cxobj **vec0, size_t len0, cxobj ***vec1, size_t *len1);
int cxvec_append(cxobj *x, cxobj ***vec, size_t *len);
int cxvec_prepend(cxobj *x, cxobj ***vec, size_t *len);
int cxvec_dup(cxobj **vec0, int len0, cxobj ***vec1, int *len1);
int cxvec_append(cxobj *x, cxobj ***vec, int *len);
int cxvec_prepend(cxobj *x, cxobj ***vec, int *len);
int xml_apply(cxobj *xn, enum cxobj_type type, xml_applyfn_t fn, void *arg);
int xml_apply0(cxobj *xn, enum cxobj_type type, xml_applyfn_t fn, void *arg);
int xml_apply_ancestor(cxobj *xn, xml_applyfn_t fn, void *arg);

View file

@ -53,9 +53,9 @@ int xmlns_assign(cxobj *x);
int xml2cvec(cxobj *xt, yang_stmt *ys, cvec **cvv0);
int cvec2xml_1(cvec *cvv, char *toptag, cxobj *xp, cxobj **xt0);
int xml_diff(yang_stmt *yspec, cxobj *x0, cxobj *x1,
cxobj ***first, size_t *firstlen,
cxobj ***second, size_t *secondlen,
cxobj ***changed_x0, cxobj ***changed_x1, size_t *changedlen);
cxobj ***first, int *firstlen,
cxobj ***second, int *secondlen,
cxobj ***changed_x0, cxobj ***changed_x1, int *changedlen);
int xml_tree_prune_flagged_sub(cxobj *xt, int flag, int test, int *upmark);
int xml_tree_prune_flagged(cxobj *xt, int flag, int test);
int xml_namespace_change(cxobj *x, char *namespace, char *prefix);

View file

@ -51,7 +51,7 @@ clixon_xvec *clixon_xvec_dup(clixon_xvec *xv0);
int clixon_xvec_free(clixon_xvec *xv);
int clixon_xvec_len(clixon_xvec *xv);
cxobj *clixon_xvec_i(clixon_xvec *xv, int i);
int clixon_xvec_extract(clixon_xvec *xv, cxobj ***xvec, size_t *xlen);
int clixon_xvec_extract(clixon_xvec *xv, cxobj ***xvec, int *xlen);
int clixon_xvec_append(clixon_xvec *xv, cxobj *x);
int clixon_xvec_prepend(clixon_xvec *xv, cxobj *x);
int clixon_xvec_insert_pos(clixon_xvec *xv, cxobj *x, int i);

View file

@ -135,12 +135,12 @@ int xpath_vec_ctx(cxobj *xcur, cvec *nsc, char *xpath, int localonly, xp_ctx
#if defined(__GNUC__) && __GNUC__ >= 3
int xpath_vec_bool(cxobj *xcur, cvec *nsc, char *xpformat, ...) __attribute__ ((format (printf, 3, 4)));
int xpath_vec_flag(cxobj *xcur, cvec *nsc, char *xpformat, uint16_t flags,
cxobj ***vec, size_t *veclen, ...) __attribute__ ((format (printf, 3, 7)));
cxobj ***vec, int *veclen, ...) __attribute__ ((format (printf, 3, 7)));
#else
int xpath_vec_bool(cxobj *xcur, cvec *nsc, char *xpformat, ...);
int xpath_vec_flag(cxobj *xcur, cvec *nsc, char *xpformat, uint16_t flags,
cxobj ***vec, size_t *veclen, ...);
cxobj ***vec, int *veclen, ...);
#endif
/* Functions with explicit namespace context (nsc) set. If you do not need

View file

@ -75,7 +75,7 @@ enum xp_objtype{
struct xp_ctx{
enum xp_objtype xc_type;
cxobj **xc_nodeset; /* if type XT_NODESET */
size_t xc_size; /* Length of nodeset */
int xc_size; /* Length of nodeset */
int xc_bool; /* if xc_type XT_BOOL */
double xc_number; /* if xc_type XT_NUMBER */
char *xc_string; /* if xc_type XT_STRING */

View file

@ -41,7 +41,10 @@
int xpath_list_optimize_stats(int *hits);
int xpath_list_optimize_set(int enable);
void xpath_optimize_exit(void);
//int xpath_optimize_check(xpath_tree *xs, cxobj *xv, cxobj ***xvec0, size_t *xlen0);
#if 0 /* XXX kludge for include file dependencies */
int xpath_optimize_check(xpath_tree *xs, cxobj *xv, cxobj ***xvec0, int *xlen0);
#else
int xpath_optimize_check();
#endif
#endif /* _CLIXON_XPATH_OPTIMIZE_H */