35
50
The allowable types of plugins
37
enum drizzle_plugin_type {
38
DRIZZLE_DAEMON_PLUGIN, /* Daemon / Raw */
39
DRIZZLE_STORAGE_ENGINE_PLUGIN, /* Storage Engine */
40
DRIZZLE_INFORMATION_SCHEMA_PLUGIN, /* Information Schema */
41
DRIZZLE_UDF_PLUGIN, /* User-Defined Function */
42
DRIZZLE_UDA_PLUGIN, /* User-Defined Aggregate Function */
43
DRIZZLE_AUDIT_PLUGIN, /* Audit */
44
DRIZZLE_LOGGER_PLUGIN, /* Query Logging */
45
DRIZZLE_ERRMSG_PLUGIN, /* Error Messages */
46
DRIZZLE_AUTH_PLUGIN, /* Authorization */
47
DRIZZLE_CONFIGVAR_PLUGIN, /* Configuration Variables */
48
DRIZZLE_QCACHE_PLUGIN, /* Query Cache */
49
DRIZZLE_PARSER_PLUGIN, /* Language Parser */
50
DRIZZLE_SCHEDULING_PLUGIN, /* Thread and Session Scheduling */
51
DRIZZLE_PLUGIN_MAX=DRIZZLE_SCHEDULING_PLUGIN
52
#define DRIZZLE_DAEMON_PLUGIN 0 /* Daemon / Raw */
53
#define DRIZZLE_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */
54
#define DRIZZLE_INFORMATION_SCHEMA_PLUGIN 2 /* Information Schema */
55
#define DRIZZLE_UDF_PLUGIN 3 /* User-Defined Function */
56
#define DRIZZLE_UDA_PLUGIN 4 /* User-Defined Aggregate Function */
57
#define DRIZZLE_AUDIT_PLUGIN 5 /* Audit */
58
#define DRIZZLE_LOGGER_PLUGIN 6 /* Query Logging */
59
#define DRIZZLE_ERRMSG_PLUGIN 7 /* Error Messages */
60
#define DRIZZLE_AUTH_PLUGIN 8 /* Authorization */
61
#define DRIZZLE_CONFIGVAR_PLUGIN 9 /* Configuration */
62
#define DRIZZLE_QCACHE_PLUGIN 10 /* Query Cache */
54
/* The number of plugin types */
55
const uint32_t DRIZZLE_MAX_PLUGIN_TYPE_NUM=DRIZZLE_PLUGIN_MAX+1;
64
#define DRIZZLE_MAX_PLUGIN_TYPE_NUM 11 /* The number of plugin types */
57
66
/* We use the following strings to define licenses for plugins */
58
enum plugin_license_type {
59
PLUGIN_LICENSE_PROPRIETARY,
62
PLUGIN_LICENSE_MAX=PLUGIN_LICENSE_BSD
67
#define PLUGIN_LICENSE_PROPRIETARY 0
68
#define PLUGIN_LICENSE_GPL 1
69
#define PLUGIN_LICENSE_BSD 2
65
const char * const PLUGIN_LICENSE_PROPRIETARY_STRING="PROPRIETARY";
66
const char * const PLUGIN_LICENSE_GPL_STRING="GPL";
67
const char * const PLUGIN_LICENSE_BSD_STRING="BSD";
71
#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
72
#define PLUGIN_LICENSE_GPL_STRING "GPL"
73
#define PLUGIN_LICENSE_BSD_STRING "BSD"
70
76
Macros for beginning and ending plugin declarations. Between
304
310
PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
305
311
#name, comment, check, update, &varname, def, typelib }
307
#define DRIZZLE_SessionVAR_BOOL(name, opt, comment, check, update, def) \
308
DECLARE_DRIZZLE_SessionVAR_BASIC(name, char) = { \
309
PLUGIN_VAR_BOOL | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
310
#name, comment, check, update, -1, def, NULL}
312
#define DRIZZLE_SessionVAR_STR(name, opt, comment, check, update, def) \
313
DECLARE_DRIZZLE_SessionVAR_BASIC(name, char *) = { \
314
PLUGIN_VAR_STR | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
315
#name, comment, check, update, -1, def, NULL}
317
#define DRIZZLE_SessionVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
318
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, int) = { \
319
PLUGIN_VAR_INT | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
320
#name, comment, check, update, -1, def, min, max, blk, NULL }
322
#define DRIZZLE_SessionVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
323
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, unsigned int) = { \
324
PLUGIN_VAR_INT | PLUGIN_VAR_SessionLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
325
#name, comment, check, update, -1, def, min, max, blk, NULL }
327
#define DRIZZLE_SessionVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
328
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, long) = { \
329
PLUGIN_VAR_LONG | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
330
#name, comment, check, update, -1, def, min, max, blk, NULL }
332
#define DRIZZLE_SessionVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
333
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, unsigned long) = { \
334
PLUGIN_VAR_LONG | PLUGIN_VAR_SessionLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
335
#name, comment, check, update, -1, def, min, max, blk, NULL }
337
#define DRIZZLE_SessionVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
338
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, int64_t) = { \
339
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
340
#name, comment, check, update, -1, def, min, max, blk, NULL }
342
#define DRIZZLE_SessionVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
343
DECLARE_DRIZZLE_SessionVAR_SIMPLE(name, uint64_t) = { \
344
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_SessionLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
345
#name, comment, check, update, -1, def, min, max, blk, NULL }
347
#define DRIZZLE_SessionVAR_ENUM(name, opt, comment, check, update, def, typelib) \
348
DECLARE_DRIZZLE_SessionVAR_TYPELIB(name, unsigned long) = { \
349
PLUGIN_VAR_ENUM | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
313
#define DRIZZLE_THDVAR_BOOL(name, opt, comment, check, update, def) \
314
DECLARE_DRIZZLE_THDVAR_BASIC(name, char) = { \
315
PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
316
#name, comment, check, update, -1, def, NULL}
318
#define DRIZZLE_THDVAR_STR(name, opt, comment, check, update, def) \
319
DECLARE_DRIZZLE_THDVAR_BASIC(name, char *) = { \
320
PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
321
#name, comment, check, update, -1, def, NULL}
323
#define DRIZZLE_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
324
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, int) = { \
325
PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
326
#name, comment, check, update, -1, def, min, max, blk, NULL }
328
#define DRIZZLE_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
329
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, unsigned int) = { \
330
PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
331
#name, comment, check, update, -1, def, min, max, blk, NULL }
333
#define DRIZZLE_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
334
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, long) = { \
335
PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
336
#name, comment, check, update, -1, def, min, max, blk, NULL }
338
#define DRIZZLE_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
339
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, unsigned long) = { \
340
PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
341
#name, comment, check, update, -1, def, min, max, blk, NULL }
343
#define DRIZZLE_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
344
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, int64_t) = { \
345
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
346
#name, comment, check, update, -1, def, min, max, blk, NULL }
348
#define DRIZZLE_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
349
DECLARE_DRIZZLE_THDVAR_SIMPLE(name, uint64_t) = { \
350
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
351
#name, comment, check, update, -1, def, min, max, blk, NULL }
353
#define DRIZZLE_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
354
DECLARE_DRIZZLE_THDVAR_TYPELIB(name, unsigned long) = { \
355
PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
350
356
#name, comment, check, update, -1, def, NULL, typelib }
352
#define DRIZZLE_SessionVAR_SET(name, opt, comment, check, update, def, typelib) \
353
DECLARE_DRIZZLE_SessionVAR_TYPELIB(name, uint64_t) = { \
354
PLUGIN_VAR_SET | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
358
#define DRIZZLE_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
359
DECLARE_DRIZZLE_THDVAR_TYPELIB(name, uint64_t) = { \
360
PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
355
361
#name, comment, check, update, -1, def, NULL, typelib }
357
363
/* accessor macros */