home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / dax1.exe / CP / CPDBG.H < prev    next >
Text File  |  1992-07-15  |  3KB  |  93 lines

  1. //   ╔════════════════════════════════════════════════════════════════════╗
  2. //   ║                                                                    ║
  3. //   ║ module:      cpdbg.h                                               ║
  4. //   ║                                                                    ║
  5. //   ║  This software is provided as is and carries no warranty           ║
  6. //   ║  whatsoever.  Novell disclaims and excludes any and all implied    ║
  7. //   ║  warranties of merchantability, title and fitness for a particular ║
  8. //   ║  purpose.  Novell does not warrant that the software will satisfy  ║
  9. //   ║  your requirements or that the software is without defect or error ║
  10. //   ║  or that operation of the software will be uninterrupted.  You are ║
  11. //   ║  using the software at your risk.  The software is not a product   ║
  12. //   ║  of Novell, Inc. or any of subsidiaries.                           ║
  13. //   ║                                                                    ║
  14. //   ╟────────────────────────────────────────────────────────────────────╢
  15. //   ║ maintenance history:                                               ║
  16. //   ║ level    date      pi   description                                ║
  17. //   ╟────────────────────────────────────────────────────────────────────╢
  18. //   ║  001   01/24/92    kl   initial release.                           ║
  19. //   ║  002   07/14/92    kl   windows port.                              ║
  20. //   ╚════════════════════════════════════════════════════════════════════╝
  21.  
  22. #if !defined(CPDBG)
  23. #define CPDBG
  24.  
  25. //
  26. //  DEBUG 1 - Level 1 *Error* type messages only
  27. //  DEBUG 2 - Level 2 *Warning* type messages and level 1
  28. //  DEBUG 3 - Level 3 Informational type messages and level's 1,2
  29. //  DEBUG 4 - Level 4 Debugging type messages and level's 1,2,3
  30. //
  31.  
  32.  
  33. #if defined(DEBUG)
  34. #   if DEBUG == 1
  35. #       define DEBUG1(x)   x
  36. #       define DEBUG2   
  37. #       define DEBUG3   
  38. #       define DEBUG4   
  39. #   elif DEBUG == 2
  40. #       define DEBUG1(x)   x
  41. #       define DEBUG2(x)   x
  42. #       define DEBUG3(x)
  43. #       define DEBUG4(x)
  44. #   elif DEBUG == 3
  45. #       define DEBUG1(x)   x
  46. #       define DEBUG2(x)   x
  47. #       define DEBUG3(x)   x
  48. #       define DEBUG4(x)
  49. #   elif DEBUG == 4
  50. #       define DEBUG1(x)   x
  51. #       define DEBUG2(x)   x
  52. #       define DEBUG3(x)   x
  53. #       define DEBUG4(x)   x
  54. #   else
  55. #       define DEBUG1(x)
  56. #       define DEBUG2(x)
  57. #       define DEBUG3(x)
  58. #       define DEBUG4(x)
  59. #   endif
  60. #else                   // defined(DEBUG)
  61. #   define DEBUG1(x)
  62. #   define DEBUG2(x)
  63. #   define DEBUG3(x)
  64. #   define DEBUG4(x)
  65. #endif                  // defined(DEBUG)
  66.  
  67. //
  68. //  The following macros will execute expressions depending on what the
  69. //  debug level is set to.
  70. //
  71. #define xDIAG1(x)       DEBUG1(x)
  72. #define xDIAG2(x)       DEBUG2(x)
  73. #define xDIAG3(x)       DEBUG3(x)
  74. #define xDIAG4(x)       DEBUG4(x)
  75.  
  76. #define DIAG1(x)        xDIAG1(CPprintf(x "\n"))
  77. #define DIAG2(x)        xDIAG2(CPprintf(x "\n"))
  78. #define DIAG3(x)        xDIAG3(CPprintf(x "\n"))
  79. #define DIAG4(x)        xDIAG4(CPprintf(x "\n"))
  80.  
  81. #define HEXDIAG1(x,y)   xDIAG1(CPprintf(x "(%X)\n",y))
  82. #define HEXDIAG2(x,y)   xDIAG2(CPprintf(x "(%X)\n",y))
  83. #define HEXDIAG3(x,y)   xDIAG3(CPprintf(x "(%X)\n",y))
  84. #define HEXDIAG4(x,y)   xDIAG4(CPprintf(x "(%X)\n",y))
  85.  
  86. #if defined(ENGINE)
  87. #   define CPprintf    _CPioRoutine
  88. #else
  89. #   define CPprintf    printf
  90. #endif
  91.  
  92. #endif
  93.