The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
foreach_priv.h
Go to the documentation of this file.
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: 55afbaccab578b0ed68b03fd931c594cc8d0a80e $
20  *
21  * @file unlang/foreach_priv.h
22  *
23  * @copyright 2020 The FreeRADIUS server project
24  */
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include "unlang_priv.h"
30 #include <freeradius-devel/server/tmpl.h>
31 
32 typedef struct {
35  fr_dict_attr_t const *key; //!< key variable for the foreach loop
36  fr_dict_attr_t const *value; //!< value variable in the foreach loop
38 
39 /** Cast a group structure to the foreach keyword extension
40  *
41  */
43 {
44  return talloc_get_type_abort(g, unlang_foreach_t);
45 }
46 
47 /** Cast a foreach keyword extension to a group structure
48  *
49  */
51 {
52  return (unlang_group_t *)foreach;
53 }
54 
55 #ifdef __cplusplus
56 }
57 #endif
static unlang_foreach_t * unlang_group_to_foreach(unlang_group_t *g)
Cast a group structure to the foreach keyword extension.
Definition: foreach_priv.h:42
static unlang_group_t * unlang_foreach_to_group(unlang_foreach_t *foreach)
Cast a foreach keyword extension to a group structure.
Definition: foreach_priv.h:50
fr_dict_attr_t const * value
value variable in the foreach loop
Definition: foreach_priv.h:36
unlang_group_t group
Definition: foreach_priv.h:33
fr_dict_attr_t const * key
key variable for the foreach loop
Definition: foreach_priv.h:35
Private interpreter structures and functions.
Generic representation of a grouping.
Definition: unlang_priv.h:145