MySQL 9.1.0
Source Code Documentation
service_mysql_string.h
Go to the documentation of this file.
1/* Copyright (c) 2012, 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/**
25 @file include/mysql/service_mysql_string.h
26 This service provides functions to parse mysql String.
27*/
28
29#ifndef MYSQL_SERVICE_MYSQL_STRING_INCLUDED
30#define MYSQL_SERVICE_MYSQL_STRING_INCLUDED
31
32#ifndef MYSQL_ABI_CHECK
33#include <stdlib.h>
34#endif
35
37typedef void *mysql_string_handle;
38
39extern "C" struct mysql_string_service_st {
41 const char *, char *,
42 unsigned int, int *);
53
54#ifdef MYSQL_DYNAMIC_PLUGIN
55
56#define mysql_string_convert_to_char_ptr(string_handle, charset_name, buffer, \
57 buffer_size, error) \
58 mysql_string_service->mysql_string_convert_to_char_ptr_type( \
59 string_handle, charset_name, buffer, buffer_size, error)
60
61#define mysql_string_get_iterator(string_handle) \
62 mysql_string_service->mysql_string_get_iterator_type(string_handle)
63
64#define mysql_string_iterator_next(iterator_handle) \
65 mysql_string_service->mysql_string_iterator_next_type(iterator_handle)
66
67#define mysql_string_iterator_isupper(iterator_handle) \
68 mysql_string_service->mysql_string_iterator_isupper_type(iterator_handle)
69
70#define mysql_string_iterator_islower(iterator_handle) \
71 mysql_string_service->mysql_string_iterator_islower_type(iterator_handle)
72
73#define mysql_string_iterator_isdigit(iterator_handle) \
74 mysql_string_service->mysql_string_iterator_isdigit_type(iterator_handle)
75
76#define mysql_string_to_lowercase(string_handle) \
77 mysql_string_service->mysql_string_to_lowercase_type(string_handle)
78
79#define mysql_string_free(mysql_string_handle) \
80 mysql_string_service->mysql_string_free_type(mysql_string_handle)
81
82#define mysql_string_iterator_free(mysql_string_iterator_handle) \
83 mysql_string_service->mysql_string_iterator_free_type( \
84 mysql_string_iterator_handle)
85#else
86
87/* This service function convert string into given character set */
89 const char *charset_name, char *buffer,
90 unsigned int buffer_size, int *error);
91
92/* This service function returns the beginning of the iterator handle */
94 mysql_string_handle string_handle);
95/*
96 This service function gets the next iterator handle
97 returns 0 if reached the end else return 1
98*/
100
101/*
102 This service function return 1 if current iterator handle points to a
103 uppercase character else return 0 for client character set.
104*/
106
107/*
108 This service function return 1 if current iterator handle points to a
109 lowercase character else return 0 for client character set.
110*/
112
113/*
114 This service function return 1 if current iterator handle points to a digit
115 else return 0 for client character sets.
116*/
118
119/* convert string_handle into lowercase */
121 mysql_string_handle string_handle);
122
123/* It deallocates the string created on server side during plugin operations */
125
126/*
127 It deallocates the string iterator created on server side
128 during plugin operations
129*/
131
132#endif
133
134#endif
void error(const char *format,...)
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
size_t buffer_size(const ConstBufferSequence &buffers) noexcept
Definition: buffer.h:313
void * mysql_string_handle
Definition: plugin_validate_password.h:35
void * mysql_string_handle
Definition: service_mysql_string.h:37
mysql_string_handle mysql_string_to_lowercase(mysql_string_handle string_handle)
Definition: string_service.cc:148
int mysql_string_iterator_isdigit(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:138
void mysql_string_iterator_free(mysql_string_iterator_handle)
Definition: string_service.cc:78
void mysql_string_free(mysql_string_handle)
Definition: string_service.cc:68
mysql_string_iterator_handle mysql_string_get_iterator(mysql_string_handle string_handle)
Definition: string_service.cc:83
struct mysql_string_service_st * mysql_string_service
void * mysql_string_iterator_handle
Definition: service_mysql_string.h:36
int mysql_string_iterator_islower(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:128
int mysql_string_iterator_next(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:95
int mysql_string_iterator_isupper(mysql_string_iterator_handle iterator_handle)
Definition: string_service.cc:118
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:52
Definition: service_mysql_string.h:39
mysql_string_handle(* mysql_string_to_lowercase_type)(mysql_string_handle)
Definition: service_mysql_string.h:49
int(* mysql_string_iterator_next_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:40
void(* mysql_string_iterator_free_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:51
int(* mysql_string_iterator_islower_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:47
mysql_string_iterator_handle(* mysql_string_get_iterator_type)(mysql_string_handle)
Definition: service_mysql_string.h:43
int(* mysql_string_iterator_isupper_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:46
int(* mysql_string_iterator_isdigit_type)(mysql_string_iterator_handle)
Definition: service_mysql_string.h:48
void(* mysql_string_free_type)(mysql_string_handle)
Definition: service_mysql_string.h:50