Lookup an error by code in the global_error_names array. @param code the code to lookup @param [out] name_ptr the error name, when found @param [out] msg_ptr the error text, when found @return 1 when found, otherwise 0 */
| 168 | @return 1 when found, otherwise 0 |
| 169 | */ |
| 170 | int get_ER_error_msg(uint code, const char **name_ptr, const char **msg_ptr) |
| 171 | { |
| 172 | st_error *tmp_error; |
| 173 | |
| 174 | tmp_error= & global_error_names[0]; |
| 175 | |
| 176 | while (tmp_error->name != NULL) |
| 177 | { |
| 178 | if (tmp_error->code == code) |
| 179 | { |
| 180 | *name_ptr= tmp_error->name; |
| 181 | *msg_ptr= tmp_error->text; |
| 182 | return 1; |
| 183 | } |
| 184 | tmp_error++; |
| 185 | } |
| 186 | |
| 187 | return 0; |
| 188 | } |
| 189 | |
| 190 | #if defined(__WIN__) |
| 191 | static my_bool print_win_error_msg(DWORD error, my_bool verbose) |