45
41
typedef drizzle_lex_string LEX_STRING;
48
44
extern char *opt_plugin_add;
49
extern char *opt_plugin_remove;
50
45
extern char *opt_plugin_load;
51
46
extern char *opt_plugin_dir_ptr;
52
47
extern char opt_plugin_dir[FN_REFLEN];
54
namespace plugin { class StorageEngine; }
49
namespace drizzled { namespace plugin { class StorageEngine; } }
57
52
Macros for beginning and ending plugin declarations. Between
58
53
DRIZZLE_DECLARE_PLUGIN and DRIZZLE_DECLARE_PLUGIN_END there should
59
be a plugin::Manifest for each plugin to be declared.
54
be a drizzled::plugin::Manifest for each plugin to be declared.
63
58
#define PANDORA_CPP_NAME(x) _drizzled_ ## x ## _plugin_
64
59
#define PANDORA_PLUGIN_NAME(x) PANDORA_CPP_NAME(x)
65
60
#define DRIZZLE_DECLARE_PLUGIN \
66
::drizzled::plugin::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
61
drizzled::plugin::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
69
64
#define DRIZZLE_DECLARE_PLUGIN_END
70
#define DRIZZLE_PLUGIN(init,system) \
65
#define DRIZZLE_PLUGIN(init,deinit,status,system) \
71
66
DRIZZLE_DECLARE_PLUGIN \
73
68
DRIZZLE_VERSION_ID, \
76
71
STRINGIFY_ARG(PANDORA_MODULE_AUTHOR), \
77
72
STRINGIFY_ARG(PANDORA_MODULE_TITLE), \
78
73
PANDORA_MODULE_LICENSE, \
74
init, deinit, status, system, NULL \
88
83
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
89
84
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
90
SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG,
91
SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS,
85
SHOW_ARRAY, SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG,
86
SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE,
92
87
SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_INT_NOFLUSH,
93
88
SHOW_LONGLONG_STATUS, SHOW_DOUBLE, SHOW_SIZE
118
114
#define PLUGIN_VAR_LONG 0x0003
119
115
#define PLUGIN_VAR_LONGLONG 0x0004
120
116
#define PLUGIN_VAR_STR 0x0005
117
#define PLUGIN_VAR_ENUM 0x0006
118
#define PLUGIN_VAR_SET 0x0007
121
119
#define PLUGIN_VAR_UNSIGNED 0x0080
122
120
#define PLUGIN_VAR_SessionLOCAL 0x0100 /* Variable is per-connection */
123
121
#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */
214
212
} DRIZZLE_SYSVAR_NAME(name)
214
#define DECLARE_DRIZZLE_SYSVAR_TYPELIB(name, type) struct { \
215
DRIZZLE_PLUGIN_VAR_HEADER; \
216
type *value; type def_val; \
218
} DRIZZLE_SYSVAR_NAME(name)
216
220
#define DECLARE_SessionVAR_FUNC(type) \
217
221
type *(*resolve)(Session *session, int offset)
284
288
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
285
289
#name, comment, check, update, &varname, def, min, max, blk }
291
#define DRIZZLE_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
292
DECLARE_DRIZZLE_SYSVAR_TYPELIB(name, unsigned long) = { \
293
PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \
294
#name, comment, check, update, &varname, def, typelib }
296
#define DRIZZLE_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \
297
DECLARE_DRIZZLE_SYSVAR_TYPELIB(name, uint64_t) = { \
298
PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
299
#name, comment, check, update, &varname, def, typelib }
287
301
#define DRIZZLE_SessionVAR_BOOL(name, opt, comment, check, update, def) \
288
302
DECLARE_DRIZZLE_SessionVAR_BASIC(name, char) = { \
289
303
PLUGIN_VAR_BOOL | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
324
338
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_SessionLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
325
339
#name, comment, check, update, -1, def, min, max, blk, NULL }
341
#define DRIZZLE_SessionVAR_ENUM(name, opt, comment, check, update, def, typelib) \
342
DECLARE_DRIZZLE_SessionVAR_TYPELIB(name, unsigned long) = { \
343
PLUGIN_VAR_ENUM | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
344
#name, comment, check, update, -1, def, NULL, typelib }
346
#define DRIZZLE_SessionVAR_SET(name, opt, comment, check, update, def, typelib) \
347
DECLARE_DRIZZLE_SessionVAR_TYPELIB(name, uint64_t) = { \
348
PLUGIN_VAR_SET | PLUGIN_VAR_SessionLOCAL | ((opt) & PLUGIN_VAR_MASK), \
349
#name, comment, check, update, -1, def, NULL, typelib }
327
351
/* accessor macros */
329
353
#define SYSVAR(name) \
348
372
#define DRIZZLE_VALUE_TYPE_REAL 1
349
373
#define DRIZZLE_VALUE_TYPE_INT 2
352
skeleton of a plugin variable - portion of structure common to all.
354
struct drizzle_sys_var
356
DRIZZLE_PLUGIN_VAR_HEADER;
359
void plugin_opt_set_limits(option *options, const drizzle_sys_var *opt);
361
375
struct drizzle_value
363
377
int (*value_type)(drizzle_value *);
378
extern bool plugin_init(plugin::Registry ®istry,
392
extern bool plugin_init(drizzled::plugin::Registry ®istry,
379
393
int *argc, char **argv,
381
extern void plugin_shutdown(plugin::Registry &plugins);
382
extern void my_print_help_inc_plugins(option *options);
395
extern void plugin_shutdown(drizzled::plugin::Registry &plugins);
396
extern void my_print_help_inc_plugins(my_option *options);
383
397
extern bool plugin_is_ready(const LEX_STRING *name, int type);
384
398
extern void plugin_sessionvar_init(Session *session);
385
399
extern void plugin_sessionvar_cleanup(Session *session);
406
420
@param prefix prefix for temporary file name
408
@retval >= 0 a file handle that can be passed to dup or internal::my_close
422
@retval >= 0 a file handle that can be passed to dup or my_close
410
424
int mysql_tmpfile(const char *prefix);
435
449
unsigned long session_get_thread_id(const Session *session);
437
451
const charset_info_st *session_charset(Session *session);
452
char **session_query(Session *session);
438
453
int session_non_transactional_update(const Session *session);
439
454
void session_mark_transaction_to_rollback(Session *session, bool all);