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:20:51 -0500 |
commit | 501f4dcdd8790283e1db809e23133dbeb3a1f27c (patch) | |
tree | 32837e36ec0a183f2045b4877c3a8ad817aece01 /res | |
parent | 7413bcbeb5fc0eaa22de91e8d69714b725567efa (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_statsd.c | 4 | ||||
-rw-r--r-- | res/res_xmpp.c | 8 |
6 files changed, 20 insertions, 20 deletions
diff --git a/res/ari/config.c b/res/ari/config.c index 2d3a80d0b..275f41d96 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 f3b65ad26..5abf9018f 100644 --- a/res/res_hep.c +++ b/res/res_hep.c @@ -260,8 +260,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 593134b60..ddf801245 100644 --- a/res/res_parking.c +++ b/res/res_parking.c @@ -291,8 +291,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); @@ -300,8 +300,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 8258b3857..fdc7ecf54 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_statsd.c b/res/res_statsd.c index b8e4d0475..67166e820 100644 --- a/res/res_statsd.c +++ b/res/res_statsd.c @@ -233,8 +233,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 1b0ae427b..41f89961c 100644 --- a/res/res_xmpp.c +++ b/res/res_xmpp.c @@ -822,8 +822,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); @@ -831,8 +831,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, |