comparison src/wsdebug.h @ 7:3fc0f57ecb91 v7.0001

updated for version 7.0001
author vimboss
date Sun, 13 Jun 2004 20:20:40 +0000
parents
children 4aead6a9b7a9
comparison
equal deleted inserted replaced
6:c2daee826b8f 7:3fc0f57ecb91
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 */