Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
3.0 KiB

  1. //****************************************************************************
  2. //
  3. // Module: ICSMGR.DLL
  4. // File: debug.h
  5. // Content: This file contains the debug definitions
  6. //
  7. // Revision History:
  8. //
  9. // Date
  10. // -------- ---------- -------------------------------------------------------
  11. // 03/24/97 bjohnson Created
  12. //
  13. //****************************************************************************
  14. #ifndef __ICQ_DBG_H_
  15. #define __ICQ_DBG_H_
  16. //
  17. // Name of this overall binary
  18. //
  19. #define SZ_MODULE "ICQ: "
  20. #define TRACE_FLAG_ICQ ((ULONG)0x08000000 | TRACE_USE_MASK)
  21. //****************************************************************************
  22. // Typedef's
  23. //****************************************************************************
  24. typedef struct _DEBUG_MODULE_INFO {
  25. ULONG dwModule;
  26. ULONG dwLevel;
  27. TCHAR szModuleName[80];
  28. TCHAR szDebugKey[80];
  29. } DEBUG_MODULE_INFO, *PDEBUG_MODULE_INFO;
  30. //****************************************************************************
  31. // Extern
  32. //****************************************************************************
  33. extern char g_szComponent[];
  34. extern DEBUG_MODULE_INFO gDebugInfo[];
  35. //
  36. // Trace Modules
  37. //
  38. #define TM_DEFAULT 0
  39. #define TM_BUF 1
  40. #define TM_API 2
  41. #define TM_IO 3
  42. #define TM_MSG 4
  43. #define TM_REF 5
  44. #define TM_TEST 6
  45. #define TM_CON 7
  46. #define TM_IF 8
  47. #define TM_PRX 9
  48. #define TM_SYNC 10
  49. #define TM_DISP 11
  50. #define TM_SOCK 12
  51. #define TM_LIST 13
  52. #define TM_PROF 14
  53. #define TM_TIMER 15
  54. //
  55. // Trace Levels
  56. //
  57. #define TL_NONE 0
  58. #define TL_CRIT 1
  59. #define TL_ERROR 2
  60. #define TL_INFO 3
  61. #define TL_TRACE 4
  62. #define TL_DUMP 5
  63. #if DBG
  64. #define DBG_TRACE(_mod_,_lev_,_msg_) if ((_lev_)<=gDebugInfo[_mod_].dwLevel)\
  65. { DbgPrintX _msg_ ; }
  66. #define ICQ_TRC(_mod_,_lev_,_msg_) if ((_lev_)<=gDebugInfo[_mod_].dwLevel)\
  67. { DbgPrintX _msg_ ; }
  68. #define PROFILER(_MOD_, _LEV_, _MSG_) \
  69. if( ((_LEV_) <= gDebugInfo[_MOD_].dwLevel) && \
  70. ((_LEV_) <= gDebugInfo[TM_PROF].dwLevel) \
  71. ) \
  72. { DbgPrintX _MSG_; }
  73. #define ASSERT(_X_) \
  74. if(!(_X_)) { \
  75. DbgPrintX("Line %s, File %s", __LINE__, __LINE__); \
  76. ErrorOut(); \
  77. DebugBreak(); \
  78. }
  79. #else // DBG
  80. #define DBG_TRACE(_mod_, lev, _msg_)
  81. #define ICQ_TRC(_mod_, lev, _msg_)
  82. #define PROFILER(_MOD_, _LEV_, _MSG_)
  83. #define ASSERT(_X_) if(!(_X_)) exit(1)
  84. #endif
  85. //****************************************************************************
  86. // Prototypes
  87. //****************************************************************************
  88. void DbgPrintX(LPCSTR pszMsg, ...);
  89. void InitDebuger(void);
  90. void DestroyDebuger(void);
  91. #endif // __ICQ_DBG_H_