~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/gearman_udf/gearman_udf.cc

  • Committer: Brian Aker
  • Date: 2009-05-11 23:55:31 UTC
  • mfrom: (971.3.38 eday-dev)
  • Revision ID: brian@gaz-20090511235531-j6n8i97wg2tyfg51
Merge of Eric's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2009 Sun Microsystems
 
2
 
 
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.
 
6
 
 
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.
 
11
 
 
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 */
 
15
 
 
16
#include <drizzled/server_includes.h>
 
17
#include <drizzled/sql_udf.h>
 
18
 
 
19
#include "gman_servers_set.h"
 
20
#include "gman_do.h"
 
21
 
 
22
using namespace std;
 
23
 
 
24
Create_function<Item_func_gman_servers_set> gman_servers_set(string("gman_servers_set"));
 
25
Create_function<Item_func_gman_do> gman_do(string("gman_do"));
 
26
Create_function<Item_func_gman_do_high> gman_do_high(string("gman_do_high"));
 
27
Create_function<Item_func_gman_do_low> gman_do_low(string("gman_do_low"));
 
28
Create_function<Item_func_gman_do_background> gman_do_background(string("gman_do_background"));
 
29
Create_function<Item_func_gman_do_high_background> gman_do_high_background(string("gman_do_high_background"));
 
30
Create_function<Item_func_gman_do_low_background> gman_do_low_background(string("gman_do_low_background"));
 
31
 
 
32
static int gearman_udf_plugin_init(PluginRegistry &registry)
 
33
{
 
34
  registry.add(&gman_servers_set);
 
35
  registry.add(&gman_do);
 
36
  registry.add(&gman_do_high);
 
37
  registry.add(&gman_do_low);
 
38
  registry.add(&gman_do_background);
 
39
  registry.add(&gman_do_high_background);
 
40
  registry.add(&gman_do_low_background);
 
41
  return 0;
 
42
}
 
43
 
 
44
static int gearman_udf_plugin_deinit(PluginRegistry &registry)
 
45
{
 
46
  registry.remove(&gman_do_low_background);
 
47
  registry.remove(&gman_do_high_background);
 
48
  registry.remove(&gman_do_background);
 
49
  registry.remove(&gman_do_low);
 
50
  registry.remove(&gman_do_high);
 
51
  registry.remove(&gman_do);
 
52
  registry.remove(&gman_servers_set);
 
53
  return 0;
 
54
}
 
55
 
 
56
drizzle_declare_plugin(gearman_udf)
 
57
{
 
58
  "gearman_udf",
 
59
  "0.1",
 
60
  "Eric Day",
 
61
  "Gearman Client UDFs",
 
62
  PLUGIN_LICENSE_BSD,
 
63
  gearman_udf_plugin_init, /* Plugin Init */
 
64
  gearman_udf_plugin_deinit, /* Plugin Deinit */
 
65
  NULL,   /* status variables */
 
66
  NULL,   /* system variables */
 
67
  NULL    /* config options */
 
68
}
 
69
drizzle_declare_plugin_end;