home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / src / wsdebug.h < prev   
Encoding:
C/C++ Source or Header  |  2001-08-27  |  1.4 KB  |  82 lines

  1. /* vi:set ts=8 sts=8 sw=8:
  2.  *
  3.  * VIM - Vi IMproved    by Bram Moolenaar
  4.  *            Visual Workshop integration by Gordon Prieur
  5.  *
  6.  * Do ":help uganda"  in Vim to read copying and usage conditions.
  7.  * Do ":help credits" in Vim to see a list of people who contributed.
  8.  */
  9.  
  10.  
  11. #ifndef WSDEBUG_H
  12. #define WSDEBUG_H
  13.  
  14. #ifdef WSDEBUG
  15.  
  16. #ifndef ASSERT
  17. #define ASSERT(c) \
  18.     if (!(c)) { \
  19.     fprintf(stderr, "Assertion failed: line %d, file %s\n", \
  20.         __LINE__, __FILE__); \
  21.     fflush(stderr); \
  22.     abort(); \
  23.     }
  24. #endif
  25.  
  26. #define WS_TRACE        0x00000001
  27. #define WS_TRACE_VERBOSE    0x00000002
  28. #define WS_TRACE_COLONCMD    0x00000004
  29. #define WS_DEBUG_ALL        0xffffffff
  30.  
  31. #define WSDLEVEL(flags)        (ws_debug != NULL && (ws_dlevel & (flags)))
  32.  
  33. #ifdef USE_WDDUMP
  34. #include "wdump.h"
  35. #endif
  36.  
  37. #define WSDEBUG_TRACE    1
  38. //#define WSDEBUG_SENSE    2
  39.  
  40. typedef enum {
  41.         WT_ENV = 1,        /* look for env var if set */
  42.         WT_WAIT,        /* look for ~/.gvimwait if set */
  43.         WT_STOP            /* look for ~/.gvimstop if set */
  44. } WtWait;
  45.  
  46.  
  47. void         wsdebug(char *, ...);
  48. void         wstrace(char *, ...);
  49.  
  50.  
  51. extern FILE    *ws_debug;
  52. extern u_int     ws_dlevel;        /* ws_debug verbosity level */
  53.  
  54. # else        /* not WSDEBUG */
  55.  
  56. #ifndef ASSERT
  57. # define ASSERT(c)
  58. #endif
  59.  
  60. /*
  61.  * The following 2 stubs are needed because a macro cannot be used because of
  62.  * the variable number of arguments.
  63.  */
  64.  
  65. void
  66. wsdebug(
  67.     char        *fmt,
  68.     ...)
  69. {
  70. }
  71.  
  72.  
  73. void
  74. wstrace(
  75.     char        *fmt,
  76.     ...)
  77. {
  78. }
  79.  
  80. #endif /* WSDEBUG */
  81. #endif /* WSDEBUG_H */
  82.