Return enum values as integers instead of strings

If the enums are converted to the acutual enum values before they are
returned, this removes the need for the modules to process the enum
strings to enum values. This allows modules to use enumerations with
minimal effort.
This commit is contained in:
Markus Mäkelä
2017-01-05 12:18:32 +02:00
parent 03391748ee
commit 9fa2de29d9
3 changed files with 26 additions and 7 deletions

View File

@ -267,12 +267,13 @@ const char* config_get_string(const CONFIG_PARAMETER *params, const char *key);
*
* @param params List of configuration parameters
* @param key Parameter name
* @param values All possible enumeration values
*
* @return The raw string value
* @return The enumeration value converted to an int
*
* TODO: Allow multiple enumeration values
*/
const char* config_get_enum(const CONFIG_PARAMETER *params, const char *key);
int config_get_enum(const CONFIG_PARAMETER *params, const char *key, const MXS_ENUM_VALUE *values);
char* config_clean_string_list(const char* str);
CONFIG_PARAMETER* config_clone_param(const CONFIG_PARAMETER* param);