FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
macros.h
Go to the documentation of this file.
1 /*
2  * macros.h - definitions for a simple macro expander
3  *
4  * Copyright (c) 2010-2020 Cisco and/or its affiliates.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17 */
18 
19 #ifndef included_macros_h
20 #define included_macros_h
21 
22 #include <vppinfra/vec.h>
23 #include <vppinfra/hash.h>
24 #include <vppinfra/format.h>
25 
26 #ifdef CLIB_UNIX
27 #include <stdlib.h>
28 #include <unistd.h>
29 #endif
30 
31 typedef struct
32 {
36 
37 int clib_macro_unset (clib_macro_main_t * mm, char *name);
38 int clib_macro_set_value (clib_macro_main_t * mm, char *name, char *value);
40  void *eval_fn);
42 i8 *clib_macro_eval (clib_macro_main_t * mm, i8 * s, i32 complain,
43  u16 level, u16 max_level);
44 i8 *clib_macro_eval_dollar (clib_macro_main_t * mm, i8 * s, i32 complain);
47 
49 
50 #endif /* included_macros_h */
51 
52 /*
53  * fd.io coding-style-patch-verification: ON
54  *
55  * Local Variables:
56  * eval: (c-set-style "gnu")
57  * End:
58  */
name
string name[64]
Definition: fib.api:25
clib_macro_set_value
int clib_macro_set_value(clib_macro_main_t *mm, char *name, char *value)
Definition: macros.c:64
u16
unsigned short u16
Definition: types.h:57
clib_macro_main_t::the_value_table_hash
uword * the_value_table_hash
Definition: macros.h:34
i32
signed int i32
Definition: types.h:77
hash.h
clib_macro_eval
i8 * clib_macro_eval(clib_macro_main_t *mm, i8 *s, i32 complain, u16 level, u16 max_level)
Definition: macros.c:95
uword
u64 uword
Definition: types.h:112
format.h
clib_macro_main_t
Definition: macros.h:31
clib_macro_get_value
i8 * clib_macro_get_value(clib_macro_main_t *mm, char *name)
Definition: macros.c:79
format_function_t
u8 *() format_function_t(u8 *s, va_list *args)
Definition: format.h:48
clib_macro_free
void clib_macro_free(clib_macro_main_t *mm)
Definition: macros.c:247
i8
signed char i8
Definition: types.h:45
value
u8 value
Definition: qos.api:54
vec.h
clib_macro_eval_dollar
i8 * clib_macro_eval_dollar(clib_macro_main_t *mm, i8 *s, i32 complain)
Definition: macros.c:201
format_clib_macro_main
format_function_t format_clib_macro_main
Definition: macros.h:48
clib_macro_init
void clib_macro_init(clib_macro_main_t *mm)
Definition: macros.c:230
clib_macro_unset
int clib_macro_unset(clib_macro_main_t *mm, char *name)
Definition: macros.c:44
clib_macro_add_builtin
void clib_macro_add_builtin(clib_macro_main_t *mm, char *name, void *eval_fn)
Definition: macros.c:213
clib_macro_main_t::the_builtin_eval_hash
uword * the_builtin_eval_hash
Definition: macros.h:33