~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_handler_errors.h

  • Committer: Monty Taylor
  • Date: 2008-08-04 19:37:18 UTC
  • mto: (261.2.2 codestyle)
  • mto: This revision was merged to the branch mainline in revision 262.
  • Revision ID: monty@inaugust.com-20080804193718-f0rz13uli4429ozb
Changed gettext_noop() to N_()

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
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
8
 
 *  the Free Software Foundation; version 2 of the License.
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
 
 
20
 
#include <drizzled/base.h>
21
 
#include <storage/myisam/my_handler.h>
22
 
 
23
 
#include <drizzled/gettext.h>
 
1
#include <libdrizzle/gettext.h>
24
2
 
25
3
/*
26
4
  Errors a handler can give you
35
13
  /* HA_ERR_INTERNAL_ERROR */
36
14
  N_("Internal (unspecified) error in handler"),
37
15
  /* HA_ERR_RECORD_CHANGED */
38
 
  N_("Someone has changed the row since it was read (while the table "
39
 
     "was locked to prevent it)"),
 
16
  N_("Someone has changed the row since it was read (while the table was locked to prevent it)"),
40
17
  /* HA_ERR_WRONG_INDEX */
41
18
  N_("Wrong index given to function"),
42
19
  /* empty */
153
130
  N_("Tablespace not empty") /* TODO: get a better message */
154
131
};
155
132
 
156
 
 
157
 
/*
158
 
  Register handler error messages for usage with my_error()
159
 
 
160
 
  NOTES
161
 
    This is safe to call multiple times as my_error_register()
162
 
    will ignore calls to register already registered error numbers.
163
 
*/
164
 
 
165
 
 
166
 
void my_handler_error_register(void)
167
 
{
168
 
  /*
169
 
    If you got compilation error here about compile_time_assert array, check
170
 
    that every HA_ERR_xxx constant has a corresponding error message in
171
 
    handler_error_messages[] list (check mysys/ma_handler_errors.h and
172
 
    include/my_base.h).
173
 
 
174
 
    TODO: Remove fix the handler_error_messages so that this hack isn't 
175
 
          necessary.
176
 
  */
177
 
#ifdef __GNUC__
178
 
  char compile_time_assert[(HA_ERR_FIRST +
179
 
                            array_elements(handler_error_messages) ==
180
 
                            HA_ERR_LAST + 1) ? 1 : -1]
181
 
    __attribute__ ((__unused__));
182
 
#endif
183
 
  my_error_register(handler_error_messages, HA_ERR_FIRST,
184
 
                    HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
185
 
}
186
 
 
187
 
 
188
 
void my_handler_error_unregister(void)
189
 
{
190
 
  my_error_unregister(HA_ERR_FIRST,
191
 
                      HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
192
 
}