~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/errmsg_stderr/errmsg_stderr.cc

  • Committer: Stewart Smith
  • Date: 2010-02-15 01:56:32 UTC
  • mto: (1273.13.96 build)
  • mto: This revision was merged to the branch mainline in revision 1308.
  • Revision ID: stewart@flamingspork.com-20100215015632-pm7lnxfq5j5uh8kj
move DATABASE() to function plugin. modify parser so that it looks for a function named 'database' when DATABASE() is called. Special case still needed in parser due to hilarity of not-really-reserved words.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#include <drizzled/plugin/error_message.h>
22
22
#include <drizzled/gettext.h>
23
23
#include <drizzled/plugin.h>
 
24
#include <drizzled/plugin/registry.h>
24
25
 
25
26
#include <stdio.h>  /* for vsnprintf */
26
27
#include <stdarg.h>  /* for va_list */
55
56
};
56
57
 
57
58
static Error_message_stderr *handler= NULL;
58
 
static int errmsg_stderr_plugin_init(module::Context &context)
 
59
static int errmsg_stderr_plugin_init(plugin::Registry &registry)
59
60
{
60
61
  handler= new Error_message_stderr();
61
 
  context.add(handler);
62
 
 
 
62
  registry.add(handler);
 
63
 
 
64
  return 0;
 
65
}
 
66
 
 
67
static int errmsg_stderr_plugin_deinit(plugin::Registry &registry)
 
68
{
 
69
 
 
70
  if (handler)
 
71
  {
 
72
    registry.remove(handler);
 
73
    delete handler;
 
74
  }
63
75
  return 0;
64
76
}
65
77
 
72
84
  N_("Error Messages to stderr"),
73
85
  PLUGIN_LICENSE_GPL,
74
86
  errmsg_stderr_plugin_init,
 
87
  errmsg_stderr_plugin_deinit,
 
88
  NULL, /* status variables */
75
89
  NULL, /* system variables */
76
90
  NULL
77
91
}