00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <boost/program_options.hpp>
00023 #include <boost/filesystem.hpp>
00024
00025 #include <drizzled/module/manifest.h>
00026 #include <drizzled/module/module.h>
00027 #include <drizzled/plugin/version.h>
00028 #include <drizzled/module/context.h>
00029 #include <drizzled/definitions.h>
00030
00031 #include <drizzled/lex_string.h>
00032 #include <drizzled/sys_var.h>
00033
00034 #include <drizzled/visibility.h>
00035
00036 namespace drizzled {
00037
00038
00039
00040
00041
00042 extern boost::filesystem::path plugin_dir;
00043
00044
00045
00046
00047
00048
00049
00050
00051 #define PANDORA_CPP_NAME(x) _drizzled_ ## x ## _plugin_
00052 #define PANDORA_PLUGIN_NAME(x) PANDORA_CPP_NAME(x)
00053 #define DRIZZLE_DECLARE_PLUGIN \
00054 DRIZZLED_API ::drizzled::module::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
00055
00056
00057 #define DRIZZLE_DECLARE_PLUGIN_END
00058 #define DRIZZLE_PLUGIN(init,system,options) \
00059 DRIZZLE_DECLARE_PLUGIN \
00060 { \
00061 DRIZZLE_VERSION_ID, \
00062 STRINGIFY_ARG(PANDORA_MODULE_NAME), \
00063 STRINGIFY_ARG(PANDORA_MODULE_VERSION), \
00064 STRINGIFY_ARG(PANDORA_MODULE_AUTHOR), \
00065 STRINGIFY_ARG(PANDORA_MODULE_TITLE), \
00066 PANDORA_MODULE_LICENSE, \
00067 init, \
00068 STRINGIFY_ARG(PANDORA_MODULE_DEPENDENCIES), \
00069 options \
00070 }
00071
00072
00073
00074
00075
00076
00077
00078 #define PLUGIN_VAR_READONLY 0x0200
00079 #define PLUGIN_VAR_OPCMDARG 0x2000
00080 #define PLUGIN_VAR_MEMALLOC 0x8000
00081
00082 struct drizzle_sys_var;
00083 struct drizzle_value;
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104 typedef int (*var_check_func)(Session*, drizzle_sys_var*, void* save, drizzle_value*);
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 typedef void (*var_update_func)(Session*, drizzle_sys_var*, void*, const void* save);
00121
00122
00123
00124
00125
00126
00127 struct drizzle_sys_var
00128 {
00129 };
00130
00131 void plugin_opt_set_limits(option *options, const drizzle_sys_var *opt);
00132
00133 struct drizzle_value
00134 {
00135 int (*value_type)(drizzle_value *);
00136 const char *(*val_str)(drizzle_value *, char *buffer, int *length);
00137 int (*val_real)(drizzle_value *, double *realbuf);
00138 int (*val_int)(drizzle_value *, int64_t *intbuf);
00139 };
00140
00141
00142
00143
00144
00145
00146 extern bool plugin_init(module::Registry&, boost::program_options::options_description &long_options);
00147 extern bool plugin_finalize(module::Registry&);
00148 extern void plugin_startup_window(module::Registry&, drizzled::Session&);
00149 extern void my_print_help_inc_plugins(option* options);
00150 extern void plugin_sessionvar_init(Session*);
00151 extern void plugin_sessionvar_cleanup(Session*);
00152
00153 DRIZZLED_API int64_t session_test_options(const Session*, int64_t test_options);
00154 void compose_plugin_add(const std::vector<std::string>& options);
00155 void compose_plugin_remove(const std::vector<std::string>& options);
00156 void notify_plugin_load(const std::string& in_plugin_load);
00157
00158
00171 DRIZZLED_API int tmpfile(const char *prefix);
00172
00173 }