~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/ascii/ascii.cc

  • Committer: Brian Aker
  • Date: 2009-08-04 06:21:17 UTC
  • mfrom: (1108.2.2 merge)
  • Revision ID: brian@gaz-20090804062117-fef8x6y3ydzrvab3
Merge Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <drizzled/plugin.h>
 
20
#include <drizzled/server_includes.h>
23
21
#include <drizzled/function/math/int.h>
24
 
#include <drizzled/plugin/function.h>
 
22
#include <drizzled/function/create.h>
25
23
 
26
24
using namespace std;
27
 
using namespace drizzled;
28
25
 
29
26
class AsciiFunction :public Item_int_func
30
27
{
68
65
                   );
69
66
}
70
67
 
71
 
plugin::Create_function<AsciiFunction> *asciiudf= NULL;
 
68
Create_function<AsciiFunction> asciiudf(string("ascii"));
72
69
 
73
 
static int initialize(module::Context &context)
 
70
static int initialize(PluginRegistry &registry)
74
71
{
75
 
  asciiudf= new plugin::Create_function<AsciiFunction>("ascii");
76
 
  context.add(asciiudf);
 
72
  registry.add(&asciiudf);
77
73
  return 0;
78
74
}
79
75
 
80
 
DRIZZLE_DECLARE_PLUGIN
81
 
{
82
 
  DRIZZLE_VERSION_ID,
 
76
static int finalize(PluginRegistry &registry)
 
77
{
 
78
   registry.remove(&asciiudf);
 
79
   return 0;
 
80
}
 
81
 
 
82
drizzle_declare_plugin(ascii)
 
83
{
83
84
  "ascii",
84
85
  "1.0",
85
86
  "Devananda van der Veen",
86
87
  "Return the ASCII value of a character",
87
88
  PLUGIN_LICENSE_GPL,
88
89
  initialize, /* Plugin Init */
89
 
  NULL,   /* depends */
 
90
  finalize,   /* Plugin Deinit */
 
91
  NULL,   /* status variables */
 
92
  NULL,   /* system variables */
90
93
  NULL    /* config options */
91
94
}
92
 
DRIZZLE_DECLARE_PLUGIN_END;
 
95
drizzle_declare_plugin_end;