1 /* Copyright (c) 2016, MariaDB 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ 15 16 #ifndef MYSQL_SERVICE_MY_PRINT_ERROR_INCLUDED 17 #define MYSQL_SERVICE_MY_PRINT_ERROR_INCLUDED 18 19 /** 20 @file include/mysql/service_my_print_error.h 21 22 This service provides functions for plugins to report 23 errors to client (without client, the errors are written to the error log). 24 25 */ 26 #ifdef __cplusplus 27 extern "C" { 28 #endif 29 30 #ifndef MYSQL_ABI_CHECK 31 #include <stdarg.h> 32 #include <stdlib.h> 33 #endif 34 35 #define ME_ERROR_LOG 64 /* Write the message to the error log */ 36 #define ME_ERROR_LOG_ONLY 128 /* Write the error message to error log only */ 37 #define ME_NOTE 1024 /* Not an error, just a note */ 38 #define ME_WARNING 2048 /* Not an error, just a warning */ 39 #define ME_FATAL 4096 /* Fatal statement error */ 40 41 extern struct my_print_error_service_st { 42 void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...); 43 void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...); 44 void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap); 45 } *my_print_error_service; 46 47 #ifdef MYSQL_DYNAMIC_PLUGIN 48 49 #define my_error my_print_error_service->my_error_func 50 #define my_printf_error my_print_error_service->my_printf_error_func 51 #define my_printv_error(A,B,C,D) my_print_error_service->my_printv_error_func(A,B,C,D) 52 53 #else 54 extern void my_error(unsigned int nr, unsigned long MyFlags, ...); 55 extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...); 56 extern void my_printv_error(unsigned int error, const char *format, unsigned long MyFlags,va_list ap); 57 #endif /* MYSQL_DYNAMIC_PLUGIN */ 58 59 #ifdef __cplusplus 60 } 61 #endif 62 63 #endif 64 65