libyang
3.6.1
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
LY_TYPE_UNKNOWN
= 0,
204
LY_TYPE_BINARY
,
205
LY_TYPE_UINT8
,
206
LY_TYPE_UINT16
,
207
LY_TYPE_UINT32
,
208
LY_TYPE_UINT64
,
209
LY_TYPE_STRING
,
210
LY_TYPE_BITS
,
211
LY_TYPE_BOOL
,
212
LY_TYPE_DEC64
,
213
LY_TYPE_EMPTY
,
214
LY_TYPE_ENUM
,
215
LY_TYPE_IDENT
,
216
LY_TYPE_INST
,
217
LY_TYPE_LEAFREF
,
218
LY_TYPE_UNION
,
219
LY_TYPE_INT8
,
220
LY_TYPE_INT16
,
221
LY_TYPE_INT32
,
222
LY_TYPE_INT64
223
}
LY_DATA_TYPE
;
224
#define LY_DATA_TYPE_COUNT 20
229
extern const char *ly_data_type2str[LY_DATA_TYPE_COUNT];
230
234
typedef
enum
{
235
LY_VALUE_CANON
,
236
LY_VALUE_SCHEMA
,
237
LY_VALUE_SCHEMA_RESOLVED
,
238
LY_VALUE_XML
,
239
LY_VALUE_JSON
,
240
LY_VALUE_LYB
,
241
LY_VALUE_STR_NS
242
}
LY_VALUE_FORMAT
;
243
246
#ifdef __cplusplus
247
}
248
#endif
249
250
#endif
/* LY_TREE_H_ */
LY_VALUE_SCHEMA
Definition:
tree.h:236
LY_VALUE_STR_NS
Definition:
tree.h:241
LY_TYPE_IDENT
Definition:
tree.h:215
LY_TYPE_INT64
Definition:
tree.h:222
LY_VALUE_SCHEMA_RESOLVED
Definition:
tree.h:237
LY_TYPE_BINARY
Definition:
tree.h:204
LY_TYPE_UINT32
Definition:
tree.h:207
LY_TYPE_BOOL
Definition:
tree.h:211
LY_DATA_TYPE
LY_DATA_TYPE
YANG built-in types.
Definition:
tree.h:202
LY_VALUE_JSON
Definition:
tree.h:239
LY_TYPE_UNKNOWN
Definition:
tree.h:203
LY_VALUE_XML
Definition:
tree.h:238
LY_TYPE_ENUM
Definition:
tree.h:214
LY_TYPE_DEC64
Definition:
tree.h:212
LY_TYPE_UINT64
Definition:
tree.h:208
LY_TYPE_EMPTY
Definition:
tree.h:213
LY_TYPE_STRING
Definition:
tree.h:209
LY_TYPE_LEAFREF
Definition:
tree.h:217
LY_TYPE_BITS
Definition:
tree.h:210
LY_VALUE_LYB
Definition:
tree.h:240
LY_TYPE_UINT16
Definition:
tree.h:206
LY_VALUE_CANON
Definition:
tree.h:235
LY_VALUE_FORMAT
LY_VALUE_FORMAT
All kinds of supported value formats and prefix mappings to modules.
Definition:
tree.h:234
LY_TYPE_INT16
Definition:
tree.h:220
LY_TYPE_UNION
Definition:
tree.h:218
LY_TYPE_UINT8
Definition:
tree.h:205
LY_TYPE_INT8
Definition:
tree.h:219
LY_TYPE_INT32
Definition:
tree.h:221
LY_TYPE_INST
Definition:
tree.h:216
src
tree.h
Generated on Sat Nov 23 2024 09:01:13 for libyang by
1.8.5