NCBI C++ ToolKit
error_export.h
Go to the documentation of this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

1 #undef tdsdump_log
2 #define tdsdump_log tdsdump_do_log
3 
4 #ifdef ENABLE_ODBC_WIDE
5 static SQLRETURN _SQLGetDiagRec(SQLSMALLINT handleType,
6  SQLHANDLE handle,
7  SQLSMALLINT numRecord,
8  ODBC_CHAR * szSqlStat,
9  SQLINTEGER * pfNativeError,
10  ODBC_CHAR * szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR* pcbErrorMsg, int wide);
11 
12 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDiagRecW(
13  SQLSMALLINT handleType,
14  SQLHANDLE handle,
15  SQLSMALLINT numRecord,
16  SQLWCHAR * szSqlStat,
17  SQLINTEGER * pfNativeError,
18  SQLWCHAR * szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR* pcbErrorMsg)
19 {
20  TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDiagRecW(%d, %p, %d, %p, %p, %p, %d, %p)\n",
21  (int) handleType,
22  handle,
23  (int) numRecord,
24  szSqlStat,
25  pfNativeError,
26  szErrorMsg, (int) cbErrorMsgMax, pcbErrorMsg);
27  return _SQLGetDiagRec(handleType,
28  handle,
29  numRecord,
30  (ODBC_CHAR*) szSqlStat,
31  pfNativeError,
32  (ODBC_CHAR*) szErrorMsg, cbErrorMsgMax, pcbErrorMsg, 1);
33 }
34 #endif
35 
37  SQLSMALLINT handleType,
38  SQLHANDLE handle,
39  SQLSMALLINT numRecord,
40  SQLCHAR * szSqlStat,
41  SQLINTEGER * pfNativeError,
42  SQLCHAR * szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR* pcbErrorMsg)
43 {
44  TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDiagRec(%d, %p, %d, %p, %p, %p, %d, %p)\n",
45  (int) handleType,
46  handle,
47  (int) numRecord,
48  szSqlStat,
49  pfNativeError,
50  szErrorMsg, (int) cbErrorMsgMax, pcbErrorMsg);
51 #ifdef ENABLE_ODBC_WIDE
52  return _SQLGetDiagRec(handleType,
53  handle,
54  numRecord,
55  (ODBC_CHAR*) szSqlStat,
56  pfNativeError,
57  (ODBC_CHAR*) szErrorMsg, cbErrorMsgMax, pcbErrorMsg, 0);
58 #else
59  return _SQLGetDiagRec(handleType,
60  handle,
61  numRecord,
62  szSqlStat,
63  pfNativeError,
64  szErrorMsg, cbErrorMsgMax, pcbErrorMsg);
65 #endif
66 }
67 
68 #ifdef ENABLE_ODBC_WIDE
69 static SQLRETURN _SQLError(SQLHENV henv,
70  SQLHDBC hdbc,
71  SQLHSTMT hstmt,
72  ODBC_CHAR * szSqlStat,
73  SQLINTEGER * pfNativeError,
74  ODBC_CHAR * szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR* pcbErrorMsg, int wide);
75 
77  SQLHENV henv,
78  SQLHDBC hdbc,
79  SQLHSTMT hstmt,
80  SQLWCHAR * szSqlStat,
81  SQLINTEGER * pfNativeError,
82  SQLWCHAR * szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR* pcbErrorMsg)
83 {
84  TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLErrorW(%p, %p, %p, %p, %p, %p, %d, %p)\n",
85  henv,
86  hdbc,
87  hstmt,
88  szSqlStat,
89  pfNativeError,
90  szErrorMsg, (int) cbErrorMsgMax, pcbErrorMsg);
91  return _SQLError(henv,
92  hdbc,
93  hstmt,
94  (ODBC_CHAR*) szSqlStat,
95  pfNativeError,
96  (ODBC_CHAR*) szErrorMsg, cbErrorMsgMax, pcbErrorMsg, 1);
97 }
98 #endif
99 
101  SQLHENV henv,
102  SQLHDBC hdbc,
103  SQLHSTMT hstmt,
104  SQLCHAR * szSqlStat,
105  SQLINTEGER * pfNativeError,
106  SQLCHAR * szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR* pcbErrorMsg)
107 {
108  TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLError(%p, %p, %p, %p, %p, %p, %d, %p)\n",
109  henv,
110  hdbc,
111  hstmt,
112  szSqlStat,
113  pfNativeError,
114  szErrorMsg, (int) cbErrorMsgMax, pcbErrorMsg);
115 #ifdef ENABLE_ODBC_WIDE
116  return _SQLError(henv,
117  hdbc,
118  hstmt,
119  (ODBC_CHAR*) szSqlStat,
120  pfNativeError,
121  (ODBC_CHAR*) szErrorMsg, cbErrorMsgMax, pcbErrorMsg, 0);
122 #else
123  return _SQLError(henv,
124  hdbc,
125  hstmt,
126  szSqlStat,
127  pfNativeError,
128  szErrorMsg, cbErrorMsgMax, pcbErrorMsg);
129 #endif
130 }
131 
132 #ifdef ENABLE_ODBC_WIDE
133 static SQLRETURN _SQLGetDiagField(SQLSMALLINT handleType,
134  SQLHANDLE handle,
135  SQLSMALLINT numRecord,
136  SQLSMALLINT diagIdentifier,
138  SQLSMALLINT cbBuffer,
139  SQLSMALLINT * pcbBuffer, int wide);
140 
141 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDiagFieldW(
142  SQLSMALLINT handleType,
143  SQLHANDLE handle,
144  SQLSMALLINT numRecord,
145  SQLSMALLINT diagIdentifier,
147  SQLSMALLINT cbBuffer,
148  SQLSMALLINT * pcbBuffer)
149 {
150  TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDiagFieldW(%d, %p, %d, %d, %p, %d, %p)\n",
151  (int) handleType,
152  handle,
153  (int) numRecord,
154  (int) diagIdentifier,
155  buffer,
156  (int) cbBuffer,
157  pcbBuffer);
158  return _SQLGetDiagField(handleType,
159  handle,
160  numRecord,
161  diagIdentifier,
162  buffer,
163  cbBuffer,
164  pcbBuffer, 1);
165 }
166 #endif
167 
169  SQLSMALLINT handleType,
170  SQLHANDLE handle,
171  SQLSMALLINT numRecord,
172  SQLSMALLINT diagIdentifier,
174  SQLSMALLINT cbBuffer,
175  SQLSMALLINT * pcbBuffer)
176 {
177  TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDiagField(%d, %p, %d, %d, %p, %d, %p)\n",
178  (int) handleType,
179  handle,
180  (int) numRecord,
181  (int) diagIdentifier,
182  buffer,
183  (int) cbBuffer,
184  pcbBuffer);
185 #ifdef ENABLE_ODBC_WIDE
186  return _SQLGetDiagField(handleType,
187  handle,
188  numRecord,
189  diagIdentifier,
190  buffer,
191  cbBuffer,
192  pcbBuffer, 0);
193 #else
194  return _SQLGetDiagField(handleType,
195  handle,
196  numRecord,
197  diagIdentifier,
198  buffer,
199  cbBuffer,
200  pcbBuffer);
201 #endif
202 }
203 
204 #undef tdsdump_log
205 #define tdsdump_log TDSDUMP_LOG_FAST
static SQLRETURN _SQLError(SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLCHAR *szSqlState, SQLINTEGER FAR *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR *pcbErrorMsg)
Definition: error.c:571
static SQLRETURN _SQLGetDiagRec(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT numRecord, SQLCHAR *szSqlState, SQLINTEGER FAR *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR *pcbErrorMsg)
Definition: error.c:501
static SQLRETURN _SQLGetDiagField(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT numRecord, SQLSMALLINT diagIdentifier, SQLPOINTER buffer, SQLSMALLINT cbBuffer, SQLSMALLINT FAR *pcbBuffer)
Definition: error.c:600
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDiagRec(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT numRecord, SQLCHAR *szSqlStat, SQLINTEGER *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR *pcbErrorMsg)
Definition: error_export.h:36
SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDiagField(SQLSMALLINT handleType, SQLHANDLE handle, SQLSMALLINT numRecord, SQLSMALLINT diagIdentifier, SQLPOINTER buffer, SQLSMALLINT cbBuffer, SQLSMALLINT *pcbBuffer)
Definition: error_export.h:168
SQLRETURN ODBC_PUBLIC ODBC_API SQLError(SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLCHAR *szSqlStat, SQLINTEGER *pfNativeError, SQLCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT FAR *pcbErrorMsg)
Definition: error_export.h:100
#define FAR
Definition: ncbistd.hpp:278
#define ODBC_CHAR
Definition: odbc.h:617
#define ODBC_API
Definition: odbc.h:82
#define ODBC_PUBLIC
Definition: odbc.h:88
static pcre_uint8 * buffer
Definition: pcretest.c:1051
SQLHANDLE SQLHENV
Definition: sqltypes.h:214
void * SQLPOINTER
Definition: sqltypes.h:195
SQLHANDLE SQLHDBC
Definition: sqltypes.h:215
WCHAR SQLWCHAR
Definition: sqltypes.h:458
long SQLINTEGER
Definition: sqltypes.h:176
SQLHANDLE SQLHSTMT
Definition: sqltypes.h:216
unsigned char SQLCHAR
Definition: sqltypes.h:125
void * SQLHANDLE
Definition: sqltypes.h:213
signed short int SQLSMALLINT
Definition: sqltypes.h:201
SQLSMALLINT SQLRETURN
Definition: sqltypes.h:210
SQLRETURN SQL_API SQLErrorW(SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt, SQLWCHAR *szSqlState, SQLINTEGER *pfNativeError, SQLWCHAR *szErrorMsg, SQLSMALLINT cbErrorMsgMax, SQLSMALLINT *pcbErrorMsg)
#define TDSDUMP_LOG_FAST
Definition: tds.h:1559
#define TDS_DBG_FUNC
Definition: tds.h:898
Modified on Tue Apr 09 08:00:22 2024 by modify_doxy.py rev. 669887
Modified on Wed Apr 10 07:35:44 2024 by modify_doxy.py rev. 669887
Modified on Thu Apr 11 15:21:23 2024 by modify_doxy.py rev. 669887
Modified on Fri Apr 12 17:23:29 2024 by modify_doxy.py rev. 669887