C-API: clixon_xml2file and clixon_xml2cbuf added prefix argument
Added in-mem xml diff function: `xml_tree_diff_print`
This commit is contained in:
parent
819a0b5a9e
commit
6335f810d3
43 changed files with 309 additions and 149 deletions
|
|
@ -216,7 +216,7 @@ main(int argc, char **argv)
|
|||
xpath = "/";
|
||||
if (xmldb_get(h, db, NULL, xpath, &xt) < 0)
|
||||
goto done;
|
||||
if (clixon_xml2file(stdout, xt, 0, 0, fprintf, 0, 0) < 0)
|
||||
if (clixon_xml2file(stdout, xt, 0, 0, NULL, fprintf, 0, 0) < 0)
|
||||
goto done;
|
||||
fprintf(stdout, "\n");
|
||||
if (xt){
|
||||
|
|
@ -240,7 +240,7 @@ main(int argc, char **argv)
|
|||
clicon_err(OE_DB, 0, "xt is NULL");
|
||||
goto done;
|
||||
}
|
||||
if (clixon_xml2file(stdout, xt, 0, 0, fprintf, 0, 0) < 0)
|
||||
if (clixon_xml2file(stdout, xt, 0, 0, NULL, fprintf, 0, 0) < 0)
|
||||
goto done;
|
||||
if (xt){
|
||||
xml_free(xt);
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ main(int argc,
|
|||
if (clixon_json2cbuf(cb, xt, pretty, 1, 0) < 0)
|
||||
goto done;
|
||||
}
|
||||
else if (clixon_xml2cbuf(cb, xt, 0, pretty, -1, 1) < 0)
|
||||
else if (clixon_xml2cbuf(cb, xt, 0, pretty, NULL, -1, 1) < 0)
|
||||
goto done;
|
||||
fprintf(stdout, "%s", cbuf_get(cb));
|
||||
fflush(stdout);
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ main(int argc,
|
|||
for (i = 0; i < xlen; i++){
|
||||
xc = xvec[i];
|
||||
fprintf(stdout, "%d: ", i);
|
||||
clixon_xml2file(stdout, xc, 0, 0, fprintf, 0, 0);
|
||||
clixon_xml2file(stdout, xc, 0, 0, NULL, fprintf, 0, 0);
|
||||
fprintf(stdout, "\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ main(int argc,
|
|||
fprintf(stderr, "No xml\n");
|
||||
goto done;
|
||||
}
|
||||
if (clixon_xml2cbuf(cb, xc, 0, 0, -1, 0) < 0)
|
||||
if (clixon_xml2cbuf(cb, xc, 0, 0, NULL, -1, 0) < 0)
|
||||
goto done;
|
||||
if ((msg = clicon_msg_encode(getpid(), "%s", cbuf_get(cb))) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ main(int argc,
|
|||
if (clixon_json2cbuf(cb, xt, pretty, 1, 0) < 0)
|
||||
goto done;
|
||||
}
|
||||
else if (clixon_xml2cbuf(cb, xt, 0, pretty, -1, 1) < 0)
|
||||
else if (clixon_xml2cbuf(cb, xt, 0, pretty, NULL, -1, 1) < 0)
|
||||
goto done;
|
||||
fprintf(stdout, "%s", cbuf_get(cb));
|
||||
fflush(stdout);
|
||||
|
|
|
|||
|
|
@ -282,11 +282,11 @@ main(int argc, char **argv)
|
|||
if (sort)
|
||||
xml_sort_recurse(xb);
|
||||
if (strcmp(xml_name(xb),"top")==0){
|
||||
if (clixon_xml2file(stdout, xb, 0, 0, fprintf, 1, 0) < 0)
|
||||
if (clixon_xml2file(stdout, xb, 0, 0, NULL, fprintf, 1, 0) < 0)
|
||||
goto done;
|
||||
}
|
||||
else{
|
||||
if (clixon_xml2file(stdout, xb, 0, 0, fprintf, 0, 0) < 0)
|
||||
if (clixon_xml2file(stdout, xb, 0, 0, NULL, fprintf, 0, 0) < 0)
|
||||
goto done;
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ ctx_print2(cbuf *cb,
|
|||
case XT_NODESET:
|
||||
for (i=0; i<xc->xc_size; i++){
|
||||
cprintf(cb, "%d:", i);
|
||||
if (clixon_xml2cbuf(cb, xc->xc_nodeset[i], 0, 0, -1, 0) < 0)
|
||||
if (clixon_xml2cbuf(cb, xc->xc_nodeset[i], 0, 0, NULL, -1, 0) < 0)
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue