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:
Olof hagsand 2023-04-12 09:54:37 +02:00
parent 819a0b5a9e
commit 6335f810d3
43 changed files with 309 additions and 149 deletions

View file

@ -478,7 +478,7 @@ get_nacm_and_reply(clicon_handle h,
if (xml_name_set(xret, NETCONF_OUTPUT_DATA) < 0)
goto done;
/* Top level is data, so add 1 to depth if significant */
if (clixon_xml2cbuf(cbret, xret, 0, 0, depth>0?depth+1:depth, 0) < 0)
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, depth>0?depth+1:depth, 0) < 0)
goto done;
}
cprintf(cbret, "</rpc-reply>");
@ -755,7 +755,7 @@ get_list_pagination(clicon_handle h,
clicon_err_reason);
if (netconf_operation_failed_xml(&xerr, "application", cbuf_get(cberr)) < 0)
goto done;
if (clixon_xml2cbuf(cbret, xerr, 0, 0, -1, 0) < 0)
if (clixon_xml2cbuf(cbret, xerr, 0, 0, NULL, -1, 0) < 0)
goto done;
goto ok;
}
@ -769,7 +769,7 @@ get_list_pagination(clicon_handle h,
". Internal error, state callback returned invalid XML",
NULL) < 0)
goto done;
if (clixon_xml2cbuf(cbret, xerr, 0, 0, -1, 0) < 0)
if (clixon_xml2cbuf(cbret, xerr, 0, 0, NULL, -1, 0) < 0)
goto done;
goto ok;
}
@ -1001,7 +1001,7 @@ get_common(clicon_handle h,
if ((ret = get_statedata(h, xpath?xpath:"/", nsc, wdef, &xret)) < 0)
goto done;
if (ret == 0){ /* Error from callback (error in xret) */
if (clixon_xml2cbuf(cbret, xret, 0, 0, -1, 0) < 0)
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, -1, 0) < 0)
goto done;
goto ok;
}
@ -1024,7 +1024,7 @@ get_common(clicon_handle h,
". Internal error, state callback returned invalid XML",
NULL) < 0)
goto done;
if (clixon_xml2cbuf(cbret, xerr, 0, 0, -1, 0) < 0)
if (clixon_xml2cbuf(cbret, xerr, 0, 0, NULL, -1, 0) < 0)
goto done;
goto ok;
}