~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/status_dictionary/dictionary.cc

Additional plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 *
 
6
 *  This program is free software; you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation; either version 2 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with this program; if not, write to the Free Software
 
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
19
 */
 
20
 
 
21
#include "config.h"
 
22
#include "plugin/status_dictionary/dictionary.h"
 
23
 
 
24
static StatementsTool *global_statements;
 
25
static StatementsTool *session_statements;
 
26
static StatusTool *global_status;
 
27
static StatusTool *session_status;
 
28
static VariablesTool *global_variables;
 
29
static VariablesTool *session_variables;
 
30
 
 
31
 
 
32
static int init(drizzled::plugin::Registry &registry)
 
33
{
 
34
  global_statements= new(std::nothrow)StatementsTool(true);
 
35
  global_status= new(std::nothrow)StatusTool(true);
 
36
  session_statements= new(std::nothrow)StatementsTool(false);
 
37
  session_status= new(std::nothrow)StatusTool(false);
 
38
  global_variables= new(std::nothrow)VariablesTool(true);
 
39
  session_variables= new(std::nothrow)VariablesTool(false);
 
40
 
 
41
  registry.add(global_statements);
 
42
  registry.add(global_status);
 
43
  registry.add(global_variables);
 
44
  registry.add(session_statements);
 
45
  registry.add(session_status);
 
46
  registry.add(session_variables);
 
47
  
 
48
  return 0;
 
49
}
 
50
 
 
51
static int finalize(drizzled::plugin::Registry &registry)
 
52
{
 
53
  registry.remove(global_statements);
 
54
  registry.remove(global_status);
 
55
  registry.remove(global_variables);
 
56
  registry.remove(session_statements);
 
57
  registry.remove(session_status);
 
58
  registry.remove(session_variables);
 
59
 
 
60
  delete global_statements;
 
61
  delete global_status;
 
62
  delete global_variables;
 
63
  delete session_statements;
 
64
  delete session_status;
 
65
  delete session_variables;
 
66
 
 
67
  return 0;
 
68
}
 
69
 
 
70
int foo(void);
 
71
int foo(void)
 
72
{
 
73
  drizzled::plugin::Registry &registry= drizzled::plugin::Registry::singleton();
 
74
  init(registry);
 
75
  finalize(registry);
 
76
 
 
77
  return 0;
 
78
}
 
79
 
 
80
#if 0
 
81
DRIZZLE_DECLARE_PLUGIN
 
82
{
 
83
  DRIZZLE_VERSION_ID,
 
84
  "schema_dictionary",
 
85
  "1.0",
 
86
  "Brian Aker",
 
87
  "Data Dictionary for schema, table, column, indexes, etc",
 
88
  PLUGIN_LICENSE_GPL,
 
89
  init,
 
90
  finalize,
 
91
  NULL,
 
92
  NULL,
 
93
  NULL
 
94
}
 
95
DRIZZLE_DECLARE_PLUGIN_END;
 
96
#endif