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