summaryrefslogtreecommitdiff
path: root/libservices
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-03-28 19:26:00 +0200
committerSergei Golubchik <sergii@pisem.net>2012-03-28 19:26:00 +0200
commit0d5adca0de0a51b1f0bd49045fc4062eac7d1d25 (patch)
tree3cb7a294c5feebb813cf73b248c53d026aa11602 /libservices
parent20e706689df1eb87c696304797e9d6184c0a75bb (diff)
downloadmariadb-git-0d5adca0de0a51b1f0bd49045fc4062eac7d1d25.tar.gz
debug_sync is now a service, available to dynamically loaded plugins.
new make target - abi_update libservices/HOWTO: remove references to Makefile.am small tweaks
Diffstat (limited to 'libservices')
-rw-r--r--libservices/CMakeLists.txt3
-rw-r--r--libservices/HOWTO35
-rw-r--r--libservices/debug_sync_service.c18
3 files changed, 37 insertions, 19 deletions
diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt
index ee6a7c73abe..eb8ff7ffe09 100644
--- a/libservices/CMakeLists.txt
+++ b/libservices/CMakeLists.txt
@@ -20,7 +20,8 @@ SET(MYSQLSERVICES_SOURCES
thd_alloc_service.c
thd_wait_service.c
my_thread_scheduler_service.c
- progress_report_service.c)
+ progress_report_service.c
+ debug_sync_service.c)
ADD_CONVENIENCE_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES})
INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development)
diff --git a/libservices/HOWTO b/libservices/HOWTO
index 7edafa89268..7dcfb6d9583 100644
--- a/libservices/HOWTO
+++ b/libservices/HOWTO
@@ -34,19 +34,19 @@ into a service "foo" you need to
#endif
extern struct foo_service_st {
- int (*foo_func1_type)(...); /* fix the prototype as appropriate */
- void (*foo_func2_type)(...); /* fix the prototype as appropriate */
+ int (*foo_func1_ptr)(...); /* fix the prototype as appropriate */
+ void (*foo_func2_ptr)(...); /* fix the prototype as appropriate */
} *foo_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
- #define foo_func1(...) foo_service->foo_func1_type(...)
- #define foo_func2(...) foo_service->foo_func2_type(...)
+ #define foo_func1(...) foo_service->foo_func1_ptr(...)
+ #define foo_func2(...) foo_service->foo_func2_ptr(...)
#else
- int foo_func1_type(...); /* fix the prototype as appropriate */
- void foo_func2_type(...); /* fix the prototype as appropriate */
+ int foo_func1(...); /* fix the prototype as appropriate */
+ void foo_func2(...); /* fix the prototype as appropriate */
#endif
@@ -64,27 +64,26 @@ include them in it, e.g. if you use size_t - #include <stdlib.h>
it should also declare all the accompanying data structures, as necessary
(e.g. thd_alloc_service declares MYSQL_LEX_STRING).
-3. add the new file to include/Makefile.am (pkginclude_HEADERS)
-4. add the new file to include/mysql/services.h
-5. increase the minor plugin ABI version in include/mysql/plugin.h
- (MYSQL_PLUGIN_INTERFACE_VERSION = MYSQL_PLUGIN_INTERFACE_VERSION+1)
-6. add the version of your service to include/service_versions.h:
+3. add the new file to include/mysql/services.h
+4. increase the minor plugin ABI version in include/mysql/plugin.h
+ (MARIA_PLUGIN_INTERFACE_VERSION = MARIA_PLUGIN_INTERFACE_VERSION+1)
+5. add the version of your service to include/service_versions.h:
==================================================================
#define VERSION_foo 0x0100
==================================================================
-7. create a new file libservices/foo_service.h using the following template:
+6. create a new file libservices/foo_service.h using the following template:
==================================================================
/* GPL header */
#include <service_versions.h>
SERVICE_VERSION *foo_service= (void*)VERSION_foo;
==================================================================
-8. add the new file to libservices/CMakeLists.txt (MYSQLSERVICES_SOURCES)
-9. add the new file to libservices/Makefile.am (libmysqlservices_a_SOURCES)
-10. and finally, register your service for dynamic linking in
- sql/sql_plugin_services.h
-10.1 fill in the service structure:
+7. add the new file to libservices/CMakeLists.txt (MYSQLSERVICES_SOURCES)
+8. Add all new files to repository (bzr add)
+9. and finally, register your service for dynamic linking in
+ sql/sql_plugin_services.h as follows:
+9.1 fill in the service structure:
==================================================================
static struct foo_service_st foo_handler = {
foo_func1,
@@ -92,7 +91,7 @@ it should also declare all the accompanying data structures, as necessary
}
==================================================================
-10.2 and add it to the list of services
+9.2 and add it to the list of services
==================================================================
{ "foo_service", VERSION_foo, &foo_handler }
diff --git a/libservices/debug_sync_service.c b/libservices/debug_sync_service.c
new file mode 100644
index 00000000000..8c7f109e95a
--- /dev/null
+++ b/libservices/debug_sync_service.c
@@ -0,0 +1,18 @@
+/* Copyright (c) 2012, Monty Program Ab
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include <service_versions.h>
+SERVICE_VERSION *debug_sync_service= (void*)VERSION_debug_sync;