|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
24 if ((
c >=
'A' &&
c <=
'Z')
25 || (
c >=
'a' &&
c <=
'z') || (
c >=
'0' &&
c <=
'9') || (
c ==
'_'))
40 return (*fp) (mm, complain);
66 u8 *key_copy, *value_copy;
99 i8 *varname, *varvalue;
102 if (level >= max_level)
106 return (
i8 *)
format (0,
" CIRCULAR ");
128 while (*s && (
macro_isalnum (*s) || (*s ==
'_') || (*s ==
'(')))
135 while (*s && *s !=
')')
163 char *
tmp = getenv ((
char *) varname);
184 clib_warning (
"Undefined Variable Reference: %s\n", varname);
206 s2 = (
i8 *)
format (0,
"$(%s)%c", s, 0);
223 if (gethostname (
tmp,
sizeof (
tmp)))
224 return ((
i8 *)
format (0,
"gethostname-error%c", 0));
250 u8 **strings_to_free = 0;
258 vec_add1 (strings_to_free, (u8 *) (p->key));
259 vec_add1 (strings_to_free, (u8 *) (p->value[0]));
263 for (
i = 0;
i <
vec_len (strings_to_free);
i++)
281 return strcmp ((
char *) ns1->
name, (
char *) ns2->
name);
289 int evaluate = va_arg (*args,
int);
297 vec_add2 (nses, ns, 1);
298 ns->name = (u8 *)(p->key);
299 ns->value = (u8 *)(p->value[0]);
__clib_export u8 * format_clib_macro_main(u8 *s, va_list *args)
#define vec_append(v1, v2)
Append v2 after v1.
#define hash_get_pair(h, key)
__clib_export i8 * clib_macro_eval_dollar(clib_macro_main_t *mm, i8 *s, i32 complain)
#define hash_create_string(elts, value_bytes)
__clib_export int clib_macro_set_value(clib_macro_main_t *mm, char *name, char *value)
uword * the_value_table_hash
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define hash_set_mem(h, key, value)
__clib_export i8 * clib_macro_eval(clib_macro_main_t *mm, i8 *s, i32 complain, u16 level, u16 max_level)
sll srl srl sll sra u16x4 i
__clib_export int clib_macro_unset(clib_macro_main_t *mm, char *name)
static int name_compare(void *a1, void *a2)
static i8 * eval_hostname(clib_macro_main_t *mm, i32 complain)
#define vec_free(V)
Free vector's memory (no header).
__clib_export void clib_macro_add_builtin(clib_macro_main_t *mm, char *name, void *eval_fn)
__clib_export void clib_macro_free(clib_macro_main_t *mm)
#define hash_get_mem(h, key)
description fragment has unexpected format
i8 * clib_macro_get_value(clib_macro_main_t *mm, char *name)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
static int macro_isalnum(i8 c)
#define hash_unset_mem(h, key)
static i8 * builtin_eval(clib_macro_main_t *mm, i8 *varname, i32 complain)
#define clib_warning(format, args...)
__clib_export void clib_macro_init(clib_macro_main_t *mm)
uword * the_builtin_eval_hash