libyang  2.1.80
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Context options


#define LY_CTX_NO_YANGLIBRARY   0x04
#define LY_CTX_SET_PRIV_PARSED   0x40

Detailed Description

Options to change context behavior.

Macro Definition Documentation


All the imported modules of the schema being parsed are implemented.

Definition at line 162 of file context.h.


Do not automatically search for schemas in current working directory, which is by default searched automatically (despite not recursively).

Definition at line 192 of file context.h.


Do not search for schemas in context's searchdirs neither in current working directory. It is entirely skipped and the only way to get schema data for imports or for ly_ctx_load_module() is to use the callbacks provided by caller via ly_ctx_set_module_imp_clb()

Definition at line 185 of file context.h.


By default, all features of newly implemented imported modules of a module that is being loaded are disabled. With this flag they all become enabled.

Definition at line 224 of file context.h.


If this flag is set, the compiled modules and their schema nodes are not automatically updated (compiled) on any context changes. In other words, they do not immediately take effect. To do that, call ly_ctx_compile(). Changes requiring compilation include adding new modules, changing their features, and implementing parsed-only modules. This option allows efficient compiled context creation without redundant recompilations.

Definition at line 213 of file context.h.

#define LY_CTX_NO_YANGLIBRARY   0x04

Do not internally implement ietf-yang-library module. The option causes that function ly_ctx_get_yanglib_data() does not work (returns LY_EINVAL) until the ietf-yang-library module is loaded manually. While any revision of this schema can be loaded with this option, note that the only revisions implemented by ly_ctx_get_yanglib_data() are 2016-06-21 and 2019-01-04. This option cannot be changed on existing context.

Definition at line 174 of file context.h.


When searching for schema, prefer searchdirs instead of user callback.

Definition at line 197 of file context.h.


Implement all imported modules "referenced" from an implemented module. Normally, leafrefs, augment and deviation targets are implemented as specified by YANG 1.1. In addition to this, implement any modules of nodes referenced by when and must conditions and by any default values. Generally, only if all these modules are implemented, the explicitly implemented modules can be properly used and instantiated in data.

Definition at line 163 of file context.h.

#define LY_CTX_SET_PRIV_PARSED   0x40

For all compiled nodes, their private objects (lysc_node.priv) are used by libyang as a reference to the corresponding parsed node (lysp_node). The exception are "case" statements, which are omitted (shorthand), in that case the private objects are set to NULL. So if this option is set, the user must not change private objects. Setting this option by ly_ctx_set_options() may result in context recompilation. Resetting this option by ly_ctx_unset_options() cause that private objects will be set to NULL.

Definition at line 198 of file context.h.