1 | /* |
2 | Copyright (c) 2000, 2010, Oracle and/or its affiliates. |
3 | |
4 | This program is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by |
6 | the Free Software Foundation; version 2 of the License. |
7 | |
8 | This program is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | GNU General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU General Public License |
14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
16 | |
17 | #ifndef _mysys_err_h |
18 | #define _mysys_err_h |
19 | |
20 | #ifdef __cplusplus |
21 | extern "C" { |
22 | #endif |
23 | |
24 | #define GLOBERRS (EE_ERROR_LAST - EE_ERROR_FIRST + 1) /* Nr of global errors */ |
25 | #define EE(X) (globerrs[(X) - EE_ERROR_FIRST]) |
26 | |
27 | extern const char *globerrs[]; /* my_error_messages is here */ |
28 | |
29 | /* Error message numbers in global map */ |
30 | /* |
31 | Do not add error numbers before EE_ERROR_FIRST. |
32 | If necessary to add lower numbers, change EE_ERROR_FIRST accordingly. |
33 | |
34 | We start with error 1 to not confuse peoples with 'error 0' |
35 | */ |
36 | |
37 | #define EE_ERROR_FIRST 1 /*Copy first error nr.*/ |
38 | #define EE_CANTCREATEFILE 1 |
39 | #define EE_READ 2 |
40 | #define EE_WRITE 3 |
41 | #define EE_BADCLOSE 4 |
42 | #define EE_OUTOFMEMORY 5 |
43 | #define EE_DELETE 6 |
44 | #define EE_LINK 7 |
45 | #define EE_EOFERR 9 |
46 | #define EE_CANTLOCK 10 |
47 | #define EE_CANTUNLOCK 11 |
48 | #define EE_DIR 12 |
49 | #define EE_STAT 13 |
50 | #define EE_CANT_CHSIZE 14 |
51 | #define EE_CANT_OPEN_STREAM 15 |
52 | #define EE_GETWD 16 |
53 | #define EE_SETWD 17 |
54 | #define EE_LINK_WARNING 18 |
55 | #define EE_OPEN_WARNING 19 |
56 | #define EE_DISK_FULL 20 |
57 | #define EE_CANT_MKDIR 21 |
58 | #define EE_UNKNOWN_CHARSET 22 |
59 | #define EE_OUT_OF_FILERESOURCES 23 |
60 | #define EE_CANT_READLINK 24 |
61 | #define EE_CANT_SYMLINK 25 |
62 | #define EE_REALPATH 26 |
63 | #define EE_SYNC 27 |
64 | #define EE_UNKNOWN_COLLATION 28 |
65 | #define EE_FILENOTFOUND 29 |
66 | #define EE_FILE_NOT_CLOSED 30 |
67 | #define EE_CHANGE_OWNERSHIP 31 |
68 | #define EE_CHANGE_PERMISSIONS 32 |
69 | #define EE_CANT_SEEK 33 |
70 | #define EE_CANT_CHMOD 34 |
71 | #define EE_CANT_COPY_OWNERSHIP 35 |
72 | #define EE_ERROR_LAST 35 /* Copy last error nr */ |
73 | |
74 | /* Add error numbers before EE_ERROR_LAST and change it accordingly. */ |
75 | |
76 | /* exit codes for all MySQL programs */ |
77 | |
78 | #define EXIT_UNSPECIFIED_ERROR 1 |
79 | #define EXIT_UNKNOWN_OPTION 2 |
80 | #define EXIT_AMBIGUOUS_OPTION 3 |
81 | #define EXIT_NO_ARGUMENT_ALLOWED 4 |
82 | #define EXIT_ARGUMENT_REQUIRED 5 |
83 | #define EXIT_VAR_PREFIX_NOT_UNIQUE 6 |
84 | #define EXIT_UNKNOWN_VARIABLE 7 |
85 | #define EXIT_OUT_OF_MEMORY 8 |
86 | #define EXIT_UNKNOWN_SUFFIX 9 |
87 | #define EXIT_NO_PTR_TO_VARIABLE 10 |
88 | #define EXIT_CANNOT_CONNECT_TO_SERVICE 11 |
89 | #define EXIT_OPTION_DISABLED 12 |
90 | #define EXIT_ARGUMENT_INVALID 13 |
91 | |
92 | #ifdef __cplusplus |
93 | } |
94 | #endif |
95 | #endif |
96 | |