Remove unused functions from config.h

The header is divided into two parts, an external and an internal one. The
actual splitting is done in a later commit and this commit only prepares
the header for the split.
This commit is contained in:
Markus Mäkelä
2017-01-16 10:19:16 +02:00
parent 08b5d5c957
commit cbdab48237
4 changed files with 22 additions and 25 deletions

View File

@ -49,16 +49,7 @@ enum
MAX_PARAM_LEN = 256 MAX_PARAM_LEN = 256
}; };
typedef enum /** TODO: Remove this from the core and move it inside readwritesplit */
{
UNDEFINED_TYPE = 0x00,
STRING_TYPE = 0x01,
COUNT_TYPE = 0x02,
PERCENT_TYPE = 0x04,
BOOL_TYPE = 0x08,
SQLVAR_TARGET_TYPE = 0x10
} config_param_type_t;
typedef enum typedef enum
{ {
TYPE_UNDEFINED = 0, TYPE_UNDEFINED = 0,
@ -322,6 +313,26 @@ struct server* config_get_server(const CONFIG_PARAMETER *params, const char *key
*/ */
char* config_copy_string(const CONFIG_PARAMETER *params, const char *key); char* config_copy_string(const CONFIG_PARAMETER *params, const char *key);
/**
* @brief Convert string truth value
*
* Used for truth values with @c 1, @c yes or @c true for a boolean true value and @c 0, @c no
* or @c false for a boolean false value.
*
* @param str String to convert to a truth value
*
* @return 1 if @c value is true, 0 if value is false and -1 if the value is not
* a valid truth value
*/
int config_truth_value(const char *value);
/** TODO: Add new capability that allows skipping of permission checks */
bool is_internal_service(const char *router);
/***************************************************************************************
* TODO: Move the following functions to a header that's internal to the MaxScale core *
***************************************************************************************/
/** /**
* @brief Generate default module parameters * @brief Generate default module parameters
* *
@ -329,8 +340,6 @@ char* config_copy_string(const CONFIG_PARAMETER *params, const char *key);
* *
* @param ctx Configuration context where the parameters are added * @param ctx Configuration context where the parameters are added
* @param params Module parameters * @param params Module parameters
*
* TODO: Move this to a header internal to the MaxScale core
*/ */
void config_add_defaults(CONFIG_CONTEXT *ctx, const MXS_MODULE_PARAM *params); void config_add_defaults(CONFIG_CONTEXT *ctx, const MXS_MODULE_PARAM *params);
@ -338,15 +347,12 @@ char* config_clean_string_list(const char* str);
CONFIG_PARAMETER* config_clone_param(const CONFIG_PARAMETER* param); CONFIG_PARAMETER* config_clone_param(const CONFIG_PARAMETER* param);
void config_enable_feedback_task(void); void config_enable_feedback_task(void);
void config_disable_feedback_task(void); void config_disable_feedback_task(void);
unsigned long config_get_gateway_id(void);
GATEWAY_CONF* config_get_global_options(); GATEWAY_CONF* config_get_global_options();
bool config_load(const char *); bool config_load(const char *);
unsigned int config_nbpolls(); unsigned int config_nbpolls();
unsigned int config_pollsleep(); unsigned int config_pollsleep();
bool config_reload(); bool config_reload();
int config_threadcount(); int config_threadcount();
int config_truth_value(const char *);
void config_parameter_free(CONFIG_PARAMETER* p1); void config_parameter_free(CONFIG_PARAMETER* p1);
bool is_internal_service(const char *router);
MXS_END_DECLS MXS_END_DECLS

View File

@ -1950,13 +1950,6 @@ check_config_objects(CONFIG_CONTEXT *context)
return rval; return rval;
} }
/**
* Used for boolean settings where values may be 1, yes or true
* to enable a setting or -, no, false to disable a setting.
*
* @param str String to convert to a boolean
* @return Truth value
*/
int int
config_truth_value(const char *str) config_truth_value(const char *str)
{ {

View File

@ -118,8 +118,6 @@ void service_update_weights();
void serviceAddRouterOption(SERVICE *service, char *option); void serviceAddRouterOption(SERVICE *service, char *option);
void serviceClearRouterOptions(SERVICE *service); void serviceClearRouterOptions(SERVICE *service);
void service_update(SERVICE *service, char *router, char *user, char *auth); void service_update(SERVICE *service, char *router, char *user, char *auth);
bool service_set_param_value(SERVICE* service, CONFIG_PARAMETER* param, char* valstr,
count_spec_t count_spec, config_param_type_t type);
/** /**
* @brief Add parameters to a service * @brief Add parameters to a service

View File

@ -264,7 +264,7 @@ startMonitor(MONITOR *monitor, const CONFIG_PARAMETER* params)
hashtable_item_free, info_free_func); hashtable_item_free, info_free_func);
handle->server_info = server_info; handle->server_info = server_info;
handle->shutdown = 0; handle->shutdown = 0;
handle->id = config_get_gateway_id(); handle->id = config_get_global_options()->id;
handle->warn_failover = true; handle->warn_failover = true;
spinlock_init(&handle->lock); spinlock_init(&handle->lock);
} }