~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/data_engine/modules.cc

Does not work (compile issue in plugin).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
 
#include <plugin/registry_dictionary/dictionary.h>
24
 
#include <drizzled/module/library.h>
 
23
#include <plugin/data_engine/function.h>
 
24
#include <drizzled/plugin/library.h>
25
25
 
26
26
using namespace std;
27
27
using namespace drizzled;
28
28
 
29
 
/* 
30
 
 * Suffix _STRING was added because sys/param.h on OSX defines a BSD symbol
31
 
 * to the version of BSD being run. FAIL
32
 
 */
33
 
static const string GPL_STRING("GPL");
34
 
static const string LGPL_STRING("LGPL");
35
 
static const string BSD_STRING("BSD");
36
 
static const string PROPRIETARY_STRING("PROPRIETARY");
 
29
static const string GPL("GPL");
 
30
static const string LGPL("LGPL");
 
31
static const string BSD("BSD");
 
32
static const string PROPRIETARY("PROPRIETARY");
37
33
 
38
34
ModulesTool::ModulesTool() :
39
35
  plugin::TableFunction("DATA_DICTIONARY", "MODULES")
41
37
  add_field("MODULE_NAME");
42
38
  add_field("MODULE_VERSION", 20);
43
39
  add_field("MODULE_AUTHOR");
44
 
  add_field("IS_BUILTIN", plugin::TableFunction::BOOLEAN, 0, false);
 
40
  add_field("IS_BUILTIN", plugin::TableFunction::BOOLEAN);
45
41
  add_field("MODULE_LIBRARY", 254);
46
42
  add_field("MODULE_DESCRIPTION", 254);
47
43
  add_field("MODULE_LICENSE", 80);
50
46
ModulesTool::Generator::Generator(Field **arg) :
51
47
  plugin::TableFunction::Generator(arg)
52
48
{
53
 
  module::Registry &registry= module::Registry::singleton();
54
 
  modules= registry.getList();
 
49
  plugin::Registry &registry= plugin::Registry::singleton();
 
50
  modules= registry.getList(true);
55
51
  it= modules.begin();
56
52
}
57
53
 
61
57
    return false;
62
58
 
63
59
  {
64
 
    module::Module *module= *it;
65
 
    const module::Manifest &manifest= module->getManifest();
 
60
    plugin::Module *module= *it;
 
61
    const plugin::Manifest &manifest= module->getManifest();
66
62
 
67
63
    /* MODULE_NAME */
68
64
    push(module->getName());
85
81
    /* MODULE_LICENSE */
86
82
    switch (manifest.license) {
87
83
    case PLUGIN_LICENSE_GPL:
88
 
      push(GPL_STRING);
 
84
      push(GPL);
89
85
      break;
90
86
    case PLUGIN_LICENSE_BSD:
91
 
      push(BSD_STRING);
 
87
      push(BSD);
92
88
      break;
93
89
    case PLUGIN_LICENSE_LGPL:
94
 
      push(LGPL_STRING);
 
90
      push(LGPL);
95
91
      break;
96
92
    default:
97
 
      push(PROPRIETARY_STRING);
 
93
      push(PROPRIETARY);
98
94
      break;
99
95
    }
100
96
  }