showmsg.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright (c) Athena Dev Teams - Licensed under GNU GPL
  2. // For more information, see LICENCE in the main folder
  3. #ifndef _SHOWMSG_H_
  4. #define _SHOWMSG_H_
  5. #define SHOW_DEBUG_MSG 1
  6. // for help with the console colors look here:
  7. // http://www.edoceo.com/liberum/?doc=printf-with-color
  8. // some code explanation (used here):
  9. // \033[2J : clear screen and go up/left (0, 0 position)
  10. // \033[K : clear line from actual position to end of the line
  11. // \033[0m : reset color parameter
  12. // \033[1m : use bold for font
  13. #ifdef _WIN32
  14. #define CL_RESET ""
  15. #define CL_CLS ""
  16. #define CL_CLL ""
  17. #define CL_BOLD ""
  18. #define CL_NORMAL CL_RESET
  19. #define CL_NONE CL_RESET
  20. #define CL_WHITE ""
  21. #define CL_GRAY ""
  22. #define CL_RED ""
  23. #define CL_GREEN ""
  24. #define CL_YELLOW ""
  25. #define CL_BLUE ""
  26. #define CL_MAGENTA ""
  27. #define CL_CYAN ""
  28. #define CL_BT_YELLOW ""
  29. #define CL_WTBL ""
  30. #define CL_XXBL ""
  31. #define CL_PASS ""
  32. #else
  33. #define CL_RESET "\033[0;0m"
  34. #define CL_CLS "\033[2J"
  35. #define CL_CLL "\033[K"
  36. // font settings
  37. #define CL_BOLD "\033[1m"
  38. #define CL_NORMAL CL_RESET
  39. #define CL_NONE CL_RESET
  40. #define CL_WHITE "\033[1;37m"
  41. #define CL_GRAY "\033[1;30m"
  42. #define CL_RED "\033[1;31m"
  43. #define CL_GREEN "\033[1;32m"
  44. #define CL_YELLOW "\033[1;33m"
  45. #define CL_BLUE "\033[1;34m"
  46. #define CL_MAGENTA "\033[1;35m"
  47. #define CL_CYAN "\033[1;36m"
  48. #define CL_BT_YELLOW "\033[1;33m"
  49. #define CL_WTBL "\033[37;44m" // white on blue
  50. #define CL_XXBL "\033[0;44m" // default on blue
  51. #define CL_PASS "\033[0;32;42m" // green on green
  52. #endif
  53. extern int msg_silent; //Specifies how silent the console is. [Skotlex]
  54. extern char timestamp_format[20]; //For displaying Timestamps [Skotlex]
  55. extern char tmp_output[1024];
  56. enum msg_type {
  57. MSG_NONE,
  58. MSG_STATUS,
  59. MSG_SQL,
  60. MSG_INFORMATION,
  61. MSG_NOTICE,
  62. MSG_WARNING,
  63. MSG_DEBUG,
  64. MSG_ERROR,
  65. MSG_FATALERROR
  66. };
  67. extern void ClearScreen(void);
  68. extern int ShowMessage(const char *, ...);
  69. extern int ShowStatus(const char *, ...);
  70. extern int ShowSQL(const char *, ...);
  71. extern int ShowInfo(const char *, ...);
  72. extern int ShowNotice(const char *, ...);
  73. extern int ShowWarning(const char *, ...);
  74. extern int ShowDebug(const char *, ...);
  75. extern int ShowError(const char *, ...);
  76. extern int ShowFatalError(const char *, ...);
  77. #endif