Skip to content

Commit

Permalink
parser REFACTOR unify function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Oct 8, 2024
1 parent 9805f21 commit 0af8370
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/parser_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ lyd_parser_create_meta(struct lyd_ctx *lydctx, struct lyd_node *parent, struct l
}

LY_ERR
lyd_parse_check_keys(struct lyd_node *node)
lyd_parser_check_keys(struct lyd_node *node)
{
const struct lysc_node *skey = NULL;
const struct lyd_node *key;
Expand All @@ -381,7 +381,7 @@ lyd_parse_check_keys(struct lyd_node *node)
}

LY_ERR
lyd_parse_set_data_flags(struct lyd_node *node, struct lyd_meta **meta, struct lyd_ctx *lydctx,
lyd_parser_set_data_flags(struct lyd_node *node, struct lyd_meta **meta, struct lyd_ctx *lydctx,
struct lysc_ext_instance *ext)
{
struct lyd_meta *meta2, *prev_meta = NULL, *next_meta = NULL;
Expand Down Expand Up @@ -3569,7 +3569,7 @@ lysp_stmt_parse(struct lysp_ctx *pctx, const struct lysp_stmt *stmt, void **resu
}

LY_ERR
lys_parse_ext_instance_stmt(struct lysp_ctx *pctx, struct lysp_ext_substmt *substmt, struct lysp_stmt *stmt)
lys_parser_ext_instance_stmt(struct lysp_ctx *pctx, struct lysp_ext_substmt *substmt, struct lysp_stmt *stmt)
{
LY_ERR rc = LY_SUCCESS;

Expand Down
6 changes: 3 additions & 3 deletions src/parser_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ LY_ERR lyd_parser_create_meta(struct lyd_ctx *lydctx, struct lyd_node *parent, s
* @return LY_SUCCESS on success.
* @return LY_ENOT on a missing key.
*/
LY_ERR lyd_parse_check_keys(struct lyd_node *node);
LY_ERR lyd_parser_check_keys(struct lyd_node *node);

/**
* @brief Set data flags for a newly parsed node.
Expand All @@ -435,7 +435,7 @@ LY_ERR lyd_parse_check_keys(struct lyd_node *node);
* @param[in] ext Extension instance if @p node was parsed for one.
* @return LY_ERR value.
*/
LY_ERR lyd_parse_set_data_flags(struct lyd_node *node, struct lyd_meta **meta, struct lyd_ctx *lydctx,
LY_ERR lyd_parser_set_data_flags(struct lyd_node *node, struct lyd_meta **meta, struct lyd_ctx *lydctx,
struct lysc_ext_instance *ext);

/**
Expand All @@ -446,6 +446,6 @@ LY_ERR lyd_parse_set_data_flags(struct lyd_node *node, struct lyd_meta **meta, s
* @param[in] stmt Parsed generic statement to process.
* @return LY_ERR value.
*/
LY_ERR lys_parse_ext_instance_stmt(struct lysp_ctx *pctx, struct lysp_ext_substmt *substmt, struct lysp_stmt *stmt);
LY_ERR lys_parser_ext_instance_stmt(struct lysp_ctx *pctx, struct lysp_ext_substmt *substmt, struct lysp_stmt *stmt);

#endif /* LY_PARSER_INTERNAL_H_ */
8 changes: 4 additions & 4 deletions src/parser_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ lydjson_metadata_finish(struct lyd_json_ctx *lydctx, struct lyd_node **first_p)
}

/* add/correct flags */
ret = lyd_parse_set_data_flags(node, &node->meta, (struct lyd_ctx *)lydctx, ext);
ret = lyd_parser_set_data_flags(node, &node->meta, (struct lyd_ctx *)lydctx, ext);
LY_CHECK_GOTO(ret, cleanup);
break;
}
Expand Down Expand Up @@ -857,7 +857,7 @@ lydjson_metadata(struct lyd_json_ctx *lydctx, const struct lysc_node *snode, str
LY_CHECK_GOTO(rc, cleanup);

/* add/correct flags */
rc = lyd_parse_set_data_flags(node, &node->meta, (struct lyd_ctx *)lydctx, NULL);
rc = lyd_parser_set_data_flags(node, &node->meta, (struct lyd_ctx *)lydctx, NULL);
LY_CHECK_GOTO(rc, cleanup);
} else {
/* create attribute */
Expand Down Expand Up @@ -1434,7 +1434,7 @@ lydjson_parse_instance_inner(struct lyd_json_ctx *lydctx, const struct lysc_node

if (snode->nodetype == LYS_LIST) {
/* check all keys exist */
r = lyd_parse_check_keys(*node);
r = lyd_parser_check_keys(*node);
LY_DPARSER_ERR_GOTO(r, rc = r, lydctx, cleanup);
}

Expand Down Expand Up @@ -1530,7 +1530,7 @@ lydjson_parse_instance(struct lyd_json_ctx *lydctx, struct lyd_node *parent, str
LY_CHECK_GOTO(!*node, cleanup);

/* add/correct flags */
r = lyd_parse_set_data_flags(*node, &(*node)->meta, (struct lyd_ctx *)lydctx, ext);
r = lyd_parser_set_data_flags(*node, &(*node)->meta, (struct lyd_ctx *)lydctx, ext);
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);

if (!(lydctx->parse_opts & LYD_PARSE_ONLY)) {
Expand Down
4 changes: 2 additions & 2 deletions src/parser_xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ lydxml_subtree_inner(struct lyd_xml_ctx *lydctx, const struct lysc_node *snode,

if (snode->nodetype == LYS_LIST) {
/* check all keys exist */
r = lyd_parse_check_keys(*node);
r = lyd_parser_check_keys(*node);
LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
}

Expand Down Expand Up @@ -1107,7 +1107,7 @@ lydxml_subtree_r(struct lyd_xml_ctx *lydctx, struct lyd_node *parent, struct lyd
node_parsed:
if (node && snode) {
/* add/correct flags */
r = lyd_parse_set_data_flags(node, &meta, (struct lyd_ctx *)lydctx, ext);
r = lyd_parser_set_data_flags(node, &meta, (struct lyd_ctx *)lydctx, ext);
LY_CHECK_ERR_GOTO(r, rc = r; lyd_free_tree(node), cleanup);

if (!(lydctx->parse_opts & LYD_PARSE_ONLY)) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins_exts.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ lyplg_ext_parse_extension_instance(struct lysp_ctx *pctx, struct lysp_ext_instan
continue;
}

if ((rc = lys_parse_ext_instance_stmt(pctx, &ext->substmts[u], stmt))) {
if ((rc = lys_parser_ext_instance_stmt(pctx, &ext->substmts[u], stmt))) {
goto cleanup;
}
}
Expand Down

0 comments on commit 0af8370

Please sign in to comment.