Skip to content

Commit

Permalink
Updated to changed clixon xml_chardata API
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed May 15, 2024
1 parent ef4dc00 commit b2b2a19
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/controller_cli_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,10 +955,10 @@ cli_rpc_controller_commit(clixon_handle h,
goto done;
if (keyname){
cprintf(cb, "<service-instance>");
if (xml_chardata_cbuf_append(cb, service) < 0)
if (xml_chardata_cbuf_append(cb, 0, service) < 0)
goto done;
cprintf(cb, "[%s='", keyname);
if (xml_chardata_cbuf_append(cb, instance) < 0)
if (xml_chardata_cbuf_append(cb, 0, instance) < 0)
goto done;
cprintf(cb, "']");
cprintf(cb, "</service-instance>");
Expand Down
4 changes: 2 additions & 2 deletions src/controller_device_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ devices_statedata(clixon_handle h,
if ((xb = xml_body(x)) == NULL)
continue;
cprintf(cb, "<capability>");
xml_chardata_cbuf_append(cb, xb);
xml_chardata_cbuf_append(cb, 0, xb);
cprintf(cb, "</capability>");
}
cprintf(cb, "</capabilities>");
Expand All @@ -1780,7 +1780,7 @@ devices_statedata(clixon_handle h,
}
if ((logmsg = device_handle_logmsg_get(dh)) != NULL){
cprintf(cb, "<logmsg>");
xml_chardata_cbuf_append(cb, logmsg);
xml_chardata_cbuf_append(cb, 0, logmsg);
cprintf(cb, "</logmsg>");
}
cprintf(cb, "</device></devices>");
Expand Down
8 changes: 4 additions & 4 deletions src/controller_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ controller_commit_actions(clixon_handle h,
cprintf(notifycb, "<target>actions</target>");
while ((cv = cvec_each(cvv, cv)) != NULL){
cprintf(notifycb, "<service>");
xml_chardata_cbuf_append(notifycb, cv_name_get(cv));
xml_chardata_cbuf_append(notifycb, 0, cv_name_get(cv));
cprintf(notifycb, "</service>");
}
cprintf(notifycb, "</services-commit>");
Expand Down Expand Up @@ -1916,7 +1916,7 @@ datastore_diff_dsref(clixon_handle h,
}
cprintf(cbret, "<rpc-reply xmlns=\"%s\">", NETCONF_BASE_NAMESPACE);
cprintf(cbret, "<diff xmlns=\"%s\">", CONTROLLER_NAMESPACE);
xml_chardata_cbuf_append(cbret, cbuf_get(cb));
xml_chardata_cbuf_append(cbret, 0, cbuf_get(cb));
cprintf(cbret, "</diff>");
cprintf(cbret, "</rpc-reply>");
retval = 0;
Expand Down Expand Up @@ -2075,7 +2075,7 @@ datastore_diff_device(clixon_handle h,
if (cbuf_len(cb)){
cprintf(cbret, "<diff xmlns=\"%s\">", CONTROLLER_NAMESPACE);
cprintf(cbret, "%s:\n", devname);
xml_chardata_cbuf_append(cbret, cbuf_get(cb));
xml_chardata_cbuf_append(cbret, 0, cbuf_get(cb));
cprintf(cbret, "</diff>");
}
break;
Expand All @@ -2086,7 +2086,7 @@ datastore_diff_device(clixon_handle h,
if (cbuf_len(cb)){
cprintf(cbret, "<diff xmlns=\"%s\">", CONTROLLER_NAMESPACE);
cprintf(cbret, "%s:\n", devname);
xml_chardata_cbuf_append(cbret, cbuf_get(cb));
xml_chardata_cbuf_append(cbret, 0, cbuf_get(cb));
cprintf(cbret, "</diff>");
}
break;
Expand Down
6 changes: 3 additions & 3 deletions src/controller_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ controller_transaction_notify(clixon_handle h,
cprintf(cb, "<origin>%s</origin>", ct->ct_origin);
if (ct->ct_reason){
cprintf(cb, "<reason>");
if (xml_chardata_cbuf_append(cb, ct->ct_reason) < 0)
if (xml_chardata_cbuf_append(cb, 0, ct->ct_reason) < 0)
goto done;
cprintf(cb, "</reason>");
}
Expand Down Expand Up @@ -694,12 +694,12 @@ controller_transaction_statedata(clixon_handle h,
cprintf(cb, "<origin>%s</origin>", ct->ct_origin);
if (ct->ct_reason){
cprintf(cb, "<reason>");
xml_chardata_cbuf_append(cb, ct->ct_reason);
xml_chardata_cbuf_append(cb, 0, ct->ct_reason);
cprintf(cb, "</reason>");
}
if (ct->ct_warning){
cprintf(cb, "<warning>");
xml_chardata_cbuf_append(cb, ct->ct_warning);
xml_chardata_cbuf_append(cb, 0, ct->ct_warning);
cprintf(cb, "</warning>");
}
if (ct->ct_state != TS_INIT)
Expand Down

0 comments on commit b2b2a19

Please sign in to comment.