annotate src/nbdebug.h @ 1425:15154710ed57 v7.1.140

updated for version 7.1-140
author vimboss
date Sun, 14 Oct 2007 15:16:27 +0000
parents 6b49757d378c
children 18ee39301b82
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 /* vi:set ts=8 sts=8 sw=8:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 * Visual Workshop integration by Gordon Prieur
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Do ":help uganda" in Vim to read copying and usage conditions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * Do ":help credits" in Vim to see a list of people who contributed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 #ifndef NBDEBUG_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 #define NBDEBUG_H
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 #ifdef NBDEBUG
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 #ifndef ASSERT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 #define ASSERT(c) \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if (!(c)) { \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 fprintf(stderr, "Assertion failed: line %d, file %s\n", \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 __LINE__, __FILE__); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 fflush(stderr); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 abort(); \
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 #define nbdebug(a) nbdbg##a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 #define NB_TRACE 0x00000001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 #define NB_TRACE_VERBOSE 0x00000002
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 #define NB_TRACE_COLONCMD 0x00000004
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
31 #define NB_PRINT 0x00000008
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 #define NB_DEBUG_ALL 0xffffffff
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 #define NBDLEVEL(flags) (nb_debug != NULL && (nb_dlevel & (flags)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 #define NBDEBUG_TRACE 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 typedef enum {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 WT_ENV = 1, /* look for env var if set */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 WT_WAIT, /* look for ~/.gvimwait if set */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 WT_STOP /* look for ~/.gvimstop if set */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 } WtWait;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 void nbdbg(char *, ...);
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
46 void nbprt(char *, ...);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 void nbtrace(char *, ...);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 void nbdebug_wait __ARGS((u_int wait_flags, char *wait_var, u_int wait_secs));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 void nbdebug_log_init __ARGS((char *log_var, char *level_var));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 extern FILE *nb_debug;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 extern u_int nb_dlevel; /* nb_debug verbosity level */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 # else /* not NBDEBUG */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 #ifndef ASSERT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 # define ASSERT(c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 #endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 /*
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
62 * The following 3 stubs are needed because a macro cannot be used because of
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 * the variable number of arguments.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 nbdbg(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 char *fmt,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 ...)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
33
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
73 void
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
74 nbprt(
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
75 char *fmt,
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
76 ...)
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
77 {
f6033dcbaf31 updated for version 7.0020
vimboss
parents: 7
diff changeset
78 }
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 void
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 nbtrace(
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 char *fmt,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 ...)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 #endif /* NBDEBUG */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 #endif /* NBDEBUG_H */