Radek Krejci | 70853c5 | 2018-10-15 14:46:16 +0200 | [diff] [blame^] | 1 | /** |
| 2 | * @file tree_schema_internal.h |
| 3 | * @author Radek Krejci <rkrejci@cesnet.cz> |
| 4 | * @brief internal functions for YANG schema trees. |
| 5 | * |
| 6 | * Copyright (c) 2015 - 2018 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_TREE_SCHEMA_INTERNAL_H_ |
| 16 | #define LY_TREE_SCHEMA_INTERNAL_H_ |
| 17 | |
| 18 | /** |
| 19 | * @brief internal context for schema parsers |
| 20 | */ |
| 21 | struct ly_parser_ctx { |
| 22 | struct ly_ctx *ctx; |
| 23 | uint64_t line; /* line number */ |
| 24 | uint64_t indent; /* current position on the line for YANG indentation */ |
| 25 | }; |
| 26 | |
| 27 | /** |
| 28 | * @brief Check the currently present prefixes in the module for collision with the new one. |
| 29 | * |
| 30 | * @param[in] ctx yang parser context. |
| 31 | * @param[in] module Schema tree to check. |
| 32 | * @param[in] value Newly added prefix value (including its location to distinguish collision with itself). |
| 33 | * @return LY_EEXIST when prefix is already used in the module, LY_SUCCESS otherwise |
| 34 | */ |
| 35 | LY_ERR lysp_check_prefix(struct ly_parser_ctx *ctx, struct lysp_module *module, const char **value); |
| 36 | |
| 37 | #endif /* LY_TREE_SCHEMA_INTERNAL_H_ */ |