libyang  3.4.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
tree.h File Reference

libyang generic macros and functions to work with YANG schema or data trees. More...

#include <inttypes.h>
Include dependency graph for tree.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LY_ARRAY_COUNT(ARRAY)   (ARRAY ? (*((LY_ARRAY_COUNT_TYPE*)(ARRAY) - 1)) : 0)
 Get the number of records in the ARRAY. More...
 
#define LY_ARRAY_COUNT_TYPE   uint64_t
 Type (i.e. size) of the sized array's size counter. More...
 
#define LY_ARRAY_FOR(ARRAY,...)   LY_ARRAY_SELECT(__VA_ARGS__, LY_ARRAY_FOR_ITER, LY_ARRAY_FOR_INDEX, LY_UNDEF)(ARRAY, __VA_ARGS__)
 Sized-array iterator (for-loop). More...
 
#define LY_ARRAY_FOR_INDEX(ARRAY, INDEX)
 Helper macro to go through sized-arrays with a numeric iterator. More...
 
#define LY_ARRAY_FOR_ITER(ARRAY, TYPE, ITER)
 Helper macro to go through sized-arrays with a pointer iterator. More...
 
#define LY_ARRAY_SELECT(_1, _2, NAME,...)   NAME
 Macro selector for other LY_ARRAY_* macros, do not use directly! More...
 
#define LY_DATA_TYPE_COUNT   20
 
#define LY_LIST_FOR(START, ELEM)
 Macro to iterate via all sibling elements without affecting the list itself. More...
 
#define LY_LIST_FOR_SAFE(START, NEXT, ELEM)
 Macro to iterate via all sibling elements allowing to modify the list itself (e.g. removing elements) More...
 
#define LY_PRI_ARRAY_COUNT_TYPE   PRIu64
 Printing format specifier macro for LY_ARRAY_SIZE_TYPE values. More...
 

Enumerations

enum  LY_DATA_TYPE {
  LY_TYPE_UNKNOWN = 0, LY_TYPE_BINARY, LY_TYPE_UINT8, LY_TYPE_UINT16,
  LY_TYPE_UINT32, LY_TYPE_UINT64, LY_TYPE_STRING, LY_TYPE_BITS,
  LY_TYPE_BOOL, LY_TYPE_DEC64, LY_TYPE_EMPTY, LY_TYPE_ENUM,
  LY_TYPE_IDENT, LY_TYPE_INST, LY_TYPE_LEAFREF, LY_TYPE_UNION,
  LY_TYPE_INT8, LY_TYPE_INT16, LY_TYPE_INT32, LY_TYPE_INT64
}
 YANG built-in types. More...
 
enum  LY_VALUE_FORMAT {
  LY_VALUE_CANON, LY_VALUE_SCHEMA, LY_VALUE_SCHEMA_RESOLVED, LY_VALUE_XML,
  LY_VALUE_JSON, LY_VALUE_LYB, LY_VALUE_STR_NS
}
 All kinds of supported value formats and prefix mappings to modules. More...
 

Variables

const char * ly_data_type2str [20]
 Stringfield YANG built-in data types. More...
 

Detailed Description

libyang generic macros and functions to work with YANG schema or data trees.

Author
Radek Krejci rkrej.nosp@m.ci@c.nosp@m.esnet.nosp@m..cz Copyright (c) 2019 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 tree.h.