~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/compression/compressionudf.cc

  • Committer: Stewart Smith
  • Date: 2009-06-16 00:45:15 UTC
  • mto: (1119.2.6 merge)
  • mto: This revision was merged to the branch mainline in revision 1124.
  • Revision ID: stewart@flamingspork.com-20090616004515-bgr8e62psvn2820l
make snowman test not leave tables behind after running

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
 
#include "config.h"
17
 
#include "drizzled/plugin/function.h"
 
16
#include <drizzled/server_includes.h>
 
17
#include <drizzled/sql_udf.h>
18
18
 
19
19
#include "plugin/compression/compress.h"
20
20
#include "plugin/compression/uncompress.h"
21
21
#include "plugin/compression/uncompressed_length.h"
22
 
 
23
 
using namespace std;
24
 
using namespace drizzled;
25
 
 
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;
30
 
 
31
 
static int compressionudf_plugin_init(module::Context &context)
32
 
{
33
 
  compressudf= new plugin::Create_function<Item_func_compress>("compress");
34
 
  uncompressudf=
35
 
    new plugin::Create_function<Item_func_uncompress>("uncompress");
36
 
  uncompressed_lengthudf=
37
 
    new plugin::Create_function<Item_func_uncompressed_length>("uncompressed_length");
38
 
  context.add(compressudf);
39
 
  context.add(uncompressudf);
40
 
  context.add(uncompressed_lengthudf);
41
 
  return 0;
42
 
}
43
 
 
44
 
DRIZZLE_DECLARE_PLUGIN
45
 
{
46
 
  DRIZZLE_VERSION_ID,
 
22
#include <string>
 
23
 
 
24
 
 
25
Create_function<Item_func_compress> compressudf("compress");
 
26
Create_function<Item_func_uncompress> uncompressudf("uncompress");
 
27
Create_function<Item_func_uncompressed_length>
 
28
  uncompressed_lengthudf("uncompressed_length");
 
29
 
 
30
static int compressionudf_plugin_init(drizzled::plugin::Registry &registry)
 
31
{
 
32
  registry.add(&compressudf);
 
33
  registry.add(&uncompressudf);
 
34
  registry.add(&uncompressed_lengthudf);
 
35
  return 0;
 
36
}
 
37
 
 
38
static int compressionudf_plugin_deinit(drizzled::plugin::Registry &registry)
 
39
{
 
40
  registry.remove(&compressudf);
 
41
  registry.remove(&uncompressudf);
 
42
  registry.remove(&uncompressed_lengthudf);
 
43
  return 0;
 
44
}
 
45
 
 
46
drizzle_declare_plugin(compression)
 
47
{
47
48
  "compression",
48
49
  "1.1",
49
50
  "Stewart Smith",
50
51
  "UDFs for compression functions",
51
52
  PLUGIN_LICENSE_GPL,
52
53
  compressionudf_plugin_init, /* Plugin Init */
53
 
  NULL,   /* depends */
 
54
  compressionudf_plugin_deinit, /* Plugin Deinit */
 
55
  NULL,   /* status variables */
 
56
  NULL,   /* system variables */
54
57
  NULL    /* config options */
55
58
}
56
 
DRIZZLE_DECLARE_PLUGIN_END;
 
59
drizzle_declare_plugin_end;