Library functions in clixon_cli_api.h (e.g cli_commit) is rewritten in new

for (eg cli_commitv). See clixon_cli_api.h for new names.
Use restconf format for internal xmldb keys. Eg /a/b=3,4
Changed example to use multiple cli callbacks
This commit is contained in:
Olof hagsand 2017-01-31 22:36:14 +01:00
parent c9f1ece53e
commit 7f0b9909b3
30 changed files with 1444 additions and 1054 deletions

View file

@ -494,7 +494,12 @@ xml_new(char *name,
return xn;
}
/*! Create new xml node given a name, parent and spec. Free it with xml_free().
/*! Create new xml node given a name, parent and spec.
* @param[in] name Name of new xml node
* @param[in] xp XML parent
* @param[in] spec Yang spec
* @retval NULL Error
* @retval x XML tree. Free with xml_free().
*/
cxobj *
xml_new_spec(char *name,
@ -1229,6 +1234,7 @@ cxvec_append(cxobj *x,
* @endcode
* @note do not delete or move around any children during this function
* @note It does not apply fn to the root node,..
* @see xml_apply0 including top object
*/
int
xml_apply(cxobj *xn,
@ -1250,6 +1256,25 @@ xml_apply(cxobj *xn,
return retval;
}
/*! Apply a function call on top object and all xml node children recursively
* @see xml_apply not including top object
*/
int
xml_apply0(cxobj *xn,
enum cxobj_type type,
xml_applyfn_t fn,
void *arg)
{
int retval = -1;
if (fn(xn, arg) < 0)
goto done;
retval = xml_apply(xn, type, fn, arg);
done:
return retval;
}
/*! Apply a function call recursively on all ancestors
* Recursively traverse upwards to all ancestor nodes in a parse-tree and apply fn(arg) for
* each object found. The function is called with the xml node and an