~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/hello_world/hello_world.cc

  • Committer: Brian Aker
  • Date: 2009-08-21 06:18:23 UTC
  • mfrom: (1115.3.12 captain)
  • Revision ID: brian@gaz-20090821061823-ljcpbpvun22lsvem
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <drizzled/server_includes.h>
21
 
#include <drizzled/sql_udf.h>
 
21
#include <drizzled/slot/function.h>
22
22
#include <drizzled/item/func.h>
23
23
#include <drizzled/function/str/strfunc.h>
24
24
 
25
25
#include <string>
26
26
 
27
27
using namespace std;
 
28
using namespace drizzled;
28
29
 
29
30
class Item_func_hello_world : public Item_str_func
30
31
{
40
41
  }
41
42
};
42
43
 
43
 
Create_function<Item_func_hello_world>
44
 
  hello_world_udf(string("hello_world"));
 
44
plugin::Create_function<Item_func_hello_world> *hello_world_udf= NULL;
45
45
 
46
46
static int hello_world_plugin_init(drizzled::plugin::Registry &registry)
47
47
{
48
 
  registry.add(&hello_world_udf);
 
48
  hello_world_udf=
 
49
    new plugin::Create_function<Item_func_hello_world>("hello_world");
 
50
  registry.function.add(hello_world_udf);
49
51
 
50
52
  return 0;
51
53
}
52
54
 
53
 
static int hello_world_plugin_deinit(drizzled::plugin::Registry &)
 
55
static int hello_world_plugin_deinit(drizzled::plugin::Registry &registry)
54
56
{
 
57
  registry.function.remove(hello_world_udf);
 
58
  delete hello_world_udf;
55
59
  return 0;
56
60
}
57
61