C-style update: Unified comment, retvals in order, remove trailing spaces
Changed function name for `clicon_debug` functions
This commit is contained in:
parent
6e314dd96f
commit
62348fc9c7
204 changed files with 6047 additions and 4904 deletions
|
|
@ -32,9 +32,9 @@
|
|||
|
||||
***** END LICENSE BLOCK *****
|
||||
|
||||
* Clixon XML XPATH 1.0 according to https://www.w3.org/TR/xpath-10
|
||||
* Clixon XML XPath 1.0 according to https://www.w3.org/TR/xpath-10
|
||||
* Note: for YANG which is constrained to path-arg as defined in rfc7950
|
||||
* See: clixon_xpath.[ch] for full XML XPATH implementation
|
||||
* See: clixon_xpath.[ch] for full XML XPath implementation
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "clixon_config.h" /* generated by config & autoconf */
|
||||
|
|
@ -86,7 +86,7 @@ xp_yang_ctx *
|
|||
xy_dup(xp_yang_ctx *xy0)
|
||||
{
|
||||
xp_yang_ctx *xy = NULL;
|
||||
|
||||
|
||||
if ((xy = malloc(sizeof(*xy))) == NULL){
|
||||
clicon_err(OE_UNIX, errno, "malloc");
|
||||
goto done;
|
||||
|
|
@ -115,7 +115,7 @@ xp_yang_op_eq(xp_yang_ctx *xy1,
|
|||
{
|
||||
int retval = -1;
|
||||
xp_yang_ctx *xy = NULL;
|
||||
|
||||
|
||||
if ((xy = xy_dup(xy1)) == NULL)
|
||||
goto done;
|
||||
if (xy1 == NULL || xy2 == NULL || xy1->xy_node == NULL || xy2->xy_node == NULL){
|
||||
|
|
@ -134,7 +134,7 @@ xp_yang_op_eq(xp_yang_ctx *xy1,
|
|||
/*! Evaluate leafref PATH-ARG step rule on a YANG tree
|
||||
*
|
||||
* @param[in] xy0 Incoming context
|
||||
* @param[in] xpath_tree XPATH parse-tree
|
||||
* @param[in] xpath_tree XPath parse-tree
|
||||
* @param[out] xyr Resulting context
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
|
|
@ -157,7 +157,7 @@ xp_yang_eval_step(xp_yang_ctx *xy0,
|
|||
goto done;
|
||||
ys = xy->xy_node;
|
||||
switch (xptree->xs_int){
|
||||
case A_CHILD:
|
||||
case A_CHILD:
|
||||
if ((nodetest = xptree->xs_c0) == NULL){
|
||||
clicon_err(OE_YANG, 0, "child step nodetest expected");
|
||||
goto done;
|
||||
|
|
@ -221,7 +221,7 @@ xp_yang_eval_step(xp_yang_ctx *xy0,
|
|||
/*! Evaluate leafref PATH-ARG predicate rule on a YANG tree
|
||||
*
|
||||
* @param[in] xy Incoming context
|
||||
* @param[in] xpath_tree XPATH parse-tree
|
||||
* @param[in] xpath_tree XPath parse-tree
|
||||
* @param[out] xyr Resulting context
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
|
|
@ -237,7 +237,7 @@ xp_yang_eval_predicate(xp_yang_ctx *xy,
|
|||
xp_yang_ctx *xy1 = NULL;
|
||||
|
||||
if (xptree->xs_c0 != NULL){ /* eval previous predicates */
|
||||
if (xp_yang_eval(xy, xptree->xs_c0, &xy0) < 0)
|
||||
if (xp_yang_eval(xy, xptree->xs_c0, &xy0) < 0)
|
||||
goto done;
|
||||
}
|
||||
else{ /* empty */
|
||||
|
|
@ -270,7 +270,7 @@ xp_yang_eval_predicate(xp_yang_ctx *xy,
|
|||
/*! Evaluate leafref PATH-ARG on a YANG tree
|
||||
*
|
||||
* @param[in] xy Incoming context
|
||||
* @param[in] xpath_tree XPATH parse-tree
|
||||
* @param[in] xpath_tree XPath parse-tree
|
||||
* @param[out] xyr Resulting context
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
|
|
@ -358,7 +358,7 @@ xp_yang_eval(xp_yang_ctx *xy,
|
|||
/* Eval first child c0
|
||||
*/
|
||||
if (xptree->xs_c0){
|
||||
if (xp_yang_eval(xy, xptree->xs_c0, &xy0) < 0)
|
||||
if (xp_yang_eval(xy, xptree->xs_c0, &xy0) < 0)
|
||||
goto done;
|
||||
}
|
||||
/* Actions between first and second child
|
||||
|
|
@ -379,7 +379,7 @@ xp_yang_eval(xp_yang_ctx *xy,
|
|||
* Note, some operators like locationpath, need transitive context (use_xr0)
|
||||
*/
|
||||
if (xptree->xs_c1){
|
||||
if (xp_yang_eval(use_xy0?xy0:xy, xptree->xs_c1, &xy1) < 0)
|
||||
if (xp_yang_eval(use_xy0?xy0:xy, xptree->xs_c1, &xy1) < 0)
|
||||
goto done;
|
||||
/* Actions after second child
|
||||
*/
|
||||
|
|
@ -447,7 +447,7 @@ xp_yang_eval(xp_yang_ctx *xy,
|
|||
* @param[out] yref YANG referred node
|
||||
* @retval 0 OK
|
||||
* @retval -1 Error
|
||||
* @note this function uses XPATH parser, which is (much too) general
|
||||
* @note this function uses XPath parser, which is (much too) general
|
||||
* @code
|
||||
* yang_stmt *ys; // source / referring node
|
||||
* yang_stmt *yref = NULL; // target / referred node
|
||||
|
|
@ -470,7 +470,7 @@ yang_path_arg(yang_stmt *ys,
|
|||
xp_yang_ctx *xyr = NULL;
|
||||
xp_yang_ctx *xy = NULL;
|
||||
|
||||
clicon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
clixon_debug(CLIXON_DBG_DETAIL, "%s", __FUNCTION__);
|
||||
if (path_arg == NULL){
|
||||
clicon_err(OE_XML, EINVAL, "path-arg is NULL");
|
||||
goto done;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue