libyang
2.0.164
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
tree.h
Go to the documentation of this file.
1
15
#ifndef LY_TREE_H_
16
#define LY_TREE_H_
17
18
#include <inttypes.h>
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
104
#define LY_ARRAY_COUNT_TYPE uint64_t
105
109
#define LY_PRI_ARRAY_COUNT_TYPE PRIu64
110
114
#define LY_ARRAY_SELECT(_1, _2, NAME, ...) NAME
115
125
#define LY_ARRAY_FOR_ITER(ARRAY, TYPE, ITER) \
126
for (ITER = ARRAY; \
127
(ARRAY) && ((char *)ITER - (char *)ARRAY)/(sizeof(TYPE)) < (*((LY_ARRAY_COUNT_TYPE*)(ARRAY) - 1)); \
128
ITER = (TYPE*)ITER + 1)
129
140
#define LY_ARRAY_FOR_INDEX(ARRAY, INDEX) \
141
for (INDEX = 0; \
142
INDEX < LY_ARRAY_COUNT(ARRAY); \
143
++INDEX)
144
148
#define LY_ARRAY_COUNT(ARRAY) (ARRAY ? (*((LY_ARRAY_COUNT_TYPE*)(ARRAY) - 1)) : 0)
149
167
#define LY_ARRAY_FOR(ARRAY, ...) LY_ARRAY_SELECT(__VA_ARGS__, LY_ARRAY_FOR_ITER, LY_ARRAY_FOR_INDEX, LY_UNDEF)(ARRAY, __VA_ARGS__)
168
180
#define LY_LIST_FOR(START, ELEM) \
181
for ((ELEM) = (START); \
182
(ELEM); \
183
(ELEM) = (ELEM)->next)
184
194
#define LY_LIST_FOR_SAFE(START, NEXT, ELEM) \
195
for ((ELEM) = (START); \
196
(ELEM) ? (NEXT = (ELEM)->next, 1) : 0; \
197
(ELEM) = (NEXT))
198
202
typedef
enum
203
{
204
LY_TYPE_UNKNOWN
= 0,
205
LY_TYPE_BINARY
,
206
LY_TYPE_UINT8
,
207
LY_TYPE_UINT16
,
208
LY_TYPE_UINT32
,
209
LY_TYPE_UINT64
,
210
LY_TYPE_STRING
,
211
LY_TYPE_BITS
,
212
LY_TYPE_BOOL
,
213
LY_TYPE_DEC64
,
214
LY_TYPE_EMPTY
,
215
LY_TYPE_ENUM
,
216
LY_TYPE_IDENT
,
217
LY_TYPE_INST
,
218
LY_TYPE_LEAFREF
,
219
LY_TYPE_UNION
,
220
LY_TYPE_INT8
,
221
LY_TYPE_INT16
,
222
LY_TYPE_INT32
,
223
LY_TYPE_INT64
224
}
LY_DATA_TYPE
;
225
#define LY_DATA_TYPE_COUNT 20
230
extern const char *ly_data_type2str[LY_DATA_TYPE_COUNT];
231
235
typedef
enum
{
236
LY_VALUE_CANON
,
237
LY_VALUE_SCHEMA
,
238
LY_VALUE_SCHEMA_RESOLVED
,
239
LY_VALUE_XML
,
240
LY_VALUE_JSON
,
241
LY_VALUE_LYB
,
242
LY_VALUE_STR_NS
243
}
LY_VALUE_FORMAT
;
244
247
#ifdef __cplusplus
248
}
249
#endif
250
251
#endif
/* LY_TREE_H_ */
LY_VALUE_SCHEMA
Definition:
tree.h:237
LY_VALUE_STR_NS
Definition:
tree.h:242
LY_TYPE_IDENT
Definition:
tree.h:216
LY_TYPE_INT64
Definition:
tree.h:223
LY_VALUE_SCHEMA_RESOLVED
Definition:
tree.h:238
LY_TYPE_BINARY
Definition:
tree.h:205
LY_TYPE_UINT32
Definition:
tree.h:208
LY_TYPE_BOOL
Definition:
tree.h:212
LY_DATA_TYPE
LY_DATA_TYPE
YANG built-in types.
Definition:
tree.h:202
LY_VALUE_JSON
Definition:
tree.h:240
LY_TYPE_UNKNOWN
Definition:
tree.h:204
LY_VALUE_XML
Definition:
tree.h:239
LY_TYPE_ENUM
Definition:
tree.h:215
LY_TYPE_DEC64
Definition:
tree.h:213
LY_TYPE_UINT64
Definition:
tree.h:209
LY_TYPE_EMPTY
Definition:
tree.h:214
LY_TYPE_STRING
Definition:
tree.h:210
LY_TYPE_LEAFREF
Definition:
tree.h:218
LY_TYPE_BITS
Definition:
tree.h:211
LY_VALUE_LYB
Definition:
tree.h:241
LY_TYPE_UINT16
Definition:
tree.h:207
LY_VALUE_CANON
Definition:
tree.h:236
LY_VALUE_FORMAT
LY_VALUE_FORMAT
All kinds of supported value formats and prefix mappings to modules.
Definition:
tree.h:235
LY_TYPE_INT16
Definition:
tree.h:221
LY_TYPE_UNION
Definition:
tree.h:219
LY_TYPE_UINT8
Definition:
tree.h:206
LY_TYPE_INT8
Definition:
tree.h:220
LY_TYPE_INT32
Definition:
tree.h:222
LY_TYPE_INST
Definition:
tree.h:217
src
tree.h
Generated on Thu Apr 20 2023 19:43:24 for libyang by
1.8.5