17
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
#ifndef DRIZZLED_PLUGIN_H
21
#define DRIZZLED_PLUGIN_H
23
22
#include <boost/program_options.hpp>
24
23
#include <boost/filesystem.hpp>
26
#include "drizzled/module/manifest.h"
27
#include "drizzled/module/module.h"
28
#include "drizzled/plugin/version.h"
29
#include "drizzled/module/context.h"
30
#include "drizzled/definitions.h"
32
#include "drizzled/lex_string.h"
33
#include "drizzled/sys_var.h"
34
#include "drizzled/xid.h"
41
struct charset_info_st;
25
#include <drizzled/module/manifest.h>
26
#include <drizzled/module/module.h>
27
#include <drizzled/plugin/version.h>
28
#include <drizzled/module/context.h>
29
#include <drizzled/definitions.h>
31
#include <drizzled/lex_string.h>
32
#include <drizzled/sys_var.h>
34
#include <drizzled/visibility.h>
43
38
/*************************************************************************
44
39
Plugin API. Common for all plugin types.
49
typedef drizzle_lex_string LEX_STRING;
52
42
extern boost::filesystem::path plugin_dir;
54
namespace plugin { class StorageEngine; }
57
45
Macros for beginning and ending plugin declarations. Between
58
46
DRIZZLE_DECLARE_PLUGIN and DRIZZLE_DECLARE_PLUGIN_END there should
63
51
#define PANDORA_CPP_NAME(x) _drizzled_ ## x ## _plugin_
64
52
#define PANDORA_PLUGIN_NAME(x) PANDORA_CPP_NAME(x)
65
53
#define DRIZZLE_DECLARE_PLUGIN \
66
::drizzled::module::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
54
DRIZZLED_API ::drizzled::module::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
69
57
#define DRIZZLE_DECLARE_PLUGIN_END
76
64
STRINGIFY_ARG(PANDORA_MODULE_AUTHOR), \
77
65
STRINGIFY_ARG(PANDORA_MODULE_TITLE), \
78
66
PANDORA_MODULE_LICENSE, \
79
init, system, options \
68
STRINGIFY_ARG(PANDORA_MODULE_DEPENDENCIES), \
88
#define PLUGIN_VAR_BOOL 0x0001
89
#define PLUGIN_VAR_INT 0x0002
90
#define PLUGIN_VAR_LONG 0x0003
91
#define PLUGIN_VAR_LONGLONG 0x0004
92
#define PLUGIN_VAR_STR 0x0005
93
#define PLUGIN_VAR_UNSIGNED 0x0080
94
#define PLUGIN_VAR_SessionLOCAL 0x0100 /* Variable is per-connection */
95
78
#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */
96
#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */
97
#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */
98
#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */
99
#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */
100
79
#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */
101
80
#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */
122
101
automatically at the end of the statement.
125
typedef int (*mysql_var_check_func)(Session *session,
104
typedef int (*var_check_func)(Session *session,
126
105
drizzle_sys_var *var,
127
106
void *save, drizzle_value *value);
131
(*mysql_var_update_func)()
132
111
session thread handle
133
112
var dynamic variable being altered
134
113
var_ptr pointer to dynamic variable
140
119
and persist it in the provided pointer to the dynamic variable.
141
120
For example, strings may require memory to be allocated.
143
typedef void (*mysql_var_update_func)(Session *session,
122
typedef void (*var_update_func)(Session *session,
144
123
drizzle_sys_var *var,
145
124
void *var_ptr, const void *save);
171
150
extern bool plugin_init(module::Registry ®istry,
172
151
boost::program_options::options_description &long_options);
173
152
extern bool plugin_finalize(module::Registry ®istry);
153
extern void plugin_startup_window(module::Registry ®istry, drizzled::Session &session);
174
154
extern void my_print_help_inc_plugins(option *options);
175
155
extern bool plugin_is_ready(const LEX_STRING *name, int type);
176
156
extern void plugin_sessionvar_init(Session *session);
177
157
extern void plugin_sessionvar_cleanup(Session *session);
178
extern sys_var *intern_find_sys_var(const char *str, uint32_t, bool no_error);
180
159
int session_in_lock_tables(const Session *session);
181
int session_tablespace_op(const Session *session);
182
void set_session_proc_info(Session *session, const char *info);
183
const char *get_session_proc_info(Session *session);
184
int64_t session_test_options(const Session *session, int64_t test_options);
185
int session_sql_command(const Session *session);
186
enum_tx_isolation session_tx_isolation(const Session *session);
160
DRIZZLED_API int64_t session_test_options(const Session *session, int64_t test_options);
188
161
void compose_plugin_add(std::vector<std::string> options);
189
162
void compose_plugin_remove(std::vector<std::string> options);
190
163
void notify_plugin_load(std::string in_plugin_load);
203
176
@retval >= 0 a file handle that can be passed to dup or internal::my_close
205
int mysql_tmpfile(const char *prefix);
178
DRIZZLED_API int tmpfile(const char *prefix);
207
180
} /* namespace drizzled */
209
#endif /* DRIZZLED_PLUGIN_H */