]> git.saurik.com Git - wxWidgets.git/blame - src/iodbc/itrace.h
toplevel event handler exposed
[wxWidgets.git] / src / iodbc / itrace.h
CommitLineData
cd5bf2a6
RR
1/*
2 * itrace.h
3 *
4 * $Id$
5 *
6 * Trace functions
7 *
8 * The iODBC driver manager.
9 *
10 * Copyright (C) 1995 by Ke Jin <kejin@empress.com>
11 *
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
21 *
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26#ifndef _ITRACE_H
27#define _ITRACE_H
1a6944fd 28
cd5bf2a6 29#ifdef DEBUG
1a6944fd 30
cd5bf2a6 31#ifndef NO_TRACE
f6fcbb63 32#define NO_TRACE
cd5bf2a6
RR
33#endif
34
35#endif
f6fcbb63 36
cd5bf2a6
RR
37#define TRACE_TYPE_APP2DM 1
38#define TRACE_TYPE_DM2DRV 2
39#define TRACE_TYPE_DRV2DM 3
1a6944fd 40
cd5bf2a6 41#define TRACE_TYPE_RETURN 4
1a6944fd 42
cd5bf2a6 43extern HPROC _iodbcdm_gettrproc (void FAR * stm, int procid, int type);
1a6944fd 44
cd5bf2a6
RR
45#ifdef NO_TRACE
46#define TRACE_CALL( stm, trace_on, procid, plist )
47#else
48#define TRACE_CALL( stm, trace_on, plist )\
49 {\
50 if( trace_on)\
51 {\
52 HPROC hproc;\
1a6944fd 53\
cd5bf2a6 54 hproc = _iodbcdm_gettrproc(stm, procid, TRACE_TYPE_APP2DM);\
1a6944fd 55\
cd5bf2a6
RR
56 if( hproc )\
57 hproc plist;\
58 }\
59 }
60#endif
1a6944fd 61
cd5bf2a6
RR
62#ifdef NO_TRACE
63#define TRACE_DM2DRV( stm, procid, plist )
64#else
65#define TRACE_DM2DRV( stm, procid, plist )\
66 {\
67 HPROC hproc;\
1a6944fd 68\
cd5bf2a6 69 hproc = _iodbcdm_gettrproc(stm, procid, TRACE_TYPE_DM2DRV);\
1a6944fd 70\
cd5bf2a6
RR
71 if( hproc )\
72 hproc plist;\
73 }
74#endif
1a6944fd 75
cd5bf2a6
RR
76#ifdef NO_TRACE
77#define TRACE_DRV2DM( stm, procid, plist )
78#else
79#define TRACE_DRV2DM( stm, procid, plist ) \
80 {\
81 HPROC hproc;\
1a6944fd 82\
cd5bf2a6 83 hproc = _iodbcdm_gettrproc( stm, procid, TRACE_TYPE_DRV2DM);\
1a6944fd 84\
cd5bf2a6
RR
85 if( hproc )\
86 hproc plist;\
87 }
88#endif
1a6944fd 89
cd5bf2a6
RR
90#ifdef NO_TRACE
91#define TRACE_RETURN( stm, trace_on, ret )
92#else
93#define TRACE_RETURN( stm, trace_on, ret )\
94 {\
95 if( trace_on ) {\
96 HPROC hproc;\
1a6944fd 97\
cd5bf2a6 98 hproc = _iodbcdm_gettrproc( stm, 0, TRACE_TYPE_RETURN);\
1a6944fd 99\
cd5bf2a6
RR
100 if( hproc )\
101 hproc( stm, ret );\
102 }\
103 }
104#endif
1a6944fd 105
cd5bf2a6
RR
106#ifdef NO_TRACE
107#define CALL_DRIVER( hdbc, ret, proc, procid, plist ) { ret = proc plist; }
108#else
109#define CALL_DRIVER( hdbc, ret, proc, procid, plist )\
110 {\
111 DBC_t FAR* pdbc = (DBC_t FAR*)(hdbc);\
1a6944fd 112\
cd5bf2a6
RR
113 if( pdbc->trace ) {\
114 TRACE_DM2DRV( pdbc->tstm, procid, plist )\
115 ret = proc plist;\
116 TRACE_DRV2DM( pdbc->tstm, procid, plist )\
117 TRACE_RETURN( pdbc->tstm, 1, ret )\
118 }\
119 else\
120 ret = proc plist;\
121 }
122#endif
1a6944fd
RR
123
124#endif