libyang  4.0.4
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
binary.c File Reference

Built-in binary type plugin. More...

#include "plugins_types.h"
#include <ctype.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 binary.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE   /* strdup */
 

Functions

 if ((v1->size!=v2->size)||memcmp(v1->data, v2->data, v1->size))
 
 if (v1->size< v2->size)
 
else if (v1->size > v2->size)
 
 LYD_VALUE_GET (val1, v1)
 
 LYD_VALUE_GET (val2, v2)
 

Variables

int cmp = memcmp(v1->data, v2->data, v1->size)
 
return LY_SUCCESS
 
struct lyplg_type_record plugins_binary []
 Plugin information for binray type implementation. More...
 

Detailed Description

Built-in binary 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 binary.c.

Macro Definition Documentation

#define _GNU_SOURCE   /* strdup */

Definition at line 16 of file binary.c.

Function Documentation

if ( (v1->size!=v2->size)||memcmp(v1->data, v2->data, v1->size)  )

Definition at line 384 of file binary.c.

if ( v1->size< v2->  size)

Definition at line 399 of file binary.c.

else if ( v1->  size,
v2->  size 
)

Definition at line 401 of file binary.c.

LYD_VALUE_GET ( val1  ,
v1   
)
LYD_VALUE_GET ( val2  ,
v2   
)

Variable Documentation

return cmp = memcmp(v1->data, v2->data, v1->size)

Definition at line 394 of file binary.c.

return LY_SUCCESS

Definition at line 387 of file binary.c.

struct lyplg_type_record plugins_binary[]
Initial value:
= {
{
.module = "",
.revision = NULL,
.name = LY_TYPE_BINARY_STR,
.plugin.id = "ly2 binary",
.plugin.store = lyplg_type_store_binary,
.plugin.validate_value = lyplg_type_validate_value_binary,
.plugin.validate_tree = NULL,
.plugin.compare = lyplg_type_compare_binary,
.plugin.sort = lyplg_type_sort_binary,
.plugin.print = lyplg_type_print_binary,
.plugin.duplicate = lyplg_type_dup_binary,
.plugin.free = lyplg_type_free_binary,
},
{0}
}
LIBYANG_API_DECL void lyplg_type_lyb_size_variable_bytes(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 rounded to bytes...

Plugin information for binray type implementation.

Note that external plugins are supposed to use:

LYPLG_TYPES = {

Definition at line 503 of file binary.c.