24#include "tree_data_sorted.h"
26static void lyplg_type_free_lyds(
const struct ly_ctx *ctx,
struct lyd_value *value);
29lyplg_type_store_lyds(
const struct ly_ctx *ctx,
const struct lysc_type *type,
const void *value,
30 size_t UNUSED(value_len), uint32_t options,
LY_VALUE_FORMAT format,
void *UNUSED(prefix_data),
31 uint32_t UNUSED(hints),
const struct lysc_node *UNUSED(ctx_node),
struct lyd_value *storage,
32 struct lys_glob_unres *UNUSED(unres),
struct ly_err_item **UNUSED(err))
35 struct rb_node *rbt = NULL;
40 LY_CHECK_ERR_GOTO(!val, ret =
LY_EMEM, cleanup);
44 memset(storage->fixed_mem, 0, LYD_VALUE_FIXED_MEM_SIZE);
52 ret = lyds_create_node((
struct lyd_node *)value, &
rbt);
53 LY_CHECK_GOTO(ret, cleanup);
61 lyplg_type_free_lyds(ctx, storage);
68lyplg_type_free_lyds(
const struct ly_ctx *UNUSED(ctx),
struct lyd_value *value)
77 lyds_free_tree(val->
rbt);
79 memset(value->fixed_mem, 0, LYD_VALUE_FIXED_MEM_SIZE);
88 memset(dup, 0,
sizeof *dup);
95lyplg_type_compare_lyds(
const struct ly_ctx *UNUSED(ctx),
const struct lyd_value *UNUSED(val1),
102lyplg_type_sort_lyds(
const struct ly_ctx *UNUSED(ctx),
const struct lyd_value *UNUSED(val1),
109lyplg_type_print_lyds(
const struct ly_ctx *UNUSED(ctx),
const struct lyd_value *UNUSED(value),
135 .plugin.id =
"libyang 2 - lyds_tree, version 1",
136 .plugin.store = lyplg_type_store_lyds,
137 .plugin.validate = NULL,
138 .plugin.compare = lyplg_type_compare_lyds,
139 .plugin.sort = lyplg_type_sort_lyds,
140 .plugin.print = lyplg_type_print_lyds,
141 .plugin.duplicate = lyplg_type_dupl_lyds,
142 .plugin.free = lyplg_type_free_lyds,
143 .plugin.lyb_data_len = 0
LY_ERR
libyang's error codes returned by the libyang functions.
Libyang full error structure.
const char *const char * revision
#define LYPLG_TYPE_VAL_INLINE_PREPARE(storage, type_val)
Prepare value memory for storing a specific type value, may be allocated dynamically.
#define LYPLG_TYPE_VAL_INLINE_DESTROY(type_val)
Destroy a prepared value.
#define LYPLG_TYPE_STORE_DYNAMIC
LY_VALUE_FORMAT
All kinds of supported value formats and prefix mappings to modules.
The main libyang public header.
uint8_t ly_bool
Type to indicate boolean value.
const struct lyplg_type_record plugins_lyds_tree[]
Plugin information for lyds_tree type implementation.
API for (user) types plugins.
const struct lysc_type * realtype
#define LYD_VALUE_GET(value, type_val)
Get the value in format specific to the type.
Generic structure for a data node.
YANG data representation.
Special lyd_value structure for lyds tree value.