diff options
author | Corey Farrell <git@cfware.com> | 2017-12-12 13:55:12 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-12-15 10:18:52 -0500 |
commit | 957709e1e824e221254599e4ad8445e3839ce535 (patch) | |
tree | 87f5e5481c78e21219025ac36033ee3106428fc3 /res | |
parent | 5d49e2e3297c3af800eb68b74972d2b38c0eb8de (diff) |
aco: Minimize use of regex.
Remove nearly all use of regex from ACO users. Still remaining:
* app_confbridge has a legitamate use of option name regex.
* ast_sorcery_object_fields_register is implemented with regex, all
callers use simple prefix based regex. I haven't decided the best
way to fix this in both 13/15 and master.
Change-Id: Ib5ed478218d8a661ace4d2eaaea98b59a897974b
Diffstat (limited to 'res')
-rw-r--r-- | res/ari/config.c | 8 | ||||
-rw-r--r-- | res/res_hep.c | 4 | ||||
-rw-r--r-- | res/res_parking.c | 8 | ||||
-rw-r--r-- | res/res_pjsip_notify.c | 8 | ||||
-rw-r--r-- | res/res_resolver_unbound.c | 4 | ||||
-rw-r--r-- | res/res_statsd.c | 4 | ||||
-rw-r--r-- | res/res_xmpp.c | 8 |
7 files changed, 22 insertions, 22 deletions
diff --git a/res/ari/config.c b/res/ari/config.c index a080bb713..46d23c61d 100644 --- a/res/ari/config.c +++ b/res/ari/config.c @@ -39,8 +39,8 @@ static struct aco_type general_option = { .type = ACO_GLOBAL, .name = "general", .item_offset = offsetof(struct ast_ari_conf, general), - .category = "^general$", - .category_match = ACO_WHITELIST, + .category = "general", + .category_match = ACO_WHITELIST_EXACT, }; static struct aco_type *general_options[] = ACO_TYPES(&general_option); @@ -156,8 +156,8 @@ static void *user_find(struct ao2_container *tmp_container, const char *cat) static struct aco_type user_option = { .type = ACO_ITEM, .name = "user", - .category_match = ACO_BLACKLIST, - .category = "^general$", + .category_match = ACO_BLACKLIST_EXACT, + .category = "general", .matchfield = "type", .matchvalue = "user", .item_alloc = user_alloc, diff --git a/res/res_hep.c b/res/res_hep.c index 25b4d13b1..48e7bbcbe 100644 --- a/res/res_hep.c +++ b/res/res_hep.c @@ -258,8 +258,8 @@ static struct aco_type global_option = { .type = ACO_GLOBAL, .name = "general", .item_offset = offsetof(struct module_config, general), - .category_match = ACO_WHITELIST, - .category = "^general$", + .category_match = ACO_WHITELIST_EXACT, + .category = "general", }; struct aco_type *global_options[] = ACO_TYPES(&global_option); diff --git a/res/res_parking.c b/res/res_parking.c index d511ab581..20827189d 100644 --- a/res/res_parking.c +++ b/res/res_parking.c @@ -289,8 +289,8 @@ static struct aco_type global_option = { .type = ACO_GLOBAL, .name = "globals", .item_offset = offsetof(struct parking_config, global), - .category_match = ACO_WHITELIST, - .category = "^general$", + .category_match = ACO_WHITELIST_EXACT, + .category = "general", }; struct aco_type *global_options[] = ACO_TYPES(&global_option); @@ -298,8 +298,8 @@ struct aco_type *global_options[] = ACO_TYPES(&global_option); static struct aco_type parking_lot_type = { .type = ACO_ITEM, .name = "parking_lot", - .category_match = ACO_BLACKLIST, - .category = "^(general)$", + .category_match = ACO_BLACKLIST_EXACT, + .category = "general", .item_alloc = parking_lot_cfg_alloc, .item_find = named_item_find, .item_offset = offsetof(struct parking_config, parking_lots), diff --git a/res/res_pjsip_notify.c b/res/res_pjsip_notify.c index 8de88c7e8..59b7c6ea4 100644 --- a/res/res_pjsip_notify.c +++ b/res/res_pjsip_notify.c @@ -82,7 +82,7 @@ order; any other header is treated as part of the SIP request.</para> </description> - <configOption name="^.*$"> + <configOption name=""> <synopsis>A key/value pair to add to a NOTIFY request.</synopsis> <description> <para>If the key is <literal>Content</literal>, @@ -234,8 +234,8 @@ static void *notify_cfg_alloc(void) static struct aco_type notify_option = { .type = ACO_ITEM, .name = "notify", - .category_match = ACO_BLACKLIST, - .category = "^general$", + .category_match = ACO_BLACKLIST_EXACT, + .category = "general", .item_offset = offsetof(struct notify_cfg, notify_options), .item_alloc = notify_option_alloc, .item_find = notify_option_find @@ -993,7 +993,7 @@ static int load_module(void) return AST_MODULE_LOAD_DECLINE; } - aco_option_register_custom(¬ify_cfg, "^.*$", ACO_REGEX, notify_options, + aco_option_register_custom(¬ify_cfg, "", ACO_PREFIX, notify_options, "", notify_option_handler, 0); if (aco_process_config(¬ify_cfg, 0)) { diff --git a/res/res_resolver_unbound.c b/res/res_resolver_unbound.c index 3c7805010..25f61509a 100644 --- a/res/res_resolver_unbound.c +++ b/res/res_resolver_unbound.c @@ -142,8 +142,8 @@ static struct aco_type global_option = { .type = ACO_GLOBAL, .name = "general", .item_offset = offsetof(struct unbound_config, global), - .category_match = ACO_WHITELIST, - .category = "^general$", + .category_match = ACO_WHITELIST_EXACT, + .category = "general", }; static struct aco_type *global_options[] = ACO_TYPES(&global_option); diff --git a/res/res_statsd.c b/res/res_statsd.c index aee0bcd5a..221b359c9 100644 --- a/res/res_statsd.c +++ b/res/res_statsd.c @@ -231,8 +231,8 @@ static struct aco_type global_option = { .type = ACO_GLOBAL, .name = "global", .item_offset = offsetof(struct conf, global), - .category = "^general$", - .category_match = ACO_WHITELIST + .category = "general", + .category_match = ACO_WHITELIST_EXACT, }; static struct aco_type *global_options[] = ACO_TYPES(&global_option); diff --git a/res/res_xmpp.c b/res/res_xmpp.c index f683557a5..b72581fa5 100644 --- a/res/res_xmpp.c +++ b/res/res_xmpp.c @@ -820,8 +820,8 @@ static struct aco_type global_option = { .type = ACO_GLOBAL, .name = "global", .item_offset = offsetof(struct xmpp_config, global), - .category_match = ACO_WHITELIST, - .category = "^general$", + .category_match = ACO_WHITELIST_EXACT, + .category = "general", }; struct aco_type *global_options[] = ACO_TYPES(&global_option); @@ -829,8 +829,8 @@ struct aco_type *global_options[] = ACO_TYPES(&global_option); static struct aco_type client_option = { .type = ACO_ITEM, .name = "client", - .category_match = ACO_BLACKLIST, - .category = "^(general)$", + .category_match = ACO_BLACKLIST_EXACT, + .category = "general", .item_alloc = ast_xmpp_client_config_alloc, .item_find = xmpp_config_find, .item_prelink = xmpp_config_prelink, |