~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
/* Copyright (C) 2000-2005 MySQL AB
2
3
   This program is free software; you can redistribute it and/or modify
4
   it under the terms of the GNU General Public License as published by
5
   the Free Software Foundation; version 2 of the License.
6
7
   This program is distributed in the hope that it will be useful,
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
   GNU General Public License for more details.
11
12
   You should have received a copy of the GNU General Public License
13
   along with this program; if not, write to the Free Software
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
16
17
/**
18
  @file
19
20
  @brief
21
  Read language depeneded messagefile
22
*/
23
243.1.17 by Jay Pipes
FINAL PHASE removal of mysql_priv.h (Bye, bye my friend.)
24
#include <drizzled/server_includes.h>
212.5.13 by Monty Taylor
Moved my_sys/my_pthread/my_nosys and mysys_err to mysys.
25
#include <mysys/mysys_err.h>
202.3.6 by Monty Taylor
First pass at gettexizing the error messages.
26
#include <drizzled/drizzled_error_messages.h>
1 by brian
clean slate
27
28
static void init_myfunc_errs(void);
29
202.3.6 by Monty Taylor
First pass at gettexizing the error messages.
30
31
1 by brian
clean slate
32
/**
33
  Read messages from errorfile.
34
35
  This function can be called multiple times to reload the messages.
36
  If it fails to load the messages, it will fail softly by initializing
37
  the errmesg pointer to an array of empty strings or by keeping the
38
  old array if it exists.
39
40
  @retval
41
    FALSE       OK
42
  @retval
43
    TRUE        Error
44
*/
45
46
bool init_errmessage(void)
47
{
48
49
  /* Register messages for use with my_error(). */
202.3.6 by Monty Taylor
First pass at gettexizing the error messages.
50
  if (my_error_register(drizzled_error_messages,
51
                        ER_ERROR_FIRST, ER_ERROR_LAST))
1 by brian
clean slate
52
  {
51.1.18 by Jay Pipes
Removed/replaced DBUG symbols and fixed FALSE/TRUEs
53
    return(true);
1 by brian
clean slate
54
  }
55
56
  init_myfunc_errs();			/* Init myfunc messages */
51.1.18 by Jay Pipes
Removed/replaced DBUG symbols and fixed FALSE/TRUEs
57
  return(false);
1 by brian
clean slate
58
}
59
60
61
/**
62
  Initiates error-messages used by my_func-library.
63
*/
64
65
static void init_myfunc_errs()
66
{
67
  init_glob_errs();			/* Initiate english errors */
362 by Brian Aker
No more dead special flags...
68
1 by brian
clean slate
69
  {
70
    EE(EE_FILENOTFOUND)   = ER(ER_FILE_NOT_FOUND);
71
    EE(EE_CANTCREATEFILE) = ER(ER_CANT_CREATE_FILE);
72
    EE(EE_READ)           = ER(ER_ERROR_ON_READ);
73
    EE(EE_WRITE)          = ER(ER_ERROR_ON_WRITE);
74
    EE(EE_BADCLOSE)       = ER(ER_ERROR_ON_CLOSE);
75
    EE(EE_OUTOFMEMORY)    = ER(ER_OUTOFMEMORY);
76
    EE(EE_DELETE)         = ER(ER_CANT_DELETE_FILE);
77
    EE(EE_LINK)           = ER(ER_ERROR_ON_RENAME);
78
    EE(EE_EOFERR)         = ER(ER_UNEXPECTED_EOF);
79
    EE(EE_CANTLOCK)       = ER(ER_CANT_LOCK);
80
    EE(EE_DIR)            = ER(ER_CANT_READ_DIR);
81
    EE(EE_STAT)           = ER(ER_CANT_GET_STAT);
82
    EE(EE_GETWD)          = ER(ER_CANT_GET_WD);
83
    EE(EE_SETWD)          = ER(ER_CANT_SET_WD);
84
    EE(EE_DISK_FULL)      = ER(ER_DISK_FULL);
85
  }
86
}