blob: 03da5697c5676f035ddcec3f3792ef4d8294d2f1 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001/* 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
40typedef 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
47void wsdebug(char *, ...);
48void wstrace(char *, ...);
49
50
51extern FILE *ws_debug;
52extern 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
65void
66wsdebug(
67 char *fmt,
68 ...)
69{
70}
71
72
73void
74wstrace(
75 char *fmt,
76 ...)
77{
78}
79
80#endif /* WSDEBUG */
81#endif /* WSDEBUG_H */