~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_errmsg.h

  • Committer: Jay Pipes
  • Date: 2009-02-28 20:43:31 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 912.
  • Revision ID: jpipes@serialcoder-20090228204331-6x804cdbfzyy9w8i
Merged in remove-timezone work

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
1
/*
 
2
 -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
3
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
 
4
 
4
5
 *  Definitions required for Error Message plugin
5
 
 *
6
 
 *  Copyright (C) 2008 Sun Microsystems
 
6
 
 
7
 *  Copyright (C) 2008 Mark Atwood
7
8
 *
8
9
 *  This program is free software; you can redistribute it and/or modify
9
10
 *  it under the terms of the GNU General Public License as published by
19
20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
21
 */
21
22
 
22
 
#ifndef DRIZZLED_PLUGIN_ERROR_MESSAGE_H
23
 
#define DRIZZLED_PLUGIN_ERROR_MESSAGE_H
24
 
 
25
 
#include "drizzled/plugin/plugin.h"
 
23
#ifndef DRIZZLED_PLUGIN_ERRMSG_H
 
24
#define DRIZZLED_PLUGIN_ERRMSG_H
26
25
 
27
26
#include <stdarg.h>
28
27
 
29
 
#include <string>
30
 
 
31
 
namespace drizzled
32
 
{
33
 
class Session;
34
 
 
35
 
namespace plugin
36
 
{
37
 
 
38
 
class ErrorMessage : public Plugin
39
 
{
40
 
  ErrorMessage();
41
 
  ErrorMessage(const ErrorMessage &);
42
 
  ErrorMessage& operator=(const ErrorMessage &);
43
 
public:
44
 
  explicit ErrorMessage(std::string name_arg)
45
 
   : Plugin(name_arg, "ErrorMessage")
46
 
  {}
47
 
  virtual ~ErrorMessage() {}
48
 
 
49
 
  virtual bool errmsg(Session *session, int priority,
50
 
                      const char *format, va_list ap)=0;
51
 
 
52
 
  static bool addPlugin(plugin::ErrorMessage *handler);
53
 
  static void removePlugin(plugin::ErrorMessage *handler);
54
 
 
55
 
  static bool vprintf(Session *session, int priority, char const *format,
56
 
                      va_list ap);
57
 
};
58
 
 
59
 
} /* namespace plugin */
60
 
} /* namespace drizzled */
61
 
 
62
 
#endif /* DRIZZLED_PLUGIN_ERROR_MESSAGE_H */
 
28
typedef struct errmsg_st
 
29
{
 
30
  bool (*errmsg_func)(Session *session, int priority, const char *format, va_list ap);
 
31
} errmsg_t;
 
32
 
 
33
#endif /* DRIZZLED_PLUGIN_ERRMSG_H */