blob: e90704292d407dead36e34f1d40c761d68392238 [file] [log] [blame]
Radek Krejci5aeea3a2018-09-05 13:29:36 +02001/**
2 * @file context.h
3 * @author Radek Krejci <rkrejci@cesnet.cz>
4 * @brief internal context structures and functions
5 *
6 * Copyright (c) 2015 - 2017 CESNET, z.s.p.o.
7 *
8 * This source code is licensed under BSD 3-Clause License (the "License").
9 * You may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * https://opensource.org/licenses/BSD-3-Clause
13 */
14
15#ifndef LY_CONTEXT_H_
16#define LY_CONTEXT_H_
17
18#include <pthread.h>
19
20#include "common.h"
Radek Krejciad573502018-09-07 15:26:55 +020021#include "set.h"
Radek Krejci5aeea3a2018-09-05 13:29:36 +020022#include "hash_table.h"
23#include "tree_schema.h"
24
Radek Krejci5aeea3a2018-09-05 13:29:36 +020025/**
26 * @brief Context of the YANG schemas
27 */
28struct ly_ctx {
Radek Krejci0af5f5d2018-09-07 15:00:30 +020029 struct dict_table dict; /**< dictionary to effectively store strings used in the context related structures */
30 struct ly_set search_paths; /**< set of directories where to search for schema's imports/includes */
31 struct ly_set list; /**< set of YANG schemas */
32 uint16_t module_set_id; /**< ID of the current set of schemas */
33 uint16_t flags; /**< context settings, see @ref contextoptions. */
34 pthread_key_t errlist_key; /**< key for the thread-specific list of errors related to the context */
Radek Krejci5aeea3a2018-09-05 13:29:36 +020035};
36
Radek Krejci5aeea3a2018-09-05 13:29:36 +020037#endif /* LY_CONTEXT_H_ */