| 332 | /* dict_eval - expand embedded dictionary references */ |
| 333 | |
| 334 | const char *dict_eval(char *dict_name, const char *value, int recursive) |
| 335 | { |
| 336 | const char *myname = "dict_eval"; |
| 337 | static __thread ACL_VSTRING *buf = NULL; |
| 338 | int status; |
| 339 | |
| 340 | /* |
| 341 | * Initialize. |
| 342 | */ |
| 343 | if (buf == 0) { |
| 344 | buf = acl_vstring_alloc(10); |
| 345 | acl_pthread_atexit_add(buf, free_vstring_fn); |
| 346 | } |
| 347 | |
| 348 | /* |
| 349 | * Expand macros, possibly recursively. |
| 350 | */ |
| 351 | #define DONT_FILTER (char *) 0 |
| 352 | |
| 353 | status = mac_expand(buf, value, |
| 354 | recursive ? MAC_EXP_FLAG_RECURSE : MAC_EXP_FLAG_NONE, |
| 355 | DONT_FILTER, dict_eval_lookup, (char *) dict_name); |
| 356 | if (status & MAC_PARSE_ERROR) |
| 357 | acl_msg_fatal("dictionary %s: macro processing error", dict_name); |
| 358 | if (acl_do_debug(DEBUG_DICT, 2)) { |
| 359 | if (strcmp(value, STR(buf)) != 0) |
| 360 | acl_msg_info("%s: expand %s -> %s", myname, value, STR(buf)); |
| 361 | else |
| 362 | acl_msg_info("%s: const %s", myname, value); |
| 363 | } |
| 364 | return STR(buf); |
| 365 | } |
| 366 | |
| 367 | /* dict_walk - iterate over all dictionaries in arbitrary order */ |
| 368 |
nothing calls this directly
no test coverage detected
searching dependent graphs…