<NME> tree_schema.h <BEF> /** * @file tree_schema.h * @author Radek Krejci <rkrejci@cesnet.cz> * @brief libyang representation of YANG schema trees. * * Copyright (c) 2015 - 2018 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 */ #ifndef LY_TREE_SCHEMA_H_ #define LY_TREE_SCHEMA_H_ #define PCRE2_CODE_UNIT_WIDTH 8 #include <pcre2.h> #include <stdint.h> #include <stdio.h> #include "config.h" #include "log.h" #include "tree.h" #ifdef __cplusplus extern "C" { #endif struct ly_ctx; struct ly_path; struct ly_set; struct lys_module; struct lysc_node; struct lyxp_expr; /** * @page howtoSchema YANG Modules * * To be able to work with YANG data instances, libyang has to represent YANG data models. All the processed modules are stored * in libyang [context](@ref howtoContext) and loaded using [parser functions](@ref howtoSchemaParsers). It means, that there is * no way to create/change YANG module programmatically. However, all the YANG model definitions are available and can be examined * through the C structures. All the context's modules together form YANG Schema for the data being instantiated. * * Any YANG module is represented as ::lys_module. In fact, the module is represented in two different formats. As ::lys_module.parsed, * there is a parsed schema reflecting the source YANG module. It is exactly what is read from the input. This format is good for * converting from one format to another (YANG to YIN and vice versa), but it is not very useful for validating/manipulating YANG * data. Therefore, there is ::lys_module.compiled storing the compiled YANG module. It is based on the parsed module, but all the * references are resolved. It means that, for example, there are no `grouping`s or `typedef`s since they are supposed to be placed instead of * `uses` or `type` references. This split also means, that the YANG module is fully validated after compilation of the parsed * representation of the module. YANG submodules are available only in the parsed representation. When a submodule is compiled, it * is fully integrated into its main module. * * The context can contain even modules without the compiled representation. Such modules are still useful as imports of other * modules. The grouping or typedef definition can be even compiled into the importing modules. This is actually the main * difference between the imported and implemented modules in the libyang context. The implemented modules are compiled while the * imported modules are only parsed. * * By default, the module is implemented (and compiled) in case it is explicitly loaded or referenced in another module as * target of leafref, augment or deviation. This behavior can be changed via context options ::LY_CTX_ALL_IMPLEMENTED, when * all the modules in the context are marked as implemented (note the problem with multiple revisions of a single module), * or by ::LY_CTX_REF_IMPLEMENTED option, extending the set of references making the module implemented by when, must and * default statements. * * All modules with deviation definition are always marked as implemented. The imported (not implemented) module can be set implemented by ::lys_set_implemented(). But * the implemented module cannot be changed back to just imported module. Note also that only one revision of a specific module * can be implemented in a single context. The imported modules are used only as a * source of definitions for types and groupings for uses statements. The data in such modules are ignored - caller * is not allowed to create the data (including instantiating identities) defined in the model via data parsers, * the default nodes are not added into any data tree and mandatory nodes are not checked in the data trees. * * The compiled schema tree nodes are able to hold private objects (::lysc_node.priv as a pointer to a structure, * function, variable, ...) used by a caller application unless ::LY_CTX_SET_PRIV_PARSED is set, in that case * the ::lysc_node.priv pointers are used by libyang. * Note that the object is not freed by libyang when the context is being destroyed. So the caller is responsible * for freeing the provided structure after the context is destroyed or the private pointer is set to NULL in * appropriate schema nodes where the object was previously set. Also ::lysc_tree_dfs_full() can be useful to manage * the private data. * * Despite all the schema structures and their members are available as part of the libyang API and callers can use * it to navigate through the schema tree structure or to obtain various information, we recommend to use the following * macros for the specific actions. * - ::LYSC_TREE_DFS_BEGIN and ::LYSC_TREE_DFS_END to traverse the schema tree (depth-first). * - ::LY_LIST_FOR and ::LY_ARRAY_FOR as described on @ref howtoStructures page. * * Further information about modules handling can be found on the following pages: * - @subpage howtoSchemaParsers * - @subpage howtoSchemaFeatures * - @subpage howtoPlugins * - @subpage howtoSchemaPrinters * * \note There are many functions to access information from the schema trees. Details are available in * the [Schema Tree module](@ref schematree). * * For information about difference between implemented and imported modules, see the * [context description](@ref howtoContext). * * Functions List (not assigned to above subsections) * -------------------------------------------------- * - ::lys_getnext() * - ::lys_nodetype2str() * - ::lys_set_implemented() * * - ::lysc_has_when() * - ::lysc_owner_module() * * - ::lysc_node_child() * - ::lysc_node_actions() * - ::lysc_node_notifs() * * - ::lysp_node_child() * - ::lysp_node_actions() * - ::lysp_node_notifs() * - ::lysp_node_groupings() * - ::lysp_node_typedefs() */ /** * @page howtoSchemaFeatures YANG Features * * YANG feature statement is an important part of the language which can significantly affect the meaning of the schemas. * Modifying features may have similar effects as loading/removing schema from the context so it is limited to context * preparation period before working with data. YANG features, respectively their use in if-feature * statements, are evaluated as part of schema compilation so a feature-specific compiled schema tree is generated * as a result. * * To enable any features, they must currently be specified when implementing a new schema with ::lys_parse() or * ::ly_ctx_load_module(). To later examine what the status of a feature is, check its ::LYS_FENABLED flag or * search for it first with ::lys_feature_value(). Lastly, to evaluate compiled if-features, use ::lysc_iffeature_value(). * * To iterate over all features of a particular YANG module, use ::lysp_feature_next(). * * Note, that the feature's state can affect some of the output formats (e.g. Tree format). * * Functions List * -------------- * - ::lys_feature_value() * - ::lysc_iffeature_value() * - ::lysp_feature_next() */ /** * @ingroup trees * @defgroup schematree Schema Tree * @{ * * Data structures and functions to manipulate and access schema tree. */ /* *INDENT-OFF* */ /** * @brief Macro to iterate via all elements in a schema (sub)tree including input and output. * Note that __actions__ and __notifications__ of traversed nodes __are ignored__! To traverse * on all the nodes including those, use ::lysc_tree_dfs_full() instead. * * This is the opening part to the #LYSC_TREE_DFS_END - they always have to be used together. * * The function follows deep-first search algorithm: * <pre> * 1 * / \ * 2 4 * / / \ * 3 5 6 * </pre> * * Use the same parameters for #LYSC_TREE_DFS_BEGIN and #LYSC_TREE_DFS_END. While * START can be any of the lysc_node* types (including lysc_node_action and lysc_node_notif), * ELEM variable must be of the struct lysc_node* type. * * To skip a particular subtree, instead of the continue statement, set LYSC_TREE_DFS_continue * variable to non-zero value. * * Use with opening curly bracket '{' after the macro. * * @param START Pointer to the starting element processed first. * @param ELEM Iterator intended for use in the block. */ #define LYSC_TREE_DFS_BEGIN(START, ELEM) \ { ly_bool LYSC_TREE_DFS_continue = 0; struct lysc_node *LYSC_TREE_DFS_next; \ for ((ELEM) = (LYSC_TREE_DFS_next) = (struct lysc_node *)(START); \ (ELEM); \ (ELEM) = (LYSC_TREE_DFS_next), LYSC_TREE_DFS_continue = 0) /** * @brief Macro to iterate via all elements in a (sub)tree. This is the closing part * to the #LYSC_TREE_DFS_BEGIN - they always have to be used together. * * Use the same parameters for #LYSC_TREE_DFS_BEGIN and #LYSC_TREE_DFS_END. While * START can be a pointer to any of the lysc_node* types (including lysc_node_action and lysc_node_notif), * ELEM variable must be pointer to the lysc_node type. * * Use with closing curly bracket '}' after the macro. * * @param START Pointer to the starting element processed first. * @param ELEM Iterator intended for use in the block. */ #define LYSC_TREE_DFS_END(START, ELEM) \ /* select element for the next run - children first */ \ if (LYSC_TREE_DFS_continue) { \ (LYSC_TREE_DFS_next) = NULL; \ } else { \ (LYSC_TREE_DFS_next) = (struct lysc_node *)lysc_node_child(ELEM); \ } \ if (!(LYSC_TREE_DFS_next)) { \ /* no children, try siblings */ \ _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \ } \ while (!(LYSC_TREE_DFS_next)) { \ /* parent is already processed, go to its sibling */ \ (ELEM) = (ELEM)->parent; \ _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \ } } /** * @brief Helper macro for #LYSC_TREE_DFS_END, should not be used directly! */ #define _LYSC_TREE_DFS_NEXT(START, ELEM, NEXT) \ if ((ELEM) == (struct lysc_node *)(START)) { \ /* we are done, no next element to process */ \ break; \ } \ (NEXT) = (ELEM)->next; /* *INDENT-ON* */ #define LY_REV_SIZE 11 /**< revision data string length (including terminating NULL byte) */ /** * @defgroup schemanodetypes Schema Node Types * Values of the ::lysp_node.nodetype and ::lysc_node.nodetype members. * @{ */ #define LYS_UNKNOWN 0x0000 /**< uninitalized unknown statement node */ #define LYS_CONTAINER 0x0001 /**< container statement node */ #define LYS_CHOICE 0x0002 /**< choice statement node */ #define LYS_LEAF 0x0004 /**< leaf statement node */ #define LYS_LEAFLIST 0x0008 /**< leaf-list statement node */ #define LYS_LIST 0x0010 /**< list statement node */ #define LYS_ANYXML 0x0020 /**< anyxml statement node */ #define LYS_ANYDATA 0x0060 /**< anydata statement node, in tests it can be used for both #LYS_ANYXML and #LYS_ANYDATA */ #define LYS_CASE 0x0080 /**< case statement node */ #define LYS_RPC 0x0100 /**< RPC statement node */ #define LYS_ACTION 0x0200 /**< action statement node */ #define LYS_NOTIF 0x0400 /**< notification statement node */ #define LYS_USES 0x0800 /**< uses statement node */ #define LYS_INPUT 0x1000 /**< RPC/action input node */ #define LYS_OUTPUT 0x2000 /**< RPC/action output node */ #define LYS_GROUPING 0x4000 #define LYS_AUGMENT 0x8000 #define LYS_NODETYPE_MASK 0xffff /**< Mask for nodetypes, the value is limited for 16 bits */ /** @} schemanodetypes */ /** * @brief Generic test for operation statements. * * This macro matches a subset of schema nodes that maps to common ::lysc_node or ::lysp_node structures. To match all * such nodes, use ::LY_STMT_IS_NODE() * * This macro matches action and RPC. */ #define LY_STMT_IS_OP(STMT) (((STMT) == LY_STMT_ACTION) || ((STMT) == LY_STMT_RPC)) /** * @brief Generic test for schema data nodes. * * This macro matches a subset of schema nodes that maps to common ::lysc_node or ::lysp_node structures. To match all * such nodes, use ::LY_STMT_IS_NODE() * * This macro matches anydata, anyxml, augment, case, choice, container, grouping, leaf, leaf-list, list and uses. Note * that the list of statements that can appear in parsed or compiled schema trees differs (e.g. no uses in compiled tree). */ #define LY_STMT_IS_DATA_NODE(STMT) (((STMT) >= LY_STMT_ANYDATA) && ((STMT) <= LY_STMT_LIST)) /** * @brief Generic test for any schema node that maps to common ::lysc_node or ::lysp_node structures. * * Note that the list of statements that can appear in parsed or compiled schema trees differs (e.g. no uses in compiled tree). * * To check for some of the subsets of this test, try ::LY_STMT_IS_DATA_NODE() or ::LY_STMT_IS_OP(). * * This macro matches action, anydata, anyxml, augment, case, choice, container, grouping, input, leaf, leaf-list, list, * notification, output, RPC and uses. */ #define LY_STMT_IS_NODE(STMT) (((STMT) >= LY_STMT_NOTIFICATION) && ((STMT) <= LY_STMT_LIST)) /** * @brief List of YANG statements */ enum ly_stmt { LY_STMT_NONE = 0, LY_STMT_NOTIFICATION, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node_notif *`. The RPCs/Actions and Notifications are expected in a separated lists than the rest of data definition nodes as it is done in generic structures of libyang. */ LY_STMT_INPUT, LY_STMT_OUTPUT, /* LY_STMT_IS_OP */ LY_STMT_ACTION, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node_action *`. The RPCs/Actions and Notifications are expected in a separated lists than the rest of data definition nodes as it is done in generic structures of libyang. */ LY_STMT_RPC, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node_action *`. The RPCs/Actions and Notifications are expected in a separated lists than the rest of data definition nodes as it is done in generic structures of libyang. */ /* LY_STMT_IS_DATA_NODE */ LY_STMT_ANYDATA, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`. Note that due to ::lysc_node compatibility the anydata is expected to be actually mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang. */ LY_STMT_ANYXML, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`. Note that due to ::lysc_node compatibility the anyxml is expected to be actually mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang. */ LY_STMT_AUGMENT, LY_STMT_CASE, /**< TODO is it possible to compile cases without the parent choice? */ LY_STMT_CHOICE, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`. Note that due to ::lysc_node compatibility the choice is expected to be actually mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang. */ LY_STMT_CONTAINER, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`. Note that due to ::lysc_node compatibility the container is expected to be actually mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang. */ LY_STMT_GROUPING, LY_STMT_LEAF, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`. Note that due to ::lysc_node compatibility the leaf is expected to be actually mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang. */ LY_STMT_LEAF_LIST, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`. Note that due to ::lysc_node compatibility the leaf-list is expected to be actually mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang. */ LY_STMT_LIST, /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`. Note that due to ::lysc_node compatibility the list is expected to be actually mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and Notifications are expected in a separated lists as it is done in generic structures of libyang. */ LY_STMT_USES, /* rest */ LY_STMT_ARGUMENT, LY_STMT_BASE, LY_STMT_BELONGS_TO, LY_STMT_BIT, LY_STMT_CONFIG, /**< in ::lysc_ext_substmt.storage stored as a pointer to `uint16_t`, only cardinality < #LY_STMT_CARD_SOME is allowed */ LY_STMT_CONTACT, LY_STMT_DEFAULT, LY_STMT_DESCRIPTION, /**< in ::lysc_ext_substmt.storage stored as a pointer to `const char *` (cardinality < #LY_STMT_CARD_SOME) or as a pointer to a [sized array](@ref sizedarrays) `const char **` */ LY_STMT_DEVIATE, LY_STMT_DEVIATION, LY_STMT_ENUM, LY_STMT_ERROR_APP_TAG, LY_STMT_ERROR_MESSAGE, LY_STMT_EXTENSION, LY_STMT_EXTENSION_INSTANCE, LY_STMT_FEATURE, LY_STMT_FRACTION_DIGITS, LY_STMT_IDENTITY, LY_STMT_IF_FEATURE, /**< if-feature statements are not compiled, they are evaluated and the parent statement is preserved only in case the evaluation of all the if-feature statements is true. Therefore there is no storage expected. */ LY_STMT_IMPORT, LY_STMT_INCLUDE, LY_STMT_KEY, LY_STMT_LENGTH, LY_STMT_MANDATORY, /**< in ::lysc_ext_substmt.storage stored as a pointer to `uint16_t`, only cardinality < #LY_STMT_CARD_SOME is allowed */ LY_STMT_MAX_ELEMENTS, LY_STMT_MIN_ELEMENTS, LY_STMT_MODIFIER, LY_STMT_MODULE, LY_STMT_MUST, LY_STMT_NAMESPACE, LY_STMT_ORDERED_BY, LY_STMT_ORGANIZATION, LY_STMT_PATH, LY_STMT_PATTERN, LY_STMT_POSITION, LY_STMT_PREFIX, LY_STMT_PRESENCE, LY_STMT_RANGE, LY_STMT_REFERENCE, /**< in ::lysc_ext_substmt.storage stored as a pointer to `const char *` (cardinality < #LY_STMT_CARD_SOME) or as a pointer to a [sized array](@ref sizedarrays) `const char **` */ LY_STMT_REFINE, LY_STMT_REQUIRE_INSTANCE, LY_STMT_REVISION, LY_STMT_REVISION_DATE, LY_STMT_STATUS, /**< in ::lysc_ext_substmt.storage stored as a pointer to `uint16_t`, only cardinality < #LY_STMT_CARD_SOME is allowed */ LY_STMT_SUBMODULE, LY_STMT_TYPE, /**< in ::lysc_ext_substmt.storage stored as a pointer to `struct lysc_type *` (cardinality < #LY_STMT_CARD_SOME) or as a pointer to a [sized array](@ref sizedarrays) `struct lysc_type **` */ LY_STMT_TYPEDEF, LY_STMT_UNIQUE, LY_STMT_UNITS, /**< in ::lysc_ext_substmt.storage stored as a pointer to `const char *` (cardinality < #LY_STMT_CARD_SOME) or as a pointer to a [sized array](@ref sizedarrays) `const char **` */ LY_STMT_VALUE, LY_STMT_WHEN, LY_STMT_YANG_VERSION, LY_STMT_YIN_ELEMENT, /* separated from the list of statements * the following tokens are part of the syntax and parsers have to work * with them, but they are not a standard YANG statements */ LY_STMT_SYNTAX_SEMICOLON, LY_STMT_SYNTAX_LEFT_BRACE, LY_STMT_SYNTAX_RIGHT_BRACE, /* * YIN-specific tokens, still they are part of the syntax, but not the standard statements */ LY_STMT_ARG_TEXT, LY_STMT_ARG_VALUE }; /** * @brief Stringify statement identifier. * @param[in] stmt The statement identifier to stringify. * @return Constant string representation of the given @p stmt. */ LIBYANG_API_DECL const char *ly_stmt2str(enum ly_stmt stmt); /** * @brief Convert nodetype to statement identifier * @param[in] nodetype Nodetype to convert. * @return Statement identifier representing the given @p nodetype. */ LIBYANG_API_DECL enum ly_stmt lys_nodetype2stmt(uint16_t nodetype); /** * @brief Possible cardinalities of the YANG statements. * * Used in extensions plugins to define cardinalities of the extension instance substatements. */ enum ly_stmt_cardinality { LY_STMT_CARD_OPT, /* 0..1 */ LY_STMT_CARD_MAND, /* 1 */ LY_STMT_CARD_SOME, /* 1..n */ LY_STMT_CARD_ANY /* 0..n */ }; /** * @brief YANG import-stmt */ struct lysp_import { struct lys_module *module; /**< pointer to the imported module (mandatory, but resolved when the referring module is completely parsed) */ const char *name; /**< name of the imported module (mandatory) */ const char *prefix; /**< prefix for the data from the imported schema (mandatory) */ const char *dsc; /**< description */ const char *ref; /**< reference */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ uint16_t flags; /**< LYS_INTERNAL value (@ref snodeflags) */ char rev[LY_REV_SIZE]; /**< revision-date of the imported module */ }; /** * @brief YANG include-stmt */ struct lysp_include { struct lysp_submodule *submodule;/**< pointer to the parsed submodule structure (mandatory, but resolved when the referring module is completely parsed) */ const char *name; /**< name of the included submodule (mandatory) */ const char *dsc; /**< description */ const char *ref; /**< reference */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ char rev[LY_REV_SIZE]; /**< revision-date of the included submodule */ ly_bool injected; /**< flag to mark includes copied into main module from submodules, only for backward compatibility with YANG 1.0, which does not require the main module to include all submodules. */ }; /** * @brief YANG extension-stmt */ struct lysp_ext { const char *name; /**< extension name */ const char *argname; /**< argument name, NULL if not specified */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ uint16_t flags; /**< LYS_STATUS_* and LYS_YINELEM_* values (@ref snodeflags) */ struct lysc_ext *compiled; /**< pointer to the compiled extension definition. The extension definition is compiled only if there is compiled extension instance, otherwise this pointer remains NULL. The compiled extension definition is shared among all extension instances. */ }; /** * @brief Helper structure for generic storage of the extension instances content. */ struct lysp_stmt { const char *stmt; /**< identifier of the statement */ const char *arg; /**< statement's argument */ LY_VALUE_FORMAT format; /**< prefix format of the identifier/argument (::LY_VALUE_XML is YIN format) */ void *prefix_data; /**< Format-specific data for prefix resolution (see ly_resolve_prefix()) */ struct lysp_stmt *next; /**< link to the next statement */ struct lysp_stmt *child; /**< list of the statement's substatements (linked list) */ uint16_t flags; /**< statement flags, can be set to LYS_YIN_ATTR */ enum ly_stmt kw; /**< numeric respresentation of the stmt value */ }; #define LYS_YIN 0x1 /**< used to specify input format of extension instance */ /** * @brief YANG extension instance */ struct lysp_ext_instance { const char *name; /**< extension identifier, including possible prefix */ const char *argument; /**< optional value of the extension's argument */ LY_VALUE_FORMAT format; /**< prefix format of the extension name/argument (::LY_VALUE_XML is YIN format) */ struct lysp_node *parsed; /**< Simply parsed (unresolved) YANG schema tree serving as a cache. Only lys_compile_extension_instance() can set this. */ void *prefix_data; /**< Format-specific data for prefix resolution (see ly_resolve_prefix()) */ struct lysp_stmt *child; /**< list of the extension's substatements (linked list) */ void *parent; /**< pointer to the parent element holding the extension instance(s), use ::lysp_ext_instance#parent_stmt to access the schema element */ enum ly_stmt parent_stmt; /**< value identifying placement of the extension instance */ LY_ARRAY_COUNT_TYPE parent_stmt_index; /**< in case the instance is in a substatement, this identifies the index of that substatement in its [sized array](@ref sizedarrays) (if any) */ uint16_t flags; /**< LYS_INTERNAL value (@ref snodeflags) */ }; /** * @brief YANG feature-stmt */ struct lysp_feature { const char *name; /**< feature name (mandatory) */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysc_iffeature *iffeatures_c; /**< compiled if-features */ struct lysp_feature **depfeatures; /**< list of pointers to other features depending on this one ([sized array](@ref sizedarrays)) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ uint16_t flags; /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_* values and LYS_FENABLED are allowed */ }; /** * @brief Compiled YANG if-feature-stmt */ struct lysc_iffeature { uint8_t *expr; /**< 2bits array describing the if-feature expression in prefix format, see @ref ifftokens */ struct lysp_feature **features; /**< array of pointers to the features used in expression ([sized array](@ref sizedarrays)) */ }; /** * @brief Qualified name (optional prefix followed by an identifier). */ struct lysp_qname { const char *str; /**< qualified name string */ const struct lysp_module *mod; /**< module to resolve any prefixes found in the string, it must be stored explicitly because of deviations/refines */ }; /** * @brief YANG identity-stmt */ struct lysp_ident { const char *name; /**< identity name (mandatory), including possible prefix */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ const char **bases; /**< list of base identifiers ([sized array](@ref sizedarrays)) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ uint16_t flags; /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_ values are allowed */ }; /** * @brief Covers restrictions: range, length, pattern, must */ struct lysp_restr { #define LYSP_RESTR_PATTERN_ACK 0x06 #define LYSP_RESTR_PATTERN_NACK 0x15 struct lysp_qname arg; /**< The restriction expression/value (mandatory); in case of pattern restriction, the first byte has a special meaning: 0x06 (ACK) for regular match and 0x15 (NACK) for invert-match */ const char *emsg; /**< error-message */ const char *eapptag; /**< error-app-tag value */ const char *dsc; /**< description */ const char *ref; /**< reference */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; /** * @brief YANG revision-stmt */ struct lysp_revision { char date[LY_REV_SIZE]; /**< revision date (madatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; /** * @brief Enumeration/Bit value definition */ struct lysp_type_enum { const char *name; /**< name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ int64_t value; /**< enum's value or bit's position */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ uint16_t flags; /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_ and LYS_SET_VALUE values are allowed */ }; /** * @brief YANG type-stmt * * Some of the items in the structure may be mandatory, but it is necessary to resolve the type's base type first */ struct lysp_type { const char *name; /**< name of the type (mandatory) */ struct lysp_restr *range; /**< allowed values range - numerical, decimal64 */ struct lysp_restr *length; /**< allowed length of the value - string, binary */ struct lysp_restr *patterns; /**< list of patterns ([sized array](@ref sizedarrays)) - string */ struct lysp_type_enum *enums; /**< list of enum-stmts ([sized array](@ref sizedarrays)) - enum */ struct lysp_type_enum *bits; /**< list of bit-stmts ([sized array](@ref sizedarrays)) - bits */ struct lyxp_expr *path; /**< parsed path - leafref */ const char **bases; /**< list of base identifiers ([sized array](@ref sizedarrays)) - identityref */ struct lysp_type *types; /**< list of sub-types ([sized array](@ref sizedarrays)) - union */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ const struct lysp_module *pmod; /**< (sub)module where the type is defined (needed for deviations) */ struct lysc_type *compiled; /**< pointer to the compiled custom type, not used for built-in types */ uint8_t fraction_digits; /**< number of fraction digits - decimal64 */ uint8_t require_instance; /**< require-instance flag - leafref, instance */ uint16_t flags; /**< [schema node flags](@ref spnodeflags) */ }; /** * @brief YANG typedef-stmt */ struct lysp_tpdf { const char *name; /**< name of the newly defined type (mandatory) */ const char *units; /**< units of the newly defined type */ struct lysp_qname dflt; /**< default value of the newly defined type, it may or may not be a qualified name */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ struct lysp_type type; /**< base type from which the typedef is derived (mandatory) */ uint16_t flags; /**< [schema node flags](@ref spnodeflags) */ }; /** * @brief YANG when-stmt */ struct lysp_when { uint8_t version:4; /**< yang-version (LYS_VERSION values) */ }; /** * @brief Compiled YANG schema tree structure representing YANG module. * struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_restr *musts; /**< list of must restrictions ([sized array](@ref sizedarrays)) */ const char *presence; /**< presence description */ struct lysp_qname *dflts; /**< list of default values ([sized array](@ref sizedarrays)) */ uint32_t min; /**< min-elements constraint */ uint32_t max; /**< max-elements constraint, 0 means unbounded */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ }; /** * @ingroup schematree * @defgroup deviatetypes Deviate types * * Type of the deviate operation (used as ::lysp_deviate.mod) * * @{ */ #define LYS_DEV_NOT_SUPPORTED 1 /**< deviate type not-supported */ #define LYS_DEV_ADD 2 /**< deviate type add */ #define LYS_DEV_DELETE 3 /**< deviate type delete */ #define LYS_DEV_REPLACE 4 /**< deviate type replace */ /** @} deviatetypes */ /** * @brief Generic deviate structure to get type and cast to lysp_deviate_* structure */ struct lysp_deviate { uint8_t mod; /**< [type](@ref deviatetypes) of the deviate modification */ struct lysp_deviate *next; /**< next deviate structure in the list */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; struct lysp_deviate_add { uint8_t mod; /**< [type](@ref deviatetypes) of the deviate modification */ struct lysp_deviate *next; /**< next deviate structure in the list */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ const char *units; /**< units of the values */ struct lysp_restr *musts; /**< list of must restrictions ([sized array](@ref sizedarrays)) */ struct lysp_qname *uniques; /**< list of uniques specifications ([sized array](@ref sizedarrays)) */ struct lysp_qname *dflts; /**< list of default values ([sized array](@ref sizedarrays)) */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ uint32_t min; /**< min-elements constraint */ uint32_t max; /**< max-elements constraint, 0 means unbounded */ }; struct lysp_deviate_del { uint8_t mod; /**< [type](@ref deviatetypes) of the deviate modification */ struct lysp_deviate *next; /**< next deviate structure in the list */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ const char *units; /**< units of the values */ struct lysp_restr *musts; /**< list of must restrictions ([sized array](@ref sizedarrays)) */ struct lysp_qname *uniques; /**< list of uniques specifications ([sized array](@ref sizedarrays)) */ struct lysp_qname *dflts; /**< list of default values ([sized array](@ref sizedarrays)) */ }; struct lysp_deviate_rpl { uint8_t mod; /**< [type](@ref deviatetypes) of the deviate modification */ struct lysp_deviate *next; /**< next deviate structure in the list */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ struct lysp_type *type; /**< type of the node */ const char *units; /**< units of the values */ struct lysp_qname dflt; /**< default value */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ uint32_t min; /**< min-elements constraint */ uint32_t max; /**< max-elements constraint, 0 means unbounded */ }; struct lysp_deviation { const char *nodeid; /**< target absolute schema nodeid (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_deviate *deviates; /**< list of deviate specifications (linked list) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; /** * @ingroup snodeflags * @defgroup spnodeflags Parsed schema nodes flags * * Various flags for parsed schema nodes (used as ::lysp_node.flags). * * 1 - container 6 - anydata/anyxml 11 - output 16 - grouping 21 - enum * 2 - choice 7 - case 12 - feature 17 - uses 22 - type * 3 - leaf 8 - notification 13 - identity 18 - refine 23 - stmt * 4 - leaflist 9 - rpc 14 - extension 19 - augment * 5 - list 10 - input 15 - typedef 20 - deviate * * 1 1 1 1 1 1 1 1 1 1 2 2 2 2 * bit name 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 * ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 1 LYS_CONFIG_W |x|x|x|x|x|x| | | | | | | | | | | |x| |x| | | | * LYS_SET_BASE | | | | | | | | | | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 2 LYS_CONFIG_R |x|x|x|x|x|x| | | | | | | | | | | |x| |x| | | | * LYS_SET_BIT | | | | | | | | | | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 3 LYS_STATUS_CURR |x|x|x|x|x|x|x|x|x| | |x|x|x|x|x|x| |x|x|x| | | * LYS_SET_ENUM | | | | | | | | | | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 4 LYS_STATUS_DEPRC |x|x|x|x|x|x|x|x|x| | |x|x|x|x|x|x| |x|x|x| | | * LYS_SET_FRDIGITS | | | | | | | | | | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 5 LYS_STATUS_OBSLT |x|x|x|x|x|x|x|x|x| | |x|x|x|x|x|x| |x|x|x| | | * LYS_SET_LENGTH | | | | | | | | | | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 6 LYS_MAND_TRUE | |x|x| | |x| | | | | | | | | | | |x| |x| | | | * LYS_SET_PATH | | | | | | | | | | | | | | | | | | | | | |x| | * LYS_FENABLED | | | | | | | | | | | |x| | | | | | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 7 LYS_MAND_FALSE | |x|x| | |x| | | | | | | | | | | |x| |x| | | | * LYS_ORDBY_USER | | | |x|x| | | | | | | | | | | | | | | | | | | * LYS_SET_PATTERN | | | | | | | | | | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 8 LYS_ORDBY_SYSTEM | | | |x|x| | | | | | | | | | | | | | | | | | | * LYS_YINELEM_TRUE | | | | | | | | | | | | | |x| | | | | | | | | | * LYS_SET_RANGE | | | | | | | | | | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 9 LYS_YINELEM_FALSE| | | | | | | | | | | | | |x| | | | | | | | | | * LYS_SET_TYPE | | | | | | | | | | | | | | | | | | | | | |x| | * LYS_SINGLEQUOTED | | | | | | | | | | | | | | | | | | | | | | |x| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 10 LYS_SET_VALUE | | | | | | | | | | | | | | | | | | | | |x| | | * LYS_SET_REQINST | | | | | | | | | | | | | | | | | | | | | |x| | * LYS_SET_MIN | | | |x|x| | | | | | | | | | | | |x| |x| | | | * LYS_DOUBLEQUOTED | | | | | | | | | | | | | | | | | | | | | | |x| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 11 LYS_SET_MAX | | | |x|x| | | | | | | | | | | | |x| |x| | | | * LYS_USED_GRP | | | | | | | | | | | | | | | |x| | | | | | | | * LYS_YIN_ATTR | | | | | | | | | | | | | | | | | | | | | | |x| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 12 LYS_YIN_ARGUMENT | | | | | | | | | | | | | | | | | | | | | | |x| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 13 LYS_INTERNAL |x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x| * ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ /** * @ingroup snodeflags * @defgroup scnodeflags Compiled schema nodes flags * * Various flags for compiled schema nodes (used as ::lysc_node.flags). * * 1 - container 6 - anydata/anyxml 11 - identity * 2 - choice 7 - case 12 - extension * 3 - leaf 8 - notification 13 - bitenum * 4 - leaflist 9 - rpc/action 14 - when * 5 - list 10 - feature * * 1 1 1 1 1 * bit name 1 2 3 4 5 6 7 8 9 0 1 2 3 4 * ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 1 LYS_CONFIG_W |x|x|x|x|x|x|x| | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 2 LYS_CONFIG_R |x|x|x|x|x|x|x| | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 3 LYS_STATUS_CURR |x|x|x|x|x|x|x|x|x|x|x|x|x|x| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 4 LYS_STATUS_DEPRC |x|x|x|x|x|x|x|x|x|x|x|x|x|x| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 5 LYS_STATUS_OBSLT |x|x|x|x|x|x|x|x|x|x|x|x|x|x| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 6 LYS_MAND_TRUE |x|x|x|x|x|x| | | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 7 LYS_ORDBY_USER | | | |x|x| | | | | | | | | | * LYS_MAND_FALSE | |x|x| | |x| | | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 8 LYS_ORDBY_SYSTEM | | | |x|x| | | | | | | | | | * LYS_PRESENCE |x| | | | | | | | | | | | | | * LYS_UNIQUE | | |x| | | | | | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 9 LYS_KEY | | |x| | | | | | | | | | | | * LYS_DISABLED | | | | | | | | | | | | |x| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 10 LYS_SET_DFLT | | |x|x| | |x| | | | | | | | * LYS_IS_ENUM | | | | | | | | | | | | |x| | * LYS_KEYLESS | | | | |x| | | | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 11 LYS_SET_UNITS | | |x|x| | | | | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 12 LYS_SET_CONFIG |x|x|x|x|x|x| | | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 13 LYS_IS_INPUT |x|x|x|x|x|x|x| | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 14 LYS_IS_OUTPUT |x|x|x|x|x|x|x| | | | | | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * 15 LYS_IS_NOTIF |x|x|x|x|x|x|x| | | | | | | | * ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * */ /** * @defgroup snodeflags Schema nodes flags * * Various flags for schema nodes ([parsed](@ref spnodeflags) as well as [compiled](@ref scnodeflags)). * * @{ */ #define LYS_CONFIG_W 0x01 /**< config true; */ #define LYS_CONFIG_R 0x02 /**< config false; */ #define LYS_CONFIG_MASK 0x03 /**< mask for config value */ #define LYS_STATUS_CURR 0x04 /**< status current; */ #define LYS_STATUS_DEPRC 0x08 /**< status deprecated; */ #define LYS_STATUS_OBSLT 0x10 /**< status obsolete; */ #define LYS_STATUS_MASK 0x1C /**< mask for status value */ #define LYS_MAND_TRUE 0x20 /**< mandatory true; applicable only to ::lysp_node_choice/::lysc_node_choice, ::lysp_node_leaf/::lysc_node_leaf and ::lysp_node_anydata/::lysc_node_anydata. The ::lysc_node_leaflist and ::lysc_node_leaflist have this flag in case that min-elements > 0. The ::lysc_node_container has this flag if it is not a presence container and it has at least one child with LYS_MAND_TRUE. */ #define LYS_MAND_FALSE 0x40 /**< mandatory false; applicable only to ::lysp_node_choice/::lysc_node_choice, ::lysp_node_leaf/::lysc_node_leaf and ::lysp_node_anydata/::lysc_node_anydata. This flag is present only in case the mandatory false statement was explicitly specified. */ #define LYS_MAND_MASK 0x60 /**< mask for mandatory values */ #define LYS_PRESENCE 0x80 /**< flag for presence property of a container, but it is not only for explicit presence containers, but also for NP containers with some meaning, applicable only to ::lysc_node_container */ #define LYS_UNIQUE 0x80 /**< flag for leafs being part of a unique set, applicable only to ::lysc_node_leaf */ #define LYS_KEY 0x0100 /**< flag for leafs being a key of a list, applicable only to ::lysc_node_leaf */ #define LYS_KEYLESS 0x0200 /**< flag for list without any key, applicable only to ::lysc_node_list */ #define LYS_DISABLED 0x0100 /**< internal flag for a disabled statement, used only for bits/enums */ #define LYS_FENABLED 0x20 /**< feature enabled flag, applicable only to ::lysp_feature. */ #define LYS_ORDBY_SYSTEM 0x80 /**< ordered-by system configuration lists, applicable only to ::lysc_node_leaflist/::lysp_node_leaflist and ::lysc_node_list/::lysp_node_list */ #define LYS_ORDBY_USER 0x40 /**< ordered-by user configuration lists, applicable only to ::lysc_node_leaflist/::lysp_node_leaflist and ::lysc_node_list/::lysp_node_list; is always set for state leaf-lists, and key-less lists */ #define LYS_ORDBY_MASK 0x60 /**< mask for ordered-by values */ #define LYS_YINELEM_TRUE 0x80 /**< yin-element true for extension's argument */ #define LYS_YINELEM_FALSE 0x0100 /**< yin-element false for extension's argument */ #define LYS_YINELEM_MASK 0x0180 /**< mask for yin-element value */ #define LYS_USED_GRP 0x0400 /**< internal flag for validating not-instantiated groupings (resp. do not validate again the instantiated groupings). */ #define LYS_SET_VALUE 0x0200 /**< value attribute is set */ #define LYS_SET_MIN 0x0200 /**< min attribute is set */ #define LYS_SET_MAX 0x0400 /**< max attribute is set */ #define LYS_SET_BASE 0x0001 /**< type's flag for present base substatement */ #define LYS_SET_BIT 0x0002 /**< type's flag for present bit substatement */ #define LYS_SET_ENUM 0x0004 /**< type's flag for present enum substatement */ #define LYS_SET_FRDIGITS 0x0008 /**< type's flag for present fraction-digits substatement */ #define LYS_SET_LENGTH 0x0010 /**< type's flag for present length substatement */ #define LYS_SET_PATH 0x0020 /**< type's flag for present path substatement */ #define LYS_SET_PATTERN 0x0040 /**< type's flag for present pattern substatement */ #define LYS_SET_RANGE 0x0080 /**< type's flag for present range substatement */ #define LYS_SET_TYPE 0x0100 /**< type's flag for present type substatement */ #define LYS_SET_REQINST 0x0200 /**< type's flag for present require-instance substatement */ #define LYS_SET_DFLT 0x0200 /**< flag to mark leaf/leaflist with own (or refined) default value, not a default value taken from its type, and default cases of choice. This information is important for refines, since it is prohibited to make leafs with default statement mandatory. In case the default leaf value is taken from type, it is thrown away when it is refined to be mandatory node. Similarly it is used for deviations to distinguish between own default or the default values taken from the type. */ #define LYS_SET_UNITS 0x0400 /**< flag to know if the leaf's/leaflist's units are their own (flag set) or it is taken from the type. */ #define LYS_SET_CONFIG 0x0800 /**< flag to know if the config property was set explicitly (flag set) or it is inherited. */ #define LYS_SINGLEQUOTED 0x0100 /**< flag for single-quoted argument of an extension instance's substatement, only when the source is YANG */ #define LYS_DOUBLEQUOTED 0x0200 /**< flag for double-quoted argument of an extension instance's substatement, only when the source is YANG */ #define LYS_YIN_ATTR 0x0400 /**< flag to identify YIN attribute parsed as extension's substatement, only when the source is YIN */ #define LYS_YIN_ARGUMENT 0x0800 /**< flag to identify statement representing extension's argument, only when the source is YIN */ #define LYS_INTERNAL 0x1000 /**< flag to identify internal parsed statements that should not be printed */ #define LYS_IS_ENUM 0x0200 /**< flag to simply distinguish type in struct lysc_type_bitenum_item */ #define LYS_IS_INPUT 0x1000 /**< flag for nodes that are in the subtree of an input statement */ #define LYS_IS_OUTPUT 0x2000 /**< flag for nodes that are in the subtree of an output statement */ #define LYS_IS_NOTIF 0x4000 /**< flag for nodes that are in the subtree of a notification statement */ #define LYS_FLAGS_COMPILED_MASK 0xff /**< mask for flags that maps to the compiled structures */ /** @} snodeflags */ /** * @brief Generic YANG data node */ struct lysp_node { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t nodetype; /**< [type of the node](@ref schemanodetypes) (mandatory) */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ struct lysp_node *next; /**< next sibling node (NULL if there is no one) */ const char *name; /**< node name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)), must be qname because of refines */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; /** * @brief Extension structure of the lysp_node for YANG container */ struct lysp_node_container { union { struct lysp_node node; /**< implicit cast for the members compatible with ::lysp_node */ struct { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t nodetype; /**< LYS_CONTAINER */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ struct lysp_node *next; /**< pointer to the next sibling node (NULL if there is no one) */ const char *name; /**< node name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; }; /**< common part corresponding to ::lysp_node */ /* container */ struct lysp_restr *musts; /**< list of must restrictions ([sized array](@ref sizedarrays)) */ struct lysp_when *when; /**< when statement */ const char *presence; /**< presence description */ struct lysp_tpdf *typedefs; /**< list of typedefs ([sized array](@ref sizedarrays)) */ struct lysp_node_grp *groupings; /**< list of groupings (linked list) */ struct lysp_node *child; /**< list of data nodes (linked list) */ struct lysp_node_action *actions;/**< list of actions (linked list) */ struct lysp_node_notif *notifs; /**< list of notifications (linked list) */ }; struct lysp_node_leaf { union { struct lysp_node node; /**< implicit cast for the members compatible with ::lysp_node */ struct { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t nodetype; /**< LYS_LEAF */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ struct lysp_node *next; /**< pointer to the next sibling node (NULL if there is no one) */ const char *name; /**< node name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; }; /**< common part corresponding to ::lysp_node */ /* leaf */ struct lysp_restr *musts; /**< list of must restrictions ([sized array](@ref sizedarrays)) */ struct lysp_when *when; /**< when statement */ struct lysp_type type; /**< type of the leaf node (mandatory) */ const char *units; /**< units of the leaf's type */ struct lysp_qname dflt; /**< default value, it may or may not be a qualified name */ }; struct lysp_node_leaflist { union { struct lysp_node node; /**< implicit cast for the members compatible with ::lysp_node */ struct { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t nodetype; /**< LYS_LEAFLIST */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ struct lysp_node *next; /**< pointer to the next sibling node (NULL if there is no one) */ const char *name; /**< node name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; }; /**< common part corresponding to ::lysp_node */ /* leaf-list */ struct lysp_restr *musts; /**< list of must restrictions ([sized array](@ref sizedarrays)) */ struct lysp_when *when; /**< when statement */ struct lysp_type type; /**< type of the leaf node (mandatory) */ const char *units; /**< units of the leaf's type */ struct lysp_qname *dflts; /**< list of default values ([sized array](@ref sizedarrays)), they may or may not be qualified names */ uint32_t min; /**< min-elements constraint */ uint32_t max; /**< max-elements constraint, 0 means unbounded */ }; struct lysp_node_list { union { struct lysp_node node; /**< implicit cast for the members compatible with ::lysp_node */ struct { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t nodetype; /**< LYS_LIST */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ struct lysp_node *next; /**< pointer to the next sibling node (NULL if there is no one) */ const char *name; /**< node name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; }; /**< common part corresponding to ::lysp_node */ /* list */ struct lysp_restr *musts; /**< list of must restrictions ([sized array](@ref sizedarrays)) */ struct lysp_when *when; /**< when statement */ const char *key; /**< keys specification */ struct lysp_tpdf *typedefs; /**< list of typedefs ([sized array](@ref sizedarrays)) */ struct lysp_node_grp *groupings; /**< list of groupings (linked list) */ struct lysp_node *child; /**< list of data nodes (linked list) */ struct lysp_node_action *actions;/**< list of actions (linked list) */ struct lysp_node_notif *notifs; /**< list of notifications (linked list) */ struct lysp_qname *uniques; /**< list of unique specifications ([sized array](@ref sizedarrays)) */ uint32_t min; /**< min-elements constraint */ uint32_t max; /**< max-elements constraint, 0 means unbounded */ }; struct lysp_node_choice { union { struct lysp_node node; /**< implicit cast for the members compatible with ::lysp_node */ struct { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t nodetype; /**< LYS_CHOICE */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ struct lysp_node *next; /**< pointer to the next sibling node (NULL if there is no one) */ const char *name; /**< node name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; }; /**< common part corresponding to ::lysp_node */ /* choice */ struct lysp_node *child; /**< list of data nodes (linked list) */ struct lysp_when *when; /**< when statement */ struct lysp_qname dflt; /**< default case */ }; struct lysp_node_case { union { struct lysp_node node; /**< implicit cast for the members compatible with ::lysp_node */ struct { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t nodetype; /**< LYS_CASE */ uint16_t flags; /**< [schema node flags](@ref snodeflags) */ struct lysp_node *next; /**< pointer to the next sibling node (NULL if there is no one) */ const char *name; /**< node name (mandatory) */ const char *dsc; /**< description statement */ const char *ref; /**< reference statement */ struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */ struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */ }; }; /**< common part corresponding to ::lysp_node */ /* case */ struct lysp_node *child; /**< list of data nodes (linked list) */ struct lysp_when *when; /**< when statement */ }; struct lysp_node_anydata { union { struct lysp_node node; /**< implicit cast for the members compatible with ::lysp_node */ struct { struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */ uint16_t
{'commit': 'diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex 403a6b04..31662ba4 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -157,6 +157,7 @@ set(libsrc\n     src/hash_table.c\n     src/set.c\n     src/context.c\n+    src/tree_schema.c\n     src/parser_yang.c\n     src/xml.c)\n \ndiff --git a/src/tree_schema.c b/src/tree_schema.c\nnew file mode 100644\nindex 00000000..d9a5d32f\n--- /dev/null\n+++ b/src/tree_schema.c\n@@ -0,0 +1,31 @@\n+/**\n+ * @file tree_schema.c\n+ * @author Radek Krejci <rkrejci@cesnet.cz>\n+ * @brief Schema tree implementation\n+ *\n+ * Copyright (c) 2015 - 2018 CESNET, z.s.p.o.\n+ *\n+ * This source code is licensed under BSD 3-Clause License (the "License").\n+ * You may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     https://opensource.org/licenses/BSD-3-Clause\n+ */\n+\n+#include "libyang.h"\n+#include "common.h"\n+\n+API void\n+lysp_module_free(struct lysp_module *module)\n+{\n+    struct ly_ctx *ctx;\n+\n+    LY_CHECK_ARG_RET(NULL, module,);\n+    ctx = module->ctx;\n+\n+    lydict_remove(ctx, module->name);\n+    lydict_remove(ctx, module->ns);\n+    lydict_remove(ctx, module->prefix);\n+\n+    free(module);\n+}\ndiff --git a/src/tree_schema.h b/src/tree_schema.h\nindex 1b33060e..382f681e 100644\n--- a/src/tree_schema.h\n+++ b/src/tree_schema.h\n@@ -673,6 +673,13 @@ struct lysp_module {\n     uint8_t version:4;               /**< yang-version (LYS_VERSION values) */\n };\n \n+/**\n+ * @brief Free the printable YANG schema tree structure.\n+ *\n+ * @param[in] module Printable YANG schema tree structure to free.\n+ */\n+void lysp_module_free(struct lysp_module *module);\n+\n /**\n  * @brief Compiled YANG schema tree structure representing YANG module.\n  *\n', 'commit_subject': "schema tree CHANGE base for the printer tree's free function", 'repo_name': 'CESNET/libyang', 'committer': {'name': 'Radek Krejci', 'email': 'ac6bc358cf742cff4f5723566468a80fdae7adfe@cesnet.cz', 'time_sec': '1539266267', 'tz_offset': '120', 'date': {'seconds': '1539266267'}}, 'commit_tree': 'fec5fd576c4e242eda2e351f1ecd461d1450a626', 'commit_message': "schema tree CHANGE base for the printer tree's free function\n", 'language_name': 'Shell', 'license': 'bsd-3-clause', 'hunks': '@@ -673,6 +673,13 @@ struct lysp_module {\n     uint8_t version:4;               /**< yang-version (LYS_VERSION values) */\n };\n \n+/**\n+ * @brief Free the printable YANG schema tree structure.\n+ *\n+ * @param[in] module Printable YANG schema tree structure to free.\n+ */\n+void lysp_module_free(struct lysp_module *module);\n+\n /**\n  * @brief Compiled YANG schema tree structure representing YANG module.\n  *\n', 'addition_count': 7, 'deletion_count': 0, 'src_file': 'a/src/tree_schema.h', 'tgt_file': 'b/src/tree_schema.h', 'file_extension': '.h', 'before_file': '/**\n * @file tree_schema.h\n * @author Radek Krejci <rkrejci@cesnet.cz>\n * @brief libyang representation of YANG schema trees.\n *\n * Copyright (c) 2015 - 2018 CESNET, z.s.p.o.\n *\n * This source code is licensed under BSD 3-Clause License (the "License").\n * You may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://opensource.org/licenses/BSD-3-Clause\n */\n\n#ifndef LY_TREE_SCHEMA_H_\n#define LY_TREE_SCHEMA_H_\n\n#define PCRE2_CODE_UNIT_WIDTH 8\n\n#include <pcre2.h>\n\n#include <stdint.h>\n#include <stdio.h>\n\n#include "config.h"\n#include "log.h"\n#include "tree.h"\n\n#ifdef __cplusplus\nextern "C" {\n#endif\n\nstruct ly_ctx;\nstruct ly_path;\nstruct ly_set;\nstruct lys_module;\nstruct lysc_node;\nstruct lyxp_expr;\n\n/**\n * @page howtoSchema YANG Modules\n *\n * To be able to work with YANG data instances, libyang has to represent YANG data models. All the processed modules are stored\n * in libyang [context](@ref howtoContext) and loaded using [parser functions](@ref howtoSchemaParsers). It means, that there is\n * no way to create/change YANG module programmatically. However, all the YANG model definitions are available and can be examined\n * through the C structures. All the context\'s modules together form YANG Schema for the data being instantiated.\n *\n * Any YANG module is represented as ::lys_module. In fact, the module is represented in two different formats. As ::lys_module.parsed,\n * there is a parsed schema reflecting the source YANG module. It is exactly what is read from the input. This format is good for\n * converting from one format to another (YANG to YIN and vice versa), but it is not very useful for validating/manipulating YANG\n * data. Therefore, there is ::lys_module.compiled storing the compiled YANG module. It is based on the parsed module, but all the\n * references are resolved. It means that, for example, there are no `grouping`s or `typedef`s since they are supposed to be placed instead of\n * `uses` or `type` references. This split also means, that the YANG module is fully validated after compilation of the parsed\n * representation of the module. YANG submodules are available only in the parsed representation. When a submodule is compiled, it\n * is fully integrated into its main module.\n *\n * The context can contain even modules without the compiled representation. Such modules are still useful as imports of other\n * modules. The grouping or typedef definition can be even compiled into the importing modules. This is actually the main\n * difference between the imported and implemented modules in the libyang context. The implemented modules are compiled while the\n * imported modules are only parsed.\n *\n * By default, the module is implemented (and compiled) in case it is explicitly loaded or referenced in another module as\n * target of leafref, augment or deviation. This behavior can be changed via context options ::LY_CTX_ALL_IMPLEMENTED, when\n * all the modules in the context are marked as implemented (note the problem with multiple revisions of a single module),\n * or by ::LY_CTX_REF_IMPLEMENTED option, extending the set of references making the module implemented by when, must and\n * default statements.\n *\n * All modules with deviation definition are always marked as implemented. The imported (not implemented) module can be set implemented by ::lys_set_implemented(). But\n * the implemented module cannot be changed back to just imported module. Note also that only one revision of a specific module\n * can be implemented in a single context. The imported modules are used only as a\n * source of definitions for types and groupings for uses statements. The data in such modules are ignored - caller\n * is not allowed to create the data (including instantiating identities) defined in the model via data parsers,\n * the default nodes are not added into any data tree and mandatory nodes are not checked in the data trees.\n *\n * The compiled schema tree nodes are able to hold private objects (::lysc_node.priv as a pointer to a structure,\n * function, variable, ...) used by a caller application unless ::LY_CTX_SET_PRIV_PARSED is set, in that case\n * the ::lysc_node.priv pointers are used by libyang.\n * Note that the object is not freed by libyang when the context is being destroyed. So the caller is responsible\n * for freeing the provided structure after the context is destroyed or the private pointer is set to NULL in\n * appropriate schema nodes where the object was previously set. Also ::lysc_tree_dfs_full() can be useful to manage\n * the private data.\n *\n * Despite all the schema structures and their members are available as part of the libyang API and callers can use\n * it to navigate through the schema tree structure or to obtain various information, we recommend to use the following\n * macros for the specific actions.\n * - ::LYSC_TREE_DFS_BEGIN and ::LYSC_TREE_DFS_END to traverse the schema tree (depth-first).\n * - ::LY_LIST_FOR and ::LY_ARRAY_FOR as described on @ref howtoStructures page.\n *\n * Further information about modules handling can be found on the following pages:\n * - @subpage howtoSchemaParsers\n * - @subpage howtoSchemaFeatures\n * - @subpage howtoPlugins\n * - @subpage howtoSchemaPrinters\n *\n * \\note There are many functions to access information from the schema trees. Details are available in\n * the [Schema Tree module](@ref schematree).\n *\n * For information about difference between implemented and imported modules, see the\n * [context description](@ref howtoContext).\n *\n * Functions List (not assigned to above subsections)\n * --------------------------------------------------\n * - ::lys_getnext()\n * - ::lys_nodetype2str()\n * - ::lys_set_implemented()\n *\n * - ::lysc_has_when()\n * - ::lysc_owner_module()\n *\n * - ::lysc_node_child()\n * - ::lysc_node_actions()\n * - ::lysc_node_notifs()\n *\n * - ::lysp_node_child()\n * - ::lysp_node_actions()\n * - ::lysp_node_notifs()\n * - ::lysp_node_groupings()\n * - ::lysp_node_typedefs()\n */\n\n/**\n * @page howtoSchemaFeatures YANG Features\n *\n * YANG feature statement is an important part of the language which can significantly affect the meaning of the schemas.\n * Modifying features may have similar effects as loading/removing schema from the context so it is limited to context\n * preparation period before working with data. YANG features, respectively their use in if-feature\n * statements, are evaluated as part of schema compilation so a feature-specific compiled schema tree is generated\n * as a result.\n *\n * To enable any features, they must currently be specified when implementing a new schema with ::lys_parse() or\n * ::ly_ctx_load_module(). To later examine what the status of a feature is, check its ::LYS_FENABLED flag or\n * search for it first with ::lys_feature_value(). Lastly, to evaluate compiled if-features, use ::lysc_iffeature_value().\n *\n * To iterate over all features of a particular YANG module, use ::lysp_feature_next().\n *\n * Note, that the feature\'s state can affect some of the output formats (e.g. Tree format).\n *\n * Functions List\n * --------------\n * - ::lys_feature_value()\n * - ::lysc_iffeature_value()\n * - ::lysp_feature_next()\n */\n\n/**\n * @ingroup trees\n * @defgroup schematree Schema Tree\n * @{\n *\n * Data structures and functions to manipulate and access schema tree.\n */\n\n/* *INDENT-OFF* */\n\n/**\n * @brief Macro to iterate via all elements in a schema (sub)tree including input and output.\n * Note that __actions__ and __notifications__ of traversed nodes __are ignored__! To traverse\n * on all the nodes including those, use ::lysc_tree_dfs_full() instead.\n *\n * This is the opening part to the #LYSC_TREE_DFS_END - they always have to be used together.\n *\n * The function follows deep-first search algorithm:\n * <pre>\n *     1\n *    / \\\n *   2   4\n *  /   / \\\n * 3   5   6\n * </pre>\n *\n * Use the same parameters for #LYSC_TREE_DFS_BEGIN and #LYSC_TREE_DFS_END. While\n * START can be any of the lysc_node* types (including lysc_node_action and lysc_node_notif),\n * ELEM variable must be of the struct lysc_node* type.\n *\n * To skip a particular subtree, instead of the continue statement, set LYSC_TREE_DFS_continue\n * variable to non-zero value.\n *\n * Use with opening curly bracket \'{\' after the macro.\n *\n * @param START Pointer to the starting element processed first.\n * @param ELEM Iterator intended for use in the block.\n */\n#define LYSC_TREE_DFS_BEGIN(START, ELEM) \\\n    { ly_bool LYSC_TREE_DFS_continue = 0; struct lysc_node *LYSC_TREE_DFS_next; \\\n    for ((ELEM) = (LYSC_TREE_DFS_next) = (struct lysc_node *)(START); \\\n         (ELEM); \\\n         (ELEM) = (LYSC_TREE_DFS_next), LYSC_TREE_DFS_continue = 0)\n\n/**\n * @brief Macro to iterate via all elements in a (sub)tree. This is the closing part\n * to the #LYSC_TREE_DFS_BEGIN - they always have to be used together.\n *\n * Use the same parameters for #LYSC_TREE_DFS_BEGIN and #LYSC_TREE_DFS_END. While\n * START can be a pointer to any of the lysc_node* types (including lysc_node_action and lysc_node_notif),\n * ELEM variable must be pointer to the lysc_node type.\n *\n * Use with closing curly bracket \'}\' after the macro.\n *\n * @param START Pointer to the starting element processed first.\n * @param ELEM Iterator intended for use in the block.\n */\n#define LYSC_TREE_DFS_END(START, ELEM) \\\n    /* select element for the next run - children first */ \\\n    if (LYSC_TREE_DFS_continue) { \\\n        (LYSC_TREE_DFS_next) = NULL; \\\n    } else { \\\n        (LYSC_TREE_DFS_next) = (struct lysc_node *)lysc_node_child(ELEM); \\\n    } \\\n    if (!(LYSC_TREE_DFS_next)) { \\\n        /* no children, try siblings */ \\\n        _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \\\n    } \\\n    while (!(LYSC_TREE_DFS_next)) { \\\n        /* parent is already processed, go to its sibling */ \\\n        (ELEM) = (ELEM)->parent; \\\n        _LYSC_TREE_DFS_NEXT(START, ELEM, LYSC_TREE_DFS_next); \\\n    } }\n\n/**\n * @brief Helper macro for #LYSC_TREE_DFS_END, should not be used directly!\n */\n#define _LYSC_TREE_DFS_NEXT(START, ELEM, NEXT) \\\n    if ((ELEM) == (struct lysc_node *)(START)) { \\\n        /* we are done, no next element to process */ \\\n        break; \\\n    } \\\n    (NEXT) = (ELEM)->next;\n\n/* *INDENT-ON* */\n\n#define LY_REV_SIZE 11   /**< revision data string length (including terminating NULL byte) */\n\n/**\n * @defgroup schemanodetypes Schema Node Types\n * Values of the ::lysp_node.nodetype and ::lysc_node.nodetype members.\n * @{\n */\n#define LYS_UNKNOWN     0x0000    /**< uninitalized unknown statement node */\n#define LYS_CONTAINER   0x0001    /**< container statement node */\n#define LYS_CHOICE      0x0002    /**< choice statement node */\n#define LYS_LEAF        0x0004    /**< leaf statement node */\n#define LYS_LEAFLIST    0x0008    /**< leaf-list statement node */\n#define LYS_LIST        0x0010    /**< list statement node */\n#define LYS_ANYXML      0x0020    /**< anyxml statement node */\n#define LYS_ANYDATA     0x0060    /**< anydata statement node, in tests it can be used for both #LYS_ANYXML and #LYS_ANYDATA */\n#define LYS_CASE        0x0080    /**< case statement node */\n\n#define LYS_RPC         0x0100    /**< RPC statement node */\n#define LYS_ACTION      0x0200    /**< action statement node */\n#define LYS_NOTIF       0x0400    /**< notification statement node */\n\n#define LYS_USES        0x0800    /**< uses statement node */\n#define LYS_INPUT       0x1000    /**< RPC/action input node */\n#define LYS_OUTPUT      0x2000    /**< RPC/action output node */\n#define LYS_GROUPING    0x4000\n#define LYS_AUGMENT     0x8000\n\n#define LYS_NODETYPE_MASK 0xffff  /**< Mask for nodetypes, the value is limited for 16 bits */\n/** @} schemanodetypes */\n\n/**\n * @brief Generic test for operation statements.\n *\n * This macro matches a subset of schema nodes that maps to common ::lysc_node or ::lysp_node structures. To match all\n * such nodes, use ::LY_STMT_IS_NODE()\n *\n * This macro matches action and RPC.\n */\n#define LY_STMT_IS_OP(STMT) (((STMT) == LY_STMT_ACTION) || ((STMT) == LY_STMT_RPC))\n\n/**\n * @brief Generic test for schema data nodes.\n *\n * This macro matches a subset of schema nodes that maps to common ::lysc_node or ::lysp_node structures. To match all\n * such nodes, use ::LY_STMT_IS_NODE()\n *\n * This macro matches anydata, anyxml, augment, case, choice, container, grouping, leaf, leaf-list, list and uses. Note\n * that the list of statements that can appear in parsed or compiled schema trees differs (e.g. no uses in compiled tree).\n */\n#define LY_STMT_IS_DATA_NODE(STMT) (((STMT) >= LY_STMT_ANYDATA) && ((STMT) <= LY_STMT_LIST))\n\n/**\n * @brief Generic test for any schema node that maps to common ::lysc_node or ::lysp_node structures.\n *\n * Note that the list of statements that can appear in parsed or compiled schema trees differs (e.g. no uses in compiled tree).\n *\n * To check for some of the subsets of this test, try ::LY_STMT_IS_DATA_NODE() or ::LY_STMT_IS_OP().\n *\n * This macro matches action, anydata, anyxml, augment, case, choice, container, grouping, input, leaf, leaf-list, list,\n * notification, output, RPC and uses.\n */\n#define LY_STMT_IS_NODE(STMT) (((STMT) >= LY_STMT_NOTIFICATION) && ((STMT) <= LY_STMT_LIST))\n\n/**\n * @brief List of YANG statements\n */\nenum ly_stmt {\n    LY_STMT_NONE = 0,\n\n    LY_STMT_NOTIFICATION,       /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node_notif *`.\n                                     The RPCs/Actions and Notifications are expected in a separated lists than the rest of\n                                     data definition nodes as it is done in generic structures of libyang. */\n    LY_STMT_INPUT,\n    LY_STMT_OUTPUT,\n\n/* LY_STMT_IS_OP */\n    LY_STMT_ACTION,             /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node_action *`.\n                                     The RPCs/Actions and Notifications are expected in a separated lists than the rest of\n                                     data definition nodes as it is done in generic structures of libyang. */\n    LY_STMT_RPC,                /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node_action *`.\n                                     The RPCs/Actions and Notifications are expected in a separated lists than the rest of\n                                     data definition nodes as it is done in generic structures of libyang. */\n\n/* LY_STMT_IS_DATA_NODE */\n    LY_STMT_ANYDATA,            /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`.\n                                     Note that due to ::lysc_node compatibility the anydata is expected to be actually\n                                     mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and\n                                     Notifications are expected in a separated lists as it is done in generic structures\n                                     of libyang. */\n    LY_STMT_ANYXML,             /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`.\n                                     Note that due to ::lysc_node compatibility the anyxml is expected to be actually\n                                     mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and\n                                     Notifications are expected in a separated lists as it is done in generic structures\n                                     of libyang. */\n    LY_STMT_AUGMENT,\n    LY_STMT_CASE,               /**< TODO is it possible to compile cases without the parent choice? */\n    LY_STMT_CHOICE,             /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`.\n                                     Note that due to ::lysc_node compatibility the choice is expected to be actually\n                                     mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and\n                                     Notifications are expected in a separated lists as it is done in generic structures\n                                     of libyang. */\n    LY_STMT_CONTAINER,          /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`.\n                                     Note that due to ::lysc_node compatibility the container is expected to be actually\n                                     mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and\n                                     Notifications are expected in a separated lists as it is done in generic structures\n                                     of libyang. */\n    LY_STMT_GROUPING,\n    LY_STMT_LEAF,               /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`.\n                                     Note that due to ::lysc_node compatibility the leaf is expected to be actually\n                                     mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and\n                                     Notifications are expected in a separated lists as it is done in generic structures\n                                     of libyang. */\n    LY_STMT_LEAF_LIST,          /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`.\n                                     Note that due to ::lysc_node compatibility the leaf-list is expected to be actually\n                                     mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and\n                                     Notifications are expected in a separated lists as it is done in generic structures\n                                     of libyang. */\n    LY_STMT_LIST,               /**< in ::lysc_ext_substmt.storage stored as a pointer to linked list of `struct lysc_node *`.\n                                     Note that due to ::lysc_node compatibility the list is expected to be actually\n                                     mixed in the linked list with other ::lysc_node based nodes. The RPCs/Actions and\n                                     Notifications are expected in a separated lists as it is done in generic structures\n                                     of libyang. */\n    LY_STMT_USES,\n\n/* rest */\n    LY_STMT_ARGUMENT,\n    LY_STMT_BASE,\n    LY_STMT_BELONGS_TO,\n    LY_STMT_BIT,\n    LY_STMT_CONFIG,             /**< in ::lysc_ext_substmt.storage stored as a pointer to `uint16_t`, only cardinality < #LY_STMT_CARD_SOME is allowed */\n    LY_STMT_CONTACT,\n    LY_STMT_DEFAULT,\n    LY_STMT_DESCRIPTION,        /**< in ::lysc_ext_substmt.storage stored as a pointer to `const char *` (cardinality < #LY_STMT_CARD_SOME)\n                                     or as a pointer to a [sized array](@ref sizedarrays) `const char **` */\n    LY_STMT_DEVIATE,\n    LY_STMT_DEVIATION,\n    LY_STMT_ENUM,\n    LY_STMT_ERROR_APP_TAG,\n    LY_STMT_ERROR_MESSAGE,\n    LY_STMT_EXTENSION,\n    LY_STMT_EXTENSION_INSTANCE,\n    LY_STMT_FEATURE,\n    LY_STMT_FRACTION_DIGITS,\n    LY_STMT_IDENTITY,\n    LY_STMT_IF_FEATURE,         /**< if-feature statements are not compiled, they are evaluated and the parent statement is\n                                     preserved only in case the evaluation of all the if-feature statements is true.\n                                     Therefore there is no storage expected. */\n    LY_STMT_IMPORT,\n    LY_STMT_INCLUDE,\n    LY_STMT_KEY,\n    LY_STMT_LENGTH,\n    LY_STMT_MANDATORY,          /**< in ::lysc_ext_substmt.storage stored as a pointer to `uint16_t`, only cardinality < #LY_STMT_CARD_SOME is allowed */\n    LY_STMT_MAX_ELEMENTS,\n    LY_STMT_MIN_ELEMENTS,\n    LY_STMT_MODIFIER,\n    LY_STMT_MODULE,\n    LY_STMT_MUST,\n    LY_STMT_NAMESPACE,\n    LY_STMT_ORDERED_BY,\n    LY_STMT_ORGANIZATION,\n    LY_STMT_PATH,\n    LY_STMT_PATTERN,\n    LY_STMT_POSITION,\n    LY_STMT_PREFIX,\n    LY_STMT_PRESENCE,\n    LY_STMT_RANGE,\n    LY_STMT_REFERENCE,          /**< in ::lysc_ext_substmt.storage stored as a pointer to `const char *` (cardinality < #LY_STMT_CARD_SOME)\n                                     or as a pointer to a [sized array](@ref sizedarrays) `const char **` */\n    LY_STMT_REFINE,\n    LY_STMT_REQUIRE_INSTANCE,\n    LY_STMT_REVISION,\n    LY_STMT_REVISION_DATE,\n    LY_STMT_STATUS,             /**< in ::lysc_ext_substmt.storage stored as a pointer to `uint16_t`, only cardinality < #LY_STMT_CARD_SOME is allowed */\n    LY_STMT_SUBMODULE,\n    LY_STMT_TYPE,               /**< in ::lysc_ext_substmt.storage stored as a pointer to `struct lysc_type *` (cardinality < #LY_STMT_CARD_SOME)\n                                     or as a pointer to a [sized array](@ref sizedarrays) `struct lysc_type **` */\n    LY_STMT_TYPEDEF,\n    LY_STMT_UNIQUE,\n    LY_STMT_UNITS,              /**< in ::lysc_ext_substmt.storage stored as a pointer to `const char *` (cardinality < #LY_STMT_CARD_SOME)\n                                     or as a pointer to a [sized array](@ref sizedarrays) `const char **` */\n    LY_STMT_VALUE,\n    LY_STMT_WHEN,\n    LY_STMT_YANG_VERSION,\n    LY_STMT_YIN_ELEMENT,\n\n    /* separated from the list of statements\n     * the following tokens are part of the syntax and parsers have to work\n     * with them, but they are not a standard YANG statements\n     */\n    LY_STMT_SYNTAX_SEMICOLON,\n    LY_STMT_SYNTAX_LEFT_BRACE,\n    LY_STMT_SYNTAX_RIGHT_BRACE,\n\n    /*\n     * YIN-specific tokens, still they are part of the syntax, but not the standard statements\n     */\n    LY_STMT_ARG_TEXT,\n    LY_STMT_ARG_VALUE\n};\n\n/**\n * @brief Stringify statement identifier.\n * @param[in] stmt The statement identifier to stringify.\n * @return Constant string representation of the given @p stmt.\n */\nLIBYANG_API_DECL const char *ly_stmt2str(enum ly_stmt stmt);\n\n/**\n * @brief Convert nodetype to statement identifier\n * @param[in] nodetype Nodetype to convert.\n * @return Statement identifier representing the given @p nodetype.\n */\nLIBYANG_API_DECL enum ly_stmt lys_nodetype2stmt(uint16_t nodetype);\n\n/**\n * @brief Possible cardinalities of the YANG statements.\n *\n * Used in extensions plugins to define cardinalities of the extension instance substatements.\n */\nenum ly_stmt_cardinality {\n    LY_STMT_CARD_OPT,    /* 0..1 */\n    LY_STMT_CARD_MAND,   /* 1 */\n    LY_STMT_CARD_SOME,   /* 1..n */\n    LY_STMT_CARD_ANY     /* 0..n */\n};\n\n/**\n * @brief YANG import-stmt\n */\nstruct lysp_import {\n    struct lys_module *module;       /**< pointer to the imported module\n                                          (mandatory, but resolved when the referring module is completely parsed) */\n    const char *name;                /**< name of the imported module (mandatory) */\n    const char *prefix;              /**< prefix for the data from the imported schema (mandatory) */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< LYS_INTERNAL value (@ref snodeflags) */\n    char rev[LY_REV_SIZE];           /**< revision-date of the imported module */\n};\n\n/**\n * @brief YANG include-stmt\n */\nstruct lysp_include {\n    struct lysp_submodule *submodule;/**< pointer to the parsed submodule structure\n                                         (mandatory, but resolved when the referring module is completely parsed) */\n    const char *name;                /**< name of the included submodule (mandatory) */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    char rev[LY_REV_SIZE];           /**< revision-date of the included submodule */\n    ly_bool injected;                /**< flag to mark includes copied into main module from submodules,\n                                          only for backward compatibility with YANG 1.0, which does not require the\n                                          main module to include all submodules. */\n};\n\n/**\n * @brief YANG extension-stmt\n */\nstruct lysp_ext {\n    const char *name;                /**< extension name */\n    const char *argname;             /**< argument name, NULL if not specified */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< LYS_STATUS_* and LYS_YINELEM_* values (@ref snodeflags) */\n\n    struct lysc_ext *compiled;       /**< pointer to the compiled extension definition.\n                                          The extension definition is compiled only if there is compiled extension instance,\n                                          otherwise this pointer remains NULL. The compiled extension definition is shared\n                                          among all extension instances. */\n};\n\n/**\n * @brief Helper structure for generic storage of the extension instances content.\n */\nstruct lysp_stmt {\n    const char *stmt;                /**< identifier of the statement */\n    const char *arg;                 /**< statement\'s argument */\n    LY_VALUE_FORMAT format;         /**< prefix format of the identifier/argument (::LY_VALUE_XML is YIN format) */\n    void *prefix_data;               /**< Format-specific data for prefix resolution (see ly_resolve_prefix()) */\n\n    struct lysp_stmt *next;          /**< link to the next statement */\n    struct lysp_stmt *child;         /**< list of the statement\'s substatements (linked list) */\n    uint16_t flags;                  /**< statement flags, can be set to LYS_YIN_ATTR */\n    enum ly_stmt kw;                 /**< numeric respresentation of the stmt value */\n};\n\n#define LYS_YIN 0x1 /**< used to specify input format of extension instance */\n\n/**\n * @brief YANG extension instance\n */\nstruct lysp_ext_instance {\n    const char *name;                       /**< extension identifier, including possible prefix */\n    const char *argument;                   /**< optional value of the extension\'s argument */\n    LY_VALUE_FORMAT format;                 /**< prefix format of the extension name/argument (::LY_VALUE_XML is YIN format) */\n    struct lysp_node *parsed;               /**< Simply parsed (unresolved) YANG schema tree serving as a cache.\n                                                 Only lys_compile_extension_instance() can set this. */\n    void *prefix_data;                      /**< Format-specific data for prefix resolution\n                                                 (see ly_resolve_prefix()) */\n\n    struct lysp_stmt *child;                /**< list of the extension\'s substatements (linked list) */\n\n    void *parent;                           /**< pointer to the parent element holding the extension instance(s), use\n                                                 ::lysp_ext_instance#parent_stmt to access the schema element */\n    enum ly_stmt parent_stmt;               /**< value identifying placement of the extension instance */\n    LY_ARRAY_COUNT_TYPE parent_stmt_index;  /**< in case the instance is in a substatement, this identifies\n                                                 the index of that substatement in its [sized array](@ref sizedarrays) (if any) */\n    uint16_t flags;                         /**< LYS_INTERNAL value (@ref snodeflags) */\n};\n\n/**\n * @brief YANG feature-stmt\n */\nstruct lysp_feature {\n    const char *name;                /**< feature name (mandatory) */\n    struct lysp_qname *iffeatures;   /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n    struct lysc_iffeature *iffeatures_c;    /**< compiled if-features */\n    struct lysp_feature **depfeatures;  /**< list of pointers to other features depending on this one\n                                          ([sized array](@ref sizedarrays)) */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement  */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_* values and\n                                          LYS_FENABLED are allowed */\n};\n\n/**\n * @brief Compiled YANG if-feature-stmt\n */\nstruct lysc_iffeature {\n    uint8_t *expr;                   /**< 2bits array describing the if-feature expression in prefix format, see @ref ifftokens */\n    struct lysp_feature **features;  /**< array of pointers to the features used in expression ([sized array](@ref sizedarrays)) */\n};\n\n/**\n * @brief Qualified name (optional prefix followed by an identifier).\n */\nstruct lysp_qname {\n    const char *str;                 /**< qualified name string */\n    const struct lysp_module *mod;   /**< module to resolve any prefixes found in the string, it must be\n                                          stored explicitly because of deviations/refines */\n};\n\n/**\n * @brief YANG identity-stmt\n */\nstruct lysp_ident {\n    const char *name;                /**< identity name (mandatory), including possible prefix */\n    struct lysp_qname *iffeatures;   /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n    const char **bases;              /**< list of base identifiers ([sized array](@ref sizedarrays)) */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_ values are allowed */\n};\n\n/**\n * @brief Covers restrictions: range, length, pattern, must\n */\nstruct lysp_restr {\n#define LYSP_RESTR_PATTERN_ACK   0x06\n#define LYSP_RESTR_PATTERN_NACK  0x15\n    struct lysp_qname arg;           /**< The restriction expression/value (mandatory);\n                                          in case of pattern restriction, the first byte has a special meaning:\n                                          0x06 (ACK) for regular match and 0x15 (NACK) for invert-match */\n    const char *emsg;                /**< error-message */\n    const char *eapptag;             /**< error-app-tag value */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\n/**\n * @brief YANG revision-stmt\n */\nstruct lysp_revision {\n    char date[LY_REV_SIZE];          /**< revision date (madatory) */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\n/**\n * @brief Enumeration/Bit value definition\n */\nstruct lysp_type_enum {\n    const char *name;                /**< name (mandatory) */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement */\n    int64_t value;                   /**< enum\'s value or bit\'s position */\n    struct lysp_qname *iffeatures;   /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_ and LYS_SET_VALUE\n                                          values are allowed */\n};\n\n/**\n * @brief YANG type-stmt\n *\n * Some of the items in the structure may be mandatory, but it is necessary to resolve the type\'s base type first\n */\nstruct lysp_type {\n    const char *name;                /**< name of the type (mandatory) */\n    struct lysp_restr *range;        /**< allowed values range - numerical, decimal64 */\n    struct lysp_restr *length;       /**< allowed length of the value - string, binary */\n    struct lysp_restr *patterns;     /**< list of patterns ([sized array](@ref sizedarrays)) - string */\n    struct lysp_type_enum *enums;    /**< list of enum-stmts ([sized array](@ref sizedarrays)) - enum */\n    struct lysp_type_enum *bits;     /**< list of bit-stmts ([sized array](@ref sizedarrays)) - bits */\n    struct lyxp_expr *path;          /**< parsed path - leafref */\n    const char **bases;              /**< list of base identifiers ([sized array](@ref sizedarrays)) - identityref */\n    struct lysp_type *types;         /**< list of sub-types ([sized array](@ref sizedarrays)) - union */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n\n    const struct lysp_module *pmod;  /**< (sub)module where the type is defined (needed for deviations) */\n    struct lysc_type *compiled;      /**< pointer to the compiled custom type, not used for built-in types */\n\n    uint8_t fraction_digits;         /**< number of fraction digits - decimal64 */\n    uint8_t require_instance;        /**< require-instance flag - leafref, instance */\n    uint16_t flags;                  /**< [schema node flags](@ref spnodeflags) */\n};\n\n/**\n * @brief YANG typedef-stmt\n */\nstruct lysp_tpdf {\n    const char *name;                /**< name of the newly defined type (mandatory) */\n    const char *units;               /**< units of the newly defined type */\n    struct lysp_qname dflt;          /**< default value of the newly defined type, it may or may not be a qualified name */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lysp_type type;           /**< base type from which the typedef is derived (mandatory) */\n    uint16_t flags;                  /**< [schema node flags](@ref spnodeflags) */\n};\n\n/**\n * @brief YANG when-stmt\n */\nstruct lysp_when {\n    uint8_t version:4;               /**< yang-version (LYS_VERSION values) */\n};\n\n/**\n * @brief Compiled YANG schema tree structure representing YANG module.\n *\n    struct lysp_qname *iffeatures;   /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    const char *presence;            /**< presence description */\n    struct lysp_qname *dflts;        /**< list of default values ([sized array](@ref sizedarrays)) */\n    uint32_t min;                    /**< min-elements constraint */\n    uint32_t max;                    /**< max-elements constraint, 0 means unbounded */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) */\n};\n\n/**\n * @ingroup schematree\n * @defgroup deviatetypes Deviate types\n *\n * Type of the deviate operation (used as ::lysp_deviate.mod)\n *\n * @{\n */\n#define LYS_DEV_NOT_SUPPORTED 1      /**< deviate type not-supported */\n#define LYS_DEV_ADD 2                /**< deviate type add */\n#define LYS_DEV_DELETE 3             /**< deviate type delete */\n#define LYS_DEV_REPLACE 4            /**< deviate type replace */\n/** @} deviatetypes */\n\n/**\n * @brief Generic deviate structure to get type and cast to lysp_deviate_* structure\n */\nstruct lysp_deviate {\n    uint8_t mod;                     /**< [type](@ref deviatetypes) of the deviate modification */\n    struct lysp_deviate *next;       /**< next deviate structure in the list */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysp_deviate_add {\n    uint8_t mod;                     /**< [type](@ref deviatetypes) of the deviate modification */\n    struct lysp_deviate *next;       /**< next deviate structure in the list */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    const char *units;               /**< units of the values */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_qname *uniques;      /**< list of uniques specifications ([sized array](@ref sizedarrays)) */\n    struct lysp_qname *dflts;        /**< list of default values ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) */\n    uint32_t min;                    /**< min-elements constraint */\n    uint32_t max;                    /**< max-elements constraint, 0 means unbounded */\n};\n\nstruct lysp_deviate_del {\n    uint8_t mod;                     /**< [type](@ref deviatetypes) of the deviate modification */\n    struct lysp_deviate *next;       /**< next deviate structure in the list */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    const char *units;               /**< units of the values */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_qname *uniques;      /**< list of uniques specifications ([sized array](@ref sizedarrays)) */\n    struct lysp_qname *dflts;        /**< list of default values ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysp_deviate_rpl {\n    uint8_t mod;                     /**< [type](@ref deviatetypes) of the deviate modification */\n    struct lysp_deviate *next;       /**< next deviate structure in the list */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lysp_type *type;          /**< type of the node */\n    const char *units;               /**< units of the values */\n    struct lysp_qname dflt;          /**< default value */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) */\n    uint32_t min;                    /**< min-elements constraint */\n    uint32_t max;                    /**< max-elements constraint, 0 means unbounded */\n};\n\nstruct lysp_deviation {\n    const char *nodeid;              /**< target absolute schema nodeid (mandatory) */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement */\n    struct lysp_deviate *deviates;   /**< list of deviate specifications (linked list) */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\n/**\n * @ingroup snodeflags\n * @defgroup spnodeflags Parsed schema nodes flags\n *\n * Various flags for parsed schema nodes (used as ::lysp_node.flags).\n *\n *     1 - container    6 - anydata/anyxml    11 - output       16 - grouping   21 - enum\n *     2 - choice       7 - case              12 - feature      17 - uses       22 - type\n *     3 - leaf         8 - notification      13 - identity     18 - refine     23 - stmt\n *     4 - leaflist     9 - rpc               14 - extension    19 - augment\n *     5 - list        10 - input             15 - typedef      20 - deviate\n *\n *                                             1 1 1 1 1 1 1 1 1 1 2 2 2 2\n *     bit name              1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3\n *     ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       1 LYS_CONFIG_W     |x|x|x|x|x|x| | | | | | | | | | | |x| |x| | | |\n *         LYS_SET_BASE     | | | | | | | | | | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       2 LYS_CONFIG_R     |x|x|x|x|x|x| | | | | | | | | | | |x| |x| | | |\n *         LYS_SET_BIT      | | | | | | | | | | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       3 LYS_STATUS_CURR  |x|x|x|x|x|x|x|x|x| | |x|x|x|x|x|x| |x|x|x| | |\n *         LYS_SET_ENUM     | | | | | | | | | | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       4 LYS_STATUS_DEPRC |x|x|x|x|x|x|x|x|x| | |x|x|x|x|x|x| |x|x|x| | |\n *         LYS_SET_FRDIGITS | | | | | | | | | | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       5 LYS_STATUS_OBSLT |x|x|x|x|x|x|x|x|x| | |x|x|x|x|x|x| |x|x|x| | |\n *         LYS_SET_LENGTH   | | | | | | | | | | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       6 LYS_MAND_TRUE    | |x|x| | |x| | | | | | | | | | | |x| |x| | | |\n *         LYS_SET_PATH     | | | | | | | | | | | | | | | | | | | | | |x| |\n *         LYS_FENABLED     | | | | | | | | | | | |x| | | | | | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       7 LYS_MAND_FALSE   | |x|x| | |x| | | | | | | | | | | |x| |x| | | |\n *         LYS_ORDBY_USER   | | | |x|x| | | | | | | | | | | | | | | | | | |\n *         LYS_SET_PATTERN  | | | | | | | | | | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       8 LYS_ORDBY_SYSTEM | | | |x|x| | | | | | | | | | | | | | | | | | |\n *         LYS_YINELEM_TRUE | | | | | | | | | | | | | |x| | | | | | | | | |\n *         LYS_SET_RANGE    | | | | | | | | | | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       9 LYS_YINELEM_FALSE| | | | | | | | | | | | | |x| | | | | | | | | |\n *         LYS_SET_TYPE     | | | | | | | | | | | | | | | | | | | | | |x| |\n *         LYS_SINGLEQUOTED | | | | | | | | | | | | | | | | | | | | | | |x|\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      10 LYS_SET_VALUE    | | | | | | | | | | | | | | | | | | | | |x| | |\n *         LYS_SET_REQINST  | | | | | | | | | | | | | | | | | | | | | |x| |\n *         LYS_SET_MIN      | | | |x|x| | | | | | | | | | | | |x| |x| | | |\n *         LYS_DOUBLEQUOTED | | | | | | | | | | | | | | | | | | | | | | |x|\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      11 LYS_SET_MAX      | | | |x|x| | | | | | | | | | | | |x| |x| | | |\n *         LYS_USED_GRP     | | | | | | | | | | | | | | | |x| | | | | | | |\n *         LYS_YIN_ATTR     | | | | | | | | | | | | | | | | | | | | | | |x|\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      12 LYS_YIN_ARGUMENT | | | | | | | | | | | | | | | | | | | | | | |x|\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      13 LYS_INTERNAL     |x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|x|\n *     ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *\n */\n\n/**\n * @ingroup snodeflags\n * @defgroup scnodeflags Compiled schema nodes flags\n *\n * Various flags for compiled schema nodes (used as ::lysc_node.flags).\n *\n *     1 - container    6 - anydata/anyxml    11 - identity\n *     2 - choice       7 - case              12 - extension\n *     3 - leaf         8 - notification      13 - bitenum\n *     4 - leaflist     9 - rpc/action        14 - when\n *     5 - list        10 - feature\n *\n *                                             1 1 1 1 1\n *     bit name              1 2 3 4 5 6 7 8 9 0 1 2 3 4\n *     ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       1 LYS_CONFIG_W     |x|x|x|x|x|x|x| | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       2 LYS_CONFIG_R     |x|x|x|x|x|x|x| | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       3 LYS_STATUS_CURR  |x|x|x|x|x|x|x|x|x|x|x|x|x|x|\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       4 LYS_STATUS_DEPRC |x|x|x|x|x|x|x|x|x|x|x|x|x|x|\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       5 LYS_STATUS_OBSLT |x|x|x|x|x|x|x|x|x|x|x|x|x|x|\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       6 LYS_MAND_TRUE    |x|x|x|x|x|x| | | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       7 LYS_ORDBY_USER   | | | |x|x| | | | | | | | | |\n *         LYS_MAND_FALSE   | |x|x| | |x| | | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       8 LYS_ORDBY_SYSTEM | | | |x|x| | | | | | | | | |\n *         LYS_PRESENCE     |x| | | | | | | | | | | | | |\n *         LYS_UNIQUE       | | |x| | | | | | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *       9 LYS_KEY          | | |x| | | | | | | | | | | |\n *         LYS_DISABLED     | | | | | | | | | | | | |x| |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      10 LYS_SET_DFLT     | | |x|x| | |x| | | | | | | |\n *         LYS_IS_ENUM      | | | | | | | | | | | | |x| |\n *         LYS_KEYLESS      | | | | |x| | | | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      11 LYS_SET_UNITS    | | |x|x| | | | | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      12 LYS_SET_CONFIG   |x|x|x|x|x|x| | | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      13 LYS_IS_INPUT     |x|x|x|x|x|x|x| | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      14 LYS_IS_OUTPUT    |x|x|x|x|x|x|x| | | | | | | |\n *                          +-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *      15 LYS_IS_NOTIF     |x|x|x|x|x|x|x| | | | | | | |\n *     ---------------------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n *\n */\n\n/**\n * @defgroup snodeflags Schema nodes flags\n *\n * Various flags for schema nodes ([parsed](@ref spnodeflags) as well as [compiled](@ref scnodeflags)).\n *\n * @{\n */\n#define LYS_CONFIG_W     0x01        /**< config true; */\n#define LYS_CONFIG_R     0x02        /**< config false; */\n#define LYS_CONFIG_MASK  0x03        /**< mask for config value */\n#define LYS_STATUS_CURR  0x04        /**< status current; */\n#define LYS_STATUS_DEPRC 0x08        /**< status deprecated; */\n#define LYS_STATUS_OBSLT 0x10        /**< status obsolete; */\n#define LYS_STATUS_MASK  0x1C        /**< mask for status value */\n#define LYS_MAND_TRUE    0x20        /**< mandatory true; applicable only to ::lysp_node_choice/::lysc_node_choice,\n                                          ::lysp_node_leaf/::lysc_node_leaf and ::lysp_node_anydata/::lysc_node_anydata.\n                                          The ::lysc_node_leaflist and ::lysc_node_leaflist have this flag in case that min-elements > 0.\n                                          The ::lysc_node_container has this flag if it is not a presence container and it has at least one\n                                          child with LYS_MAND_TRUE. */\n#define LYS_MAND_FALSE   0x40        /**< mandatory false; applicable only to ::lysp_node_choice/::lysc_node_choice,\n                                          ::lysp_node_leaf/::lysc_node_leaf and ::lysp_node_anydata/::lysc_node_anydata.\n                                          This flag is present only in case the mandatory false statement was explicitly specified. */\n#define LYS_MAND_MASK    0x60        /**< mask for mandatory values */\n#define LYS_PRESENCE     0x80        /**< flag for presence property of a container, but it is not only for explicit presence\n                                          containers, but also for NP containers with some meaning, applicable only to\n                                          ::lysc_node_container */\n#define LYS_UNIQUE       0x80        /**< flag for leafs being part of a unique set, applicable only to ::lysc_node_leaf */\n#define LYS_KEY          0x0100      /**< flag for leafs being a key of a list, applicable only to ::lysc_node_leaf */\n#define LYS_KEYLESS      0x0200      /**< flag for list without any key, applicable only to ::lysc_node_list */\n#define LYS_DISABLED     0x0100      /**< internal flag for a disabled statement, used only for bits/enums */\n#define LYS_FENABLED     0x20        /**< feature enabled flag, applicable only to ::lysp_feature. */\n#define LYS_ORDBY_SYSTEM 0x80        /**< ordered-by system configuration lists, applicable only to\n                                          ::lysc_node_leaflist/::lysp_node_leaflist and ::lysc_node_list/::lysp_node_list */\n#define LYS_ORDBY_USER   0x40        /**< ordered-by user configuration lists, applicable only to\n                                          ::lysc_node_leaflist/::lysp_node_leaflist and ::lysc_node_list/::lysp_node_list;\n                                          is always set for state leaf-lists, and key-less lists */\n#define LYS_ORDBY_MASK   0x60        /**< mask for ordered-by values */\n#define LYS_YINELEM_TRUE 0x80        /**< yin-element true for extension\'s argument */\n#define LYS_YINELEM_FALSE 0x0100     /**< yin-element false for extension\'s argument */\n#define LYS_YINELEM_MASK 0x0180      /**< mask for yin-element value */\n#define LYS_USED_GRP     0x0400      /**< internal flag for validating not-instantiated groupings\n                                          (resp. do not validate again the instantiated groupings). */\n#define LYS_SET_VALUE    0x0200      /**< value attribute is set */\n#define LYS_SET_MIN      0x0200      /**< min attribute is set */\n#define LYS_SET_MAX      0x0400      /**< max attribute is set */\n\n#define LYS_SET_BASE     0x0001      /**< type\'s flag for present base substatement */\n#define LYS_SET_BIT      0x0002      /**< type\'s flag for present bit substatement */\n#define LYS_SET_ENUM     0x0004      /**< type\'s flag for present enum substatement */\n#define LYS_SET_FRDIGITS 0x0008      /**< type\'s flag for present fraction-digits substatement */\n#define LYS_SET_LENGTH   0x0010      /**< type\'s flag for present length substatement */\n#define LYS_SET_PATH     0x0020      /**< type\'s flag for present path substatement */\n#define LYS_SET_PATTERN  0x0040      /**< type\'s flag for present pattern substatement */\n#define LYS_SET_RANGE    0x0080      /**< type\'s flag for present range substatement */\n#define LYS_SET_TYPE     0x0100      /**< type\'s flag for present type substatement */\n#define LYS_SET_REQINST  0x0200      /**< type\'s flag for present require-instance substatement */\n#define LYS_SET_DFLT     0x0200      /**< flag to mark leaf/leaflist with own (or refined) default value, not a default value taken from its type, and default\n                                          cases of choice. This information is important for refines, since it is prohibited to make leafs\n                                          with default statement mandatory. In case the default leaf value is taken from type, it is thrown\n                                          away when it is refined to be mandatory node. Similarly it is used for deviations to distinguish\n                                          between own default or the default values taken from the type. */\n#define LYS_SET_UNITS    0x0400      /**< flag to know if the leaf\'s/leaflist\'s units are their own (flag set) or it is taken from the type. */\n#define LYS_SET_CONFIG   0x0800      /**< flag to know if the config property was set explicitly (flag set) or it is inherited. */\n\n#define LYS_SINGLEQUOTED 0x0100      /**< flag for single-quoted argument of an extension instance\'s substatement, only when the source is YANG */\n#define LYS_DOUBLEQUOTED 0x0200      /**< flag for double-quoted argument of an extension instance\'s substatement, only when the source is YANG */\n\n#define LYS_YIN_ATTR     0x0400      /**< flag to identify YIN attribute parsed as extension\'s substatement, only when the source is YIN */\n#define LYS_YIN_ARGUMENT 0x0800      /**< flag to identify statement representing extension\'s argument, only when the source is YIN */\n\n#define LYS_INTERNAL     0x1000      /**< flag to identify internal parsed statements that should not be printed */\n\n#define LYS_IS_ENUM      0x0200      /**< flag to simply distinguish type in struct lysc_type_bitenum_item */\n\n#define LYS_IS_INPUT     0x1000      /**< flag for nodes that are in the subtree of an input statement */\n\n#define LYS_IS_OUTPUT    0x2000      /**< flag for nodes that are in the subtree of an output statement */\n\n#define LYS_IS_NOTIF     0x4000      /**< flag for nodes that are in the subtree of a notification statement */\n\n#define LYS_FLAGS_COMPILED_MASK 0xff /**< mask for flags that maps to the compiled structures */\n/** @} snodeflags */\n\n/**\n * @brief Generic YANG data node\n */\nstruct lysp_node {\n    struct lysp_node *parent;        /**< parent node (NULL if this is a top-level node) */\n    uint16_t nodetype;               /**< [type of the node](@ref schemanodetypes) (mandatory) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) */\n    struct lysp_node *next;          /**< next sibling node (NULL if there is no one) */\n    const char *name;                /**< node name (mandatory) */\n    const char *dsc;                 /**< description statement */\n    const char *ref;                 /**< reference statement */\n    struct lysp_qname *iffeatures;   /**< list of if-feature expressions ([sized array](@ref sizedarrays)),\n                                          must be qname because of refines */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\n/**\n * @brief Extension structure of the lysp_node for YANG container\n */\nstruct lysp_node_container {\n    union {\n        struct lysp_node node;        /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_CONTAINER */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* container */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_when *when;          /**< when statement */\n    const char *presence;            /**< presence description */\n    struct lysp_tpdf *typedefs;      /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings; /**< list of groupings (linked list) */\n    struct lysp_node *child;         /**< list of data nodes (linked list) */\n    struct lysp_node_action *actions;/**< list of actions (linked list) */\n    struct lysp_node_notif *notifs;  /**< list of notifications (linked list) */\n};\n\nstruct lysp_node_leaf {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_LEAF */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* leaf */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_when *when;          /**< when statement */\n    struct lysp_type type;           /**< type of the leaf node (mandatory) */\n    const char *units;               /**< units of the leaf\'s type */\n    struct lysp_qname dflt;          /**< default value, it may or may not be a qualified name */\n};\n\nstruct lysp_node_leaflist {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_LEAFLIST */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* leaf-list */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_when *when;          /**< when statement */\n    struct lysp_type type;           /**< type of the leaf node (mandatory) */\n    const char *units;               /**< units of the leaf\'s type */\n    struct lysp_qname *dflts;        /**< list of default values ([sized array](@ref sizedarrays)), they may or\n                                          may not be qualified names */\n    uint32_t min;                    /**< min-elements constraint */\n    uint32_t max;                    /**< max-elements constraint, 0 means unbounded */\n};\n\nstruct lysp_node_list {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_LIST */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* list */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_when *when;          /**< when statement */\n    const char *key;                 /**< keys specification */\n    struct lysp_tpdf *typedefs;      /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings; /**< list of groupings (linked list) */\n    struct lysp_node *child;         /**< list of data nodes (linked list) */\n    struct lysp_node_action *actions;/**< list of actions (linked list) */\n    struct lysp_node_notif *notifs;  /**< list of notifications (linked list) */\n    struct lysp_qname *uniques;      /**< list of unique specifications ([sized array](@ref sizedarrays)) */\n    uint32_t min;                    /**< min-elements constraint */\n    uint32_t max;                    /**< max-elements constraint, 0 means unbounded */\n};\n\nstruct lysp_node_choice {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_CHOICE */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* choice */\n    struct lysp_node *child;         /**< list of data nodes (linked list) */\n    struct lysp_when *when;          /**< when statement */\n    struct lysp_qname dflt;          /**< default case */\n};\n\nstruct lysp_node_case {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_CASE */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* case */\n    struct lysp_node *child;         /**< list of data nodes (linked list) */\n    struct lysp_when *when;          /**< when statement */\n};\n\nstruct lysp_node_anydata {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_ANYXML or LYS_ANYDATA */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* anyxml/anydata */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_when *when;          /**< when statement */\n};\n\nstruct lysp_node_uses {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_USES */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< pointer to the next sibling node (NULL if there is no one) */\n            const char *name;        /**< grouping name reference (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* uses */\n    struct lysp_refine *refines;     /**< list of uses\'s refines ([sized array](@ref sizedarrays)) */\n    struct lysp_node_augment *augments; /**< list of augments (linked list) */\n    struct lysp_when *when;          /**< when statement */\n};\n\n/**\n * @brief YANG input-stmt and output-stmt\n */\nstruct lysp_node_action_inout {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_INPUT or LYS_OUTPUT */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node *next;  /**< NULL */\n            const char *name;        /**< empty string */\n            const char *dsc;         /**< ALWAYS NULL, compatibility member with ::lysp_node */\n            const char *ref;         /**< ALWAYS NULL, compatibility member with ::lysp_node */\n            struct lysp_qname *iffeatures; /**< ALWAYS NULL, compatibility member with ::lysp_node */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* inout */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_tpdf *typedefs;      /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings; /**< list of groupings (linked list) */\n    struct lysp_node *child;         /**< list of data nodes (linked list) */\n};\n\n/**\n * @brief YANG rpc-stmt and action-stmt\n */\nstruct lysp_node_action {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_RPC or LYS_ACTION */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            struct lysp_node_action *next; /**< pointer to the next action (NULL if there is no one) */\n            const char *name;        /**< grouping name reference (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* action */\n    struct lysp_tpdf *typedefs;      /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings; /**< list of groupings (linked list) */\n\n    struct lysp_node_action_inout input;  /**< RPC\'s/Action\'s input */\n    struct lysp_node_action_inout output; /**< RPC\'s/Action\'s output */\n};\n\n/**\n * @brief YANG notification-stmt\n */\nstruct lysp_node_notif {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent; /**< parent node (NULL if this is a top-level node) */\n            uint16_t nodetype;       /**< LYS_NOTIF */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_* values are allowed */\n            struct lysp_node_notif *next; /**< pointer to the next notification (NULL if there is no one) */\n            const char *name;        /**< grouping name reference (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                            /**< common part corresponding to ::lysp_node */\n\n    /* notif */\n    struct lysp_restr *musts;        /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysp_tpdf *typedefs;      /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings; /**< list of groupings (linked list) */\n    struct lysp_node *child;         /**< list of data nodes (linked list) */\n};\n\n/**\n * @brief YANG grouping-stmt\n */\nstruct lysp_node_grp {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent;/**< parent node (NULL if this is a top-level grouping) */\n            uint16_t nodetype;       /**< LYS_GROUPING */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_* values are allowed */\n            struct lysp_node_grp *next; /**< pointer to the next grouping (NULL if there is no one) */\n            const char *name;        /**< grouping name (mandatory) */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< ALWAYS NULL, compatibility member with ::lysp_node */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                                /**< common part corresponding to ::lysp_node */\n\n    /* grp */\n    struct lysp_tpdf *typedefs;       /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings;  /**< list of groupings (linked list) */\n    struct lysp_node *child;          /**< list of data nodes (linked list) */\n    struct lysp_node_action *actions; /**< list of actions (linked list) */\n    struct lysp_node_notif *notifs;   /**< list of notifications (linked list) */\n};\n\n/**\n * @brief YANG uses-augment-stmt and augment-stmt (compatible with struct lysp_node )\n */\nstruct lysp_node_augment {\n    union {\n        struct lysp_node node;       /**< implicit cast for the members compatible with ::lysp_node */\n        struct {\n            struct lysp_node *parent;/**< parent node (NULL if this is a top-level augment) */\n            uint16_t nodetype;       /**< LYS_AUGMENT */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_* values are allowed */\n            struct lysp_node_augment *next; /**< pointer to the next augment (NULL if there is no one) */\n            const char *nodeid;      /**< target schema nodeid (mandatory) - absolute for global augments, descendant for uses\'s augments */\n            const char *dsc;         /**< description statement */\n            const char *ref;         /**< reference statement */\n            struct lysp_qname *iffeatures; /**< list of if-feature expressions ([sized array](@ref sizedarrays)) */\n            struct lysp_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n        };\n    };                                /**< common part corresponding to ::lysp_node */\n\n    struct lysp_node *child;         /**< list of data nodes (linked list) */\n    struct lysp_when *when;          /**< when statement */\n    struct lysp_node_action *actions;/**< list of actions (linked list) */\n    struct lysp_node_notif *notifs;  /**< list of notifications (linked list) */\n};\n\n/**\n * @brief supported YANG schema version values\n */\ntypedef enum LYS_VERSION {\n    LYS_VERSION_UNDEF = 0,  /**< no specific version, YANG 1.0 as default */\n    LYS_VERSION_1_0 = 1,    /**< YANG 1 (1.0) */\n    LYS_VERSION_1_1 = 2     /**< YANG 1.1 */\n} LYS_VERSION;\n\n/**\n * @brief Printable YANG schema tree structure representing YANG module.\n *\n * Simple structure corresponding to the YANG format. The schema is only syntactically validated.\n */\nstruct lysp_module {\n    struct lys_module *mod;          /**< covering module structure */\n\n    struct lysp_revision *revs;      /**< list of the module revisions ([sized array](@ref sizedarrays)), the first revision\n                                          in the list is always the last (newest) revision of the module */\n    struct lysp_import *imports;     /**< list of imported modules ([sized array](@ref sizedarrays)) */\n    struct lysp_include *includes;   /**< list of included submodules ([sized array](@ref sizedarrays)) */\n    struct lysp_ext *extensions;     /**< list of extension statements ([sized array](@ref sizedarrays)) */\n    struct lysp_feature *features;   /**< list of feature definitions ([sized array](@ref sizedarrays)) */\n    struct lysp_ident *identities;   /**< list of identities ([sized array](@ref sizedarrays)) */\n    struct lysp_tpdf *typedefs;      /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings; /**< list of groupings (linked list) */\n    struct lysp_node *data;          /**< list of module\'s top-level data nodes (linked list) */\n    struct lysp_node_augment *augments; /**< list of augments (linked list) */\n    struct lysp_node_action *rpcs;   /**< list of RPCs (linked list) */\n    struct lysp_node_notif *notifs;  /**< list of notifications (linked list) */\n    struct lysp_deviation *deviations; /**< list of deviations ([sized array](@ref sizedarrays)) */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n\n    uint8_t version;                 /**< yang-version (LYS_VERSION values) */\n    uint8_t parsing : 1;             /**< flag for circular check */\n    uint8_t is_submod : 1;           /**< always 0 */\n};\n\nstruct lysp_submodule {\n    struct lys_module *mod;          /**< belongs to parent module (submodule - mandatory) */\n\n    struct lysp_revision *revs;      /**< list of the module revisions ([sized array](@ref sizedarrays)), the first revision\n                                          in the list is always the last (newest) revision of the module */\n    struct lysp_import *imports;     /**< list of imported modules ([sized array](@ref sizedarrays)) */\n    struct lysp_include *includes;   /**< list of included submodules ([sized array](@ref sizedarrays)) */\n    struct lysp_ext *extensions;     /**< list of extension statements ([sized array](@ref sizedarrays)) */\n    struct lysp_feature *features;   /**< list of feature definitions ([sized array](@ref sizedarrays)) */\n    struct lysp_ident *identities;   /**< list of identities ([sized array](@ref sizedarrays)) */\n    struct lysp_tpdf *typedefs;      /**< list of typedefs ([sized array](@ref sizedarrays)) */\n    struct lysp_node_grp *groupings; /**< list of groupings (linked list) */\n    struct lysp_node *data;          /**< list of module\'s top-level data nodes (linked list) */\n    struct lysp_node_augment *augments; /**< list of augments (linked list) */\n    struct lysp_node_action *rpcs;   /**< list of RPCs (linked list) */\n    struct lysp_node_notif *notifs;  /**< list of notifications (linked list) */\n    struct lysp_deviation *deviations; /**< list of deviations ([sized array](@ref sizedarrays)) */\n    struct lysp_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n\n    uint8_t version;                 /**< yang-version (LYS_VERSION values) */\n    uint8_t parsing : 1;             /**< flag for circular check */\n    uint8_t is_submod : 1;           /**< always 1 */\n\n    uint8_t latest_revision : 2;     /**< flag to mark the latest available revision:\n                                          1 - the latest revision in searchdirs was not searched yet and this is the\n                                          latest revision in the current context\n                                          2 - searchdirs were searched and this is the latest available revision */\n    const char *name;                /**< name of the module (mandatory) */\n    const char *filepath;            /**< path, if the schema was read from a file, NULL in case of reading from memory */\n    const char *prefix;              /**< submodule belongsto prefix of main module (mandatory) */\n    const char *org;                 /**< party/company responsible for the module */\n    const char *contact;             /**< contact information for the module */\n    const char *dsc;                 /**< description of the module */\n    const char *ref;                 /**< cross-reference for the module */\n};\n\n/**\n * @brief Get the parsed module or submodule name.\n *\n * @param[in] PMOD Parsed module or submodule.\n * @return Module or submodule name.\n */\n#define LYSP_MODULE_NAME(PMOD) (PMOD->is_submod ? ((struct lysp_submodule *)PMOD)->name : ((struct lysp_module *)PMOD)->mod->name)\n\n/**\n * @brief Compiled prefix data pair mapping of prefixes to modules. In case the format is ::LY_VALUE_SCHEMA_RESOLVED,\n * the expected prefix data is a sized array of these structures.\n */\nstruct lysc_prefix {\n    char *prefix;                   /**< used prefix */\n    const struct lys_module *mod;   /**< mapping to a module */\n};\n\n/**\n * @brief Compiled YANG extension-stmt\n *\n * Note that the compiled extension definition is created only in case the extension is instantiated. It is not available\n * from the compiled schema, but from the parsed extension definition which is being searched when an extension instance\n * is being compiled.\n */\nstruct lysc_ext {\n    const char *name;                /**< extension name */\n    const char *argname;             /**< argument name, NULL if not specified */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_ext *plugin;        /**< Plugin implementing the specific extension */\n    struct lys_module *module;       /**< module structure */\n    uint32_t refcount;               /**< reference counter since extension definition is shared among all its instances */\n    uint16_t flags;                  /**< LYS_STATUS_* value (@ref snodeflags) */\n};\n\n/**\n * @brief Description of the extension instance substatements.\n *\n * Provided by extensions plugins to libyang to be able to correctly compile the content of extension instances.\n * Note that order of the defined records matters - just follow the values of ::ly_stmt and order the records from lower to higher values.\n */\nstruct lysc_ext_substmt {\n    enum ly_stmt stmt;                     /**< allowed substatement */\n    enum ly_stmt_cardinality cardinality;  /**< cardinality of the substatement */\n    void *storage;                         /**< pointer to the storage of the compiled statement according to the specific\n                                                lysc_ext_substmt::stmt and lysc_ext_substmt::cardinality */\n};\n\n/**\n * @brief YANG extension instance\n */\nstruct lysc_ext_instance {\n    struct lysc_ext *def;            /**< pointer to the extension definition */\n    const char *argument;            /**< optional value of the extension\'s argument */\n    struct lys_module *module;       /**< module where the extension instantiated is defined */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lysc_ext_substmt *substmts; /**< list of allowed substatements with the storage to access the present\n                                          substatements ([sized array](@ref sizedarrays)) */\n    void *data;                      /**< private plugins\'s data, not used by libyang */\n\n    void *parent;                    /**< pointer to the parent element holding the extension instance(s), use\n                                          ::lysc_ext_instance#parent_stmt to access the schema element */\n    enum ly_stmt parent_stmt;        /**< value identifying placement of the extension instance in specific statement */\n    LY_ARRAY_COUNT_TYPE parent_stmt_index; /**< in case the instance is in a substatement, this identifies\n                                          the index of that substatement in its [sized array](@ref sizedarrays) (if any) */\n};\n\n/**\n * @brief YANG when-stmt\n */\nstruct lysc_when {\n    struct lyxp_expr *cond;          /**< XPath when condition */\n    struct lysc_node *context;       /**< context node for evaluating the expression, NULL if the context is root node */\n    struct lysc_prefix *prefixes;    /**< compiled used prefixes in the condition */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint32_t refcount;               /**< reference counter since some of the when statements are shared among several nodes */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) - only LYS_STATUS is allowed */\n};\n\n/**\n * @brief YANG identity-stmt\n */\nstruct lysc_ident {\n    const char *name;                /**< identity name (mandatory, no prefix) */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    struct lys_module *module;       /**< module structure */\n    struct lysc_ident **derived;     /**< list of (pointers to the) derived identities ([sized array](@ref sizedarrays))\n                                          It also contains references to identities located in unimplemented modules. */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_ values are allowed */\n};\n\n/**\n * @defgroup ifftokens if-feature expression tokens\n * Tokens of if-feature expression used in ::lysc_iffeature.expr.\n *\n * @{\n */\n#define LYS_IFF_NOT  0x00 /**< operand "not" */\n#define LYS_IFF_AND  0x01 /**< operand "and" */\n#define LYS_IFF_OR   0x02 /**< operand "or" */\n#define LYS_IFF_F    0x03 /**< feature */\n/** @} ifftokens */\n\n/**\n * @brief Compiled YANG revision statement\n */\nstruct lysc_revision {\n    char date[LY_REV_SIZE];          /**< revision-date (mandatory) */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysc_range {\n    struct lysc_range_part {\n        union {                      /**< min boundary */\n            int64_t min_64;          /**< for int8, int16, int32, int64 and decimal64 ( >= LY_TYPE_DEC64) */\n            uint64_t min_u64;        /**< for uint8, uint16, uint32, uint64, string and binary ( < LY_TYPE_DEC64) */\n        };\n        union {                      /**< max boundary */\n            int64_t max_64;          /**< for int8, int16, int32, int64 and decimal64 ( >= LY_TYPE_DEC64) */\n            uint64_t max_u64;        /**< for uint8, uint16, uint32, uint64, string and binary ( < LY_TYPE_DEC64) */\n        };\n    } *parts;                        /**< compiled range expression ([sized array](@ref sizedarrays)) */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    const char *emsg;                /**< error-message */\n    const char *eapptag;             /**< error-app-tag value */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysc_pattern {\n    const char *expr;                /**< original, not compiled, regular expression */\n    pcre2_code *code;                /**< compiled regular expression */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    const char *emsg;                /**< error-message */\n    const char *eapptag;             /**< error-app-tag value */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    uint32_t inverted : 1;             /**< invert-match flag */\n    uint32_t refcount : 31;            /**< reference counter */\n};\n\nstruct lysc_must {\n    struct lyxp_expr *cond;          /**< XPath when condition */\n    struct lysc_prefix *prefixes;    /**< compiled used prefixes in the condition */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    const char *emsg;                /**< error-message */\n    const char *eapptag;             /**< error-app-tag value */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysc_type {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing, it may be accessed concurrently when\n                                          creating/freeing data node values that reference it (instance-identifier) */\n};\n\nstruct lysc_type_num {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lysc_range *range;        /**< Optional range limitation */\n};\n\nstruct lysc_type_dec {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    uint8_t fraction_digits;         /**< fraction digits specification */\n    struct lysc_range *range;        /**< Optional range limitation */\n};\n\nstruct lysc_type_str {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lysc_range *length;       /**< Optional length limitation */\n    struct lysc_pattern **patterns;  /**< Optional list of pointers to pattern limitations ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysc_type_bitenum_item {\n    const char *name;            /**< enumeration identifier */\n    const char *dsc;             /**< description */\n    const char *ref;             /**< reference */\n    struct lysc_ext_instance *exts;    /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    union {\n        int32_t value;           /**< integer value associated with the enumeration */\n        uint32_t position;       /**< non-negative integer value associated with the bit */\n    };\n    uint16_t flags;              /**< [schema node flags](@ref snodeflags) - only LYS_STATUS_ and LYS_IS_ENUM values\n                                      are allowed */\n};\n\nstruct lysc_type_enum {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lysc_type_bitenum_item *enums; /**< enumerations list ([sized array](@ref sizedarrays)), mandatory (at least 1 item) */\n};\n\nstruct lysc_type_bits {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lysc_type_bitenum_item *bits; /**< bits list ([sized array](@ref sizedarrays)), mandatory (at least 1 item),\n                                              the items are ordered by their position value. */\n};\n\nstruct lysc_type_leafref {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lyxp_expr *path;          /**< parsed target path, compiled path cannot be stored because of type sharing */\n    struct lysc_prefix *prefixes;    /**< resolved prefixes used in the path */\n    const struct lys_module *cur_mod;/**< unused, not needed */\n    struct lysc_type *realtype;      /**< pointer to the real (first non-leafref in possible leafrefs chain) type. */\n    uint8_t require_instance;        /**< require-instance flag */\n};\n\nstruct lysc_type_identityref {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lysc_ident **bases;       /**< list of pointers to the base identities ([sized array](@ref sizedarrays)),\n                                          mandatory (at least 1 item) */\n};\n\nstruct lysc_type_instanceid {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    uint8_t require_instance;        /**< require-instance flag */\n};\n\nstruct lysc_type_union {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lysc_type **types;        /**< list of types in the union ([sized array](@ref sizedarrays)), mandatory (at least 1 item) */\n};\n\nstruct lysc_type_bin {\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    struct lyplg_type *plugin;       /**< type\'s plugin with built-in as well as user functions to canonize or validate the value of the type */\n    LY_DATA_TYPE basetype;           /**< Base type of the type */\n    uint32_t refcount;               /**< reference counter for type sharing */\n    struct lysc_range *length;       /**< Optional length limitation */\n};\n\n/**\n * @brief Maximum number of hashes stored in a schema node.\n */\n#define LYS_NODE_HASH_COUNT 4\n\n/**\n * @brief Compiled YANG data node\n */\nstruct lysc_node {\n    uint16_t nodetype;               /**< [type of the node](@ref schemanodetypes) (mandatory) */\n    uint16_t flags;                  /**< [schema node flags](@ref snodeflags) */\n    uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n    struct lys_module *module;       /**< module structure */\n    struct lysc_node *parent;        /**< parent node (NULL in case of top level node) */\n    struct lysc_node *next;          /**< next sibling node (NULL if there is no one) */\n    struct lysc_node *prev;          /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n    const char *name;                /**< node name (mandatory) */\n    const char *dsc;                 /**< description */\n    const char *ref;                 /**< reference */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n    void *priv;                      /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n};\n\nstruct lysc_node_action_inout {\n    union {\n        struct lysc_node node;       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_INPUT or LYS_OUTPUT */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent;/**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (output node for input, NULL for output) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node (input and output node pointing to each other) */\n            const char *name;        /**< "input" or "output" */\n            const char *dsc;         /**< ALWAYS NULL, compatibility member with ::lysc_node */\n            const char *ref;         /**< ALWAYS NULL, compatibility member with ::lysc_node */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /** private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_node *child;         /**< first child node (linked list) */\n    struct lysc_must *musts;         /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysc_node_action {\n    union {\n        struct lysc_node node;               /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_RPC or LYS_ACTION */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node - RPC) */\n            struct lysc_node_action *next; /**< next sibling node (NULL if there is no one) */\n            struct lysc_node_action *prev; /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< action/RPC name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /** private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_when **when;         /**< list of pointers to when statements ([sized array](@ref sizedarrays)),\n                                          the action/RPC nodes do not contain the when statement on their own, but they can\n                                          inherit it from the parent\'s uses. */\n    struct lysc_node_action_inout input;  /**< RPC\'s/action\'s input */\n    struct lysc_node_action_inout output; /**< RPC\'s/action\'s output */\n\n};\n\nstruct lysc_node_notif {\n    union {\n        struct lysc_node node;                       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_NOTIF */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node_notif *next; /**< next sibling node (NULL if there is no one) */\n            struct lysc_node_notif *prev; /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< Notification name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /** private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_node *child;         /**< first child node (linked list) */\n    struct lysc_must *musts;         /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysc_when **when;         /**< list of pointers to when statements ([sized array](@ref sizedarrays)),\n                                          the notification nodes do not contain the when statement on their own, but they can\n                                          inherit it from the parent\'s uses. */\n};\n\nstruct lysc_node_container {\n    union {\n        struct lysc_node node;       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_CONTAINER */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (NULL if there is no one) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_node *child;         /**< first child node (linked list) */\n    struct lysc_must *musts;         /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysc_when **when;         /**< list of pointers to when statements ([sized array](@ref sizedarrays)) */\n    struct lysc_node_action *actions;/**< first of actions nodes (linked list) */\n    struct lysc_node_notif *notifs;  /**< first of notifications nodes (linked list) */\n};\n\nstruct lysc_node_case {\n    union {\n        struct lysc_node node;       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_CASE */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser, unused */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (NULL if there is no one) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< name of the case, including the implicit case */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_node *child;         /**< first child node of the case (linked list). Note that all the children of all the sibling cases are linked\n                                          each other as siblings with the parent pointer pointing to appropriate case node. */\n    struct lysc_when **when;         /**< list of pointers to when statements ([sized array](@ref sizedarrays)) */\n};\n\nstruct lysc_node_choice {\n    union {\n        struct lysc_node node;       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_CHOICE */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser, unused */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (NULL if there is no one) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_node_case *cases;    /**< list of the cases (linked list). Note that all the children of all the cases are linked each other\n                                          as siblings. Their parent pointers points to the specific case they belongs to, so distinguish the\n                                          case is simple. */\n    struct lysc_when **when;         /**< list of pointers to when statements ([sized array](@ref sizedarrays)) */\n    struct lysc_node_case *dflt;     /**< default case of the choice, only a pointer into the cases array. */\n};\n\nstruct lysc_node_leaf {\n    union {\n        struct lysc_node node;               /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_LEAF */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (NULL if there is no one) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_must *musts;         /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysc_when **when;         /**< list of pointers to when statements ([sized array](@ref sizedarrays)) */\n    struct lysc_type *type;          /**< type of the leaf node (mandatory) */\n\n    const char *units;               /**< units of the leaf\'s type */\n    struct lyd_value *dflt;          /**< default value, use ::lyd_value_get_canonical() to get the canonical string */\n};\n\nstruct lysc_node_leaflist {\n    union {\n        struct lysc_node node;       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_LEAFLIST */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (NULL if there is no one) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_must *musts;         /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysc_when **when;         /**< list of pointers to when statements ([sized array](@ref sizedarrays)) */\n    struct lysc_type *type;          /**< type of the leaf node (mandatory) */\n\n    const char *units;               /**< units of the leaf\'s type */\n    struct lyd_value **dflts;        /**< list ([sized array](@ref sizedarrays)) of default values, use\n                                        ::lyd_value_get_canonical() to get the canonical strings */\n\n    uint32_t min;                    /**< min-elements constraint */\n    uint32_t max;                    /**< max-elements constraint */\n\n};\n\nstruct lysc_node_list {\n    union {\n        struct lysc_node node;       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_LIST */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (NULL if there is no one) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_node *child;         /**< first child node (linked list) */\n    struct lysc_must *musts;         /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysc_when **when; /**< list of pointers to when statements ([sized array](@ref sizedarrays)) */\n    struct lysc_node_action *actions;/**< first of actions nodes (linked list) */\n    struct lysc_node_notif *notifs;  /**< first of notifications nodes (linked list) */\n\n    struct lysc_node_leaf ***uniques;/**< list of sized arrays of pointers to the unique nodes ([sized array](@ref sizedarrays)) */\n    uint32_t min;                    /**< min-elements constraint */\n    uint32_t max;                    /**< max-elements constraint */\n};\n\nstruct lysc_node_anydata {\n    union {\n        struct lysc_node node;       /**< implicit cast for the members compatible with ::lysc_node */\n        struct {\n            uint16_t nodetype;       /**< LYS_ANYXML or LYS_ANYDATA */\n            uint16_t flags;          /**< [schema node flags](@ref snodeflags) */\n            uint8_t hash[LYS_NODE_HASH_COUNT]; /**< schema hash required for LYB printer/parser */\n            struct lys_module *module; /**< module structure */\n            struct lysc_node *parent; /**< parent node (NULL in case of top level node) */\n            struct lysc_node *next;  /**< next sibling node (NULL if there is no one) */\n            struct lysc_node *prev;  /**< pointer to the previous sibling node \\note Note that this pointer is\n                                          never NULL. If there is no sibling node, pointer points to the node\n                                          itself. In case of the first node, this pointer points to the last\n                                          node in the list. */\n            const char *name;        /**< node name (mandatory) */\n            const char *dsc;         /**< description */\n            const char *ref;         /**< reference */\n            struct lysc_ext_instance *exts; /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n            void *priv;              /**< private arbitrary user data, not used by libyang unless ::LY_CTX_SET_PRIV_PARSED is set */\n        };\n    };\n\n    struct lysc_must *musts;         /**< list of must restrictions ([sized array](@ref sizedarrays)) */\n    struct lysc_when **when; /**< list of pointers to when statements ([sized array](@ref sizedarrays)) */\n};\n\n/**\n * @brief Compiled YANG schema tree structure representing YANG module.\n *\n * Semantically validated YANG schema tree for data tree parsing.\n * Contains only the necessary information for the data validation.\n */\nstruct lysc_module {\n    struct lys_module *mod;          /**< covering module structure */\n\n    struct lysc_node *data;          /**< list of module\'s top-level data nodes (linked list) */\n    struct lysc_node_action *rpcs;   /**< first of actions nodes (linked list) */\n    struct lysc_node_notif *notifs;  /**< first of notifications nodes (linked list) */\n    struct lysc_ext_instance *exts;  /**< list of the extension instances ([sized array](@ref sizedarrays)) */\n};\n\n/**\n * @brief Examine whether a node is user-ordered list or leaf-list.\n *\n * @param[in] lysc_node Schema node to examine.\n * @return Boolean value whether the @p node is user-ordered or not.\n */\n#define lysc_is_userordered(lysc_node) \\\n    ((!lysc_node || !(lysc_node->nodetype & (LYS_LEAFLIST | LYS_LIST)) || !(lysc_node->flags & LYS_ORDBY_USER)) ? 0 : 1)\n\n/**\n * @brief Examine whether a node is a list\'s key.\n *\n * @param[in] lysc_node Schema node to examine.\n * @return Boolean value whether the @p node is a key or not.\n */\n#define lysc_is_key(lysc_node) \\\n    ((!lysc_node || (lysc_node->nodetype != LYS_LEAF) || !(lysc_node->flags & LYS_KEY)) ? 0 : 1)\n\n/**\n * @brief Examine whether a node is a non-presence container.\n *\n * @param[in] lysc_node Schema node to examine.\n * @return Boolean value whether the @p node is a NP container or not.\n */\n#define lysc_is_np_cont(lysc_node) \\\n    ((!lysc_node || (lysc_node->nodetype != LYS_CONTAINER) || (lysc_node->flags & LYS_PRESENCE)) ? 0 : 1)\n\n/**\n * @brief Examine whether a node is a key-less list or a non-configuration leaf-list.\n *\n * @param[in] lysc_node Schema node to examine.\n * @return Boolean value whether the @p node is a list with duplicate instances allowed.\n */\n#define lysc_is_dup_inst_list(lysc_node) \\\n    ((lysc_node && (((lysc_node->nodetype == LYS_LIST) && (lysc_node->flags & LYS_KEYLESS)) || \\\n            ((lysc_node->nodetype == LYS_LEAFLIST) && !(lysc_node->flags & LYS_CONFIG_W)))) ? 1 : 0)\n\n/**\n * @brief Get nearest @p schema parent (including the node itself) that can be instantiated in data.\n *\n * @param[in] schema Schema node to get the nearest data node for.\n * @return Schema data node, NULL if top-level (in data).\n */\nLIBYANG_API_DECL const struct lysc_node *lysc_data_node(const struct lysc_node *schema);\n\n/**\n * @brief Same as ::lysc_data_node() but never returns the node itself.\n */\n#define lysc_data_parent(SCHEMA) lysc_data_node((SCHEMA) ? (SCHEMA)->parent : NULL)\n\n/**\n * @brief Check whether the schema node data instance existence depends on any when conditions.\n * This node and any direct parent choice and case schema nodes are also examined for when conditions.\n *\n * Be careful, this function is not recursive and checks only conditions that apply to this node directly.\n * Meaning if there are any conditions associated with any data parent instance of @p node, they are not returned.\n *\n * @param[in] node Schema node to examine.\n * @return When condition associated with the node data instance, NULL if there is none.\n */\nLIBYANG_API_DECL const struct lysc_when *lysc_has_when(const struct lysc_node *node);\n\n/**\n * @brief Get the owner module of the schema node. It is the module of the top-level node. Generally,\n * in case of augments it is the target module, recursively, otherwise it is the module where the node is defined.\n *\n * @param[in] node Schema node to examine.\n * @return Module owner of the node.\n */\nLIBYANG_API_DECL const struct lys_module *lysc_owner_module(const struct lysc_node *node);\n\n/**\n * @brief Get the groupings linked list of the given (parsed) schema node.\n * Decides the node\'s type and in case it has a groupings array, returns it.\n * @param[in] node Node to examine.\n * @return The node\'s groupings linked list if any, NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysp_node_grp *lysp_node_groupings(const struct lysp_node *node);\n\n/**\n * @brief Get the typedefs sized array of the given (parsed) schema node.\n * Decides the node\'s type and in case it has a typedefs array, returns it.\n * @param[in] node Node to examine.\n * @return The node\'s typedefs sized array if any, NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysp_tpdf *lysp_node_typedefs(const struct lysp_node *node);\n\n/**\n * @brief Get the actions/RPCs linked list of the given (parsed) schema node.\n * Decides the node\'s type and in case it has a actions/RPCs array, returns it.\n * @param[in] node Node to examine.\n * @return The node\'s actions/RPCs linked list if any, NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysp_node_action *lysp_node_actions(const struct lysp_node *node);\n\n/**\n * @brief Get the Notifications linked list of the given (parsed) schema node.\n * Decides the node\'s type and in case it has a Notifications array, returns it.\n * @param[in] node Node to examine.\n * @return The node\'s Notifications linked list if any, NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysp_node_notif *lysp_node_notifs(const struct lysp_node *node);\n\n/**\n * @brief Get the children linked list of the given (parsed) schema node.\n * Decides the node\'s type and in case it has a children list, returns it.\n * @param[in] node Node to examine.\n * @return The node\'s children linked list if any, NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysp_node *lysp_node_child(const struct lysp_node *node);\n\n/**\n * @brief Get the actions/RPCs linked list of the given (compiled) schema node.\n * Decides the node\'s type and in case it has a actions/RPCs array, returns it.\n * @param[in] node Node to examine.\n * @return The node\'s actions/RPCs linked list if any, NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysc_node_action *lysc_node_actions(const struct lysc_node *node);\n\n/**\n * @brief Get the Notifications linked list of the given (compiled) schema node.\n * Decides the node\'s type and in case it has a Notifications array, returns it.\n * @param[in] node Node to examine.\n * @return The node\'s Notifications linked list if any, NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysc_node_notif *lysc_node_notifs(const struct lysc_node *node);\n\n/**\n * @brief Get the children linked list of the given (compiled) schema node.\n *\n * Note that ::LYS_CHOICE has only ::LYS_CASE children.\n * Also, ::LYS_RPC and ::LYS_ACTION have the first child ::LYS_INPUT, its sibling is ::LYS_OUTPUT.\n *\n * @param[in] node Node to examine.\n * @return Children linked list if any,\n * @return NULL otherwise.\n */\nLIBYANG_API_DECL const struct lysc_node *lysc_node_child(const struct lysc_node *node);\n\n/**\n * @brief Get the must statements list if present in the @p node\n *\n * @param[in] node Node to examine.\n * @return Pointer to the list of must restrictions ([sized array](@ref sizedarrays))\n * @return NULL if there is no must statement in the node, no matter if it is not even allowed or just present\n */\nLIBYANG_API_DECL struct lysc_must *lysc_node_musts(const struct lysc_node *node);\n\n/**\n * @brief Get the when statements list if present in the @p node\n *\n * @param[in] node Node to examine.\n * @return Pointer to the list of pointers to when statements ([sized array](@ref sizedarrays))\n * @return NULL if there is no when statement in the node, no matter if it is not even allowed or just present\n */\nLIBYANG_API_DECL struct lysc_when **lysc_node_when(const struct lysc_node *node);\n\n/**\n * @brief Callback to be called for every schema node in a DFS traversal.\n *\n * @param[in] node Current node.\n * @param[in] data Arbitrary user data.\n * @param[out] dfs_continue Set to true if the current subtree should be skipped and continue with siblings instead.\n * @return LY_SUCCESS on success,\n * @return LY_ERR value to terminate DFS and return this value.\n */\ntypedef LY_ERR (*lysc_dfs_clb)(struct lysc_node *node, void *data, ly_bool *dfs_continue);\n\n/**\n * @brief DFS traversal of all the schema nodes in a (sub)tree including any actions and nested notifications.\n *\n * Node with children, actions, and notifications is traversed in this order:\n * 1) each child subtree;\n * 2) each action subtree;\n * 3) each notification subtree.\n *\n * For algorithm illustration or traversal with actions and notifications skipped, see ::LYSC_TREE_DFS_BEGIN.\n *\n * @param[in] root Schema root to fully traverse.\n * @param[in] dfs_clb Callback to call for each node.\n * @param[in] data Arbitrary user data passed to @p dfs_clb.\n * @return LY_SUCCESS on success,\n * @return LY_ERR value returned by @p dfs_clb.\n */\nLIBYANG_API_DECL LY_ERR lysc_tree_dfs_full(const struct lysc_node *root, lysc_dfs_clb dfs_clb, void *data);\n\n/**\n * @brief DFS traversal of all the schema nodes in a module including RPCs and notifications.\n *\n * For more details, see ::lysc_tree_dfs_full().\n *\n * @param[in] mod Module to fully traverse.\n * @param[in] dfs_clb Callback to call for each node.\n * @param[in] data Arbitrary user data passed to @p dfs_clb.\n * @return LY_SUCCESS on success,\n * @return LY_ERR value returned by @p dfs_clb.\n */\nLIBYANG_API_DECL LY_ERR lysc_module_dfs_full(const struct lys_module *mod, lysc_dfs_clb dfs_clb, void *data);\n\n/**\n * @brief Get how the if-feature statement currently evaluates.\n *\n * @param[in] iff Compiled if-feature statement to evaluate.\n * @return LY_SUCCESS if the statement evaluates to true,\n * @return LY_ENOT if it evaluates to false,\n * @return LY_ERR on error.\n */\nLIBYANG_API_DECL LY_ERR lysc_iffeature_value(const struct lysc_iffeature *iff);\n\n/**\n * @brief Get how the if-feature statement is evaluated for certain identity.\n *\n * The function can be called even if the identity does not contain\n * if-features, in which case ::LY_SUCCESS is returned.\n *\n * @param[in] ident Compiled identity statement to evaluate.\n * @return LY_SUCCESS if the statement evaluates to true,\n * @return LY_ENOT if it evaluates to false,\n * @return LY_ERR on error.\n */\nLIBYANG_API_DECL LY_ERR lys_identity_iffeature_value(const struct lysc_ident *ident);\n\n/**\n * @brief Get the next feature in the module or submodules.\n *\n * @param[in] last Last returned feature.\n * @param[in] pmod Parsed module and submodules whose features to iterate over.\n * @param[in,out] idx Submodule index, set to 0 on first call.\n * @return Next found feature, NULL if the last has already been returned.\n */\nLIBYANG_API_DECL struct lysp_feature *lysp_feature_next(const struct lysp_feature *last, const struct lysp_module *pmod,\n        uint32_t *idx);\n\n/**\n * @brief Get pointer to the storage of the specified substatement in the given extension instance.\n *\n * The function simplifies access into the ::lysc_ext_instance.substmts sized array.\n *\n * @param[in] ext Compiled extension instance to process.\n * @param[in] substmt Extension substatement to search for.\n * @param[out] instance_p Pointer where the storage of the @p substmt will be provided. The specific type returned depends\n * on the @p substmt and can be found in the documentation of each ::ly_stmt value. Also note that some of the substatements\n * (::lysc_node based or flags) can share the storage with other substatements. In case the pointer is NULL, still the return\n * code can be used to at least know if the substatement is allowed for the extension.\n * @param[out] cardinality_p Pointer to provide allowed cardinality of the substatements in the extension. Note that in some\n * cases, the type of the storage depends also on the cardinality of the substatement.\n * @return LY_SUCCESS if the @p substmt found.\n * @return LY_ENOT in case the @p ext is not able to store (does not allow) the specified @p substmt.\n */\nLIBYANG_API_DECL LY_ERR lysc_ext_substmt(const struct lysc_ext_instance *ext, enum ly_stmt substmt,\n        void **instance_p, enum ly_stmt_cardinality *cardinality_p);\n\n/**\n * @defgroup findxpathoptions Atomize XPath options\n * Options to modify behavior of ::lys_find_xpath() and ::lys_find_xpath_atoms() searching for schema nodes in schema tree.\n * @{\n */\n#define LYS_FIND_XP_SCHEMA  0x08    /**< Apply node access restrictions defined for \'when\' and \'must\' evaluation. */\n#define LYS_FIND_XP_OUTPUT  0x10    /**< Search RPC/action output nodes instead of input ones. */\n#define LYS_FIND_NO_MATCH_ERROR 0x40    /**< Return error if a path segment matches no nodes, otherwise only warning\n                                             is printed. */\n/** @} findxpathoptions */\n\n/**\n * @brief Get all the schema nodes that are required for @p xpath to be evaluated (atoms).\n *\n * @param[in] ctx libyang context to use. May be NULL if @p ctx_node is set.\n * @param[in] ctx_node XPath schema context node. Use NULL for the root node.\n * @param[in] xpath Data XPath expression filtering the matching nodes. ::LY_VALUE_JSON prefix format is expected.\n * @param[in] options Whether to apply some node access restrictions, see @ref findxpathoptions.\n * @param[out] set Set of found atoms (schema nodes).\n * @return LY_SUCCESS on success, @p set is returned.\n * @return LY_ERR value on error.\n */\nLIBYANG_API_DECL LY_ERR lys_find_xpath_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath,\n        uint32_t options, struct ly_set **set);\n\n/**\n * @brief Get all the schema nodes that are required for @p expr to be evaluated (atoms).\n *\n * @param[in] ctx_node XPath schema context node. Use NULL for the root node.\n * @param[in] cur_mod Current module for the expression (where it was "instantiated").\n * @param[in] expr Parsed expression to use.\n * @param[in] prefixes Sized array of compiled prefixes.\n * @param[in] options Whether to apply some node access restrictions, see @ref findxpathoptions.\n * @param[out] set Set of found atoms (schema nodes).\n * @return LY_SUCCESS on success, @p set is returned.\n * @return LY_ERR value on error.\n */\nLIBYANG_API_DECL LY_ERR lys_find_expr_atoms(const struct lysc_node *ctx_node, const struct lys_module *cur_mod,\n        const struct lyxp_expr *expr, const struct lysc_prefix *prefixes, uint32_t options, struct ly_set **set);\n\n/**\n * @brief Evaluate an @p xpath expression on schema nodes.\n *\n * @param[in] ctx libyang context to use for absolute @p xpath. May be NULL if @p ctx_node is set.\n * @param[in] ctx_node XPath schema context node for relative @p xpath. Use NULL for the root node.\n * @param[in] xpath Data XPath expression filtering the matching nodes. ::LY_VALUE_JSON prefix format is expected.\n * @param[in] options Whether to apply some node access restrictions, see @ref findxpathoptions.\n * @param[out] set Set of found schema nodes.\n * @return LY_SUCCESS on success, @p set is returned.\n * @return LY_ERR value if an error occurred.\n */\nLIBYANG_API_DECL LY_ERR lys_find_xpath(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *xpath,\n        uint32_t options, struct ly_set **set);\n\n/**\n * @brief Get all the schema nodes that are required for @p path to be evaluated (atoms).\n *\n * @param[in] path Compiled path to use.\n * @param[out] set Set of found atoms (schema nodes).\n * @return LY_SUCCESS on success, @p set is returned.\n * @return LY_ERR value on error.\n */\nLIBYANG_API_DECL LY_ERR lys_find_lypath_atoms(const struct ly_path *path, struct ly_set **set);\n\n/**\n * @brief Get all the schema nodes that are required for @p path to be evaluated (atoms).\n *\n * @param[in] ctx libyang context to use for absolute @p path. May be NULL if @p ctx_node is set.\n * @param[in] ctx_node XPath schema context node for relative @p path. Use NULL for the root node.\n * @param[in] path JSON path to examine.\n * @param[in] output Search operation output instead of input.\n * @param[out] set Set of found atoms (schema nodes).\n * @return LY_ERR value on error.\n */\nLIBYANG_API_DECL LY_ERR lys_find_path_atoms(const struct ly_ctx *ctx, const struct lysc_node *ctx_node, const char *path,\n        ly_bool output, struct ly_set **set);\n\n/**\n * @brief Get a schema node based on the given data path (JSON format, see @ref howtoXPath).\n *\n * @param[in] ctx libyang context to use for absolute @p path. May be NULL if @p ctx_node is set.\n * @param[in] ctx_node XPath schema context node for relative @p path. Use NULL for the root node.\n * @param[in] path JSON path of the node to get.\n * @param[in] output Search operation output instead of input.\n * @return Found schema node or NULL.\n */\nLIBYANG_API_DECL const struct lysc_node *lys_find_path(const struct ly_ctx *ctx, const struct lysc_node *ctx_node,\n        const char *path, ly_bool output);\n\n/**\n * @brief Types of the different schema paths.\n */\ntypedef enum {\n    LYSC_PATH_LOG,  /**< Descriptive path format used in log messages */\n    LYSC_PATH_DATA, /**< Similar to ::LYSC_PATH_LOG except that schema-only nodes (choice, case) are skipped */\n    LYSC_PATH_DATA_PATTERN  /**< Similar to ::LYSC_PATH_DATA but there are predicates for all list keys added with\n                                 "%s" where their values should be so that they can be printed there */\n} LYSC_PATH_TYPE;\n\n/**\n * @brief Generate path of the given node in the requested format.\n *\n * @param[in] node Schema path of this node will be generated.\n * @param[in] pathtype Format of the path to generate.\n * @param[in,out] buffer Prepared buffer of the @p buflen length to store the generated path.\n *                If NULL, memory for the complete path is allocated.\n * @param[in] buflen Size of the provided @p buffer.\n * @return NULL in case of memory allocation error, path of the node otherwise.\n * In case the @p buffer is NULL, the returned string is dynamically allocated and caller is responsible to free it.\n */\nLIBYANG_API_DECL char *lysc_path(const struct lysc_node *node, LYSC_PATH_TYPE pathtype, char *buffer, size_t buflen);\n\n/**\n * @brief Available YANG schema tree structures representing YANG module.\n */\nstruct lys_module {\n    struct ly_ctx *ctx;              /**< libyang context of the module (mandatory) */\n    const char *name;                /**< name of the module (mandatory) */\n    const char *revision;            /**< revision of the module (if present) */\n    const char *ns;                  /**< namespace of the module (module - mandatory) */\n    const char *prefix;              /**< module prefix or submodule belongsto prefix of main module (mandatory) */\n    const char *filepath;            /**< path, if the schema was read from a file, NULL in case of reading from memory */\n    const char *org;                 /**< party/company responsible for the module */\n    const char *contact;             /**< contact information for the module */\n    const char *dsc;                 /**< description of the module */\n    const char *ref;                 /**< cross-reference for the module */\n\n    struct lysp_module *parsed;      /**< Simply parsed (unresolved) YANG schema tree */\n    struct lysc_module *compiled;    /**< Compiled and fully validated YANG schema tree for data parsing.\n                                          Available only for implemented modules. */\n\n    struct lysc_ident *identities;   /**< List of compiled identities of the module ([sized array](@ref sizedarrays))\n                                          also contains the disabled identities when their if-feature(s) are evaluated to \\"false\\",\n                                          and also the list is filled even if the module is not implemented.\n                                          The list is located here because it avoids problems when the module became implemented in\n                                          future (no matter if implicitly via augment/deviate or explicitly via\n                                          ::lys_set_implemented()). Note that if the module is not implemented (compiled), the\n                                          identities cannot be instantiated in data (in identityrefs). */\n\n    struct lys_module **augmented_by;/**< List of modules that augment this module ([sized array](@ref sizedarrays)) */\n    struct lys_module **deviated_by; /**< List of modules that deviate this module ([sized array](@ref sizedarrays)) */\n\n    ly_bool implemented;             /**< flag if the module is implemented, not just imported */\n    ly_bool to_compile;              /**< flag marking a module that was changed but not (re)compiled, see\n                                          ::LY_CTX_EXPLICIT_COMPILE. */\n    uint8_t latest_revision;         /**< Flag to mark the latest available revision, see [latest_revision options](@ref latestrevflags). */\n};\n\n/**\n * @defgroup latestrevflags Options for ::lys_module.latest_revision.\n *\n * Various information bits of ::lys_module.latest_revision.\n *\n * @{\n */\n#define LYS_MOD_LATEST_REV          0x01 /**< This is the latest revision of the module in the current context. */\n#define LYS_MOD_LATEST_SEARCHDIRS   0x02 /**< This is the latest revision of the module found in searchdirs. */\n#define LYS_MOD_IMPORTED_REV        0x04 /**< This is the module revision used when importing the module without\n                                              an explicit revision-date. It is used for all such imports regardless of\n                                              any changes made in the context. */\n#define LYS_MOD_LATEST_IMPCLB       0x08 /**< This is the latest revision of the module obtained from import callback. */\n/** @} latestrevflags */\n\n/**\n * @brief Get the current real status of the specified feature in the module.\n *\n * If the feature is enabled, but some of its if-features are false, the feature is considered\n * disabled.\n *\n * @param[in] module Module where the feature is defined.\n * @param[in] feature Name of the feature to inspect.\n * @return LY_SUCCESS if the feature is enabled,\n * @return LY_ENOT if the feature is disabled,\n * @return LY_ENOTFOUND if the feature was not found.\n */\nLIBYANG_API_DECL LY_ERR lys_feature_value(const struct lys_module *module, const char *feature);\n\n/**\n * @brief Get next schema (sibling) node element in the schema order that can be instantiated in a data tree.\n * Returned node may be from an augment.\n *\n * ::lys_getnext() is supposed to be called sequentially. In the first call, the @p last parameter is usually NULL\n * and function starts returning 1) the first @p parent child (if it is set) or 2) the first top level element of\n * @p module. Consequent calls should provide the previously returned node as @p last and the same @p parent and\n * @p module parameters.\n *\n * Without options, the function is used to traverse only the schema nodes that can be paired with corresponding\n * data nodes in a data tree. By setting some @p options the behavior can be modified to the extent that\n * all the schema nodes are iteratively returned.\n *\n * @param[in] last Previously returned schema tree node, or NULL in case of the first call.\n * @param[in] parent Parent of the subtree to iterate over. If set, @p module is ignored.\n * @param[in] module Module of the top level elements to iterate over. If @p parent is NULL, it must be specified.\n * @param[in] options [ORed options](@ref sgetnextflags).\n * @return Next schema tree node, NULL in case there are no more.\n */\nLIBYANG_API_DECL const struct lysc_node *lys_getnext(const struct lysc_node *last, const struct lysc_node *parent,\n        const struct lysc_module *module, uint32_t options);\n\n/**\n * @brief Get next schema (sibling) node element in the schema order of an extension that can be instantiated in\n * a data tree.\n *\n * It is just ::lys_getnext() for extensions.\n *\n * @param[in] last Previously returned schema tree node, or NULL in case of the first call.\n * @param[in] parent Parent of the subtree to iterate over. If set, @p ext is ignored.\n * @param[in] ext Extension instance with schema nodes to iterate over. If @p parent is NULL, it must be specified.\n * @param[in] options [ORed options](@ref sgetnextflags).\n * @return Next schema tree node, NULL in case there are no more.\n */\nLIBYANG_API_DECL const struct lysc_node *lys_getnext_ext(const struct lysc_node *last, const struct lysc_node *parent,\n        const struct lysc_ext_instance *ext, uint32_t options);\n\n/**\n * @defgroup sgetnextflags Options for ::lys_getnext() and ::lys_getnext_ext().\n *\n * Various options setting behavior of ::lys_getnext() and ::lys_getnext_ext().\n *\n * @{\n */\n#define LYS_GETNEXT_WITHCHOICE   0x01 /**< ::lys_getnext() option to allow returning #LYS_CHOICE nodes instead of looking into them */\n#define LYS_GETNEXT_NOCHOICE     0x02 /**< ::lys_getnext() option to ignore (kind of conditional) nodes within choice node */\n#define LYS_GETNEXT_WITHCASE     0x04 /**< ::lys_getnext() option to allow returning #LYS_CASE nodes instead of looking into them */\n#define LYS_GETNEXT_INTONPCONT   0x08 /**< ::lys_getnext() option to look into non-presence container, instead of returning container itself */\n#define LYS_GETNEXT_OUTPUT       0x10 /**< ::lys_getnext() option to provide RPC\'s/action\'s output schema nodes instead of input schema nodes\n                                            provided by default */\n/** @} sgetnextflags */\n\n/**\n * @brief Get child node according to the specified criteria.\n *\n * @param[in] parent Optional parent of the node to find. If not specified, the module\'s top-level nodes are searched.\n * @param[in] module module of the node to find. It is also limitation for the children node of the given parent.\n * @param[in] name Name of the node to find.\n * @param[in] name_len Optional length of the name in case it is not NULL-terminated string.\n * @param[in] nodetype Optional criteria (to speedup) specifying nodetype(s) of the node to find.\n * Used as a bitmask, so multiple nodetypes can be specified.\n * @param[in] options [ORed options](@ref sgetnextflags).\n * @return Found node if any.\n */\nLIBYANG_API_DECL const struct lysc_node *lys_find_child(const struct lysc_node *parent, const struct lys_module *module,\n        const char *name, size_t name_len, uint16_t nodetype, uint32_t options);\n\n/**\n * @brief Make the specific module implemented.\n *\n * If the module is already implemented but with a different set of features, the whole context is recompiled.\n *\n * @param[in] mod Module to make implemented. It is not an error\n * to provide already implemented module, it just does nothing.\n * @param[in] features Optional array specifying the enabled features terminated with NULL overriding any previous\n * feature setting. The feature string \'*\' enables all the features and array of length 1 with only the terminating\n * NULL explicitly disables all the features. In case the parameter is NULL, the features are untouched - left disabled\n * in a newly implemented module or with the current features settings in case the module is already implemented.\n * @return LY_SUCCESS on success.\n * @return LY_EDENIED in case the context contains some other revision of the same module which is already implemented.\n * @return LY_ERR on other errors during module compilation.\n */\nLIBYANG_API_DECL LY_ERR lys_set_implemented(struct lys_module *mod, const char **features);\n\n/**\n * @brief Stringify schema nodetype.\n *\n * @param[in] nodetype Nodetype to stringify.\n * @return Constant string with the name of the node\'s type.\n */\nLIBYANG_API_DECL const char *lys_nodetype2str(uint16_t nodetype);\n\n/**\n * @brief Getter for original XPath expression from a parsed expression.\n *\n * @param[in] path Parsed expression.\n * @return Original string expression.\n */\nLIBYANG_API_DECL const char *lyxp_get_expr(const struct lyxp_expr *path);\n\n/** @} schematree */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* LY_TREE_SCHEMA_H_ */\n', 'message': "schema tree CHANGE base for the printer tree's free function\n", 'author_name': 'Radek Krejci', 'lang': 'h'}