libyang  4.0.0
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
union.c File Reference

Built-in union type plugin. More...

#include "plugins_types.h"
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "libyang.h"
#include "compat.h"
#include "ly_common.h"
#include "lyb.h"
#include "plugins_internal.h"
Include dependency graph for union.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE   /* strdup */
 
#define LYPLG_UNION_TYPE_IDX_SIZE   1
 Size in bytes of the used type index in the LYB Binary Format. More...
 

Variables

struct lyplg_type_record plugins_union []
 Plugin information for union type implementation. More...
 

Detailed Description

Built-in union type plugin.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz
Michal Vasko Copyright (c) 2019 - 2025 CESNET, z.s.p.o.

This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at

https://opensource.org/licenses/BSD-3-Clause

Definition in file union.c.

Macro Definition Documentation

#define _GNU_SOURCE   /* strdup */

Definition at line 16 of file union.c.

#define LYPLG_UNION_TYPE_IDX_SIZE   1

Size in bytes of the used type index in the LYB Binary Format.

Definition at line 50 of file union.c.

Variable Documentation

struct lyplg_type_record plugins_union[]
Initial value:
= {
{
.module = "",
.revision = NULL,
.name = LY_TYPE_UNION_STR,
.plugin.id = "ly2 union",
.plugin.store = lyplg_type_store_union,
.plugin.validate_value = NULL,
.plugin.validate_tree = lyplg_type_validate_tree_union,
.plugin.compare = lyplg_type_compare_union,
.plugin.sort = lyplg_type_sort_union,
.plugin.print = lyplg_type_print_union,
.plugin.duplicate = lyplg_type_dup_union,
.plugin.free = lyplg_type_free_union,
},
{0}
}
LIBYANG_API_DECL void lyplg_type_lyb_size_variable_bits(const struct lysc_type *type, enum lyplg_lyb_size_type *size_type, uint32_t *fixed_size_bits)
Implementation of lyplg_type_lyb_size_clb for a type with variable length in bits.

Plugin information for union type implementation.

Note that external plugins are supposed to use:

LYPLG_TYPES = {

Definition at line 778 of file union.c.