Changed C-API for xml translation/print the internal cxobj tree data structure to other formats

New API is as follows:
  * `clixon_xml2file()` - Print internal tree as XML to file
  * `clixon_xml2cbuf()` - Print internal tree as XML to buffer
  * `clixon_json2file()` - Print internal tree as JSON to file
  * `clixon_json2cbuf()` - Print internal tree as JSON to buffer
  * `clixon_cli2file()` - Print internal tree as CLI format to file
  * `clixon_txt2file()` - Print internal tree as text format to file
This commit is contained in:
Olof hagsand 2022-06-01 20:02:27 +02:00
parent 87719c623c
commit 0c79298e76
49 changed files with 421 additions and 503 deletions

View file

@ -481,7 +481,7 @@ netconf_notification_cb(int s,
clicon_err(OE_PLUGIN, errno, "cbuf_new");
goto done;
}
if (clicon_xml2cbuf(cb, xn, 0, 0, -1, 0) < 0)
if (clixon_xml2cbuf(cb, xn, 0, 0, -1, 0) < 0)
goto done;
/* Send it to listening client on stdout */
if (netconf_output_encap(clicon_option_int(h, "netconf-framing"), cb) < 0){
@ -659,7 +659,7 @@ netconf_application_rpc(clicon_handle h,
if (ret > 0 && (ret = xml_yang_validate_add(h, xoutput, &xerr)) < 0)
goto done;
if (ret == 0){
if (clicon_xml2cbuf(cbret, xerr, 0, 0, -1, 0) < 0)
if (clixon_xml2cbuf(cbret, xerr, 0, 0, -1, 0) < 0)
goto done;
clicon_log(LOG_WARNING, "Errors in output netconf %s", cbuf_get(cbret));
goto ok;