Blame src/context.h

Packit 8fb591
/**
Packit 8fb591
 * @file context.h
Packit 8fb591
 * @author Radek Krejci <rkrejci@cesnet.cz>
Packit 8fb591
 * @brief internal context structures and functions
Packit 8fb591
 *
Packit 8fb591
 * Copyright (c) 2015 - 2017 CESNET, z.s.p.o.
Packit 8fb591
 *
Packit 8fb591
 * This source code is licensed under BSD 3-Clause License (the "License").
Packit 8fb591
 * You may not use this file except in compliance with the License.
Packit 8fb591
 * You may obtain a copy of the License at
Packit 8fb591
 *
Packit 8fb591
 *     https://opensource.org/licenses/BSD-3-Clause
Packit 8fb591
 */
Packit 8fb591
Packit 8fb591
#ifndef LY_CONTEXT_H_
Packit 8fb591
#define LY_CONTEXT_H_
Packit 8fb591
Packit 8fb591
#include <pthread.h>
Packit 8fb591
Packit 8fb591
#include "libyang.h"
Packit 8fb591
#include "common.h"
Packit 8fb591
#include "hash_table.h"
Packit 8fb591
#include "tree_schema.h"
Packit 8fb591
Packit 8fb591
struct ly_modules_list {
Packit 8fb591
    char **search_paths;
Packit 8fb591
    int size;
Packit 8fb591
    int used;
Packit 8fb591
    struct lys_module **list;
Packit 8fb591
    /* all (sub)modules that are currently being parsed */
Packit 8fb591
    struct lys_module **parsing_sub_modules;
Packit 8fb591
    /* all already parsed submodules of a module, which is before all its submodules (to mark submodule imports) */
Packit 8fb591
    struct lys_module **parsed_submodules;
Packit 8fb591
    uint8_t parsing_sub_modules_count;
Packit 8fb591
    uint8_t parsed_submodules_count;
Packit 8fb591
    uint16_t module_set_id;
Packit 8fb591
    int flags; /* see @ref contextoptions. */
Packit 8fb591
};
Packit 8fb591
Packit 8fb591
struct ly_ctx {
Packit 8fb591
    struct dict_table dict;
Packit 8fb591
    struct ly_modules_list models;
Packit 8fb591
    ly_module_imp_clb imp_clb;
Packit 8fb591
    void *imp_clb_data;
Packit 8fb591
    ly_module_data_clb data_clb;
Packit 8fb591
    void *data_clb_data;
Packit 8fb591
#ifdef LY_ENABLED_LYD_PRIV
Packit 8fb591
    void *(*priv_dup_clb)(const void *priv);
Packit 8fb591
#endif
Packit 8fb591
    pthread_key_t errlist_key;
Packit 8fb591
    uint8_t internal_module_count;
Packit 8fb591
};
Packit 8fb591
Packit 8fb591
#endif /* LY_CONTEXT_H_ */