Add module parameter options

The options allow the modules to impose type specific restrictions on the
parameters. This can be used to offload file permission and mandatory
parameter checks to the core.
This commit is contained in:
Markus Mäkelä
2017-01-05 09:13:34 +02:00
parent 2b50ce6548
commit e0ad6188ad
2 changed files with 58 additions and 6 deletions

View File

@ -85,12 +85,22 @@ enum mxs_module_param_type
MXS_MODULE_PARAM_ENUM /**< Enumeration of string values */
};
enum mxs_module_param_options
{
MXS_MODULE_OPT_NONE = 0,
MXS_MODULE_OPT_REQUIRED = (1 << 0), /**< A required parameter */
MXS_MODULE_OPT_PATH_X_OK = (1 << 1), /**< PATH: Execute permission to path required */
MXS_MODULE_OPT_PATH_R_OK = (1 << 2), /**< PATH: Read permission to path required */
MXS_MODULE_OPT_PATH_W_OK = (1 << 3) /**< PATH: Write permission to path required */
};
/** Module parameter declaration */
typedef struct mxs_module_param
{
const char *name; /**< Name of the parameter */
enum mxs_module_param_type type; /**< Type of the parameter */
const char *default_value;
const char *default_value; /**< Default value for the parameter, NULL for no default value */
uint64_t options; /**< Parameter options */
const char **accepted_values; /**< Only for enum values */
} MXS_MODULE_PARAM;