diff options
Diffstat (limited to 'src/common/showmsg.h')
-rw-r--r-- | src/common/showmsg.h | 93 |
1 files changed, 50 insertions, 43 deletions
diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 1c4a2dfcb..b5f4d4bfd 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -1,50 +1,57 @@ #ifndef _SHOWMSG_H_ #define _SHOWMSG_H_ -extern char tmp_output[1024]; - -enum msg_type {MSG_STATUS,/* MSG_SQL, */MSG_INFORMATION,MSG_NOTICE,MSG_WARNING,MSG_ERROR,MSG_FATALERROR}; - -extern int _ShowMessage(const char *string, enum msg_type flag); - -/* MSG_XX */ - #define ShowMsg(string,flag) _ShowMessage(string,flag) -// #define DisplayMsg(string,flag) _ShowMessage(string,flag) - #define ShowMessage(string,flag) _ShowMessage(string,flag) - -/* MSG_STATUS */ - #define ShowStatus(string) _ShowMessage(string,MSG_STATUS) -// #define DisplayStatus(string) _ShowMessage(string,MSG_STATUS) - -/* MSG_SQL*/ -// #define ShowSQL(string) _ShowMessage(string,MSG_SQL) -// #define DisplaySQL(string) _ShowMessage(string,MSG_SQL) - -/* MSG_INFORMATION */ - #define ShowInfo(string) _ShowMessage(string,MSG_INFORMATION) -// #define DisplayInfo(string) _ShowMessage(string,MSG_INFORMATION) -// #define ShowInformation(string) _ShowMessage(string,MSG_INFORMATION) -// #define DisplayInformation(string) _ShowMessage(string,MSG_INFORMATION) - -/* MSG_NOTICE */ - #define ShowNotice(string) _ShowMessage(string,MSG_NOTICE) -// #define DisplayNotice(string) _ShowMessage(string,MSG_NOTICE) - -/* */ - #define ShowWarning(string) _ShowMessage(string,MSG_WARNING) -// #define DisplayWarning(string) _ShowMessage(string,MSG_WARNING) -// #define Warn(string) _ShowMessage(string,MSG_WARNING) +//davidsiaw, 'lookee' here! +#define SHOW_DEBUG_MSG 1 + +#ifdef _WIN32 +#define CL_RESET "" +#define CL_NORMAL CL_RESET +#define CL_NONE CL_RESET +#define CL_WHITE "" +#define CL_GRAY "" +#define CL_RED "" +#define CL_GREEN "" +#define CL_YELLOW "" +#define CL_BLUE "" +#define CL_MAGENTA "" +#define CL_CYAN "" +#else +#define CL_RESET "\033[0;0m" +#define CL_NORMAL CL_RESET +#define CL_NONE CL_RESET +#define CL_WHITE "\033[1;29m" +#define CL_GRAY "\033[1;30m" +#define CL_RED "\033[1;31m" +#define CL_GREEN "\033[1;32m" +#define CL_YELLOW "\033[1;33m" +#define CL_BLUE "\033[1;34m" +#define CL_MAGENTA "\033[1;35m" +#define CL_CYAN "\033[1;36m" +#endif -/* MSG_ERROR */ - #define ShowError(string) _ShowMessage(string,MSG_ERROR) -// #define DisplayError(string) _ShowMessage(string,MSG_ERROR) -// #define OutputError(string) _ShowMessage(string,MSG_ERROR) +extern char tmp_output[1024]; -/* MSG_FATALERROR */ - #define ShowFatalError(string) _ShowMessage(string,MSG_FATALERROR) -// #define DisplayFatalError(string) _ShowMessage(string,MSG_ERROR) -// #define Terminate(string) _ShowMessage(string,MSG_FATALERROR) -// #define Kill(string) _ShowMessage(string,MSG_FATALERROR) -// #define AbortEx(string) _ShowMessage(string,MSG_FATALERROR) +enum msg_type { + MSG_NONE, + MSG_STATUS, + MSG_SQL, + MSG_INFORMATION, + MSG_NOTICE, + MSG_WARNING, + MSG_DEBUG, + MSG_ERROR, + MSG_FATALERROR +}; + +extern int ShowMessage(const char *, ...); +extern int ShowStatus(const char *, ...); +extern int ShowSQL(const char *, ...); +extern int ShowInfo(const char *, ...); +extern int ShowNotice(const char *, ...); +extern int ShowWarning(const char *, ...); +extern int ShowDebug(const char *, ...); +extern int ShowError(const char *, ...); +extern int ShowFatalError(const char *, ...); #endif |