24#ifndef COMPONENT_SYSTEM_VAR_SERVICE_H
25#define COMPONENT_SYSTEM_VAR_SERVICE_H
32#define COPY_MYSQL_PLUGIN_VAR_HEADER(sys_var_type, type, sys_var_check, \
34 sys_var_type->flags = flags; \
35 sys_var_type->name = var_name; \
36 sys_var_type->comment = comment; \
37 sys_var_type->check = check_func ? check_func : sys_var_check; \
38 sys_var_type->update = update_func ? update_func : sys_var_update; \
39 sys_var_type->value = (type *)variable_value;
41#define COPY_MYSQL_PLUGIN_THDVAR_HEADER(sys_var_type, type, sys_var_check, \
43 sys_var_type->flags = flags; \
44 sys_var_type->name = var_name; \
45 sys_var_type->comment = comment; \
46 sys_var_type->check = check_func ? check_func : sys_var_check; \
47 sys_var_type->update = update_func ? update_func : sys_var_update; \
48 sys_var_type->offset = -1;
50#define COPY_MYSQL_PLUGIN_VAR_REMAINING(sys_var_type, check_arg_type) \
51 sys_var_type->def_val = check_arg_type->def_val; \
52 sys_var_type->min_val = check_arg_type->min_val; \
53 sys_var_type->max_val = check_arg_type->max_val; \
54 sys_var_type->blk_sz = check_arg_type->blk_sz;
56#define THDVAR_FUNC(type) type *(*resolve)(MYSQL_THD thd, int offset)
58#define SYSVAR_INTEGRAL_TYPE(type) \
59 struct sysvar_##type##_type { \
60 MYSQL_PLUGIN_VAR_HEADER; \
68#define THDVAR_INTEGRAL_TYPE(type) \
69 struct thdvar_##type##_type { \
70 MYSQL_PLUGIN_VAR_HEADER; \
79#define SYSVAR_ENUM_TYPE(type) \
80 struct sysvar_##type##_type { \
81 MYSQL_PLUGIN_VAR_HEADER; \
82 unsigned long *value; \
83 unsigned long def_val; \
87#define THDVAR_ENUM_TYPE(type) \
88 struct thdvar_##type##_type { \
89 MYSQL_PLUGIN_VAR_HEADER; \
91 unsigned long def_val; \
92 THDVAR_FUNC(unsigned long); \
96#define SYSVAR_BOOL_TYPE(type) \
97 struct sysvar_##type##_type { \
98 MYSQL_PLUGIN_VAR_HEADER; \
103#define THDVAR_BOOL_TYPE(type) \
104 struct thdvar_##type##_type { \
105 MYSQL_PLUGIN_VAR_HEADER; \
111#define SYSVAR_STR_TYPE(type) \
112 struct sysvar_##type##_type { \
113 MYSQL_PLUGIN_VAR_HEADER; \
118#define THDVAR_STR_TYPE(type) \
119 struct thdvar_##type##_type { \
120 MYSQL_PLUGIN_VAR_HEADER; \
123 THDVAR_FUNC(char *); \
148 (
const char *component_name,
const char *var_name,
152 void *check_arg,
void *variable_value));
168 (
const char *component_name,
const char *var_name,
169 void **val,
size_t *out_length_of_val));
181 (
const char *component_name,
const char *var_name));
An implementation of the configuration system variables Service to register variable and unregister v...
Definition: component_sys_var_service_imp.h:130
static mysql_service_status_t get_variable(const char *component_name, const char *var_name, void **val, size_t *out_length_of_val) noexcept
Get the component system variable value from the global structure.
Definition: component_sys_var_service.cc:699
static mysql_service_status_t unregister_variable(const char *component_name, const char *var_name) noexcept
Unregister's component system variable.
Definition: component_sys_var_service.cc:721
static mysql_service_status_t register_variable(const char *component_name, const char *var_name, int flags, const char *comment, mysql_sys_var_check_func check_func, mysql_sys_var_update_func update_func, void *check_arg, void *variable_value) noexcept
Register's component system variables.
Definition: component_sys_var_service.cc:125
int(* mysql_sys_var_check_func)(MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
Signature for the check function.
Definition: component_sys_var_service.h:78
void(* mysql_sys_var_update_func)(MYSQL_THD thd, SYS_VAR *var, void *val_ptr, const void *save)
Signature for the update function.
Definition: component_sys_var_service.h:106
void mysql_comp_sys_var_services_init()
Definition: component_sys_var_service.cc:95
static int flags[50]
Definition: hp_test1.cc:40
#define comment
Definition: lexyy.cc:959
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88