~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/crc32/crc32udf.cc

  • Committer: pcrews
  • Date: 2011-05-24 17:36:24 UTC
  • mfrom: (1099.4.232 drizzle)
  • Revision ID: pcrews@lucid32-20110524173624-mwr1bvq6fa1r01ao
Updated translations + 2011.05.18 tarball tag

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 <config.h>
21
21
 
22
22
#include <drizzled/plugin.h>
23
23
#include <drizzled/plugin/function.h>
29
29
using namespace std;
30
30
using namespace drizzled;
31
31
 
32
 
class Crc32Function :public Item_int_func
 
32
class Crc32Function : public Item_int_func
33
33
{
34
34
public:
35
35
  int64_t val_int();
36
36
  
37
 
  Crc32Function() :Item_int_func() 
 
37
  Crc32Function()
38
38
  { 
39
39
    unsigned_flag= true; 
40
40
  }
71
71
  return static_cast<int64_t>(drizzled::algorithm::crc32(res->ptr(), res->length()));
72
72
}
73
73
 
74
 
plugin::Create_function<Crc32Function> *crc32udf= NULL;
75
 
 
76
74
static int initialize(module::Context &context)
77
75
{
78
 
  crc32udf= new plugin::Create_function<Crc32Function>("crc32");
79
 
  context.add(crc32udf);
 
76
  context.add(new plugin::Create_function<Crc32Function>("crc32"));
80
77
  return 0;
81
78
}
82
79