MySQL  8.0.22
Source Code Documentation
service_mysql_string.h
Go to the documentation of this file.
1 /* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
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 also distributed 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 included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 /**
24  @file include/mysql/service_mysql_string.h
25  This service provides functions to parse mysql String.
26 */
27 
28 #ifndef MYSQL_SERVICE_MYSQL_STRING_INCLUDED
29 #define MYSQL_SERVICE_MYSQL_STRING_INCLUDED
30 
31 #ifndef MYSQL_ABI_CHECK
32 #include <stdlib.h>
33 #endif
34 
36 typedef void *mysql_string_handle;
37 
38 extern "C" struct mysql_string_service_st {
40  const char *, char *,
41  unsigned int, int *);
52 
53 #ifdef MYSQL_DYNAMIC_PLUGIN
54 
55 #define mysql_string_convert_to_char_ptr(string_handle, charset_name, buffer, \
56  buffer_size, error) \
57  mysql_string_service->mysql_string_convert_to_char_ptr_type( \
58  string_handle, charset_name, buffer, buffer_size, error)
59 
60 #define mysql_string_get_iterator(string_handle) \
61  mysql_string_service->mysql_string_get_iterator_type(string_handle)
62 
63 #define mysql_string_iterator_next(iterator_handle) \
64  mysql_string_service->mysql_string_iterator_next_type(iterator_handle)
65 
66 #define mysql_string_iterator_isupper(iterator_handle) \
67  mysql_string_service->mysql_string_iterator_isupper_type(iterator_handle)
68 
69 #define mysql_string_iterator_islower(iterator_handle) \
70  mysql_string_service->mysql_string_iterator_islower_type(iterator_handle)
71 
72 #define mysql_string_iterator_isdigit(iterator_handle) \
73  mysql_string_service->mysql_string_iterator_isdigit_type(iterator_handle)
74 
75 #define mysql_string_to_lowercase(string_handle) \
76  mysql_string_service->mysql_string_to_lowercase_type(string_handle)
77 
78 #define mysql_string_free(mysql_string_handle) \
79  mysql_string_service->mysql_string_free_type(mysql_string_handle)
80 
81 #define mysql_string_iterator_free(mysql_string_iterator_handle) \
82  mysql_string_service->mysql_string_iterator_free_type( \
83  mysql_string_iterator_handle)
84 #else
85 
86 /* This service function convert string into given character set */
88  const char *charset_name, char *buffer,
89  unsigned int buffer_size, int *error);
90 
91 /* This service function returns the beginning of the iterator handle */
93  mysql_string_handle string_handle);
94 /*
95  This service function gets the next iterator handle
96  returns 0 if reached the end else return 1
97 */
99 
100 /*
101  This service function return 1 if current iterator handle points to a
102  uppercase character else return 0 for client character set.
103 */
105 
106 /*
107  This service function return 1 if current iterator handle points to a
108  lowercase character else return 0 for client character set.
109 */
111 
112 /*
113  This service function return 1 if current iterator handle points to a digit
114  else return 0 for client character sets.
115 */
117 
118 /* convert string_handle into lowercase */
120  mysql_string_handle string_handle);
121 
122 /* It deallocates the string created on server side during plugin operations */
124 
125 /*
126  It deallocates the string iterator created on server side
127  during plugin operations
128 */
130 
131 #endif
132 
133 #endif
void * mysql_string_handle
Definition: service_mysql_string.h:36
int(* mysql_string_iterator_isdigit_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:47
mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle string_handle)
Definition: string_service.cc:81
char buffer[STRING_BUFFER]
Definition: test_sql_9_sessions.cc:57
int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:136
void(* mysql_string_free_type)(mysql_string_handle)
Definition: service_mysql_string.h:49
int(* mysql_string_iterator_isupper_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:45
int(* mysql_string_convert_to_char_ptr_type)(mysql_string_handle, const char *, char *, unsigned int, int *)
Definition: service_mysql_string.h:39
mysql_string_handle(* mysql_string_to_lowercase_type)(mysql_string_handle)
Definition: service_mysql_string.h:48
void * mysql_string_handle
Definition: plugin_validate_password.h:34
void(* mysql_string_iterator_free_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:50
Definition: service_mysql_string.h:38
void mysql_string_iterator_free(mysql_string_iterator_handle)
Definition: string_service.cc:76
int mysql_string_convert_to_char_ptr(mysql_string_handle string_handle, const char *charset_name, char *buffer, unsigned int buffer_size, int *error)
Definition: string_service.cc:50
void mysql_string_free(mysql_string_handle)
Definition: string_service.cc:66
mysql_string_iterator_handle(* mysql_string_get_iterator_type)(mysql_string_handle)
Definition: service_mysql_string.h:42
int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:126
struct mysql_string_service_st * mysql_string_service
int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:93
mysql_string_handle mysql_string_to_lowercase(mysql_string_handle string_handle)
Definition: string_service.cc:146
size_t buffer_size(const ConstBufferSequence &buffers) noexcept
Definition: buffer.h:283
void * mysql_string_iterator_handle
Definition: service_mysql_string.h:35
int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:116
int(* mysql_string_iterator_next_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:44
int(* mysql_string_iterator_islower_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:46