]> git.saurik.com Git - wxWidgets.git/blob - src/iodbc/itrace.h
OnExit() is called for modules which were initialized even if the init of
[wxWidgets.git] / src / iodbc / itrace.h
1 #ifndef _ITRACE_H
2 # define _ITRACE_H
3
4 # ifdef DEBUG
5 # ifndef NO_TRACE
6 # define NO_TRACE
7 # endif
8 # endif
9
10 #define NO_TRACE
11
12 # define TRACE_TYPE_APP2DM 1
13 # define TRACE_TYPE_DM2DRV 2
14 # define TRACE_TYPE_DRV2DM 3
15
16 # define TRACE_TYPE_RETURN 4
17
18 extern HPROC _iodbcdm_gettrproc(void FAR* stm, int procid, int type);
19
20 # ifdef NO_TRACE
21 # define TRACE_CALL( stm, trace_on, procid, plist )
22 # else
23 # define TRACE_CALL( stm, trace_on, plist )\
24 {\
25 if( trace_on)\
26 {\
27 HPROC hproc;\
28 \
29 hproc = _iodbcdm_gettrproc(stm, procid, TRACE_TYPE_APP2DM);\
30 \
31 if( hproc )\
32 hproc plist;\
33 }\
34 }
35 # endif
36
37 # ifdef NO_TRACE
38 # define TRACE_DM2DRV( stm, procid, plist )
39 # else
40 # define TRACE_DM2DRV( stm, procid, plist )\
41 {\
42 HPROC hproc;\
43 \
44 hproc = _iodbcdm_gettrproc(stm, procid, TRACE_TYPE_DM2DRV);\
45 \
46 if( hproc )\
47 hproc plist;\
48 }
49 # endif
50
51 # ifdef NO_TRACE
52 # define TRACE_DRV2DM( stm, procid, plist )
53 # else
54 # define TRACE_DRV2DM( stm, procid, plist ) \
55 {\
56 HPROC hproc;\
57 \
58 hproc = _iodbcdm_gettrproc( stm, procid, TRACE_TYPE_DRV2DM);\
59 \
60 if( hproc )\
61 hproc plist;\
62 }
63 # endif
64
65 # ifdef NO_TRACE
66 # define TRACE_RETURN( stm, trace_on, ret )
67 # else
68 # define TRACE_RETURN( stm, trace_on, ret )\
69 {\
70 if( trace_on ) {\
71 HPROC hproc;\
72 \
73 hproc = _iodbcdm_gettrproc( stm, 0, TRACE_TYPE_RETURN);\
74 \
75 if( hproc )\
76 hproc( stm, ret );\
77 }\
78 }
79 # endif
80
81 # ifdef NO_TRACE
82 # define CALL_DRIVER( hdbc, ret, proc, procid, plist ) { ret = proc plist; }
83 # else
84 # define CALL_DRIVER( hdbc, ret, proc, procid, plist )\
85 {\
86 DBC_t FAR* pdbc = (DBC_t FAR*)(hdbc);\
87 \
88 if( pdbc->trace ) {\
89 TRACE_DM2DRV( pdbc->tstm, procid, plist )\
90 ret = proc plist;\
91 TRACE_DRV2DM( pdbc->tstm, procid, plist )\
92 TRACE_RETURN( pdbc->tstm, 1, ret )\
93 }\
94 else\
95 ret = proc plist;\
96 }
97 # endif
98
99 #endif