~drizzle-trunk/drizzle/development

390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
212.5.42 by Monty Taylor
Ding dong include is dead.
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
4
 *  Copyright (C) 2008 Sun Microsystems
212.5.42 by Monty Taylor
Ding dong include is dead.
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
390.1.2 by Monty Taylor
Fixed copyright headers in drizzled/
8
 *  the Free Software Foundation; version 2 of the License.
212.5.42 by Monty Taylor
Ding dong include is dead.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 */
19
1122.2.10 by Monty Taylor
Fixed all of the include guards.
20
#ifndef DRIZZLED_ERROR_H
21
#define DRIZZLED_ERROR_H
212.5.42 by Monty Taylor
Ding dong include is dead.
22
1271.7.9 by Tim Penhey
Almost there.
23
#include <string>
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
24
#include "drizzled/definitions.h"
25
1271.6.2 by Tim Penhey
Make sure the bits from my_error.h are inside the drizzled namespace.
26
namespace drizzled
27
{
28
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
29
/* Max width of screen (for error messages) */
30
#define SC_MAXWIDTH 256
31
#define ERRMSGSIZE	(SC_MAXWIDTH)	/* Max length of a error message */
32
#define NRERRBUFFS	(2)	/* Buffers for parameters */
33
#define MY_FILE_ERROR	((size_t) -1)
34
#define ME_FATALERROR   1024    /* Fatal statement error */
35
1271.5.7 by Monty Taylor
Merged up with trunk.
36
typedef void (*error_handler_func)(uint32_t my_err,
37
                                   const char *str,
38
                                   myf MyFlags);
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
39
extern error_handler_func error_handler_hook;
1241.9.57 by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined.
40
1271.7.9 by Tim Penhey
Almost there.
41
// TODO: kill this method. Too much to do with this branch.
42
// This is called through the ER(x) macro.
549 by Monty Taylor
Took gettext.h out of header files.
43
const char * error_message(unsigned int err_index);
202.3.6 by Monty Taylor
First pass at gettexizing the error messages.
44
1271.7.9 by Tim Penhey
Almost there.
45
// Adds the message to the global error dictionary.
46
void add_error_message(uint32_t error_code, std::string const& message);
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
47
1271.7.9 by Tim Penhey
Almost there.
48
void my_error(int nr, myf MyFlags, ...);
49
void my_message(uint32_t my_err, const char *str, myf MyFlags);
1271.5.1 by Tim Penhey
Move the bits from my_error.h and my_error.cc into error.h and error.cc.
50
void my_printf_error(uint32_t my_err, const char *format,
51
                     myf MyFlags, ...)
52
                     __attribute__((format(printf, 2, 4)));
53
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
54
} /* namespace drizzled */
1271.7.4 by Tim Penhey
Another incremental commit.
55
1122.2.10 by Monty Taylor
Fixed all of the include guards.
56
#endif /* DRIZZLED_ERROR_H */