-
Notifications
You must be signed in to change notification settings - Fork 2
/
WaveTsp.h
119 lines (96 loc) · 2.83 KB
/
WaveTsp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
Name: asttapi.cpp
Copyright: Under the GNU General Public License Version 2 or later (the "GPL")
Author: Nick Knight
Klaus Darilion
Description:
*/
/* ***** BEGIN LICENSE BLOCK *****
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Asttapi.
*
* The Initial Developer of the Original Code is
* Nick Knight.
* Portions created by the Initial Developer are Copyright (C) 2005
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Klaus Darilion (enum.at)
*
* ***** END LICENSE BLOCK ***** */
// WaveTsp.h
#ifndef WAVETSP_H
#define WAVETSP_H
#define DIM(rg) (sizeof(rg)/sizeof(*rg))
#ifdef _DEBUG
#define SIPTAPI_VERSION_W L"v0.2.17 Debug"
#define SIPTAPI_VERSION "v0.2.17 Debug"
#else
#define SIPTAPI_VERSION_W L"v0.2.17 Release"
#define SIPTAPI_VERSION "v0.2.17 Release"
#endif
// Data sent back and forth between UI and TSP during a dial operation
class CtspCall;
struct TSPUIDATA
{
CtspCall* pCall; // Call operation is happening on
DWORD dwRequestID; // Asynch. operation ID
LONG tr; // Asynch, operation result
DWORD nCallState; // New call state
};
//#define DEBUGTSP
#if defined(_DEBUG) && defined(DEBUGTSP)
enum ParamType
{
ptDword,
ptString,
};
enum ParamDirection
{
dirIn,
dirOut,
};
struct FUNC_PARAM
{
const char* pszVal;
DWORD dwVal;
ParamType pt;
ParamDirection dir;
};
struct FUNC_INFO
{
const char* pszFuncName;
DWORD dwNumParams;
FUNC_PARAM* rgParams;
LONG lResult;
};
void Prolog(FUNC_INFO* pInfo);
LONG Epilog(FUNC_INFO* pInfo, LONG lResult);
#define BEGIN_PARAM_TABLE(fname) \
const char* __pszFname = fname; \
FUNC_PARAM __params[] = {
#define DWORD_IN_ENTRY(p) { #p, (DWORD)p, ptDword, dirIn },
#define DWORD_OUT_ENTRY(p) { #p, (DWORD)p, ptDword, dirOut },
#define STRING_IN_ENTRY(p) { #p, (DWORD)p, ptString, dirIn },
#define STRING_OUT_ENTRY(p) { #p, (DWORD)p, ptString, dirOut },
#define END_PARAM_TABLE() \
}; FUNC_INFO __info = { __pszFname, DIM(__params), __params }; \
Prolog(&__info);
#define EPILOG(r) Epilog(&__info, r)
#define TSPTRACE TspTrace
void TspTrace(LPCTSTR pszFormat, ...);
#else // !_DEBUG
#define EPILOG(r) r
#define BEGIN_PARAM_TABLE(fname)
#define DWORD_IN_ENTRY(p)
#define DWORD_OUT_ENTRY(p)
#define STRING_IN_ENTRY(p)
#define STRING_OUT_ENTRY(p)
#define END_PARAM_TABLE()
#define TSPTRACE TspTrace
inline void TspTrace(LPCTSTR pszFormat, ...) {}
#endif // _DEBUG
#endif // WAVETSP_H