~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/md5/md5udf.cc

merge latest dev work

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <drizzled/item/func.h>
19
19
#include <drizzled/function/str/strfunc.h>
20
20
 
21
 
#if defined(HAVE_GNUTLS_OPENSSL)
22
 
# include <gnutls/openssl.h>
23
 
#else
24
 
# include <openssl/md5.h>
25
 
#endif /* HAVE_GNUTLS_OPENSSL */
 
21
#include <openssl/md5.h>
26
22
 
27
23
#include <stdio.h>
28
24
 
40
36
      get_charset_by_csname(args[0]->collation.collation->csname,
41
37
                            MY_CS_BINSORT), DERIVATION_COERCIBLE);
42
38
  }
43
 
  bool check_argument_count(int n) { return (n==1); }
 
39
 
44
40
};
45
41
 
46
42
 
77
73
}
78
74
 
79
75
 
80
 
Create_function<Item_func_md5> md5udf(string("md5"));
81
 
 
82
 
static int md5udf_plugin_init(PluginRegistry &registry)
83
 
{
84
 
  registry.add(&md5udf);
 
76
Item_func* create_md5udf_item(MEM_ROOT* m)
 
77
{
 
78
  return  new (m) Item_func_md5();
 
79
}
 
80
 
 
81
struct udf_func md5udf = {
 
82
  { C_STRING_WITH_LEN("md5") },
 
83
  create_md5udf_item
 
84
};
 
85
 
 
86
static int md5udf_plugin_init(void *p)
 
87
{
 
88
  udf_func **f = (udf_func**) p;
 
89
 
 
90
  *f= &md5udf;
 
91
 
 
92
  return 0;
 
93
}
 
94
 
 
95
static int md5udf_plugin_deinit(void *p)
 
96
{
 
97
  udf_func *udff = (udf_func *) p;
 
98
  (void)udff;
85
99
  return 0;
86
100
}
87
101
 
88
102
drizzle_declare_plugin(md5)
89
103
{
 
104
  DRIZZLE_UDF_PLUGIN,
90
105
  "md5",
91
106
  "1.0",
92
107
  "Stewart Smith",
93
108
  "UDF for computing md5sum",
94
109
  PLUGIN_LICENSE_GPL,
95
110
  md5udf_plugin_init, /* Plugin Init */
96
 
  NULL,   /* Plugin Deinit */
 
111
  md5udf_plugin_deinit, /* Plugin Deinit */
97
112
  NULL,   /* status variables */
98
113
  NULL,   /* system variables */
99
114
  NULL    /* config options */