~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Brian Aker
  • Date: 2009-04-13 16:22:40 UTC
  • mfrom: (971.1.78 mordred)
  • Revision ID: brian@gaz-20090413162240-ugi3gvhofmcuglzl
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <drizzled/registry.h>
29
29
#include <drizzled/unireg.h>
30
30
#include <drizzled/data_home.h>
 
31
#include <drizzled/plugin_registry.h>
31
32
#include <string>
32
33
 
33
34
#include CSTDINT_H
36
37
 
37
38
drizzled::Registry<StorageEngine *> all_engines;
38
39
 
39
 
static void add_storage_engine(StorageEngine *engine)
 
40
void add_storage_engine(StorageEngine *engine)
40
41
{
41
42
  all_engines.add(engine);
42
43
}
43
44
 
44
 
static void remove_storage_engine(StorageEngine *engine)
 
45
void remove_storage_engine(StorageEngine *engine)
45
46
{
46
47
  all_engines.remove(engine);
47
48
}
453
454
                         db, name, "", 0);
454
455
    if (table_proto_exists(path)==EEXIST)
455
456
    {
456
 
      drizzle::Table table;
 
457
      drizzled::message::Table table;
457
458
      build_table_filename(path, sizeof(path),
458
459
                           db, name, ".dfe", 0);
459
460
      if(drizzle_read_table_proto(path, &table)==0)
682
683
}
683
684
 
684
685
 
685
 
int storage_engine_finalizer(st_plugin_int *plugin)
686
 
{
687
 
  StorageEngine *engine= static_cast<StorageEngine *>(plugin->data);
688
 
 
689
 
  remove_storage_engine(engine);
690
 
 
691
 
  if (engine && plugin->plugin->deinit)
692
 
    (void)plugin->plugin->deinit(engine);
693
 
 
694
 
  return(0);
695
 
}
696
 
 
697
 
 
698
 
int storage_engine_initializer(st_plugin_int *plugin)
699
 
{
700
 
  StorageEngine *engine= NULL;
701
 
 
702
 
  if (plugin->plugin->init)
703
 
  {
704
 
    if (plugin->plugin->init(&engine))
705
 
    {
706
 
      errmsg_printf(ERRMSG_LVL_ERROR,
707
 
                    _("Plugin '%s' init function returned error."),
708
 
                    plugin->name.str);
709
 
      return 1;
710
 
    }
711
 
  }
712
 
 
713
 
  if (engine != NULL)
714
 
    add_storage_engine(engine);
715
 
 
716
 
  plugin->data= engine;
717
 
  plugin->isInited= true;
718
 
 
719
 
  return 0;
720
 
}
721
 
 
722
686
const string ha_resolve_storage_engine_name(const StorageEngine *engine)
723
687
{
724
688
  return engine == NULL ? string("UNKNOWN") : engine->getName();