1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
-*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
3
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
5
* Definitions required for Error Message plugin
6
* Copyright (C) 2008 Sun Microsystems
7
* Copyright (C) 2008 Mark Atwood
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
22
#ifndef DRIZZLED_PLUGIN_ERROR_MESSAGE_H
23
#define DRIZZLED_PLUGIN_ERROR_MESSAGE_H
25
#include "drizzled/plugin/plugin.h"
23
#ifndef DRIZZLED_PLUGIN_ERRMSG_H
24
#define DRIZZLED_PLUGIN_ERRMSG_H
27
26
#include <stdarg.h>
38
class ErrorMessage : public Plugin
41
ErrorMessage(const ErrorMessage &);
42
ErrorMessage& operator=(const ErrorMessage &);
44
explicit ErrorMessage(std::string name_arg)
45
: Plugin(name_arg, "ErrorMessage")
47
virtual ~ErrorMessage() {}
49
virtual bool errmsg(Session *session, int priority,
50
const char *format, va_list ap)=0;
52
static bool addPlugin(plugin::ErrorMessage *handler);
53
static void removePlugin(plugin::ErrorMessage *handler);
55
static bool vprintf(Session *session, int priority, char const *format,
59
} /* namespace plugin */
60
} /* namespace drizzled */
62
#endif /* DRIZZLED_PLUGIN_ERROR_MESSAGE_H */
28
typedef struct errmsg_st
30
bool (*errmsg_func)(Session *session, int priority, const char *format, va_list ap);
33
#endif /* DRIZZLED_PLUGIN_ERRMSG_H */