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:
parent
5be5b02a84
commit
04017c97ba
23 changed files with 57 additions and 54 deletions
|
|
@ -225,11 +225,7 @@ keyval_pos(char *uint)
|
|||
goto done;
|
||||
}
|
||||
cv = cvec_i(cvv, 0);
|
||||
if (cv_type_set(cv, CGV_UINT32) < 0){
|
||||
clicon_err(OE_UNIX, errno, "cv_type_set");
|
||||
cvv = NULL;
|
||||
goto done;
|
||||
}
|
||||
cv_type_set(cv, CGV_UINT32);
|
||||
if ((ret = cv_parse1(uint, cv, &reason)) < 0){
|
||||
clicon_err(OE_UNIX, errno, "cv_parse1");
|
||||
cvv = NULL;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ struct clixon_json_yacc {
|
|||
cxobj *jy_xtop; /* cxobj top element (fixed) */
|
||||
cxobj *jy_current; /* cxobj active element (changes with parse context) */
|
||||
cxobj **jy_xvec; /* Vector of created top-level nodes (to know which are created) */
|
||||
size_t jy_xlen; /* Length of jy_xvec */
|
||||
int jy_xlen; /* Length of jy_xvec */
|
||||
};
|
||||
typedef struct clixon_json_yacc clixon_json_yacc;
|
||||
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ nacm_datanode_prepare(clicon_handle h,
|
|||
cvec *nsc0 = NULL; /* Non-canonical namespace context */
|
||||
yang_stmt *yspec;
|
||||
cxobj **xvec = NULL;
|
||||
size_t xlen = 0;
|
||||
int xlen = 0;
|
||||
int ret;
|
||||
|
||||
yspec = clicon_dbspec_yang(h);
|
||||
|
|
@ -422,7 +422,7 @@ nacm_datanode_prepare(clicon_handle h,
|
|||
if (ret == 0)
|
||||
continue;
|
||||
if (xlen > 1)
|
||||
clicon_log(LOG_WARNING, "%s path:%s Clixon only supports single returns, this had: %lu", __FUNCTION__, path, xlen);
|
||||
clicon_log(LOG_WARNING, "%s path:%s Clixon only supports single returns, this had: %d", __FUNCTION__, path, xlen);
|
||||
if (clixon_xvec_append(xpathvec, xvec?xvec[0]:NULL) < 0) /* XXX: vector of vectors? */
|
||||
goto done;
|
||||
if (xvec){
|
||||
|
|
|
|||
|
|
@ -1507,7 +1507,7 @@ int
|
|||
clixon_xml_find_api_path(cxobj *xt,
|
||||
yang_stmt *yt,
|
||||
cxobj ***xvec,
|
||||
size_t *xlen,
|
||||
int *xlen,
|
||||
char *format,
|
||||
...)
|
||||
{
|
||||
|
|
@ -1584,7 +1584,7 @@ clixon_xml_find_api_path(cxobj *xt,
|
|||
* - Number of keys in key-value list does not match Yang list
|
||||
* @code
|
||||
* cxobj **vec = NULL;
|
||||
* size_t len = 0;
|
||||
* int len = 0;
|
||||
* if (clixon_xml_find_instance_id(x, yspec, &vec, &len, "/symbol/%s", "foo") < 0)
|
||||
* goto err;
|
||||
* for (i=0; i<len; i++){
|
||||
|
|
@ -1601,7 +1601,7 @@ int
|
|||
clixon_xml_find_instance_id(cxobj *xt,
|
||||
yang_stmt *yt,
|
||||
cxobj ***xvec,
|
||||
size_t *xlen,
|
||||
int *xlen,
|
||||
char *format,
|
||||
...)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ xml_stats_one(cxobj *x,
|
|||
}
|
||||
if (szp)
|
||||
*szp = sz;
|
||||
clicon_debug(1, "%s %" PRIu64, __FUNCTION__, sz);
|
||||
clicon_debug(1, "%s %zu", __FUNCTION__, sz);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -307,7 +307,7 @@ xml_stats(cxobj *xt,
|
|||
if (szp)
|
||||
*szp += sz;
|
||||
}
|
||||
clicon_debug(1, "%s %" PRIu64, __FUNCTION__, *szp);
|
||||
clicon_debug(1, "%s %zu", __FUNCTION__, *szp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1911,9 +1911,9 @@ xml_dup(cxobj *x0)
|
|||
*/
|
||||
int
|
||||
cxvec_dup(cxobj **vec0,
|
||||
size_t len0,
|
||||
int len0,
|
||||
cxobj ***vec1,
|
||||
size_t *len1)
|
||||
int *len1)
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
|
|
@ -1934,7 +1934,7 @@ cxvec_dup(cxobj **vec0,
|
|||
* @retval -1 Error
|
||||
* @code
|
||||
* cxobj **xvec = NULL;
|
||||
* size_t xlen = 0;
|
||||
* int xlen = 0;
|
||||
* cxobj *x;
|
||||
*
|
||||
* if (cxvec_append(x, &xvec, &xlen) < 0)
|
||||
|
|
@ -1943,11 +1943,12 @@ cxvec_dup(cxobj **vec0,
|
|||
* free(xvec);
|
||||
* @endcode
|
||||
* @see cxvec_prepend
|
||||
* @see clixon_cxvec_append which is its own encapsulated xml vector datatype
|
||||
*/
|
||||
int
|
||||
cxvec_append(cxobj *x,
|
||||
cxobj ***vec,
|
||||
size_t *len)
|
||||
int *len)
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
|
|
@ -1978,11 +1979,12 @@ cxvec_append(cxobj *x,
|
|||
* free(xvec);
|
||||
* @endcode
|
||||
* @see cxvec_prepend
|
||||
* @see clixon_cxvec_prepend which is its own encapsulated xml vector datatype
|
||||
*/
|
||||
int
|
||||
cxvec_prepend(cxobj *x,
|
||||
cxobj ***vec,
|
||||
size_t *len)
|
||||
int *len)
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
|
|
|
|||
|
|
@ -443,12 +443,12 @@ xml_diff1(yang_stmt *ys,
|
|||
cxobj *x0,
|
||||
cxobj *x1,
|
||||
cxobj ***x0vec,
|
||||
size_t *x0veclen,
|
||||
int *x0veclen,
|
||||
cxobj ***x1vec,
|
||||
size_t *x1veclen,
|
||||
int *x1veclen,
|
||||
cxobj ***changed_x0,
|
||||
cxobj ***changed_x1,
|
||||
size_t *changedlen)
|
||||
int *changedlen)
|
||||
{
|
||||
int retval = -1;
|
||||
cxobj *x0c = NULL; /* x0 child */
|
||||
|
|
@ -551,12 +551,12 @@ xml_diff(yang_stmt *yspec,
|
|||
cxobj *x0,
|
||||
cxobj *x1,
|
||||
cxobj ***first,
|
||||
size_t *firstlen,
|
||||
int *firstlen,
|
||||
cxobj ***second,
|
||||
size_t *secondlen,
|
||||
int *secondlen,
|
||||
cxobj ***changed_x0,
|
||||
cxobj ***changed_x1,
|
||||
size_t *changedlen)
|
||||
int *changedlen)
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ struct clixon_xml_parse_yacc {
|
|||
yang_stmt *xy_yspec; /* If set, top-level yang-spec */
|
||||
int xy_lex_state; /* lex return state */
|
||||
cxobj **xy_xvec; /* Vector of created top-level nodes (to know which are created) */
|
||||
size_t xy_xlen; /* Length of xy_xvec */
|
||||
int xy_xlen; /* Length of xy_xvec */
|
||||
};
|
||||
typedef struct clixon_xml_parse_yacc clixon_xml_yacc;
|
||||
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ clixon_xvec_i(clixon_xvec *xv,
|
|||
int
|
||||
clixon_xvec_extract(clixon_xvec *xv,
|
||||
cxobj ***xvec,
|
||||
size_t *xlen)
|
||||
int *xlen)
|
||||
{
|
||||
int retval = -1;
|
||||
|
||||
|
|
|
|||
|
|
@ -770,7 +770,7 @@ xpath_vec(cxobj *xcur,
|
|||
* @retval -1 error.
|
||||
* @code
|
||||
* cxobj **vec;
|
||||
* size_t veclen;
|
||||
* int veclen;
|
||||
* cvec *nsc; // namespace context (not NULL)
|
||||
* if (xpath_vec_flag(xcur, nsc, "//symbol/foo", XML_FLAG_ADD, &vec, &veclen) < 0)
|
||||
* goto err;
|
||||
|
|
@ -789,7 +789,7 @@ xpath_vec_flag(cxobj *xcur,
|
|||
char *xpformat,
|
||||
uint16_t flags,
|
||||
cxobj ***vec,
|
||||
size_t *veclen,
|
||||
int *veclen,
|
||||
...)
|
||||
{
|
||||
int retval = -1;
|
||||
|
|
|
|||
|
|
@ -253,12 +253,12 @@ nodetest_recursive(cxobj *xn,
|
|||
cvec *nsc,
|
||||
int localonly,
|
||||
cxobj ***vec0,
|
||||
size_t *vec0len)
|
||||
int *vec0len)
|
||||
{
|
||||
int retval = -1;
|
||||
cxobj *xsub;
|
||||
cxobj **vec = *vec0;
|
||||
size_t veclen = *vec0len;
|
||||
int veclen = *vec0len;
|
||||
|
||||
xsub = NULL;
|
||||
while ((xsub = xml_child_each(xn, xsub, node_type)) != NULL) {
|
||||
|
|
@ -306,7 +306,7 @@ xp_eval_step(xp_ctx *xc0,
|
|||
cxobj *xv;
|
||||
cxobj *xp;
|
||||
cxobj **vec = NULL;
|
||||
size_t veclen = 0;
|
||||
int veclen = 0;
|
||||
xpath_tree *nodetest = xs->xs_c0;
|
||||
xp_ctx *xc = NULL;
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ int
|
|||
xpath_optimize_check(xpath_tree *xs,
|
||||
cxobj *xv,
|
||||
cxobj ***xvec0,
|
||||
size_t *xlen0)
|
||||
int *xlen0)
|
||||
{
|
||||
#ifdef XPATH_LIST_OPTIMIZE
|
||||
int ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue