diff options
author | Corey Farrell <git@cfware.com> | 2017-12-12 13:36:39 -0500 |
---|---|---|
committer | Corey Farrell <git@cfware.com> | 2017-12-15 10:18:48 -0500 |
commit | 5d49e2e3297c3af800eb68b74972d2b38c0eb8de (patch) | |
tree | 96acaccce6d5e96b308050c58ed9b04a77ded2a5 /include | |
parent | 76deae295f9d2d3a317eee3c4596fdcc5af794f8 (diff) |
aco: Create ways to minimize use of regex.
ACO uses regex in many situations where it is completely unneeded. In
some cases this doubles the total processing performed by
aco_process_config.
* Create ACO_IGNORE category type for use in place of skip_category
regex source string.
* Create additional aco_category_op values to allow specifying category
filter using either a single plain string or a NULL terminated array
of plain strings.
* Create ACO_PREFIX to allow matching option names to case insensitive
prefixes.
Change-Id: I66a920dcd8e2b0301f73f968016440a985e72821
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/config_options.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/asterisk/config_options.h b/include/asterisk/config_options.h index f4c3db188..3227f94eb 100644 --- a/include/asterisk/config_options.h +++ b/include/asterisk/config_options.h @@ -40,18 +40,30 @@ struct aco_type_internal; enum aco_type_t { ACO_GLOBAL, ACO_ITEM, + ACO_IGNORE, }; -/*! \brief Whether a category regex is a blackist or a whitelist */ +/*! Type of category matching to perform */ enum aco_category_op { + /*! Regex based blacklist. */ ACO_BLACKLIST = 0, + /*! Regex based whitelist. */ ACO_WHITELIST, + /*! Blacklist with a single string matched with strcasecmp. */ + ACO_BLACKLIST_EXACT, + /*! Whitelist with a single string matched with strcasecmp. */ + ACO_WHITELIST_EXACT, + /*! Blacklist with a NULL terminated array of strings matched with strcasecmp. */ + ACO_BLACKLIST_ARRAY, + /*! Whitelist with a NULL terminated array of strings matched with strcasecmp. */ + ACO_WHITELIST_ARRAY, }; /*! \brief What kind of matching should be done on an option name */ enum aco_matchtype { ACO_EXACT = 1, ACO_REGEX, + ACO_PREFIX, }; /*! Callback functions for option parsing via aco_process_config() */ |