MySQL 8.0.40
Source Code Documentation
component_sys_var_service_imp.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef COMPONENT_SYSTEM_VAR_SERVICE_H
25#define COMPONENT_SYSTEM_VAR_SERVICE_H
26
29
31
32/**
33 An implementation of the configuration system variables Service to register
34 variable and unregister variable.
35*/
37 public:
38 /**
39 Register's component system variables.
40
41 @param component_name name of the component
42 @param var_name variable name
43 @param flags tells about the variable type
44 @param comment variable comment message
45 @param check_func function pointer, which is called at variable check time
46 @param update_func function pointer, which is called at update time
47 @param check_arg type defined check constraints block
48 @param variable_value place holder for variable value
49 @return Status of performed operation
50 @retval false success
51 @retval true failure
52 */
54 (const char *component_name, const char *var_name,
55 int flags, const char *comment,
56 mysql_sys_var_check_func check_func,
57 mysql_sys_var_update_func update_func,
58 void *check_arg, void *variable_value));
59
60 /**
61 Get the component system variable value from the global structure.
62
63 @param component_name Name of the component
64 @param var_name Name of the variable
65 @param[in,out] val On input: a buffer to hold the value. On output a pointer
66 to the value.
67 @param[in,out] out_length_of_val On input: size of longest string that the
68 buffer can contain. On output the length of the copied string.
69 @return Status of performed operation
70 @retval false success
71 @retval true failure
72 */
74 (const char *component_name, const char *var_name,
75 void **val, size_t *out_length_of_val));
76
77 /**
78 Unregister's component system variable.
79
80 @param component_name name of the component
81 @param var_name Variable name
82 @return Status of performed operation
83 @retval false success
84 @retval true failure
85 */
87 (const char *component_name, const char *var_name));
88};
89#endif /* COMPONENT_SYSTEM_VAR_SERVICE_H */
An implementation of the configuration system variables Service to register variable and unregister v...
Definition: component_sys_var_service_imp.h:36
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:527
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:549
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:123
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:77
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:105
void mysql_comp_sys_var_services_init()
Definition: component_sys_var_service.cc:93
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