MySQL 9.0.0
Source Code Documentation
global_variable_attributes_bits.h
Go to the documentation of this file.
1/* Copyright (c) 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef GLOBAL_VARIABLE_ATTRIBUTES_BITS_H
25#define GLOBAL_VARIABLE_ATTRIBUTES_BITS_H
26
27#include <cstddef> // size_t
28
31
33
34/**
35 Initialize System Variable Attributes iterator object
36 to enumerate key/value attributes attached to system variables, pointing to
37 1st matching attribute
38
39 @param variable_base Variable prefix or NULL if none.
40 @param variable_name define system variable scope
41 @param attribute_name Optional attribute name scope (NULL to iterate all
42 attributes of a variable)
43 @param [out] iterator iterator object
44
45 @returns Result of iterator creation
46 @retval false Success
47 @retval true Failure
48*/
50 const char *variable_base, const char *variable_name,
51 const char *attribute_name, global_variable_attributes_iterator *iterator);
52
53/**
54 Uninitialize System Variable Attributes iterator
55
56 @param iterator iterator object
57
58 @returns Result of iterator creation
59 @retval false Success
60 @retval true Failure
61*/
64
65/**
66 Advance System Variable Attributes iterator to next element.
67
68 @param iterator iterator object
69
70 @returns Result of iterator creation
71 @retval false Success
72 @retval true Failure or no more elements
73*/
76
77/**
78 Return attribute name for the element pointed by
79 System Variable Attributes iterator.
80
81 @param iterator iterator object
82 @param[out] out_name_handle pointer to receive name string content
83
84 @returns Result of operation
85 @retval false Success
86 @retval true Failure or no more elements
87*/
89 global_variable_attributes_iterator iterator, my_h_string *out_name_handle);
90
91/**
92 Return attribute value for the element pointed by
93 System Variable Attributes iterator.
94
95 @param iterator iterator object
96 @param[out] out_value_handle pointer to receive value string content
97
98 @returns Result of operation
99 @retval false Success
100 @retval true Failure or no more elements
101*/
104 my_h_string *out_value_handle);
105
106/**
107 Attach a single key/value attribute to a given global system variable,
108 or delete one or all attributes of a given variable.
109
110 @param variable_base Variable prefix, NULL if none.
111 @param variable_name Variable name.
112 @param attribute_name Attribute name, if nullptr unset all attributes for the
113 variable.
114 @param attribute_value Attribute value, if nullptr unset the attribute.
115
116 @returns Result of operation
117 @retval false Success
118 @retval true Failure or no more elements
119*/
121 const char *variable_base, const char *variable_name,
122 const char *attribute_name, const char *attribute_value);
123
124/**
125 Read a single global system variable attribute value, if exists.
126
127 @param variable_base Variable prefix, NULL if none.
128 @param variable_name Variable name.
129 @param attribute_name Attribute name.
130 @param attribute_value_buffer Pointer to buffer to receive the result.
131 @param inout_attribute_value_length Buffer size, also used to return value
132 string size.
133
134 @returns Result of operation
135 @retval false Success
136 @retval true Failure or no more elements
137*/
139 const char *variable_base, const char *variable_name,
140 const char *attribute_name, char *attribute_value_buffer,
141 size_t *inout_attribute_value_length);
142
143/**
144 Read timestamp indicating when a global system variable was last modified.
145
146 @param variable_base Variable prefix, NULL if none.
147 @param variable_name Variable name.
148 @param timestamp_value_buffer Pointer to buffer to receive the result.
149 @param inout_timestamp_value_length Buffer size, also used to return value
150 string size.
151
152 @returns Result of operation
153 @retval false Success
154 @retval true Failure or no more elements
155*/
157 const char *variable_base, const char *variable_name,
158 char *timestamp_value_buffer, size_t *inout_timestamp_value_length);
159
160/**
161 Read user name that last modified a global system variable.
162
163 @param variable_base Variable prefix, NULL if none.
164 @param variable_name Variable name.
165 @param user_value_buffer Pointer to buffer to receive the result.
166 @param inout_user_value_length Buffer size, also used to return value
167 string size.
168
169 @returns Result of operation
170 @retval false Success
171 @retval true Failure or no more elements
172*/
174 const char *variable_base, const char *variable_name,
175 char *user_value_buffer, size_t *inout_user_value_length);
176
177#endif /* GLOBAL_VARIABLE_ATTRIBUTES_BITS_H */
bool(* global_variable_attributes_get_t)(const char *variable_base, const char *variable_name, const char *attribute_name, char *attribute_value_buffer, size_t *inout_attribute_value_length)
Read a single global system variable attribute value, if exists.
Definition: global_variable_attributes_bits.h:138
bool(* global_variable_attributes_iterator_get_value_t)(global_variable_attributes_iterator iterator, my_h_string *out_value_handle)
Return attribute value for the element pointed by System Variable Attributes iterator.
Definition: global_variable_attributes_bits.h:102
bool(* global_variable_attributes_iterator_create_t)(const char *variable_base, const char *variable_name, const char *attribute_name, global_variable_attributes_iterator *iterator)
Initialize System Variable Attributes iterator object to enumerate key/value attributes attached to s...
Definition: global_variable_attributes_bits.h:49
bool(* global_variable_attributes_get_time_t)(const char *variable_base, const char *variable_name, char *timestamp_value_buffer, size_t *inout_timestamp_value_length)
Read timestamp indicating when a global system variable was last modified.
Definition: global_variable_attributes_bits.h:156
bool(* global_variable_attributes_iterator_advance_t)(global_variable_attributes_iterator iterator)
Advance System Variable Attributes iterator to next element.
Definition: global_variable_attributes_bits.h:74
bool(* global_variable_attributes_iterator_get_name_t)(global_variable_attributes_iterator iterator, my_h_string *out_name_handle)
Return attribute name for the element pointed by System Variable Attributes iterator.
Definition: global_variable_attributes_bits.h:88
struct global_variable_attributes_iterator_imp * global_variable_attributes_iterator
Definition: global_variable_attributes_bits.h:32
bool(* global_variable_attributes_assign_t)(const char *variable_base, const char *variable_name, const char *attribute_name, const char *attribute_value)
Attach a single key/value attribute to a given global system variable, or delete one or all attribute...
Definition: global_variable_attributes_bits.h:120
bool(* global_variable_attributes_get_user_t)(const char *variable_base, const char *variable_name, char *user_value_buffer, size_t *inout_user_value_length)
Read user name that last modified a global system variable.
Definition: global_variable_attributes_bits.h:173
bool(* global_variable_attributes_iterator_destroy_t)(global_variable_attributes_iterator iterator)
Uninitialize System Variable Attributes iterator.
Definition: global_variable_attributes_bits.h:62
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:129
Definition: mysql_string_service.cc:60