20
20
#ifndef DRIZZLED_PLUGIN_H
21
21
#define DRIZZLED_PLUGIN_H
23
#include <drizzled/lex_string.h>
24
#include <drizzled/xid.h>
25
#include <drizzled/plugin/manifest.h>
26
#include <drizzled/plugin/module.h>
23
#include "drizzled/module/manifest.h"
24
#include "drizzled/module/module.h"
27
25
#include "drizzled/plugin/version.h"
26
#include "drizzled/module/context.h"
28
27
#include "drizzled/definitions.h"
29
#include "drizzled/plugin/context.h"
29
#include "drizzled/lex_string.h"
30
#include "drizzled/xid.h"
31
#include <boost/program_options.hpp>
57
58
Macros for beginning and ending plugin declarations. Between
58
59
DRIZZLE_DECLARE_PLUGIN and DRIZZLE_DECLARE_PLUGIN_END there should
59
be a plugin::Manifest for each plugin to be declared.
60
be a module::Manifest for each plugin to be declared.
63
64
#define PANDORA_CPP_NAME(x) _drizzled_ ## x ## _plugin_
64
65
#define PANDORA_PLUGIN_NAME(x) PANDORA_CPP_NAME(x)
65
66
#define DRIZZLE_DECLARE_PLUGIN \
66
::drizzled::plugin::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
67
::drizzled::module::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
69
70
#define DRIZZLE_DECLARE_PLUGIN_END
70
#define DRIZZLE_PLUGIN(init,system) \
71
#define DRIZZLE_PLUGIN(init,system,options) \
71
72
DRIZZLE_DECLARE_PLUGIN \
73
74
DRIZZLE_VERSION_ID, \
76
77
STRINGIFY_ARG(PANDORA_MODULE_AUTHOR), \
77
78
STRINGIFY_ARG(PANDORA_MODULE_TITLE), \
78
79
PANDORA_MODULE_LICENSE, \
80
init, system, options \
188
189
mysql_var_check_func check; \
189
190
mysql_var_update_func update
191
#define DRIZZLE_SYSVAR_NAME(name) mysql_sysvar_ ## name
192
#define DRIZZLE_SYSVAR_NAME(name) drizzle_sysvar_ ## name
192
193
#define DRIZZLE_SYSVAR(name) \
193
194
((drizzle_sys_var *)(&(DRIZZLE_SYSVAR_NAME(name))))
371
372
Miscellaneous functions for plugin implementors
378
extern bool plugin_init(plugin::Registry ®istry,
375
extern bool plugin_init(module::Registry ®istry,
379
376
int *argc, char **argv,
381
extern void plugin_shutdown(plugin::Registry &plugins);
382
extern void my_print_help_inc_plugins(option *options);
378
boost::program_options::options_description &long_options);
379
extern void my_print_help_inc_plugins(option *options,
380
boost::program_options::options_description &long_options);
383
381
extern bool plugin_is_ready(const LEX_STRING *name, int type);
384
382
extern void plugin_sessionvar_init(Session *session);
385
383
extern void plugin_sessionvar_cleanup(Session *session);
426
424
int session_killed(const Session *session);
430
Return the thread id of a user thread
432
@param session user thread connection handle
435
unsigned long session_get_thread_id(const Session *session);
437
427
const charset_info_st *session_charset(Session *session);
438
int session_non_transactional_update(const Session *session);
439
void session_mark_transaction_to_rollback(Session *session, bool all);
443
Allocate memory in the connection's local memory pool
446
When properly used in place of @c malloc(), this can significantly
447
improve concurrency. Don't use this or related functions to allocate
448
large chunks of memory. Use for temporary storage only. The memory
449
will be freed automatically at the end of the statement; no explicit
450
code is required to prevent memory leaks.
454
void *session_alloc(Session *session, unsigned int size);
458
void *session_calloc(Session *session, unsigned int size);
462
char *session_strdup(Session *session, const char *str);
466
char *session_strmake(Session *session, const char *str, unsigned int size);
470
void *session_memdup(Session *session, const void* str, unsigned int size);
473
Get the XID for this connection's transaction
475
@param session user thread connection handle
476
@param xid location where identifier is stored
478
void session_get_xid(const Session *session, DRIZZLE_XID *xid);
481
430
Invalidate the query cache for a given table.