Radek Krejci | 5aeea3a | 2018-09-05 13:29:36 +0200 | [diff] [blame^] | 1 | /** |
| 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" |
| 21 | #include "hash_table.h" |
| 22 | #include "tree_schema.h" |
| 23 | |
| 24 | struct ly_modules_list { |
| 25 | char **search_paths; |
| 26 | int size; |
| 27 | int used; |
| 28 | struct lys_module **list; |
| 29 | /* all (sub)modules that are currently being parsed */ |
| 30 | struct lys_module **parsing_sub_modules; |
| 31 | /* all already parsed submodules of a module, which is before all its submodules (to mark submodule imports) */ |
| 32 | struct lys_module **parsed_submodules; |
| 33 | uint8_t parsing_sub_modules_count; |
| 34 | uint8_t parsed_submodules_count; |
| 35 | uint16_t module_set_id; |
| 36 | int flags; /* see @ref contextoptions. */ |
| 37 | }; |
| 38 | |
| 39 | /** |
| 40 | * @brief Context of the YANG schemas |
| 41 | */ |
| 42 | struct ly_ctx { |
| 43 | struct dict_table dict; |
| 44 | struct ly_modules_list models; |
| 45 | pthread_key_t errlist_key; |
| 46 | }; |
| 47 | |
| 48 | |
| 49 | #endif /* LY_CONTEXT_H_ */ |