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 / nbdebug.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-02-13  |  1.4 KB  |  80 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 NBDEBUG_H
  12. #define NBDEBUG_H
  13.  
  14. #ifdef NBDEBUG
  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 nbdebug(a) nbdbg##a
  27.  
  28. #define NB_TRACE        0x00000001
  29. #define NB_TRACE_VERBOSE    0x00000002
  30. #define NB_TRACE_COLONCMD    0x00000004
  31. #define NB_DEBUG_ALL        0xffffffff
  32.  
  33. #define NBDLEVEL(flags)        (nb_debug != NULL && (nb_dlevel & (flags)))
  34.  
  35. #define NBDEBUG_TRACE    1
  36. //#define NBDEBUG_SENSE    2
  37.  
  38. typedef enum {
  39.         WT_ENV = 1,        /* look for env var if set */
  40.         WT_WAIT,        /* look for ~/.gvimwait if set */
  41.         WT_STOP            /* look for ~/.gvimstop if set */
  42. } WtWait;
  43.  
  44.  
  45. void         nbdbg(char *, ...);
  46. void         nbtrace(char *, ...);
  47.  
  48.  
  49. extern FILE    *nb_debug;
  50. extern u_int     nb_dlevel;        /* nb_debug verbosity level */
  51.  
  52. # else        /* not NBDEBUG */
  53.  
  54. #ifndef ASSERT
  55. # define ASSERT(c)
  56. #endif
  57.  
  58. /*
  59.  * The following 2 stubs are needed because a macro cannot be used because of
  60.  * the variable number of arguments.
  61.  */
  62.  
  63. void
  64. nbdbg(
  65.     char        *fmt,
  66.     ...)
  67. {
  68. }
  69.  
  70.  
  71. void
  72. nbtrace(
  73.     char        *fmt,
  74.     ...)
  75. {
  76. }
  77.  
  78. #endif /* NBDEBUG */
  79. #endif /* NBDEBUG_H */
  80.