1
/* Copyright (C) 2006 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
16
#include "drizzled/server_includes.h"
17
#include "drizzled/plugin/function.h"
19
#include "plugin/compression/compress.h"
20
#include "plugin/compression/uncompress.h"
21
#include "plugin/compression/uncompressed_length.h"
24
using namespace drizzled;
26
plugin::Create_function<Item_func_compress> *compressudf= NULL;
27
plugin::Create_function<Item_func_uncompress> *uncompressudf= NULL;
28
plugin::Create_function<Item_func_uncompressed_length>
29
*uncompressed_lengthudf= NULL;
31
static int compressionudf_plugin_init(plugin::Registry ®istry)
33
compressudf= new plugin::Create_function<Item_func_compress>("compress");
35
new plugin::Create_function<Item_func_uncompress>("uncompress");
36
uncompressed_lengthudf=
37
new plugin::Create_function<Item_func_uncompressed_length>("uncompressed_length");
38
registry.add(compressudf);
39
registry.add(uncompressudf);
40
registry.add(uncompressed_lengthudf);
44
static int compressionudf_plugin_deinit(plugin::Registry ®istry)
46
registry.remove(compressudf);
47
registry.remove(uncompressudf);
48
registry.remove(uncompressed_lengthudf);
51
delete uncompressed_lengthudf;
55
drizzle_declare_plugin
60
"UDFs for compression functions",
62
compressionudf_plugin_init, /* Plugin Init */
63
compressionudf_plugin_deinit, /* Plugin Deinit */
64
NULL, /* status variables */
65
NULL, /* system variables */
66
NULL /* config options */
68
drizzle_declare_plugin_end;