drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
plugin/math_functions/functions.cc
1/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3 *
4 * Copyright (C) 2010 Brian Aker
5 * Copyright (C) 2010 Stewart Smith
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include <config.h>
23#include <drizzled/plugin/function.h>
24#include <plugin/math_functions/functions.h>
25#include <plugin/math_functions/abs.h>
26#include <plugin/math_functions/acos.h>
27#include <plugin/math_functions/asin.h>
28#include <plugin/math_functions/atan.h>
29#include <plugin/math_functions/cos.h>
30#include <plugin/math_functions/log.h>
31#include <plugin/math_functions/sin.h>
32#include <plugin/math_functions/pow.h>
33#include <plugin/math_functions/ln.h>
34#include <plugin/math_functions/sqrt.h>
35#include <plugin/math_functions/ceiling.h>
36#include <plugin/math_functions/exp.h>
37#include <plugin/math_functions/floor.h>
38#include <plugin/math_functions/ord.h>
39
40using namespace drizzled;
41
42static int init(drizzled::module::Context &context)
43{
44 context.add(new plugin::Create_function<Item_func_abs>("abs"));
45 context.add(new plugin::Create_function<Item_func_acos>("acos"));
46 context.add(new plugin::Create_function<Item_func_asin>("asin"));
47 context.add(new plugin::Create_function<Item_func_atan>("atan"));
48 context.add(new plugin::Create_function<Item_func_atan>("atan2"));
49 context.add(new plugin::Create_function<Item_func_cos>("cos"));
50 context.add(new plugin::Create_function<Item_func_log>("log"));
51 context.add(new plugin::Create_function<Item_func_log2>("log2"));
52 context.add(new plugin::Create_function<Item_func_log10>("log10"));
53 context.add(new plugin::Create_function<Item_func_sin>("sin"));
54 context.add(new plugin::Create_function<Item_func_pow>("pow"));
55 context.add(new plugin::Create_function<Item_func_pow>("power"));
56 context.add(new plugin::Create_function<Item_func_ln>("ln"));
57 context.add(new plugin::Create_function<Item_func_sqrt>("sqrt"));
58 context.add(new plugin::Create_function<Item_func_ceiling>("ceil"));
59 context.add(new plugin::Create_function<Item_func_ceiling>("ceiling"));
60 context.add(new plugin::Create_function<Item_func_exp>("exp"));
61 context.add(new plugin::Create_function<Item_func_floor>("floor"));
62 context.add(new plugin::Create_function<Item_func_ord>("ord"));
63
64 return 0;
65}
66
67DRIZZLE_DECLARE_PLUGIN
68{
69 DRIZZLE_VERSION_ID,
70 "math_functions",
71 "1.0",
72 "Brian Aker, Stewart Smith",
73 N_("Math functions (ABS, LOG, POW, LN, SQRT, CEIL, FLOOR, ORD, etc.)"),
74 PLUGIN_LICENSE_GPL,
75 init,
76 NULL,
77 NULL
78}
79DRIZZLE_DECLARE_PLUGIN_END;
TODO: Rename this file - func.h is stupid.