~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin_errmsg.h

  • Committer: Monty Taylor
  • Date: 2009-03-03 07:39:39 UTC
  • mto: This revision was merged to the branch mainline in revision 910.
  • Revision ID: mordred@inaugust.com-20090303073939-rfswfdo68klfcp1o
Updated comment version indicators to handle drizzle versions.

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, Inc.
 
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>
26
 
#include <drizzled/error/level_t.h>
 
23
#ifndef DRIZZLED_PLUGIN_ERRMSG_H
 
24
#define DRIZZLED_PLUGIN_ERRMSG_H
27
25
 
28
26
#include <stdarg.h>
29
27
 
30
 
#include <string>
31
 
 
32
 
#include <drizzled/visibility.h>
33
 
 
34
 
namespace drizzled
35
 
{
36
 
 
37
 
namespace plugin
38
 
{
39
 
 
40
 
class DRIZZLED_API ErrorMessage : public Plugin
41
 
{
42
 
  ErrorMessage();
43
 
  ErrorMessage(const ErrorMessage &);
44
 
  ErrorMessage& operator=(const ErrorMessage &);
45
 
 
46
 
public:
47
 
  explicit ErrorMessage(std::string name_arg)
48
 
   : Plugin(name_arg, "ErrorMessage")
49
 
  {}
50
 
  virtual ~ErrorMessage() {}
51
 
 
52
 
  virtual bool errmsg(error::level_t priority, const char *format, va_list ap)=0;
53
 
 
54
 
  static bool addPlugin(plugin::ErrorMessage *handler);
55
 
  static void removePlugin(plugin::ErrorMessage *handler);
56
 
 
57
 
  static bool vprintf(error::level_t priority, char const *format, va_list ap);
58
 
 
59
 
  bool removeLast() const
60
 
  {
61
 
    return true;
62
 
  }
63
 
};
64
 
 
65
 
} /* namespace plugin */
66
 
} /* namespace drizzled */
67
 
 
68
 
#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 */