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_PLUGIN_MAX=DRIZZLE_REPLICATOR_PLUGIN
52
/* The number of plugin types */
53
const uint32_t DRIZZLE_MAX_PLUGIN_TYPE_NUM=DRIZZLE_PLUGIN_MAX+1;
55
34
/* We use the following strings to define licenses for plugins */
56
35
enum plugin_license_type {
70
49
Macros for beginning and ending plugin declarations. Between
71
50
drizzle_declare_plugin and drizzle_declare_plugin_end there should
72
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.
76
55
#ifndef DRIZZLE_DYNAMIC_PLUGIN
77
56
#define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \
78
struct st_mysql_plugin DECLS[]= {
57
struct drizzled_plugin_manifest DECLS[]= {
80
59
#define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \
81
struct st_mysql_plugin _mysql_plugin_declarations_[]= {
60
struct drizzled_plugin_manifest _mysql_plugin_declarations_[]= {
84
63
#define drizzle_declare_plugin(NAME) \
85
64
__DRIZZLE_DECLARE_PLUGIN(NAME, \
86
65
builtin_ ## NAME ## _plugin)
88
#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
91
79
declarations for SHOW STATUS support in plugins
95
83
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
96
84
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
97
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
100
91
struct st_mysql_show_var {
103
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;
107
101
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
108
102
typedef int (*mysql_show_var_func)(Session *, struct st_mysql_show_var *, char *);
364
358
(*(DRIZZLE_SYSVAR_NAME(name).resolve(session, DRIZZLE_SYSVAR_NAME(name).offset)))
368
Plugin description structure.
371
struct st_mysql_plugin
373
uint32_t type; /* the plugin type (a DRIZZLE_XXX_PLUGIN value) */
374
const char *name; /* plugin name (for SHOW PLUGINS) */
375
const char *version; /* plugin version (for SHOW PLUGINS) */
376
const char *author; /* plugin author (for SHOW PLUGINS) */
377
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
378
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
379
int (*init)(void *); /* the function to invoke when plugin is loaded */
380
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
381
struct st_mysql_show_var *status_vars;
382
struct st_mysql_sys_var **system_vars;
383
void *reserved1; /* reserved for dependency checking */
386
361
struct StorageEngine;