/src/freeradius-server/src/lib/unlang/switch_priv.h
Line | Count | Source |
1 | | #pragma once |
2 | | /* |
3 | | * This program is free software; you can redistribute it and/or modify |
4 | | * it under the terms of the GNU General Public License as published by |
5 | | * the Free Software Foundation; either version 2, or (at your option) |
6 | | * any later version. |
7 | | * |
8 | | * This program is distributed in the hope that it will be useful, |
9 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | | * GNU General Public License for more details. |
12 | | * |
13 | | * You should have received a copy of the GNU General Public License |
14 | | * along with this program; if not, write to the Free Software Foundation, |
15 | | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
16 | | */ |
17 | | |
18 | | /** |
19 | | * $Id: 4c5cf77524901ddfe56f72a9c5c697e1df8250a2 $ |
20 | | * |
21 | | * @file unlang/switch_priv.h |
22 | | * |
23 | | * @copyright 2020 The FreeRADIUS server project |
24 | | */ |
25 | | #ifdef __cplusplus |
26 | | extern "C" { |
27 | | #endif |
28 | | |
29 | | #include <freeradius-devel/server/tmpl.h> |
30 | | #include <freeradius-devel/util/htrie.h> |
31 | | |
32 | | typedef struct { |
33 | | unlang_group_t group; |
34 | | unlang_t *default_case; |
35 | | tmpl_t *vpt; |
36 | | fr_htrie_t *ht; |
37 | | } unlang_switch_t; |
38 | | |
39 | | /** Cast a group structure to the switch keyword extension |
40 | | * |
41 | | */ |
42 | | static inline unlang_switch_t *unlang_group_to_switch(unlang_group_t *g) |
43 | 0 | { |
44 | 0 | return talloc_get_type_abort(g, unlang_switch_t); |
45 | 0 | } Unexecuted instantiation: compile.c:unlang_group_to_switch Unexecuted instantiation: switch.c:unlang_group_to_switch |
46 | | |
47 | | /** Cast a switch keyword extension to a group structure |
48 | | * |
49 | | */ |
50 | | static inline unlang_group_t *unlang_switch_to_group(unlang_switch_t *sw) |
51 | 0 | { |
52 | 0 | return (unlang_group_t *)sw; |
53 | 0 | } Unexecuted instantiation: compile.c:unlang_switch_to_group Unexecuted instantiation: switch.c:unlang_switch_to_group |
54 | | |
55 | | typedef struct { |
56 | | unlang_group_t group; |
57 | | tmpl_t *vpt; |
58 | | } unlang_case_t; |
59 | | |
60 | | /** Cast a group structure to the case keyword extension |
61 | | * |
62 | | */ |
63 | | static inline unlang_case_t *unlang_group_to_case(unlang_group_t *g) |
64 | 0 | { |
65 | 0 | return talloc_get_type_abort(g, unlang_case_t); |
66 | 0 | } Unexecuted instantiation: compile.c:unlang_group_to_case Unexecuted instantiation: switch.c:unlang_group_to_case |
67 | | |
68 | | /** Cast a case keyword extension to a group structure |
69 | | * |
70 | | */ |
71 | | static inline unlang_group_t *unlang_case_to_group(unlang_case_t *sw) |
72 | 0 | { |
73 | 0 | return (unlang_group_t *)sw; |
74 | 0 | } Unexecuted instantiation: compile.c:unlang_case_to_group Unexecuted instantiation: switch.c:unlang_case_to_group |
75 | | |
76 | | #ifdef __cplusplus |
77 | | } |
78 | | #endif |