MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sql_plugin_services.h
1 /* Copyright (c) 2009, 2011, 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 as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software Foundation,
14  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
15 
16 /* support for Services */
17 #include <service_versions.h>
18 
20  const char *name;
21  uint version;
22  void *service;
23 };
24 
25 static struct my_snprintf_service_st my_snprintf_handler = {
26  my_snprintf,
27  my_vsnprintf
28 };
29 
30 static struct thd_alloc_service_st thd_alloc_handler= {
31  thd_alloc,
32  thd_calloc,
33  thd_strdup,
35  thd_memdup,
37 };
38 
39 static struct thd_wait_service_st thd_wait_handler= {
41  thd_wait_end
42 };
43 
44 static struct my_thread_scheduler_service my_thread_scheduler_handler= {
45  my_thread_scheduler_set,
46  my_thread_scheduler_reset,
47 };
48 
49 static struct my_plugin_log_service my_plugin_log_handler= {
51 };
52 
53 static struct mysql_string_service_st mysql_string_handler= {
54  mysql_string_convert_to_char_ptr,
55  mysql_string_get_iterator,
56  mysql_string_iterator_next,
57  mysql_string_iterator_isupper,
58  mysql_string_iterator_islower,
59  mysql_string_iterator_isdigit,
60  mysql_string_to_lowercase,
61  mysql_string_free,
62  mysql_string_iterator_free,
63 };
64 
65 static struct st_service_ref list_of_services[]=
66 {
67  { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
68  { "thd_alloc_service", VERSION_thd_alloc, &thd_alloc_handler },
69  { "thd_wait_service", VERSION_thd_wait, &thd_wait_handler },
70  { "my_thread_scheduler_service",
71  VERSION_my_thread_scheduler, &my_thread_scheduler_handler },
72  { "my_plugin_log_service", VERSION_my_plugin_log, &my_plugin_log_handler },
73  { "mysql_string_service",
74  VERSION_mysql_string, &mysql_string_handler },
75 };
76