~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/charlength/charlength.cc

  • Committer: Stewart Smith
  • Date: 2009-10-08 12:39:27 UTC
  • mto: This revision was merged to the branch mainline in revision 1179.
  • Revision ID: stewart@flamingspork.com-20091008123927-qpf9hog04w4xc5aj
make directory_file_name() static to mysys/my_lib.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
 
20
#include <drizzled/server_includes.h>
21
21
#include <drizzled/function/math/int.h>
22
22
#include <drizzled/plugin/function.h>
23
23
 
64
64
}
65
65
 
66
66
plugin::Create_function<CharLengthFunction> *charlengthudf= NULL;
67
 
plugin::Create_function<CharLengthFunction> *characterlengthudf= NULL;
68
67
 
69
 
static int initialize(drizzled::plugin::Context &context)
 
68
static int initialize(drizzled::plugin::Registry &registry)
70
69
{
71
70
  charlengthudf= new plugin::Create_function<CharLengthFunction>("char_length");
72
 
  characterlengthudf= new plugin::Create_function<CharLengthFunction>("character_length");
73
 
  context.add(charlengthudf);
74
 
  context.add(characterlengthudf);
 
71
  charlengthudf->addAlias("character_length");
 
72
  registry.add(charlengthudf);
75
73
  return 0;
76
74
}
77
75
 
78
 
DRIZZLE_DECLARE_PLUGIN
79
 
{
80
 
  DRIZZLE_VERSION_ID,
 
76
static int finalize(drizzled::plugin::Registry &registry)
 
77
{
 
78
   registry.remove(charlengthudf);
 
79
   delete charlengthudf;
 
80
   return 0;
 
81
}
 
82
 
 
83
drizzle_declare_plugin(charlength)
 
84
{
81
85
  "charlength",
82
86
  "1.0",
83
87
  "Devananda van der Veen",
84
88
  "Return the number of characters in a string",
85
89
  PLUGIN_LICENSE_GPL,
86
90
  initialize, /* Plugin Init */
 
91
  finalize,   /* Plugin Deinit */
 
92
  NULL,   /* status variables */
87
93
  NULL,   /* system variables */
88
94
  NULL    /* config options */
89
95
}
90
 
DRIZZLE_DECLARE_PLUGIN_END;
 
96
drizzle_declare_plugin_end;