context CHANGE basic context implementation
diff --git a/src/context.c b/src/context.c
new file mode 100644
index 0000000..c2eba9b
--- /dev/null
+++ b/src/context.c
@@ -0,0 +1,291 @@
+/**
+ * @file context.c
+ * @author Radek Krejci <rkrejci@cesnet.cz>
+ * @brief Context implementations
+ *
+ * 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
+ */
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "libyang.h"
+#include "common.h"
+#include "context.h"
+
+#define LY_INTERNAL_MODS_COUNT 0 /* TODO 6 when parser available */
+
+#define IETF_YANG_METADATA_PATH "../models/ietf-yang-metadata@2016-08-05.h"
+#define YANG_PATH "../models/yang@2017-02-20.h"
+#define IETF_INET_TYPES_PATH "../models/ietf-inet-types@2013-07-15.h"
+#define IETF_YANG_TYPES_PATH "../models/ietf-yang-types@2013-07-15.h"
+#define IETF_DATASTORES "../models/ietf-datastores@2017-08-17.h"
+#define IETF_YANG_LIB_PATH "../models/ietf-yang-library@2018-01-17.h"
+#define IETF_YANG_LIB_REV "2018-01-17"
+
+#if LY_INTERNAL_MODS_COUNT
+#include IETF_YANG_METADATA_PATH
+#include YANG_PATH
+#include IETF_INET_TYPES_PATH
+#include IETF_YANG_TYPES_PATH
+#include IETF_DATASTORES
+#include IETF_YANG_LIB_PATH
+#endif
+
+static struct internal_modules_s {
+    const char *name;
+    const char *revision;
+    const char *data;
+    uint8_t implemented;
+    LYS_INFORMAT format;
+} internal_modules[LY_INTERNAL_MODS_COUNT] = {
+#if LY_INTERNAL_MODS_COUNT
+    {"ietf-yang-metadata", "2016-08-05", (const char*)ietf_yang_metadata_2016_08_05_yin, 0, LYS_IN_YIN},
+    {"yang", "2017-02-20", (const char*)yang_2017_02_20_yin, 1, LYS_IN_YIN},
+    {"ietf-inet-types", "2013-07-15", (const char*)ietf_inet_types_2013_07_15_yin, 0, LYS_IN_YIN},
+    {"ietf-yang-types", "2013-07-15", (const char*)ietf_yang_types_2013_07_15_yin, 0, LYS_IN_YIN},
+    /* ietf-datastores and ietf-yang-library must be right here at the end of the list! */
+    {"ietf-datastores", "2017-08-17", (const char*)ietf_datastores_2017_08_17_yin, 0, LYS_IN_YIN},
+    {"ietf-yang-library", IETF_YANG_LIB_REV, (const char*)ietf_yang_library_2018_01_17_yin, 1, LYS_IN_YIN}
+#endif
+};
+
+API LY_ERR
+ly_ctx_set_searchdir(struct ly_ctx *ctx, const char *search_dir)
+{
+    char *new_dir = NULL;
+    LY_ERR rc = LY_ESYS;
+
+    LY_CHECK_ARG_RET(ctx, ctx, LY_EINVAL);
+
+    if (search_dir) {
+        LY_CHECK_ERR_GOTO(access(search_dir, R_OK | X_OK),
+                          LOGERR(ctx, LY_ESYS, "Unable to use search directory \"%s\" (%s)", search_dir, strerror(errno)),
+                          cleanup);
+        new_dir = realpath(search_dir, NULL);
+        LY_CHECK_ERR_GOTO(!new_dir,
+                          LOGERR(ctx, LY_ESYS, "realpath() call failed for \"%s\" (%s).", search_dir, strerror(errno)),
+                          cleanup);
+        if (ly_set_add(ctx->search_paths, new_dir) == -1) {
+            free(new_dir);
+            return LY_EMEM;
+        }
+
+        rc = LY_SUCCESS;
+    } else {
+        /* consider that no change is not actually an error */
+        return LY_SUCCESS;
+    }
+
+cleanup:
+    free(new_dir);
+    return rc;
+}
+
+API const char * const *
+ly_ctx_get_searchdirs(const struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx, NULL);
+    return (const char * const *)ctx->search_paths.objs;
+}
+
+API LY_ERR
+ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index)
+{
+    if (!ctx->search_paths.number) {
+        return LY_SUCCESS;
+    }
+
+    if (index >= 0) {
+        /* remove specific search directory */
+        return ly_set_rm_index(ctx->search_paths, index);
+    } else {
+        /* remove them all */
+        for (; ctx->search_paths.number; ctx->search_paths.number--) {
+            free(ctx->search_paths.objs[ctx->search_paths.number - 1]);
+        }
+        free(ctx->search_paths.objs);
+        memset(&ctx->search_paths, 0, sizeof ctx->search_paths);
+    }
+
+    return LY_SUCCESS;
+}
+
+API LY_ERR
+ly_ctx_new(const char *search_dir, int options, struct ly_ctx **new_ctx)
+{
+    struct ly_ctx *ctx = NULL;
+    struct lys_module *module;
+    char *search_dir_list;
+    char *sep, *dir;
+    LY_ERR rc = LY_SUCCESS;
+    int i;
+
+    ctx = calloc(1, sizeof *ctx);
+    LY_CHECK_ERR_RETURN(!ctx, LOGMEM(NULL), LY_EMEM);
+
+    /* dictionary */
+    lydict_init(&ctx->dict);
+
+    /* plugins */
+    ly_load_plugins();
+
+    /* initialize thread-specific key */
+    while ((i = pthread_key_create(&ctx->errlist_key, ly_err_free)) == EAGAIN);
+
+    /* models list */
+    ctx->flags = options;
+    if (search_dir) {
+        search_dir_list = strdup(search_dir);
+        LY_CHECK_ERR_GOTO(!search_dir_list, LOGMEM(NULL); rc = LY_EMEM, error);
+
+        for (dir = search_dir_list; (sep = strchr(dir, ':')) != NULL && rc == LY_SUCCESS; dir = sep + 1) {
+            *sep = 0;
+            rc = ly_ctx_set_searchdir(ctx, dir);
+        }
+        if (*dir && rc == LY_SUCCESS) {
+            rc = ly_ctx_set_searchdir(ctx, dir);
+        }
+        free(search_dir_list);
+
+        /* If ly_ctx_set_searchdir() failed, the error is already logged. Just exit */
+        if (rc != LY_SUCCESS) {
+            goto error;
+        }
+    }
+    ctx->module_set_id = 1;
+
+    /* load internal modules */
+    for (i = 0; i < (options & LY_CTX_NOYANGLIBRARY) ? LY_INTERNAL_MODS_COUNT - 2 : LY_INTERNAL_MODS_COUNT; i++) {
+        module = (struct lys_module *)lys_parse_mem(ctx, internal_modules[i].data, internal_modules[i].format);
+        LY_CHECK_GOTO(!module, error);
+        module->parsed->implemented = internal_modules[i].implemented;
+    }
+
+    *new_ctx = ctx;
+    return rc;
+
+error:
+    ly_ctx_destroy(ctx, NULL);
+    return rc;
+}
+
+API void
+ly_ctx_set_disable_searchdirs(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags |= LY_CTX_DISABLE_SEARCHDIRS;
+}
+
+API void
+ly_ctx_unset_disable_searchdirs(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags &= ~LY_CTX_DISABLE_SEARCHDIRS;
+}
+
+API void
+ly_ctx_set_disable_searchdir_cwd(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags |= LY_CTX_DISABLE_SEARCHDIR_CWD;
+}
+
+API void
+ly_ctx_unset_disable_searchdir_cwd(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags &= ~LY_CTX_DISABLE_SEARCHDIR_CWD;
+}
+
+API void
+ly_ctx_set_prefer_searchdirs(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags |= LY_CTX_PREFER_SEARCHDIRS;
+}
+
+API void
+ly_ctx_unset_prefer_searchdirs(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags &= ~LY_CTX_PREFER_SEARCHDIRS;
+}
+
+API void
+ly_ctx_set_allimplemented(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags |= LY_CTX_ALLIMPLEMENTED;
+}
+
+API void
+ly_ctx_unset_allimplemented(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags &= ~LY_CTX_ALLIMPLEMENTED;
+}
+
+API void
+ly_ctx_set_trusted(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags |= LY_CTX_TRUSTED;
+}
+
+API void
+ly_ctx_unset_trusted(struct ly_ctx *ctx)
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+    ctx->flags &= ~LY_CTX_TRUSTED;
+}
+
+API int
+ly_ctx_get_options(struct ly_ctx *ctx)
+{
+    return ctx->flags;
+}
+
+API uint16_t
+ly_ctx_get_module_set_id(const struct ly_ctx *ctx)
+{
+    return ctx->module_set_id;
+}
+
+API void
+ly_ctx_destroy(struct ly_ctx *ctx, void (*private_destructor)(const struct lys_node *node, void *priv))
+{
+    LY_CHECK_ARG_RET(ctx, ctx,);
+
+    /* models list */
+    for (; ctx->list.number; ctx->list.number--) {
+        /* remove the module */
+#if 0 /* TODO when parser implemented */
+        lys_free(ctx->list[ctx->list.number - 1], private_destructor, 1, 0);
+#endif
+    }
+    free(ctx->list.objs);
+
+    /* search paths list */
+    ly_ctx_unset_searchdirs(ctx, -1);
+
+    /* clean the error list */
+    ly_err_clean(ctx, 0);
+    pthread_key_delete(ctx->errlist_key);
+
+    /* dictionary */
+    lydict_clean(&ctx->dict);
+
+#if 0 /* TODO when plugins implemented */
+    /* plugins - will be removed only if this is the last context */
+    ly_clean_plugins();
+#endif
+
+    free(ctx);
+}
diff --git a/src/context.h b/src/context.h
index c3067e5..4ff45ad 100644
--- a/src/context.h
+++ b/src/context.h
@@ -21,29 +21,16 @@
 #include "hash_table.h"
 #include "tree_schema.h"
 
-struct ly_modules_list {
-    char **search_paths;
-    int size;
-    int used;
-    struct lys_module **list;
-    /* all (sub)modules that are currently being parsed */
-    struct lys_module **parsing_sub_modules;
-    /* all already parsed submodules of a module, which is before all its submodules (to mark submodule imports) */
-    struct lys_module **parsed_submodules;
-    uint8_t parsing_sub_modules_count;
-    uint8_t parsed_submodules_count;
-    uint16_t module_set_id;
-    int flags; /* see @ref contextoptions. */
-};
-
 /**
  * @brief Context of the YANG schemas
  */
 struct ly_ctx {
-    struct dict_table dict;
-    struct ly_modules_list models;
-    pthread_key_t errlist_key;
+    struct dict_table dict;           /**< dictionary to effectively store strings used in the context related structures */
+    struct ly_set search_paths;       /**< set of directories where to search for schema's imports/includes */
+    struct ly_set list;               /**< set of YANG schemas */
+    uint16_t module_set_id;           /**< ID of the current set of schemas */
+    uint16_t flags;                   /**< context settings, see @ref contextoptions. */
+    pthread_key_t errlist_key;        /**< key for the thread-specific list of errors related to the context */
 };
 
-
 #endif /* LY_CONTEXT_H_ */
diff --git a/src/libyang.h b/src/libyang.h
index ca649c3..a023fbb 100644
--- a/src/libyang.h
+++ b/src/libyang.h
@@ -15,23 +15,257 @@
 #ifndef LY_LIBYANG_H_
 #define LY_LIBYANG_H_
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /**
+ * @defgroup context Context
+ * @{
+ *
+ * Structures and functions to manipulate with the libyang "containers". The \em context concept allows callers
+ * to work in environments with different sets of YANG schemas. More detailed information can be found at
+ * @ref howtocontext page.
+ */
+
+/**
  * @struct ly_ctx
  * @brief libyang context handler.
  */
 struct ly_ctx;
 
-
-#ifdef __cplusplus
-}
-#endif
+/**@} context */
 
 #include "log.h"
 #include "set.h"
 #include "dict.h"
+#include "tree_schema.h"
+
+/**
+ * @ingroup context
+ * @{
+ */
+
+/**
+ * @defgroup contextoptions Context options
+ * @ingroup context
+ *
+ * Options to change context behavior.
+ * @{
+ */
+
+#define LY_CTX_ALLIMPLEMENTED 0x01 /**< All the imports of the schema being parsed are treated implemented. */
+#define LY_CTX_TRUSTED        0x02 /**< Handle the schema being parsed as trusted and skip its validation
+                                        tests. Note that while this option improves performance, it can
+                                        lead to an undefined behavior if the schema is not correct. */
+#define LY_CTX_NOYANGLIBRARY  0x04 /**< Do not internally implement ietf-yang-library module. The option
+                                        causes that function ly_ctx_info() does not work (returns NULL) 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_info() are 2016-04-09 and 2018-01-17.
+                                        This option cannot be used with ly_ctx_new_yl*() functions. */
+#define LY_CTX_DISABLE_SEARCHDIRS 0x08  /**< 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() */
+#define LY_CTX_DISABLE_SEARCHDIR_CWD 0x10 /**< Do not automatically search for schemas in current working
+                                        directory, which is by default searched automatically (despite not
+                                        recursively). */
+#define LY_CTX_PREFER_SEARCHDIRS 0x20 /**< When searching for schema, prefer searchdirs instead of user callback. */
+/**@} contextoptions */
+
+/**
+ * @brief Create libyang context.
+ *
+ * Context is used to hold all information about schemas. Usually, the application is supposed
+ * to work with a single context in which libyang is holding all schemas (and other internal
+ * information) according to which the data trees will be processed and validated. So, the schema
+ * trees are tightly connected with the specific context and they are held by the context internally
+ * - caller does not need to keep pointers to the schemas returned by lys_parse(), context knows
+ * about them. The data trees created with lyd_parse() are still connected with the specific context,
+ * but they are not internally held by the context. The data tree just points and lean on some data
+ * held by the context (schema tree, string dictionary, etc.). Therefore, in case of data trees, caller
+ * is supposed to keep pointers returned by the lyd_parse() and manage the data tree on its own. This
+ * also affects the number of instances of both tree types. While you can have only one instance of
+ * specific schema connected with a single context, number of data tree instances is not connected.
+ *
+ * @param[in] search_dir Directory where libyang will search for the imported or included modules
+ * and submodules. If no such directory is available, NULL is accepted.
+ * @param[in] options Context options, see @ref contextoptions.
+ * @param[out] new_ctx Pointer to the created libyang context if LY_SUCCESS returned.
+ * @return LY_ERR return value.
+ */
+LY_ERR ly_ctx_new(const char *search_dir, int options, struct ly_ctx **new_ctx);
+
+/**
+ * @brief Add the search path into libyang context
+ *
+ * To reset search paths set in the context, use ly_ctx_unset_searchdirs() and then
+ * set search paths again.
+ *
+ * @param[in] ctx Context to be modified.
+ * @param[in] search_dir New search path to add to the current paths previously set in ctx.
+ * @return EXIT_SUCCESS, EXIT_FAILURE.
+ */
+int ly_ctx_set_searchdir(struct ly_ctx *ctx, const char *search_dir);
+
+/**
+ * @brief Clean the search path(s) from the libyang context
+ *
+ * @param[in] ctx Context to be modified.
+ * @param[in] index Index of the search path to be removed, use negative value to remove them all.
+ *            Correct index value can be checked via ly_ctx_get_searchdirs().
+ * @return LY_ERR return value
+ */
+LY_ERR ly_ctx_unset_searchdirs(struct ly_ctx *ctx, int index);
+
+/**
+ * @brief Get the NULL-terminated list of the search paths in libyang context. Do not modify the result!
+ *
+ * @param[in] ctx Context to query.
+ * @return NULL-terminated list (array) of the search paths, NULL if no searchpath was set.
+ * Do not modify the provided data in any way!
+ */
+const char * const *ly_ctx_get_searchdirs(const struct ly_ctx *ctx);
+
+/**
+ * @brief Get the currently set context's options.
+ *
+ * @param[in] ctx Context to query.
+ * @return Combination of all the currently set context's options, see @ref contextoptions.
+ */
+int ly_ctx_get_options(struct ly_ctx *ctx);
+
+/**
+ * @brief Make context to stop searching for schemas (imported, included or requested via ly_ctx_load_module())
+ * in searchdirs set via ly_ctx_set_searchdir() functions. Searchdirs are still stored in the context, so by
+ * unsetting the option by ly_ctx_unset_disable_searchdirs() searching in all previously searchdirs is restored.
+ *
+ * The same effect is achieved by using #LY_CTX_DISABLE_SEARCHDIRS option when creating new context or parsing
+ * a specific schema.
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_set_disable_searchdirs(struct ly_ctx *ctx);
+
+/**
+ * @brief Reverse function to ly_ctx_set_disable_searchdirs().
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_unset_disable_searchdirs(struct ly_ctx *ctx);
+
+/**
+ * @brief Make context to stop implicitly searching for schemas (imported, included or requested via ly_ctx_load_module())
+ * in current working directory. This flag can be unset by ly_ctx_unset_disable_searchdir_cwd().
+ *
+ * The same effect is achieved by using #LY_CTX_DISABLE_SEARCHDIR_CWD option when creating new context or parsing
+ * a specific schema.
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_set_disable_searchdir_cwd(struct ly_ctx *ctx);
+
+/**
+ * @brief Reverse function to ly_ctx_set_disable_searchdir_cwd().
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_unset_disable_searchdir_cwd(struct ly_ctx *ctx);
+
+/**
+ * @brief Prefer context's searchdirs before the user callback (ly_module_imp_clb) provided via ly_ctx_set_module_imp_clb()).
+ *
+ * The same effect is achieved by using #LY_CTX_PREFER_SEARCHDIRS option when creating new context or parsing
+ * a specific schema.
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_set_prefer_searchdirs(struct ly_ctx *ctx);
+
+/**
+ * @brief Reverse function to ly_ctx_set_prefer_searchdirs().
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_unset_prefer_searchdirs(struct ly_ctx *ctx);
+
+/**
+ * @brief Make context to set all the imported modules to be implemented. By default,
+ * if the imported module is not used in leafref's path, augment or deviation, it is
+ * imported and its data tree is not taken into account.
+ *
+ * The same effect is achieved by using #LY_CTX_ALLIMPLEMENTED option when creating new context or parsing
+ * a specific schema.
+ *
+ * Note, that function does not make the currently loaded modules, it just change the
+ * schema parser behavior for the future parsing. This flag can be unset by ly_ctx_unset_allimplemented().
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_set_allimplemented(struct ly_ctx *ctx);
+
+/**
+ * @brief Reverse function to ly_ctx_set_allimplemented().
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_unset_allimplemented(struct ly_ctx *ctx);
+
+/**
+ * @brief Change the schema parser behavior when parsing new schemas forcing it to skip some of the schema
+ * validation checks to improve performance. Note that parsing invalid schemas this way may lead to an
+ * undefined behavior later, e.g. when working with data trees.
+ *
+ * The same effect is achieved by using #LY_CTX_TRUSTED option when creating new context or parsing
+ * a specific schema.
+ *
+ * This flag can be unset by ly_ctx_unset_trusted().
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_set_trusted(struct ly_ctx *ctx);
+
+/**
+ * @brief Reverse function to ly_ctx_set_trusted().
+ *
+ * @param[in] ctx Context to be modified.
+ */
+void ly_ctx_unset_trusted(struct ly_ctx *ctx);
+
+/**
+ * @brief Get current ID of the modules set. The value is available also
+ * as module-set-id in ly_ctx_info() result.
+ *
+ * @param[in] ctx Context to be examined.
+ * @return Numeric identifier of the current context's modules set.
+ */
+uint16_t ly_ctx_get_module_set_id(const struct ly_ctx *ctx);
+
+/**
+ * @brief Free all internal structures of the specified context.
+ *
+ * The function should be used before terminating the application to destroy
+ * and free all structures internally used by libyang. If the caller uses
+ * multiple contexts, the function should be called for each used context.
+ *
+ * All instance data are supposed to be freed before destroying the context.
+ * Data models are destroyed automatically as part of ly_ctx_destroy() call.
+ *
+ * @param[in] ctx libyang context to destroy
+ * @param[in] private_destructor Optional destructor function for private objects assigned
+ * to the nodes via lys_set_private(). If NULL, the private objects are not freed by libyang.
+ * Remember the differences between the structures derived from ::lys_node and always check
+ * ::lys_node#nodetype.
+ */
+void ly_ctx_destroy(struct ly_ctx *ctx, void (*private_destructor)(const struct lysc_node *node, void *priv));
+
+/** @} context */
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* LY_LIBYANG_H_ */
diff --git a/src/tree_schema.h b/src/tree_schema.h
index 4e3f095..6dc23ed 100644
--- a/src/tree_schema.h
+++ b/src/tree_schema.h
@@ -24,6 +24,27 @@
  * Data structures and functions to manipulate and access schema tree.
  */
 
+/**
+ * @brief Schema input formats accepted by libyang [parser functions](@ref howtoschemasparsers).
+ */
+typedef enum {
+    LYS_IN_UNKNOWN = 0,  /**< unknown format, used as return value in case of error */
+    LYS_IN_YANG = 1,     /**< YANG schema input format */
+    LYS_IN_YIN = 2       /**< YIN schema input format */
+} LYS_INFORMAT;
+
+/**
+ * @brief Schema output formats accepted by libyang [printer functions](@ref howtoschemasprinters).
+ */
+typedef enum {
+    LYS_OUT_UNKNOWN = 0, /**< unknown format, used as return value in case of error */
+    LYS_OUT_YANG = 1,    /**< YANG schema output format */
+    LYS_OUT_YIN = 2,     /**< YIN schema output format */
+    LYS_OUT_TREE,        /**< Tree schema output format, for more information see the [printers](@ref howtoschemasprinters) page */
+    LYS_OUT_INFO,        /**< Info schema output format, for more information see the [printers](@ref howtoschemasprinters) page */
+    LYS_OUT_JSON,        /**< JSON schema output format, reflecting YIN format with conversion of attributes to object's members */
+} LYS_OUTFORMAT;
+
 #define LY_REV_SIZE 11   /**< revision data string length (including terminating NULL byte) */
 
 #define LYS_UNKNOWN 0x0000,        /**< uninitalized unknown statement node */
@@ -619,6 +640,12 @@
 };
 
 /**
+ * @brief Compiled YANG data node
+ */
+struct lysc_node {
+};
+
+/**
  * @brief Available YANG schema tree structures representing YANG module.
  */
 struct lys_module {