libyang 3.7.8
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
New value creation options
Collaboration diagram for New value creation options:

Macros

#define LYD_NEW_ANY_USE_VALUE   0x100
 
#define LYD_NEW_META_CLEAR_DFLT   0x10
 
#define LYD_NEW_PATH_OPAQ   0x40
 
#define LYD_NEW_PATH_UPDATE   0x20
 
#define LYD_NEW_PATH_WITH_OPAQ   0x80
 
#define LYD_NEW_VAL_BIN   0x04
 
#define LYD_NEW_VAL_CANON   0x08
 
#define LYD_NEW_VAL_OUTPUT   0x01
 
#define LYD_NEW_VAL_STORE_ONLY   0x02
 

Detailed Description

Various options to change lyd_new_*() behavior. The LYD_NEW_VAL* can be used within any API, others are API specific

Default behavior:

Default behavior specific for lyd_new_path*() functions:

Macro Definition Documentation

◆ LYD_NEW_ANY_USE_VALUE

#define LYD_NEW_ANY_USE_VALUE   0x100

Whether to use dynamic value or make a copy.

Definition at line 1301 of file tree_data.h.

◆ LYD_NEW_META_CLEAR_DFLT

#define LYD_NEW_META_CLEAR_DFLT   0x10

Whether to clear the default flag starting from parent, recursively all NP containers.

Definition at line 1291 of file tree_data.h.

◆ LYD_NEW_PATH_OPAQ

#define LYD_NEW_PATH_OPAQ   0x40

Enables the creation of opaque nodes with some specific rules. If the last node in the path is not uniquely defined ((leaf-)list without a predicate) or has an invalid value (leaf/leaf-list), it is created as opaque. Otherwise a regular node is created.

Definition at line 1299 of file tree_data.h.

◆ LYD_NEW_PATH_UPDATE

#define LYD_NEW_PATH_UPDATE   0x20

If the target node exists, is a leaf, and it is updated with a new value or its default flag is changed, it is returned. If the target node exists and is not a leaf or generally no change occurs in the parent tree, NULL is returned and no error set.

Definition at line 1295 of file tree_data.h.

◆ LYD_NEW_PATH_WITH_OPAQ

#define LYD_NEW_PATH_WITH_OPAQ   0x80

Consider opaque nodes normally when searching for existing nodes.

Definition at line 1300 of file tree_data.h.

◆ LYD_NEW_VAL_BIN

#define LYD_NEW_VAL_BIN   0x04

Interpret the provided leaf/leaf-list value as being in the binary LY_VALUE_LYB format, to learn what exactly is expected see LYB Binary Format.

Definition at line 1287 of file tree_data.h.

◆ LYD_NEW_VAL_CANON

#define LYD_NEW_VAL_CANON   0x08

Interpret the provided leaf/leaf-list value as being in the canonical (or JSON if no defined) LY_VALUE_CANON format. If it is not, it may lead to unexpected behavior.

Definition at line 1290 of file tree_data.h.

◆ LYD_NEW_VAL_OUTPUT

#define LYD_NEW_VAL_OUTPUT   0x01

Flag in case the parent is RPC/Action. If value is 0, the input's data nodes of the RPC/Action are taken into consideration. Otherwise, the output's data node is going to be created.

Definition at line 1284 of file tree_data.h.

◆ LYD_NEW_VAL_STORE_ONLY

#define LYD_NEW_VAL_STORE_ONLY   0x02

Whether to perform only storing operation with no or minimum valitions

Definition at line 1285 of file tree_data.h.