MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
client_plugin.c File Reference
#include <my_global.h>
#include "mysql.h"
#include <my_sys.h>
#include <m_string.h>
#include <my_pthread.h>
#include <sql_common.h>
#include "errmsg.h"
#include <mysql/client_plugin.h>
Include dependency graph for client_plugin.c:

Go to the source code of this file.

Classes

struct  st_client_plugin_int

Functions

int mysql_client_plugin_init ()
void mysql_client_plugin_deinit ()
struct st_mysql_client_pluginmysql_client_register_plugin (MYSQL *mysql, struct st_mysql_client_plugin *plugin)
struct st_mysql_client_pluginmysql_load_plugin_v (MYSQL *mysql, const char *name, int type, int argc, va_list args)
struct st_mysql_client_pluginmysql_load_plugin (MYSQL *mysql, const char *name, int type, int argc,...)
struct st_mysql_client_pluginmysql_client_find_plugin (MYSQL *mysql, const char *name, int type)
int mysql_plugin_options (struct st_mysql_client_plugin *plugin, const char *option, const void *value)

Variables

struct st_client_plugin_intplugin_list [MYSQL_CLIENT_MAX_PLUGINS]

Detailed Description

Support code for the client side (libmysql) plugins

Client plugins are somewhat different from server plugins, they are simpler.

They do not need to be installed or in any way explicitly loaded on the client, they are loaded automatically on demand. One client plugin per shared object, soname must match the plugin name.

There is no reference counting and no unloading either.

Definition in file client_plugin.c.

Function Documentation

struct st_mysql_client_plugin* mysql_client_find_plugin ( struct st_mysql mysql,
const char *  name,
int  type 
)
read

finds an already loaded plugin by name, or loads it, if necessary

Parameters
mysqlMYSQL structure.
namea name of the plugin to load
typetype of plugin that should be loaded
Return values
apointer to the plugin, or NULL in case of a failure

Definition at line 478 of file client_plugin.c.

Here is the call graph for this function:

void mysql_client_plugin_deinit ( )

Deinitializes the client plugin layer.

Unloades all client plugins and frees any associated resources.

Definition at line 292 of file client_plugin.c.

int mysql_client_plugin_init ( )

Initializes the client plugin layer.

This function must be called before any other client plugin function.

Return values
0successful
!=0 error occured

Definition at line 258 of file client_plugin.c.

struct st_mysql_client_plugin* mysql_client_register_plugin ( struct st_mysql mysql,
struct st_mysql_client_plugin plugin 
)
read

adds a plugin structure to the list of loaded plugins

This is useful if an application has the necessary functionality (for example, a special load data handler) statically linked into the application binary. It can use this function to register the plugin directly, avoiding the need to factor it out into a shared object.

Parameters
mysqlMYSQL structure. It is only used for error reporting
pluginan st_mysql_client_plugin structure to register
Return values
apointer to the plugin, or NULL in case of a failure

Definition at line 319 of file client_plugin.c.

struct st_mysql_client_plugin* mysql_load_plugin ( struct st_mysql mysql,
const char *  name,
int  type,
int  argc,
  ... 
)
read

loads a plugin and initializes it

Parameters
mysqlMYSQL structure.
namea name of the plugin to load
typetype of plugin that should be loaded, -1 to disable type check
argcnumber of arguments to pass to the plugin initialization function
...arguments for the plugin initialization function
Return values
apointer to the loaded plugin, or NULL in case of a failure

Definition at line 466 of file client_plugin.c.

Here is the call graph for this function:

Here is the caller graph for this function:

struct st_mysql_client_plugin* mysql_load_plugin_v ( struct st_mysql mysql,
const char *  name,
int  type,
int  argc,
va_list  args 
)
read

loads a plugin and initializes it, taking va_list as an argument

This is the same as mysql_load_plugin, but take va_list instead of a list of arguments.

Parameters
mysqlMYSQL structure.
namea name of the plugin to load
typetype of plugin that should be loaded, -1 to disable type check
argcnumber of arguments to pass to the plugin initialization function
argsarguments for the plugin initialization function
Return values
apointer to the loaded plugin, or NULL in case of a failure

Definition at line 344 of file client_plugin.c.

Here is the caller graph for this function:

int mysql_plugin_options ( struct st_mysql_client_plugin plugin,
const char *  option,
const void *  value 
)

set plugin options

Can be used to set extra options and affect behavior for a plugin. This function may be called multiple times to set several options

Parameters
pluginan st_mysql_client_plugin structure
optiona string which specifies the option to set
valuevalue for the option.
Return values
0on success, 1 in case of failure

Definition at line 508 of file client_plugin.c.