~drizzle-trunk/drizzle/development

1864.3.1 by Brian Aker
Add a catalog() command.
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
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
22
#include <config.h>
2148.7.12 by Brian Aker
Merge in header fixes.
23
24
#include <drizzled/plugin.h>
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
25
#include <plugin/utility_functions/functions.h>
1864.3.1 by Brian Aker
Add a catalog() command.
26
27
using namespace drizzled;
28
29
static int init(drizzled::module::Context &context)
30
{
2039.3.1 by Brian Aker
Create a user available assert() function.
31
  context.add(new plugin::Create_function<utility_functions::Assert>("assert"));
2194.4.2 by Brian Aker
Bit functions/fix for <<
32
  context.add(new plugin::Create_function<utility_functions::BitCount>("bit_count"));
1864.3.4 by Brian Aker
This creates a function for seeing which catalog you are in. It also
33
  context.add(new plugin::Create_function<utility_functions::Catalog>("catalog"));
1976.7.2 by Brian Aker
Adding execute command to go along with main command.
34
  context.add(new plugin::Create_function<utility_functions::Execute>("execute"));
35
  context.add(new plugin::Create_function<utility_functions::GlobalReadLock>("global_read_lock"));
2039.3.3 by Brian Aker
result_type() to display the internal type.
36
  context.add(new plugin::Create_function<utility_functions::ResultType>("result_type"));
1976.7.2 by Brian Aker
Adding execute command to go along with main command.
37
  context.add(new plugin::Create_function<utility_functions::Kill>("kill"));
1864.3.4 by Brian Aker
This creates a function for seeing which catalog you are in. It also
38
  context.add(new plugin::Create_function<utility_functions::Schema>("database"));
2039.3.4 by Brian Aker
Adding typeof() method to determine drizzle type returns
39
  context.add(new plugin::Create_function<utility_functions::Typeof>("typeof"));
1864.3.4 by Brian Aker
This creates a function for seeing which catalog you are in. It also
40
  context.add(new plugin::Create_function<utility_functions::User>("user"));
1864.3.1 by Brian Aker
Add a catalog() command.
41
42
  return 0;
43
}
44
45
DRIZZLE_DECLARE_PLUGIN
46
{
47
  DRIZZLE_VERSION_ID,
48
  "Utility Functions",
2039.3.4 by Brian Aker
Adding typeof() method to determine drizzle type returns
49
  "1.4",
1864.3.1 by Brian Aker
Add a catalog() command.
50
  "Brian Aker, Stewart Smith",
51
  "Utility Functions.",
52
  PLUGIN_LICENSE_GPL,
53
  init,
54
  NULL,
55
  NULL
56
}
57
DRIZZLE_DECLARE_PLUGIN_END;