70 AMXO_FUNC(amxd_action_param_check_minimum));
72 "check_minimum_length",
73 AMXO_FUNC(amxd_action_param_check_minimum));
76 AMXO_FUNC(amxd_action_param_check_maximum));
78 "check_maximum_length",
79 AMXO_FUNC(amxd_action_param_check_maximum));
82 AMXO_FUNC(amxd_action_param_check_range));
88 AMXO_FUNC(amxd_action_param_check_is_in));
91 AMXO_FUNC(amxd_action_param_read_hidden_value));
93 "verify_max_instances",
104 amxc_htable_t* ftab_data = NULL;
105 amxc_htable_it_t* it = NULL;
108 when_null(ftab_data, exit);
110 if((data != NULL) && (data[0] != 0)) {
111 it = amxc_htable_get(ftab_data, data);
113 amxc_string_t full_name;
114 char* path = amxd_object_get_path(parser->
object, AMXD_OBJECT_NAMED);
115 amxc_string_init(&full_name, 0);
116 if((path != NULL) && (*path != 0)) {
117 amxc_string_push_buffer(&full_name, path, strlen(path) + 1);
118 amxc_string_appendf(&full_name,
".%s", fn_name);
119 it = amxc_htable_get(ftab_data, amxc_string_get(&full_name, 0));
121 amxc_string_clean(&full_name);
123 it = amxc_htable_get(ftab_data, fn_name);
137 amxc_htable_t* ftab_data = NULL;
145 when_str_empty(name, exit);
146 when_true(isalpha(name[0]) == 0 && name[0] !=
'_', exit);
148 for(
int i = 0; name[i] != 0; i++) {
149 if(isalnum(name[i]) == 0) {
150 if((name[i] !=
'_') && (name[i] !=
'-') && (name[i] !=
'.')) {
164 amxc_htable_it_t* it) {
174 amxc_htable_t* ftab_data = NULL;
175 when_null(parser, exit);
180 when_null(ftab_data, exit);
181 when_true(amxc_htable_contains(ftab_data, fn_name), exit);
184 when_null(ftab_fn, exit);
187 amxc_htable_insert(ftab_data, fn_name, &ftab_fn->
hit);
196 const char* fn_name) {
198 amxc_htable_t* ftab_data = NULL;
199 amxc_htable_it_t* it = NULL;
200 when_null(parser, exit);
201 when_str_empty(fn_name, exit);
203 when_null(ftab_data, exit);
205 it = amxc_htable_get(ftab_data, fn_name);
216 when_null(parser, exit);
224 .
hit = { .ait = NULL, .key = NULL, .next = NULL },
struct _amxo_ftab_fn amxo_ftab_fn_t
static bool amxo_ftab_func_name_is_valid(const char *name)
static amxo_fn_ptr_t amxo_resolver_ftab(amxo_parser_t *parser, const char *fn_name, UNUSED amxo_fn_type_t type, const char *data, UNUSED void *priv)
static amxo_resolver_t ftab
void amxo_ftab_fn_free(UNUSED const char *key, amxc_htable_it_t *it)
static void amxo_resolver_ftab_defaults(amxo_parser_t *parser, UNUSED void *priv)
static void amxo_resolver_ftab_clean(amxo_parser_t *parser, UNUSED void *priv)
void(* amxo_fn_ptr_t)(void)
enum _amxo_fn_type amxo_fn_type_t
int amxo_resolver_ftab_add(amxo_parser_t *parser, const char *fn_name, amxo_fn_ptr_t fn)
Adds a C function to the function table.
int amxo_resolver_ftab_remove(amxo_parser_t *parser, const char *fn_name)
Removes a function from the function table.
void amxo_resolver_ftab_clear(amxo_parser_t *parser)
Removes all functions from the function table.
int amxo_unregister_resolver(const char *name)
Unregisters a function resolver.
amxc_htable_t * amxo_parser_get_resolver_data(amxo_parser_t *parser, const char *resolver_name)
Gets the resolver specific parser data.
amxc_htable_t * amxo_parser_claim_resolver_data(amxo_parser_t *parser, const char *resolver_name)
Fetches resolver specific data for a parser instance.
#define AMXO_FUNC(x)
Function ponter caster macro.
int amxo_register_resolver(const char *name, amxo_resolver_t *resolver)
Registers a function resolver.
void amxo_parser_remove_resolver_data(amxo_parser_t *parser, const char *resolver_name)
Removes the resolver specific parser data.
The ODL parser structure.