00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ERROR_HH
00027 #define ERROR_HH
00028
00029 #include <stdio.h>
00030 #include <errno.h>
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00037 void ErrorInit(int _msgLevel);
00038
00041 void DefaultErrorPrint(int msgType, int level, const char *file, int line, const char *fmt, ...);
00042
00043 extern void (*ErrorPrint)(int msgType, int level, const char *file, int line, const char *fmt, ...);
00044 extern int msgLevel;
00045
00046
00047 extern FILE *msgFile;
00048
00049 #ifdef __cplusplus
00050 }
00051 #endif
00052
00053
00055 #define PLAYER_ERR_ERR 0
00056 #define PLAYER_ERR_WARN 1
00057 #define PLAYER_ERR_MSG 2
00058 #define PLAYER_ERR_DBG 2
00059
00063
00064 #define PLAYER_ERROR(msg) ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n")
00065 #define PLAYER_ERROR1(msg, a) ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a)
00066 #define PLAYER_ERROR2(msg, a, b) ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b)
00067 #define PLAYER_ERROR3(msg, a, b, c) ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c)
00068 #define PLAYER_ERROR4(msg, a, b, c,d) ErrorPrint(PLAYER_ERR_ERR, 0, __FILE__, __LINE__, "error : " msg "\n", a, b, c, d)
00069
00071 #define PLAYER_WARN(msg) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n")
00072 #define PLAYER_WARN1(msg, a) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a)
00073 #define PLAYER_WARN2(msg, a, b) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b)
00074 #define PLAYER_WARN3(msg, a, b, c) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c)
00075 #define PLAYER_WARN4(msg, a, b, c, d) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d)
00076 #define PLAYER_WARN5(msg, a, b, c, d, e) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e)
00077 #define PLAYER_WARN6(msg, a, b, c, d, e, f) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e, f)
00078 #define PLAYER_WARN7(msg, a, b, c, d, e, f, g) ErrorPrint(PLAYER_ERR_WARN, 0, __FILE__, __LINE__, "warning : " msg "\n", a, b, c, d, e, f, g)
00079
00087 #define PLAYER_MSG0(level, msg) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n")
00088 #define PLAYER_MSG1(level, msg, a) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a)
00089 #define PLAYER_MSG2(level, msg, a, b) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b)
00090 #define PLAYER_MSG3(level, msg, a, b, c) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c)
00091 #define PLAYER_MSG4(level, msg, a, b, c, d) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d)
00092 #define PLAYER_MSG5(level, msg, a, b, c, d, e) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e)
00093 #define PLAYER_MSG6(level, msg, a, b, c, d, e, f) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f)
00094 #define PLAYER_MSG7(level, msg, a, b, c, d, e, f, g) ErrorPrint(PLAYER_ERR_MSG, level, __FILE__, __LINE__, "" msg "\n", a, b, c, d, e, f, g)
00095
00098 #endif