~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
22
#include "config.h"
1864.3.4 by Brian Aker
This creates a function for seeing which catalog you are in. It also
23
#include "plugin/utility_functions/functions.h"
1864.3.1 by Brian Aker
Add a catalog() command.
24
25
using namespace drizzled;
26
27
static int init(drizzled::module::Context &context)
28
{
1864.3.4 by Brian Aker
This creates a function for seeing which catalog you are in. It also
29
  context.add(new plugin::Create_function<utility_functions::Catalog>("catalog"));
30
  context.add(new plugin::Create_function<utility_functions::Schema>("database"));
31
  context.add(new plugin::Create_function<utility_functions::User>("user"));
1948.2.6 by Brian Aker
Added function global_read_lock(), this way a session can know if it has
32
  context.add(new plugin::Create_function<utility_functions::GlobalReadLock>("global_read_lock"));
1963.2.1 by Brian Aker
Fixing up the kill function.
33
  context.add(new plugin::Create_function<utility_functions::Kill>("kill"));
1864.3.1 by Brian Aker
Add a catalog() command.
34
35
  return 0;
36
}
37
38
DRIZZLE_DECLARE_PLUGIN
39
{
40
  DRIZZLE_VERSION_ID,
41
  "Utility Functions",
1963.2.1 by Brian Aker
Fixing up the kill function.
42
  "1.2",
1864.3.1 by Brian Aker
Add a catalog() command.
43
  "Brian Aker, Stewart Smith",
44
  "Utility Functions.",
45
  PLUGIN_LICENSE_GPL,
46
  init,
47
  NULL,
48
  NULL
49
}
50
DRIZZLE_DECLARE_PLUGIN_END;