libyang  4.0.2
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
enumeration.c File Reference

Built-in enumeration type plugin. More...

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

Go to the source code of this file.

Macros

#define _GNU_SOURCE   /* strdup */
 
#define ENUM_FIXED_SIZE_BITS(type)
 

Variables

struct lyplg_type_record plugins_enumeration []
 Plugin information for enumeration type implementation. More...
 

Detailed Description

Built-in enumeration type plugin.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz
Michal Vasko mvask.nosp@m.o@ce.nosp@m.snet..nosp@m.cz 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 enumeration.c.

Macro Definition Documentation

#define _GNU_SOURCE   /* strdup */

Definition at line 16 of file enumeration.c.

#define ENUM_FIXED_SIZE_BITS (   type)
Value:
((struct lysc_type_enum *)type)->enums[LY_ARRAY_COUNT(((struct lysc_type_enum *)type)->enums) - 1].value)
#define LY_ARRAY_COUNT(ARRAY)
Get the number of records in the ARRAY.
Definition: tree.h:148
LIBYANG_API_DECL uint64_t lyplg_type_get_highest_set_bit_pos(uint64_t num)
Learn the position of the highest set bit in a number. Represents also the least amount of bits requi...

Definition at line 40 of file enumeration.c.

Variable Documentation

struct lyplg_type_record plugins_enumeration[]
Initial value:
= {
{
.module = "",
.revision = NULL,
.name = LY_TYPE_ENUM_STR,
.plugin.id = "ly2 enumeration",
.plugin.lyb_size = lyplg_type_lyb_size_enum,
.plugin.store = lyplg_type_store_enum,
.plugin.validate_value = NULL,
.plugin.validate_tree = NULL,
.plugin.compare = lyplg_type_compare_simple,
.plugin.sort = lyplg_type_sort_enum,
.plugin.print = lyplg_type_print_enum,
.plugin.duplicate = lyplg_type_dup_simple,
.plugin.free = lyplg_type_free_simple,
},
{0}
}
LIBYANG_API_DECL LY_ERR lyplg_type_compare_simple(const struct ly_ctx *ctx, const struct lyd_value *val1, const struct lyd_value *val2)
Implementation of lyplg_type_compare_clb for a generic simple type.
LIBYANG_API_DECL LY_ERR lyplg_type_dup_simple(const struct ly_ctx *ctx, const struct lyd_value *original, struct lyd_value *dup)
Implementation of lyplg_type_dup_clb for a generic simple type.
LIBYANG_API_DECL void lyplg_type_free_simple(const struct ly_ctx *ctx, struct lyd_value *value)
Implementation of lyplg_type_free_clb for a generic simple type.

Plugin information for enumeration type implementation.

Note that external plugins are supposed to use:

LYPLG_TYPES = {

Definition at line 223 of file enumeration.c.