/src/libyang/src/plugins_exts.c
Line | Count | Source |
1 | | /** |
2 | | * @file plugins_exts.c |
3 | | * @author Radek Krejci <rkrejci@cesnet.cz> |
4 | | * @brief Internally implemented YANG extensions. |
5 | | * |
6 | | * Copyright (c) 2019 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 | | #include "plugins_exts.h" |
16 | | #include "plugins_exts_compile.h" |
17 | | #include "plugins_exts_print.h" |
18 | | |
19 | | #include <stdint.h> |
20 | | |
21 | | extern struct lyplg_ext metadata_plugin; /* plugins_exts_metadata.c */ |
22 | | extern struct lyplg_ext nacm_plugin; /* plugins_exts_nacm.c */ |
23 | | extern struct lyplg_ext yangdata_plugin; /* plugins_exts_yangdata.c */ |
24 | | |
25 | | /* internal libyang headers - do not make them accessible to the extension plugins in plugins_exts_*.c */ |
26 | | #include "common.h" |
27 | | #include "printer_internal.h" |
28 | | #include "schema_compile.h" |
29 | | |
30 | | API struct ly_ctx * |
31 | | lysc_ctx_get_ctx(const struct lysc_ctx *ctx) |
32 | 0 | { |
33 | 0 | return ctx->ctx; |
34 | 0 | } |
35 | | |
36 | | API uint32_t * |
37 | | lysc_ctx_get_options(const struct lysc_ctx *ctx) |
38 | 0 | { |
39 | 0 | return &((struct lysc_ctx *)ctx)->options; |
40 | 0 | } |
41 | | |
42 | | API const char * |
43 | | lysc_ctx_get_path(const struct lysc_ctx *ctx) |
44 | 0 | { |
45 | 0 | return ctx->path; |
46 | 0 | } |
47 | | |
48 | | API struct ly_out ** |
49 | | lys_ypr_ctx_get_out(const struct lyspr_ctx *ctx) |
50 | 0 | { |
51 | 0 | return &((struct lyspr_ctx *)ctx)->out; |
52 | 0 | } |
53 | | |
54 | | API uint32_t * |
55 | | lys_ypr_ctx_get_options(const struct lyspr_ctx *ctx) |
56 | 0 | { |
57 | 0 | return &((struct lyspr_ctx *)ctx)->options; |
58 | 0 | } |
59 | | |
60 | | API uint16_t * |
61 | | lys_ypr_ctx_get_level(const struct lyspr_ctx *ctx) |
62 | 0 | { |
63 | 0 | return &((struct lyspr_ctx *)ctx)->level; |
64 | 0 | } |