390.1.2
by Monty Taylor
Fixed copyright headers in drizzled/ |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
1999.6.1
by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file |
4 |
* Copyright (C) 2008 Sun Microsystems, Inc.
|
390.1.2
by Monty Taylor
Fixed copyright headers in drizzled/ |
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
1
by brian
clean slate |
19 |
|
2234
by Brian Aker
Mass removal of ifdef/endif in favor of pragma once. |
20 |
#pragma once
|
1
by brian
clean slate |
21 |
|
1878.3.1
by Monty Taylor
Split set_var.* into sys_var.* and set_var.* |
22 |
#include <boost/program_options.hpp> |
23 |
#include <boost/filesystem.hpp> |
|
24 |
||
2173.2.1
by Monty Taylor
Fixes incorrect usage of include |
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> |
|
30 |
||
31 |
#include <drizzled/lex_string.h> |
|
32 |
#include <drizzled/sys_var.h> |
|
33 |
||
34 |
#include <drizzled/visibility.h> |
|
2119.4.1
by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by |
35 |
|
2221.7.6
by Olaf van der Spek
Remove unused includes |
36 |
namespace drizzled { |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
37 |
|
1
by brian
clean slate |
38 |
/*************************************************************************
|
39 |
Plugin API. Common for all plugin types.
|
|
40 |
*/
|
|
41 |
||
1813.2.7
by Monty Taylor
Migrated plugin_dir to fs::path. |
42 |
extern boost::filesystem::path plugin_dir; |
1130.1.1
by Monty Taylor
Merged in plugin-slot-reorg patches. |
43 |
|
1
by brian
clean slate |
44 |
/*
|
813.2.1
by Toru Maesaka
Renamed mysql_declare_plugin to drizzle_declare_plugin |
45 |
Macros for beginning and ending plugin declarations. Between
|
1228.1.5
by Monty Taylor
Merged in some naming things. |
46 |
DRIZZLE_DECLARE_PLUGIN and DRIZZLE_DECLARE_PLUGIN_END there should
|
1530.2.5
by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant |
47 |
be a module::Manifest for each plugin to be declared.
|
1
by brian
clean slate |
48 |
*/
|
49 |
||
50 |
||
1241.10.1
by Monty Taylor
Added ability to specify all of the meta information in the plugin.ini file. This allows us to have a streamlined out-of-tree build. |
51 |
#define PANDORA_CPP_NAME(x) _drizzled_ ## x ## _plugin_
|
52 |
#define PANDORA_PLUGIN_NAME(x) PANDORA_CPP_NAME(x)
|
|
53 |
#define DRIZZLE_DECLARE_PLUGIN \
|
|
2119.4.1
by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by |
54 |
DRIZZLED_API ::drizzled::module::Manifest PANDORA_PLUGIN_NAME(PANDORA_MODULE_NAME)=
|
1241.12.6
by Monty Taylor
We don't actually support an array of these, so remove the extra bits. |
55 |
|
56 |
||
57 |
#define DRIZZLE_DECLARE_PLUGIN_END
|
|
1633.6.2
by Vijay Samuel
Reverted changes. |
58 |
#define DRIZZLE_PLUGIN(init,system,options) \
|
1241.10.1
by Monty Taylor
Added ability to specify all of the meta information in the plugin.ini file. This allows us to have a streamlined out-of-tree build. |
59 |
DRIZZLE_DECLARE_PLUGIN \
|
60 |
{ \
|
|
1241.10.2
by Monty Taylor
Added support for embedding the drizzle version number in the plugin file. |
61 |
DRIZZLE_VERSION_ID, \
|
1241.10.1
by Monty Taylor
Added ability to specify all of the meta information in the plugin.ini file. This allows us to have a streamlined out-of-tree build. |
62 |
STRINGIFY_ARG(PANDORA_MODULE_NAME), \
|
63 |
STRINGIFY_ARG(PANDORA_MODULE_VERSION), \
|
|
64 |
STRINGIFY_ARG(PANDORA_MODULE_AUTHOR), \
|
|
65 |
STRINGIFY_ARG(PANDORA_MODULE_TITLE), \
|
|
66 |
PANDORA_MODULE_LICENSE, \
|
|
2095.3.1
by Monty Taylor
Re-purpose the old plugin sysvar slot in the struct to be a depends list. |
67 |
init, \
|
68 |
STRINGIFY_ARG(PANDORA_MODULE_DEPENDENCIES), \
|
|
69 |
options \
|
|
1241.12.6
by Monty Taylor
We don't actually support an array of these, so remove the extra bits. |
70 |
}
|
1093.3.1
by Monty Taylor
Rename of plugin classes. |
71 |
|
72 |
||
971.1.61
by Monty Taylor
Moved a few things around in headers. |
73 |
/*
|
1
by brian
clean slate |
74 |
declarations for server variables and command line options
|
75 |
*/
|
|
76 |
||
77 |
||
78 |
#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */ |
|
79 |
#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */ |
|
80 |
#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */ |
|
81 |
||
1228.1.5
by Monty Taylor
Merged in some naming things. |
82 |
struct drizzle_sys_var; |
83 |
struct drizzle_value; |
|
1
by brian
clean slate |
84 |
|
85 |
/*
|
|
86 |
SYNOPSIS
|
|
2026.2.1
by Monty Taylor
Renamed things prefixed mysql_ or mysqld_ |
87 |
(*var_check_func)()
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
88 |
session thread handle
|
1
by brian
clean slate |
89 |
var dynamic variable being altered
|
90 |
save pointer to temporary storage
|
|
91 |
value user provided value
|
|
92 |
RETURN
|
|
93 |
0 user provided value is OK and the update func may be called.
|
|
94 |
any other value indicates error.
|
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
95 |
|
1
by brian
clean slate |
96 |
This function should parse the user provided value and store in the
|
97 |
provided temporary storage any data as required by the update func.
|
|
98 |
There is sufficient space in the temporary storage to store a double.
|
|
99 |
Note that the update func may not be called if any other error occurs
|
|
100 |
so any memory allocated should be thread-local so that it may be freed
|
|
101 |
automatically at the end of the statement.
|
|
102 |
*/
|
|
103 |
||
2026.2.1
by Monty Taylor
Renamed things prefixed mysql_ or mysqld_ |
104 |
typedef int (*var_check_func)(Session *session, |
1228.1.5
by Monty Taylor
Merged in some naming things. |
105 |
drizzle_sys_var *var, |
106 |
void *save, drizzle_value *value); |
|
1
by brian
clean slate |
107 |
|
108 |
/*
|
|
109 |
SYNOPSIS
|
|
2026.2.1
by Monty Taylor
Renamed things prefixed mysql_ or mysqld_ |
110 |
(*var_update_func)()
|
520.1.22
by Brian Aker
Second pass of thd cleanup |
111 |
session thread handle
|
1
by brian
clean slate |
112 |
var dynamic variable being altered
|
113 |
var_ptr pointer to dynamic variable
|
|
114 |
save pointer to temporary storage
|
|
115 |
RETURN
|
|
116 |
NONE
|
|
660.1.3
by Eric Herman
removed trailing whitespace with simple script: |
117 |
|
1
by brian
clean slate |
118 |
This function should use the validated value stored in the temporary store
|
119 |
and persist it in the provided pointer to the dynamic variable.
|
|
120 |
For example, strings may require memory to be allocated.
|
|
121 |
*/
|
|
2026.2.1
by Monty Taylor
Renamed things prefixed mysql_ or mysqld_ |
122 |
typedef void (*var_update_func)(Session *session, |
1228.1.5
by Monty Taylor
Merged in some naming things. |
123 |
drizzle_sys_var *var, |
1
by brian
clean slate |
124 |
void *var_ptr, const void *save); |
125 |
||
126 |
||
127 |
||
1251.2.2
by Jay Pipes
Pulls MyISAM-specific server variables into the MyISAM |
128 |
/*
|
129 |
skeleton of a plugin variable - portion of structure common to all.
|
|
130 |
*/
|
|
131 |
struct drizzle_sys_var |
|
132 |
{
|
|
133 |
};
|
|
134 |
||
1410.3.4
by Djellel E. Difallah
update references to old my_'s |
135 |
void plugin_opt_set_limits(option *options, const drizzle_sys_var *opt); |
1251.2.2
by Jay Pipes
Pulls MyISAM-specific server variables into the MyISAM |
136 |
|
1228.1.5
by Monty Taylor
Merged in some naming things. |
137 |
struct drizzle_value |
1
by brian
clean slate |
138 |
{
|
1228.1.5
by Monty Taylor
Merged in some naming things. |
139 |
int (*value_type)(drizzle_value *); |
140 |
const char *(*val_str)(drizzle_value *, char *buffer, int *length); |
|
141 |
int (*val_real)(drizzle_value *, double *realbuf); |
|
142 |
int (*val_int)(drizzle_value *, int64_t *intbuf); |
|
1
by brian
clean slate |
143 |
};
|
144 |
||
145 |
||
146 |
/*************************************************************************
|
|
147 |
Miscellaneous functions for plugin implementors
|
|
148 |
*/
|
|
149 |
||
1530.2.5
by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant |
150 |
extern bool plugin_init(module::Registry ®istry, |
1633.1.1
by Monty Taylor
Added in support for program_options output in --help output. |
151 |
boost::program_options::options_description &long_options); |
1794.3.5
by Monty Taylor
Fixed temporoary dir sequencing. |
152 |
extern bool plugin_finalize(module::Registry ®istry); |
2079.4.1
by Brian Aker
Merge in code to all plugins to do whatever they need to do once all other |
153 |
extern void plugin_startup_window(module::Registry ®istry, drizzled::Session &session); |
1757.2.3
by Monty Taylor
Made printing of --help work via program_options from the core. Removed |
154 |
extern void my_print_help_inc_plugins(option *options); |
2371.1.2
by Brian Aker
Remove the typedef on lexkey |
155 |
extern bool plugin_is_ready(const lex_string_t *name, int type); |
1130.1.1
by Monty Taylor
Merged in plugin-slot-reorg patches. |
156 |
extern void plugin_sessionvar_init(Session *session); |
157 |
extern void plugin_sessionvar_cleanup(Session *session); |
|
158 |
||
520.1.22
by Brian Aker
Second pass of thd cleanup |
159 |
int session_in_lock_tables(const Session *session); |
2119.4.1
by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by |
160 |
DRIZZLED_API int64_t session_test_options(const Session *session, int64_t test_options); |
1776.4.1
by Monty Taylor
Migrates the creation of the plugin lists to have program_options directly |
161 |
void compose_plugin_add(std::vector<std::string> options); |
162 |
void compose_plugin_remove(std::vector<std::string> options); |
|
163 |
void notify_plugin_load(std::string in_plugin_load); |
|
520.6.7
by Monty Taylor
Moved a bunch of crap out of common_includes. |
164 |
|
165 |
||
1
by brian
clean slate |
166 |
/**
|
167 |
Create a temporary file.
|
|
168 |
||
169 |
@details
|
|
170 |
The temporary file is created in a location specified by the mysql
|
|
171 |
server configuration (--tmpdir option). The caller does not need to
|
|
172 |
delete the file, it will be deleted automatically.
|
|
173 |
||
174 |
@param prefix prefix for temporary file name
|
|
175 |
@retval -1 error
|
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
176 |
@retval >= 0 a file handle that can be passed to dup or internal::my_close
|
1
by brian
clean slate |
177 |
*/
|
2119.4.1
by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by |
178 |
DRIZZLED_API int tmpfile(const char *prefix); |
1
by brian
clean slate |
179 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
180 |
} /* namespace drizzled */ |
181 |
||
1
by brian
clean slate |
182 |