Databases Reference
In-Depth Information
MySQL provides two macros that help to declare plugins. A plugin declaration starts
from the mysql_declare_plugin() macro. It takes one argument, a unique identifier
for this plugin library, it will be used automatically as needed to avoid name clashes
when plugins are linked statically into the server. This identifier must be the same
one that was used as a plugin name in the plug.in file (see Chapter 1). We can put
many plugins in one library, but they all need to be declared in one place, after the
mysql_declare_plugin() macro, separated by commas. We end the list of plugin
declarations with a mysql_declare_plugin_end macro.
A complete example of the plugin declarations can be seen as follows:
mysql_declare_plugin(my_plugin)
{
MYSQL_DAEMON_PLUGIN,
&my_plugin_info,
"my_plugin",
"Andrew Hutchings (Andrew.Hutchings@Sun.COM)",
"Daemon example, shows a declaration",
PLUGIN_LICENSE_GPL,
my_plugin_init,
my_plugin_deinit,
0x0100,
NULL,
NULL,
NULL
},
{
MYSQL_DAEMON_PLUGIN,
&my_plugin2_info,
"my_plugin2",
"Sergei Golubchik (serg@mariadb.org)",
"Another Daemon example, shows a declaration",
PLUGIN_LICENSE_GPL,
my_plugin2_init,
NULL,
0xC0FFEE,
status,
vars,
NULL
}
mysql_declare_plugin_end;
 
Search WWH ::




Custom Search