23 #include <plugin/registry_dictionary/dictionary.h>
24 #include <drizzled/module/library.h>
27 using namespace drizzled;
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");
38 ModulesTool::ModulesTool() :
39 plugin::TableFunction(
"DATA_DICTIONARY",
"MODULES")
41 add_field(
"MODULE_NAME");
42 add_field(
"MODULE_VERSION", 20);
43 add_field(
"MODULE_AUTHOR");
44 add_field(
"IS_BUILTIN", plugin::TableFunction::BOOLEAN, 0,
false);
45 add_field(
"MODULE_LIBRARY", 254);
46 add_field(
"MODULE_DESCRIPTION", 254);
47 add_field(
"MODULE_LICENSE", 80);
50 ModulesTool::Generator::Generator(
Field **arg) :
51 plugin::TableFunction::Generator(arg)
54 modules= registry.getList();
58 bool ModulesTool::Generator::populate()
60 if (it == modules.end())
68 push(module->getName());
71 push(manifest.version ? manifest.version : 0);
74 manifest.author ? push(manifest.author) : push();
77 push((module->plugin_dl == NULL));
80 push((module->plugin_dl == NULL) ?
"builtin" : module->plugin_dl->getName());
83 manifest.descr ? push(manifest.descr) : push();
86 switch (manifest.license) {
87 case PLUGIN_LICENSE_GPL:
90 case PLUGIN_LICENSE_BSD:
93 case PLUGIN_LICENSE_LGPL:
97 push(PROPRIETARY_STRING);