Mercurial > vim
annotate src/wsdebug.h @ 14170:9d021144571c
Added tag v8.1.0102 for changeset 42a9178374d134af4e8e0563ce4a4a0ff43c8736
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 23 Jun 2018 15:15:05 +0200 |
parents | 4aead6a9b7a9 |
children |
rev | line source |
---|---|
10042
4aead6a9b7a9
commit https://github.com/vim/vim/commit/edf3f97ae2af024708ebb4ac614227327033ca47
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
1 /* vi:set ts=8 sw=8 noet: |
7 | 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 */ |