~drizzle-trunk/drizzle/development

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
2445.1.7 by Olaf van der Spek
Refactor
104
typedef int (*var_check_func)(Session*, drizzle_sys_var*, void* save, drizzle_value*);
1 by brian
clean slate
105
106
/*
107
  SYNOPSIS
2026.2.1 by Monty Taylor
Renamed things prefixed mysql_ or mysqld_
108
    (*var_update_func)()
520.1.22 by Brian Aker
Second pass of thd cleanup
109
      session               thread handle
1 by brian
clean slate
110
      var               dynamic variable being altered
111
      var_ptr           pointer to dynamic variable
112
      save              pointer to temporary storage
113
   RETURN
114
     NONE
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
115
1 by brian
clean slate
116
   This function should use the validated value stored in the temporary store
117
   and persist it in the provided pointer to the dynamic variable.
118
   For example, strings may require memory to be allocated.
119
*/
2445.1.7 by Olaf van der Spek
Refactor
120
typedef void (*var_update_func)(Session*, drizzle_sys_var*, void*, const void* save);
1 by brian
clean slate
121
122
123
1251.2.2 by Jay Pipes
Pulls MyISAM-specific server variables into the MyISAM
124
/*
125
  skeleton of a plugin variable - portion of structure common to all.
126
*/
127
struct drizzle_sys_var
128
{
129
};
130
1410.3.4 by Djellel E. Difallah
update references to old my_'s
131
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
132
1228.1.5 by Monty Taylor
Merged in some naming things.
133
struct drizzle_value
1 by brian
clean slate
134
{
1228.1.5 by Monty Taylor
Merged in some naming things.
135
  int (*value_type)(drizzle_value *);
136
  const char *(*val_str)(drizzle_value *, char *buffer, int *length);
137
  int (*val_real)(drizzle_value *, double *realbuf);
138
  int (*val_int)(drizzle_value *, int64_t *intbuf);
1 by brian
clean slate
139
};
140
141
142
/*************************************************************************
143
  Miscellaneous functions for plugin implementors
144
*/
145
2445.1.7 by Olaf van der Spek
Refactor
146
extern bool plugin_init(module::Registry&, boost::program_options::options_description &long_options);
147
extern bool plugin_finalize(module::Registry&);
148
extern void plugin_startup_window(module::Registry&, drizzled::Session&);
149
extern void my_print_help_inc_plugins(option* options);
150
extern void plugin_sessionvar_init(Session*);
151
extern void plugin_sessionvar_cleanup(Session*);
1130.1.1 by Monty Taylor
Merged in plugin-slot-reorg patches.
152
2445.1.7 by Olaf van der Spek
Refactor
153
DRIZZLED_API int64_t session_test_options(const Session*, int64_t test_options);
154
void compose_plugin_add(const std::vector<std::string>& options);
155
void compose_plugin_remove(const std::vector<std::string>& options);
156
void notify_plugin_load(const std::string& in_plugin_load);
520.6.7 by Monty Taylor
Moved a bunch of crap out of common_includes.
157
158
1 by brian
clean slate
159
/**
160
  Create a temporary file.
161
162
  @details
163
  The temporary file is created in a location specified by the mysql
164
  server configuration (--tmpdir option).  The caller does not need to
165
  delete the file, it will be deleted automatically.
166
167
  @param prefix  prefix for temporary file name
168
  @retval -1    error
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
169
  @retval >= 0  a file handle that can be passed to dup or internal::my_close
1 by brian
clean slate
170
*/
2119.4.1 by Monty Taylor
Turns on -fvisibility=hidden by default. Symbols intended to be used by
171
DRIZZLED_API int tmpfile(const char *prefix);
1 by brian
clean slate
172
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
173
} /* namespace drizzled */