~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/registry.cc

Added code necessary for building plugins dynamically.
Merged in changes from lifeless to allow autoreconf to work.
Touching plugin.ini files now triggers a rebuid - so config/autorun.sh is no
longer required to be run after touching those.
Removed the duplicate plugin names - also removed the issue that getting them
different would silently fail weirdly later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
namespace drizzled
34
34
{
35
35
 
36
 
plugin::Handle *plugin::Registry::find(const LEX_STRING *name)
 
36
plugin::Module *plugin::Registry::find(const LEX_STRING *name)
37
37
{
38
38
  string find_str(name->str,name->length);
39
39
  transform(find_str.begin(), find_str.end(), find_str.begin(), ::tolower);
40
40
 
41
 
  map<string, plugin::Handle *>::iterator map_iter;
42
 
  map_iter= handle_map.find(find_str);
43
 
  if (map_iter != handle_map.end())
 
41
  map<string, plugin::Module *>::iterator map_iter;
 
42
  map_iter= module_map.find(find_str);
 
43
  if (map_iter != module_map.end())
44
44
    return (*map_iter).second;
45
45
  return(0);
46
46
}
47
47
 
48
 
void plugin::Registry::add(plugin::Handle *handle)
 
48
void plugin::Registry::add(plugin::Module *handle)
49
49
{
50
50
  string add_str(handle->getName());
51
51
  transform(add_str.begin(), add_str.end(),
52
52
            add_str.begin(), ::tolower);
53
53
 
54
 
  handle_map[add_str]= handle;
 
54
  module_map[add_str]= handle;
55
55
}
56
56
 
57
57
 
58
 
vector<plugin::Handle *> plugin::Registry::getList(bool active)
 
58
vector<plugin::Module *> plugin::Registry::getList(bool active)
59
59
{
60
 
  plugin::Handle *plugin= NULL;
61
 
 
62
 
  vector <plugin::Handle *> plugins;
63
 
  plugins.reserve(handle_map.size());
64
 
 
65
 
  map<string, plugin::Handle *>::iterator map_iter;
66
 
  for (map_iter= handle_map.begin();
67
 
       map_iter != handle_map.end();
 
60
  plugin::Module *plugin= NULL;
 
61
 
 
62
  vector <plugin::Module *> plugins;
 
63
  plugins.reserve(module_map.size());
 
64
 
 
65
  map<string, plugin::Module *>::iterator map_iter;
 
66
  for (map_iter= module_map.begin();
 
67
       map_iter != module_map.end();
68
68
       map_iter++)
69
69
  {
70
70
    plugin= (*map_iter).second;