64 amxc_var_set_type(
config, AMXC_VAR_ID_LIST);
66 amxc_var_add(cstring_t,
config,
"ftab");
67 amxc_var_add(cstring_t,
config,
"import");
68 amxc_var_add(cstring_t,
config,
"*");
80 const amxc_llist_t* order = amxc_var_constcast(amxc_llist_t,
config);
82 amxc_var_t used_resolvers;
83 const char* name = NULL;
85 amxc_var_init(&used_resolvers);
86 amxc_var_set_type(&used_resolvers, AMXC_VAR_ID_HTABLE);
87 amxc_var_add_key(
bool, &used_resolvers,
"auto",
true);
88 amxc_llist_for_each(it, order) {
89 name = amxc_var_constcast(cstring_t, amxc_var_from_llist_it(it));
94 when_true(retval == 0, exit);
95 amxc_var_add_key(
bool, &used_resolvers, name,
true);
98 when_true((name != NULL && name[0] !=
'*'), exit);
101 name = amxc_htable_it_get_key(hit);
102 if(amxc_var_get_key(&used_resolvers, name, AMXC_VAR_FLAG_DEFAULT)) {
106 when_true(retval == 0, exit);
110 amxc_var_clean(&used_resolvers);
119 .
hit = { .ait = NULL, .key = NULL, .next = NULL },
static amxo_fn_ptr_t amxo_resolver_auto(amxo_parser_t *parser, const char *fn_name, amxo_fn_type_t type, UNUSED const char *data, UNUSED void *priv)
static void amxo_resolver_auto_defaults(amxo_parser_t *parser, UNUSED void *priv)
static amxo_resolver_t res_auto
PRIVATE amxc_htable_t * amxo_parser_get_resolvers(void)
PRIVATE int amxo_parser_resolve(amxo_parser_t *parser, const char *resolver_name, const char *func_name, amxo_fn_type_t type, const char *data)
static amxc_htable_t resolvers
void(* amxo_fn_ptr_t)(void)
enum _amxo_fn_type amxo_fn_type_t
amxc_var_t * amxo_parser_claim_config(amxo_parser_t *parser, const char *path)
Gets or creates a configuration option.
int amxo_unregister_resolver(const char *name)
Unregisters a function resolver.
int amxo_register_resolver(const char *name, amxo_resolver_t *resolver)
Registers a function resolver.
The ODL parser structure.
amxo_fn_ptr_t resolved_fn