30
30
Plugin API. Common for all plugin types.
34
The allowable types of plugins
36
enum drizzle_plugin_type {
37
DRIZZLE_DAEMON_PLUGIN, /* Daemon / Raw */
38
DRIZZLE_STORAGE_ENGINE_PLUGIN, /* Storage Engine */
39
DRIZZLE_INFORMATION_SCHEMA_PLUGIN, /* Information Schema */
40
DRIZZLE_UDF_PLUGIN, /* User-Defined Function */
41
DRIZZLE_UDA_PLUGIN, /* User-Defined Aggregate Function */
42
DRIZZLE_AUDIT_PLUGIN, /* Audit */
43
DRIZZLE_LOGGER_PLUGIN, /* Query Logging */
44
DRIZZLE_ERRMSG_PLUGIN, /* Error Messages */
45
DRIZZLE_AUTH_PLUGIN, /* Authorization */
46
DRIZZLE_QCACHE_PLUGIN, /* Query Cache */
47
DRIZZLE_SCHEDULING_PLUGIN, /* Thread and Session Scheduling */
48
DRIZZLE_REPLICATOR_PLUGIN, /* Database Replication */
49
DRIZZLE_PROTOCOL_PLUGIN, /* Protocol Handlers */
50
DRIZZLE_PLUGIN_MAX=DRIZZLE_PROTOCOL_PLUGIN
53
/* The number of plugin types */
54
const uint32_t DRIZZLE_MAX_PLUGIN_TYPE_NUM=DRIZZLE_PLUGIN_MAX+1;
56
34
/* We use the following strings to define licenses for plugins */
57
35
enum plugin_license_type {
71
49
Macros for beginning and ending plugin declarations. Between
72
50
drizzle_declare_plugin and drizzle_declare_plugin_end there should
73
be a st_mysql_plugin struct for each plugin to be declared.
51
be a drizzled_plugin_manifest struct for each plugin to be declared.
77
55
#ifndef DRIZZLE_DYNAMIC_PLUGIN
78
56
#define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \
79
struct st_mysql_plugin DECLS[]= {
57
struct drizzled_plugin_manifest DECLS[]= {
81
59
#define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \
82
struct st_mysql_plugin _mysql_plugin_declarations_[]= {
60
struct drizzled_plugin_manifest _mysql_plugin_declarations_[]= {
85
63
#define drizzle_declare_plugin(NAME) \
86
64
__DRIZZLE_DECLARE_PLUGIN(NAME, \
87
65
builtin_ ## NAME ## _plugin)
89
#define drizzle_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0}}
67
#define drizzle_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0}}
70
the following flags are valid for plugin_init()
72
#define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1
73
#define PLUGIN_INIT_SKIP_PLUGIN_TABLE 2
74
#define PLUGIN_INIT_SKIP_INITIALIZATION 4
76
#define INITIAL_LEX_PLUGIN_LIST_SIZE 16
92
79
declarations for SHOW STATUS support in plugins
96
83
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
97
84
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
98
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, SHOW_SIZE
85
SHOW_ARRAY, SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG,
86
SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE,
87
SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_INT_NOFLUSH,
88
SHOW_LONGLONG_STATUS, SHOW_DOUBLE, SHOW_SIZE
101
91
struct st_mysql_show_var {
104
94
enum enum_mysql_show_type type;
97
typedef enum enum_mysql_show_type SHOW_TYPE;
98
typedef struct st_mysql_show_var SHOW_VAR;
108
101
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
109
102
typedef int (*mysql_show_var_func)(Session *, struct st_mysql_show_var *, char *);
365
358
(*(DRIZZLE_SYSVAR_NAME(name).resolve(session, DRIZZLE_SYSVAR_NAME(name).offset)))
369
Plugin description structure.
372
struct st_mysql_plugin
374
uint32_t type; /* the plugin type (a DRIZZLE_XXX_PLUGIN value) */
375
const char *name; /* plugin name (for SHOW PLUGINS) */
376
const char *version; /* plugin version (for SHOW PLUGINS) */
377
const char *author; /* plugin author (for SHOW PLUGINS) */
378
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
379
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
380
int (*init)(void *); /* the function to invoke when plugin is loaded */
381
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
382
struct st_mysql_show_var *status_vars;
383
struct st_mysql_sys_var **system_vars;
384
void *reserved1; /* reserved for dependency checking */
387
361
struct StorageEngine;