Skip to content

Commit

Permalink
plugins types REFACTOR removed redundant instid callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvasko committed Sep 9, 2024
1 parent 17002f0 commit 670385f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
12 changes: 0 additions & 12 deletions src/plugins_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -950,18 +950,6 @@ LIBYANG_API_DECL LY_ERR lyplg_type_store_instanceid(const struct ly_ctx *ctx, co
LIBYANG_API_DECL LY_ERR lyplg_type_validate_instanceid(const struct ly_ctx *ctx, const struct lysc_type *type,
const struct lyd_node *ctx_node, const struct lyd_node *tree, struct lyd_value *storage, struct ly_err_item **err);

/**
* @brief Implementation of ::lyplg_type_compare_clb for the built-in instance-identifier type.
*/
LIBYANG_API_DECL LY_ERR lyplg_type_compare_instanceid(const struct ly_ctx *ctx, const struct lyd_value *val1,
const struct lyd_value *val2);

/**
* @brief Implementation of ::lyplg_type_sort_clb for the built-in instance-identifier type.
*/
LIBYANG_API_DEF int lyplg_type_sort_instanceid(const struct ly_ctx *ctx, const struct lyd_value *val1,
const struct lyd_value *val2);

/**
* @brief Implementation of ::lyplg_type_print_clb for the built-in instance-identifier type.
*/
Expand Down
16 changes: 2 additions & 14 deletions src/plugins_types/instanceid.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,6 @@ lyplg_type_validate_instanceid(const struct ly_ctx *ctx, const struct lysc_type
return LY_SUCCESS;
}

LIBYANG_API_DEF LY_ERR
lyplg_type_compare_instanceid(const struct ly_ctx *ctx, const struct lyd_value *val1, const struct lyd_value *val2)
{
return lyplg_type_compare_simple(ctx, val1, val2);
}

LIBYANG_API_DEF int
lyplg_type_sort_instanceid(const struct ly_ctx *ctx, const struct lyd_value *val1, const struct lyd_value *val2)
{
return lyplg_type_sort_simple(ctx, val1, val2);
}

LIBYANG_API_DEF const void *
lyplg_type_print_instanceid(const struct ly_ctx *UNUSED(ctx), const struct lyd_value *value, LY_VALUE_FORMAT format,
void *prefix_data, ly_bool *dynamic, size_t *value_len)
Expand Down Expand Up @@ -338,8 +326,8 @@ const struct lyplg_type_record plugins_instanceid[] = {
.plugin.id = "libyang 2 - instance-identifier, version 1",
.plugin.store = lyplg_type_store_instanceid,
.plugin.validate = lyplg_type_validate_instanceid,
.plugin.compare = lyplg_type_compare_instanceid,
.plugin.sort = lyplg_type_sort_instanceid,
.plugin.compare = lyplg_type_compare_simple,
.plugin.sort = lyplg_type_sort_simple,
.plugin.print = lyplg_type_print_instanceid,
.plugin.duplicate = lyplg_type_dup_instanceid,
.plugin.free = lyplg_type_free_instanceid,
Expand Down
8 changes: 4 additions & 4 deletions src/plugins_types/node_instanceid.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ const struct lyplg_type_record plugins_node_instanceid[] = {
.plugin.id = "libyang 2 - node-instance-identifier, version 1",
.plugin.store = lyplg_type_store_node_instanceid,
.plugin.validate = NULL,
.plugin.compare = lyplg_type_compare_instanceid,
.plugin.sort = lyplg_type_sort_instanceid,
.plugin.compare = lyplg_type_compare_simple,
.plugin.sort = lyplg_type_sort_simple,
.plugin.print = lyplg_type_print_node_instanceid,
.plugin.duplicate = lyplg_type_dup_instanceid,
.plugin.free = lyplg_type_free_instanceid,
Expand All @@ -327,8 +327,8 @@ const struct lyplg_type_record plugins_node_instanceid[] = {
.plugin.id = "libyang 2 - node-instance-identifier, version 1",
.plugin.store = lyplg_type_store_node_instanceid,
.plugin.validate = NULL,
.plugin.compare = lyplg_type_compare_instanceid,
.plugin.sort = lyplg_type_sort_instanceid,
.plugin.compare = lyplg_type_compare_simple,
.plugin.sort = lyplg_type_sort_simple,
.plugin.print = lyplg_type_print_node_instanceid,
.plugin.duplicate = lyplg_type_dup_instanceid,
.plugin.free = lyplg_type_free_instanceid,
Expand Down

0 comments on commit 670385f

Please sign in to comment.