My Project
sql_plugin_services.h
00001 /* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software Foundation,
00014    51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
00015 
00016 /* support for Services */
00017 #include <service_versions.h>
00018 
00019 struct st_service_ref {
00020   const char *name;
00021   uint version;
00022   void *service;
00023 };
00024 
00025 static struct my_snprintf_service_st my_snprintf_handler = {
00026   my_snprintf,
00027   my_vsnprintf
00028 };
00029 
00030 static struct thd_alloc_service_st thd_alloc_handler= {
00031   thd_alloc,
00032   thd_calloc,
00033   thd_strdup,
00034   thd_strmake,
00035   thd_memdup,
00036   thd_make_lex_string
00037 };
00038 
00039 static struct thd_wait_service_st thd_wait_handler= {
00040   thd_wait_begin,
00041   thd_wait_end
00042 };
00043 
00044 static struct my_thread_scheduler_service my_thread_scheduler_handler= {
00045   my_thread_scheduler_set,
00046   my_thread_scheduler_reset,
00047 };
00048 
00049 static struct my_plugin_log_service my_plugin_log_handler= {
00050   my_plugin_log_message
00051 };
00052 
00053 static struct mysql_string_service_st mysql_string_handler= {
00054   mysql_string_convert_to_char_ptr,
00055   mysql_string_get_iterator,
00056   mysql_string_iterator_next,
00057   mysql_string_iterator_isupper,
00058   mysql_string_iterator_islower,
00059   mysql_string_iterator_isdigit,
00060   mysql_string_to_lowercase,
00061   mysql_string_free,
00062   mysql_string_iterator_free,
00063 };
00064 
00065 static struct st_service_ref list_of_services[]=
00066 {
00067   { "my_snprintf_service", VERSION_my_snprintf, &my_snprintf_handler },
00068   { "thd_alloc_service",   VERSION_thd_alloc,   &thd_alloc_handler },
00069   { "thd_wait_service",    VERSION_thd_wait,    &thd_wait_handler },
00070   { "my_thread_scheduler_service",
00071     VERSION_my_thread_scheduler, &my_thread_scheduler_handler },
00072   { "my_plugin_log_service", VERSION_my_plugin_log, &my_plugin_log_handler },
00073   { "mysql_string_service",
00074     VERSION_mysql_string, &mysql_string_handler },
00075 };
00076 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines