Minor doc and err handling fixes

This commit is contained in:
Olof Hagsand 2022-12-16 10:48:28 +01:00
parent 04df38ddfa
commit e885d63f68
5 changed files with 16 additions and 7 deletions

View file

@ -51,7 +51,7 @@
* It is up to the validate callbacks to ensure that these changes are OK
* It is up to the commit callbacks to enforce these changes in the "state" of
* the system.
* see also transaction_data in clixon_plugin.h
* @see transaction_data in clixon_plugin.h
*/
typedef struct {
uint64_t td_id; /* Transaction id */

View file

@ -428,7 +428,7 @@ example_statedata(clicon_handle h,
int retval = -1;
cxobj **xvec = NULL;
size_t xlen = 0;
cbuf *cb = cbuf_new();
cbuf *cb = NULL;
int i;
cxobj *xt = NULL;
char *name;
@ -437,6 +437,10 @@ example_statedata(clicon_handle h,
if (!_state)
goto ok;
if ((cb = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
goto done;
}
yspec = clicon_dbspec_yang(h);
/* Example of statedata, in this case merging state data with
* state information. In this case adding dummy interface operation state
@ -1055,7 +1059,13 @@ upgrade_2016_to_2018(clicon_handle h,
if ((x = xpath_first(xi, NULL, "statistics/in-octets")) != NULL){
if ((xb = xml_body_get(x)) != NULL){
uint64_t u64;
cbuf *cb = cbuf_new();
cbuf *cb;
if ((cb = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
goto done;
}
parse_uint64(xml_value(xb), &u64, NULL);
cprintf(cb, "%" PRIu64 ".%03d", u64/1000, (int)(u64%1000));
xml_value_set(xb, cbuf_get(cb));

View file

@ -241,7 +241,7 @@ typedef void *pagination_data;
typedef int (plglockdb_t)(clicon_handle h, char *db, int lock, int id);
/* Transaction-data type
* @see clixon_backend_transaction.h for full transaction API
* @see transaction_data_t and clixon_backend_transaction.h for full transaction API
*/
typedef void *transaction_data;

View file

@ -452,7 +452,6 @@ clixon_xml_bottom(cxobj *xtop,
return retval;
}
/*! Internal function to construct a get-config and query a value from the backend
*
* @param[in] sock Socket

View file

@ -900,7 +900,7 @@ text_modify(clicon_handle h,
* As an alternative, return in populate where this is detected first time.
*/
if (yc != xml_spec(x1c)){
clicon_err(OE_YANG, errno, "XML node %s not in namespace %s",
clicon_err(OE_YANG, errno, "XML node \"%s\" not in namespace %s",
x1cname, yang_find_mynamespace(y0));
goto done;
}
@ -1146,7 +1146,7 @@ text_modify_top(clicon_handle h,
* @param[in] h CLICON handle
* @param[in] db running or candidate
* @param[in] op Top-level operation, can be superceded by other op in tree
* @param[in] xt xml-tree. Top-level symbol is dummy
* @param[in] x1 xml-tree. Top-level symbol is dummy
* @param[in] username User name for nacm
* @param[out] cbret Initialized cligen buffer. On exit contains XML if retval == 0
* @retval 1 OK