FreeTDS API: src/odbc/odbc_export.h Source File

FreeTDS API

Loading...
Searching...
No Matches
odbc_export.h
1#ifdef ENABLE_ODBC_WIDE
2static SQLRETURN odbc_SQLDriverConnect(SQLHDBC hdbc,
3 SQLHWND hwnd,
4 ODBC_CHAR * szConnStrIn, SQLSMALLINT cbConnStrIn,
5 ODBC_CHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR* pcbConnStrOut,
6 SQLUSMALLINT fDriverCompletion, int wide);
7
8SQLRETURN ODBC_PUBLIC ODBC_API SQLDriverConnectW(
9 SQLHDBC hdbc,
10 SQLHWND hwnd,
11 SQLWCHAR * szConnStrIn, SQLSMALLINT cbConnStrIn,
12 SQLWCHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR* pcbConnStrOut,
13 SQLUSMALLINT fDriverCompletion)
14{
15 if (TDS_UNLIKELY(tds_write_dump)) {
16 SQLWSTR_BUFS(1);
17 tdsdump_log_impl(TDS_DBG_FUNC, "SQLDriverConnectW(%p, %p, %ls, %d, %p, %d, %p, %u)\n",
18 hdbc,
19 hwnd,
20 SQLWSTR(szConnStrIn), (int) cbConnStrIn,
21 szConnStrOut, (int) cbConnStrOutMax, pcbConnStrOut,
22 (unsigned int) fDriverCompletion);
23 SQLWSTR_FREE();
24 }
25 return odbc_SQLDriverConnect(hdbc,
26 hwnd,
27 (ODBC_CHAR*) szConnStrIn, cbConnStrIn,
28 (ODBC_CHAR*) szConnStrOut, cbConnStrOutMax, pcbConnStrOut,
29 fDriverCompletion, 1);
30}
31#endif
32
33SQLRETURN ODBC_PUBLIC ODBC_API SQLDriverConnect(
34 SQLHDBC hdbc,
35 SQLHWND hwnd,
36 SQLCHAR * szConnStrIn, SQLSMALLINT cbConnStrIn,
37 SQLCHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR* pcbConnStrOut,
38 SQLUSMALLINT fDriverCompletion)
39{
40 tdsdump_log(TDS_DBG_FUNC, "SQLDriverConnect(%p, %p, %s, %d, %p, %d, %p, %u)\n",
41 hdbc,
42 hwnd,
43 (const char*) szConnStrIn, (int) cbConnStrIn,
44 szConnStrOut, (int) cbConnStrOutMax, pcbConnStrOut,
45 (unsigned int) fDriverCompletion);
46#ifdef ENABLE_ODBC_WIDE
47 return odbc_SQLDriverConnect(hdbc,
48 hwnd,
49 (ODBC_CHAR*) szConnStrIn, cbConnStrIn,
50 (ODBC_CHAR*) szConnStrOut, cbConnStrOutMax, pcbConnStrOut,
51 fDriverCompletion, 0);
52#else
53 return odbc_SQLDriverConnect(hdbc,
54 hwnd,
55 szConnStrIn, cbConnStrIn,
56 szConnStrOut, cbConnStrOutMax, pcbConnStrOut,
57 fDriverCompletion);
58#endif
59}
60
61#ifdef ENABLE_ODBC_WIDE
62static SQLRETURN odbc_SQLColumnPrivileges(SQLHSTMT hstmt,
63 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
64 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
65 ODBC_CHAR * szTableName, SQLSMALLINT cbTableName,
66 ODBC_CHAR * szColumnName, SQLSMALLINT cbColumnName, int wide);
67
68SQLRETURN ODBC_PUBLIC ODBC_API SQLColumnPrivilegesW(
69 SQLHSTMT hstmt,
70 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
71 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
72 SQLWCHAR * szTableName, SQLSMALLINT cbTableName,
73 SQLWCHAR * szColumnName, SQLSMALLINT cbColumnName)
74{
75 if (TDS_UNLIKELY(tds_write_dump)) {
76 SQLWSTR_BUFS(4);
77 tdsdump_log_impl(TDS_DBG_FUNC, "SQLColumnPrivilegesW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n",
78 hstmt,
79 SQLWSTR(szCatalogName), (int) cbCatalogName,
80 SQLWSTR(szSchemaName), (int) cbSchemaName,
81 SQLWSTR(szTableName), (int) cbTableName,
82 SQLWSTR(szColumnName), (int) cbColumnName);
83 SQLWSTR_FREE();
84 }
85 return odbc_SQLColumnPrivileges(hstmt,
86 (ODBC_CHAR*) szCatalogName, cbCatalogName,
87 (ODBC_CHAR*) szSchemaName, cbSchemaName,
88 (ODBC_CHAR*) szTableName, cbTableName,
89 (ODBC_CHAR*) szColumnName, cbColumnName, 1);
90}
91#endif
92
93SQLRETURN ODBC_PUBLIC ODBC_API SQLColumnPrivileges(
94 SQLHSTMT hstmt,
95 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
96 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
97 SQLCHAR * szTableName, SQLSMALLINT cbTableName,
98 SQLCHAR * szColumnName, SQLSMALLINT cbColumnName)
99{
100 tdsdump_log(TDS_DBG_FUNC, "SQLColumnPrivileges(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n",
101 hstmt,
102 (const char*) szCatalogName, (int) cbCatalogName,
103 (const char*) szSchemaName, (int) cbSchemaName,
104 (const char*) szTableName, (int) cbTableName,
105 (const char*) szColumnName, (int) cbColumnName);
106#ifdef ENABLE_ODBC_WIDE
107 return odbc_SQLColumnPrivileges(hstmt,
108 (ODBC_CHAR*) szCatalogName, cbCatalogName,
109 (ODBC_CHAR*) szSchemaName, cbSchemaName,
110 (ODBC_CHAR*) szTableName, cbTableName,
111 (ODBC_CHAR*) szColumnName, cbColumnName, 0);
112#else
113 return odbc_SQLColumnPrivileges(hstmt,
114 szCatalogName, cbCatalogName,
115 szSchemaName, cbSchemaName,
116 szTableName, cbTableName,
117 szColumnName, cbColumnName);
118#endif
119}
120
121#ifdef ENABLE_ODBC_WIDE
122static SQLRETURN odbc_SQLForeignKeys(SQLHSTMT hstmt,
123 ODBC_CHAR * szPkCatalogName, SQLSMALLINT cbPkCatalogName,
124 ODBC_CHAR * szPkSchemaName, SQLSMALLINT cbPkSchemaName,
125 ODBC_CHAR * szPkTableName, SQLSMALLINT cbPkTableName,
126 ODBC_CHAR * szFkCatalogName, SQLSMALLINT cbFkCatalogName,
127 ODBC_CHAR * szFkSchemaName, SQLSMALLINT cbFkSchemaName,
128 ODBC_CHAR * szFkTableName, SQLSMALLINT cbFkTableName, int wide);
129
130SQLRETURN ODBC_PUBLIC ODBC_API SQLForeignKeysW(
131 SQLHSTMT hstmt,
132 SQLWCHAR * szPkCatalogName, SQLSMALLINT cbPkCatalogName,
133 SQLWCHAR * szPkSchemaName, SQLSMALLINT cbPkSchemaName,
134 SQLWCHAR * szPkTableName, SQLSMALLINT cbPkTableName,
135 SQLWCHAR * szFkCatalogName, SQLSMALLINT cbFkCatalogName,
136 SQLWCHAR * szFkSchemaName, SQLSMALLINT cbFkSchemaName,
137 SQLWCHAR * szFkTableName, SQLSMALLINT cbFkTableName)
138{
139 if (TDS_UNLIKELY(tds_write_dump)) {
140 SQLWSTR_BUFS(6);
141 tdsdump_log_impl(TDS_DBG_FUNC, "SQLForeignKeysW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n",
142 hstmt,
143 SQLWSTR(szPkCatalogName), (int) cbPkCatalogName,
144 SQLWSTR(szPkSchemaName), (int) cbPkSchemaName,
145 SQLWSTR(szPkTableName), (int) cbPkTableName,
146 SQLWSTR(szFkCatalogName), (int) cbFkCatalogName,
147 SQLWSTR(szFkSchemaName), (int) cbFkSchemaName,
148 SQLWSTR(szFkTableName), (int) cbFkTableName);
149 SQLWSTR_FREE();
150 }
151 return odbc_SQLForeignKeys(hstmt,
152 (ODBC_CHAR*) szPkCatalogName, cbPkCatalogName,
153 (ODBC_CHAR*) szPkSchemaName, cbPkSchemaName,
154 (ODBC_CHAR*) szPkTableName, cbPkTableName,
155 (ODBC_CHAR*) szFkCatalogName, cbFkCatalogName,
156 (ODBC_CHAR*) szFkSchemaName, cbFkSchemaName,
157 (ODBC_CHAR*) szFkTableName, cbFkTableName, 1);
158}
159#endif
160
161SQLRETURN ODBC_PUBLIC ODBC_API SQLForeignKeys(
162 SQLHSTMT hstmt,
163 SQLCHAR * szPkCatalogName, SQLSMALLINT cbPkCatalogName,
164 SQLCHAR * szPkSchemaName, SQLSMALLINT cbPkSchemaName,
165 SQLCHAR * szPkTableName, SQLSMALLINT cbPkTableName,
166 SQLCHAR * szFkCatalogName, SQLSMALLINT cbFkCatalogName,
167 SQLCHAR * szFkSchemaName, SQLSMALLINT cbFkSchemaName,
168 SQLCHAR * szFkTableName, SQLSMALLINT cbFkTableName)
169{
170 tdsdump_log(TDS_DBG_FUNC, "SQLForeignKeys(%p, %s, %d, %s, %d, %s, %d, %s, %d, %s, %d, %s, %d)\n",
171 hstmt,
172 (const char*) szPkCatalogName, (int) cbPkCatalogName,
173 (const char*) szPkSchemaName, (int) cbPkSchemaName,
174 (const char*) szPkTableName, (int) cbPkTableName,
175 (const char*) szFkCatalogName, (int) cbFkCatalogName,
176 (const char*) szFkSchemaName, (int) cbFkSchemaName,
177 (const char*) szFkTableName, (int) cbFkTableName);
178#ifdef ENABLE_ODBC_WIDE
179 return odbc_SQLForeignKeys(hstmt,
180 (ODBC_CHAR*) szPkCatalogName, cbPkCatalogName,
181 (ODBC_CHAR*) szPkSchemaName, cbPkSchemaName,
182 (ODBC_CHAR*) szPkTableName, cbPkTableName,
183 (ODBC_CHAR*) szFkCatalogName, cbFkCatalogName,
184 (ODBC_CHAR*) szFkSchemaName, cbFkSchemaName,
185 (ODBC_CHAR*) szFkTableName, cbFkTableName, 0);
186#else
187 return odbc_SQLForeignKeys(hstmt,
188 szPkCatalogName, cbPkCatalogName,
189 szPkSchemaName, cbPkSchemaName,
190 szPkTableName, cbPkTableName,
191 szFkCatalogName, cbFkCatalogName,
192 szFkSchemaName, cbFkSchemaName,
193 szFkTableName, cbFkTableName);
194#endif
195}
196
197#ifdef ENABLE_ODBC_WIDE
198static SQLRETURN odbc_SQLNativeSql(SQLHDBC hdbc,
199 ODBC_CHAR * szSqlStrIn, SQLINTEGER cbSqlStrIn,
200 ODBC_CHAR * szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR* pcbSqlStr, int wide);
201
202SQLRETURN ODBC_PUBLIC ODBC_API SQLNativeSqlW(
203 SQLHDBC hdbc,
204 SQLWCHAR * szSqlStrIn, SQLINTEGER cbSqlStrIn,
205 SQLWCHAR * szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR* pcbSqlStr)
206{
207 if (TDS_UNLIKELY(tds_write_dump)) {
208 SQLWSTR_BUFS(1);
209 tdsdump_log_impl(TDS_DBG_FUNC, "SQLNativeSqlW(%p, %ls, %d, %p, %d, %p)\n",
210 hdbc,
211 SQLWSTR(szSqlStrIn), (int) cbSqlStrIn,
212 szSqlStr, (int) cbSqlStrMax, pcbSqlStr);
213 SQLWSTR_FREE();
214 }
215 return odbc_SQLNativeSql(hdbc,
216 (ODBC_CHAR*) szSqlStrIn, cbSqlStrIn,
217 (ODBC_CHAR*) szSqlStr, cbSqlStrMax, pcbSqlStr, 1);
218}
219#endif
220
221SQLRETURN ODBC_PUBLIC ODBC_API SQLNativeSql(
222 SQLHDBC hdbc,
223 SQLCHAR * szSqlStrIn, SQLINTEGER cbSqlStrIn,
224 SQLCHAR * szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR* pcbSqlStr)
225{
226 tdsdump_log(TDS_DBG_FUNC, "SQLNativeSql(%p, %s, %d, %p, %d, %p)\n",
227 hdbc,
228 (const char*) szSqlStrIn, (int) cbSqlStrIn,
229 szSqlStr, (int) cbSqlStrMax, pcbSqlStr);
230#ifdef ENABLE_ODBC_WIDE
231 return odbc_SQLNativeSql(hdbc,
232 (ODBC_CHAR*) szSqlStrIn, cbSqlStrIn,
233 (ODBC_CHAR*) szSqlStr, cbSqlStrMax, pcbSqlStr, 0);
234#else
235 return odbc_SQLNativeSql(hdbc,
236 szSqlStrIn, cbSqlStrIn,
237 szSqlStr, cbSqlStrMax, pcbSqlStr);
238#endif
239}
240
241#ifdef ENABLE_ODBC_WIDE
242static SQLRETURN odbc_SQLPrimaryKeys(SQLHSTMT hstmt,
243 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
244 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
245 ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, int wide);
246
247SQLRETURN ODBC_PUBLIC ODBC_API SQLPrimaryKeysW(
248 SQLHSTMT hstmt,
249 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
250 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
251 SQLWCHAR * szTableName, SQLSMALLINT cbTableName)
252{
253 if (TDS_UNLIKELY(tds_write_dump)) {
254 SQLWSTR_BUFS(3);
255 tdsdump_log_impl(TDS_DBG_FUNC, "SQLPrimaryKeysW(%p, %ls, %d, %ls, %d, %ls, %d)\n",
256 hstmt,
257 SQLWSTR(szCatalogName), (int) cbCatalogName,
258 SQLWSTR(szSchemaName), (int) cbSchemaName,
259 SQLWSTR(szTableName), (int) cbTableName);
260 SQLWSTR_FREE();
261 }
262 return odbc_SQLPrimaryKeys(hstmt,
263 (ODBC_CHAR*) szCatalogName, cbCatalogName,
264 (ODBC_CHAR*) szSchemaName, cbSchemaName,
265 (ODBC_CHAR*) szTableName, cbTableName, 1);
266}
267#endif
268
269SQLRETURN ODBC_PUBLIC ODBC_API SQLPrimaryKeys(
270 SQLHSTMT hstmt,
271 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
272 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
273 SQLCHAR * szTableName, SQLSMALLINT cbTableName)
274{
275 tdsdump_log(TDS_DBG_FUNC, "SQLPrimaryKeys(%p, %s, %d, %s, %d, %s, %d)\n",
276 hstmt,
277 (const char*) szCatalogName, (int) cbCatalogName,
278 (const char*) szSchemaName, (int) cbSchemaName,
279 (const char*) szTableName, (int) cbTableName);
280#ifdef ENABLE_ODBC_WIDE
281 return odbc_SQLPrimaryKeys(hstmt,
282 (ODBC_CHAR*) szCatalogName, cbCatalogName,
283 (ODBC_CHAR*) szSchemaName, cbSchemaName,
284 (ODBC_CHAR*) szTableName, cbTableName, 0);
285#else
286 return odbc_SQLPrimaryKeys(hstmt,
287 szCatalogName, cbCatalogName,
288 szSchemaName, cbSchemaName,
289 szTableName, cbTableName);
290#endif
291}
292
293#ifdef ENABLE_ODBC_WIDE
294static SQLRETURN odbc_SQLProcedureColumns(SQLHSTMT hstmt,
295 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
296 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
297 ODBC_CHAR * szProcName, SQLSMALLINT cbProcName,
298 ODBC_CHAR * szColumnName, SQLSMALLINT cbColumnName, int wide);
299
300SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedureColumnsW(
301 SQLHSTMT hstmt,
302 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
303 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
304 SQLWCHAR * szProcName, SQLSMALLINT cbProcName,
305 SQLWCHAR * szColumnName, SQLSMALLINT cbColumnName)
306{
307 if (TDS_UNLIKELY(tds_write_dump)) {
308 SQLWSTR_BUFS(4);
309 tdsdump_log_impl(TDS_DBG_FUNC, "SQLProcedureColumnsW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n",
310 hstmt,
311 SQLWSTR(szCatalogName), (int) cbCatalogName,
312 SQLWSTR(szSchemaName), (int) cbSchemaName,
313 SQLWSTR(szProcName), (int) cbProcName,
314 SQLWSTR(szColumnName), (int) cbColumnName);
315 SQLWSTR_FREE();
316 }
317 return odbc_SQLProcedureColumns(hstmt,
318 (ODBC_CHAR*) szCatalogName, cbCatalogName,
319 (ODBC_CHAR*) szSchemaName, cbSchemaName,
320 (ODBC_CHAR*) szProcName, cbProcName,
321 (ODBC_CHAR*) szColumnName, cbColumnName, 1);
322}
323#endif
324
325SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedureColumns(
326 SQLHSTMT hstmt,
327 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
328 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
329 SQLCHAR * szProcName, SQLSMALLINT cbProcName,
330 SQLCHAR * szColumnName, SQLSMALLINT cbColumnName)
331{
332 tdsdump_log(TDS_DBG_FUNC, "SQLProcedureColumns(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n",
333 hstmt,
334 (const char*) szCatalogName, (int) cbCatalogName,
335 (const char*) szSchemaName, (int) cbSchemaName,
336 (const char*) szProcName, (int) cbProcName,
337 (const char*) szColumnName, (int) cbColumnName);
338#ifdef ENABLE_ODBC_WIDE
339 return odbc_SQLProcedureColumns(hstmt,
340 (ODBC_CHAR*) szCatalogName, cbCatalogName,
341 (ODBC_CHAR*) szSchemaName, cbSchemaName,
342 (ODBC_CHAR*) szProcName, cbProcName,
343 (ODBC_CHAR*) szColumnName, cbColumnName, 0);
344#else
345 return odbc_SQLProcedureColumns(hstmt,
346 szCatalogName, cbCatalogName,
347 szSchemaName, cbSchemaName,
348 szProcName, cbProcName,
349 szColumnName, cbColumnName);
350#endif
351}
352
353#ifdef ENABLE_ODBC_WIDE
354static SQLRETURN odbc_SQLProcedures(SQLHSTMT hstmt,
355 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
356 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
357 ODBC_CHAR * szProcName, SQLSMALLINT cbProcName, int wide);
358
359SQLRETURN ODBC_PUBLIC ODBC_API SQLProceduresW(
360 SQLHSTMT hstmt,
361 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
362 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
363 SQLWCHAR * szProcName, SQLSMALLINT cbProcName)
364{
365 if (TDS_UNLIKELY(tds_write_dump)) {
366 SQLWSTR_BUFS(3);
367 tdsdump_log_impl(TDS_DBG_FUNC, "SQLProceduresW(%p, %ls, %d, %ls, %d, %ls, %d)\n",
368 hstmt,
369 SQLWSTR(szCatalogName), (int) cbCatalogName,
370 SQLWSTR(szSchemaName), (int) cbSchemaName,
371 SQLWSTR(szProcName), (int) cbProcName);
372 SQLWSTR_FREE();
373 }
374 return odbc_SQLProcedures(hstmt,
375 (ODBC_CHAR*) szCatalogName, cbCatalogName,
376 (ODBC_CHAR*) szSchemaName, cbSchemaName,
377 (ODBC_CHAR*) szProcName, cbProcName, 1);
378}
379#endif
380
381SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedures(
382 SQLHSTMT hstmt,
383 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
384 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
385 SQLCHAR * szProcName, SQLSMALLINT cbProcName)
386{
387 tdsdump_log(TDS_DBG_FUNC, "SQLProcedures(%p, %s, %d, %s, %d, %s, %d)\n",
388 hstmt,
389 (const char*) szCatalogName, (int) cbCatalogName,
390 (const char*) szSchemaName, (int) cbSchemaName,
391 (const char*) szProcName, (int) cbProcName);
392#ifdef ENABLE_ODBC_WIDE
393 return odbc_SQLProcedures(hstmt,
394 (ODBC_CHAR*) szCatalogName, cbCatalogName,
395 (ODBC_CHAR*) szSchemaName, cbSchemaName,
396 (ODBC_CHAR*) szProcName, cbProcName, 0);
397#else
398 return odbc_SQLProcedures(hstmt,
399 szCatalogName, cbCatalogName,
400 szSchemaName, cbSchemaName,
401 szProcName, cbProcName);
402#endif
403}
404
405#ifdef ENABLE_ODBC_WIDE
406static SQLRETURN odbc_SQLTablePrivileges(SQLHSTMT hstmt,
407 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
408 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
409 ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, int wide);
410
411SQLRETURN ODBC_PUBLIC ODBC_API SQLTablePrivilegesW(
412 SQLHSTMT hstmt,
413 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
414 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
415 SQLWCHAR * szTableName, SQLSMALLINT cbTableName)
416{
417 if (TDS_UNLIKELY(tds_write_dump)) {
418 SQLWSTR_BUFS(3);
419 tdsdump_log_impl(TDS_DBG_FUNC, "SQLTablePrivilegesW(%p, %ls, %d, %ls, %d, %ls, %d)\n",
420 hstmt,
421 SQLWSTR(szCatalogName), (int) cbCatalogName,
422 SQLWSTR(szSchemaName), (int) cbSchemaName,
423 SQLWSTR(szTableName), (int) cbTableName);
424 SQLWSTR_FREE();
425 }
426 return odbc_SQLTablePrivileges(hstmt,
427 (ODBC_CHAR*) szCatalogName, cbCatalogName,
428 (ODBC_CHAR*) szSchemaName, cbSchemaName,
429 (ODBC_CHAR*) szTableName, cbTableName, 1);
430}
431#endif
432
433SQLRETURN ODBC_PUBLIC ODBC_API SQLTablePrivileges(
434 SQLHSTMT hstmt,
435 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
436 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
437 SQLCHAR * szTableName, SQLSMALLINT cbTableName)
438{
439 tdsdump_log(TDS_DBG_FUNC, "SQLTablePrivileges(%p, %s, %d, %s, %d, %s, %d)\n",
440 hstmt,
441 (const char*) szCatalogName, (int) cbCatalogName,
442 (const char*) szSchemaName, (int) cbSchemaName,
443 (const char*) szTableName, (int) cbTableName);
444#ifdef ENABLE_ODBC_WIDE
445 return odbc_SQLTablePrivileges(hstmt,
446 (ODBC_CHAR*) szCatalogName, cbCatalogName,
447 (ODBC_CHAR*) szSchemaName, cbSchemaName,
448 (ODBC_CHAR*) szTableName, cbTableName, 0);
449#else
450 return odbc_SQLTablePrivileges(hstmt,
451 szCatalogName, cbCatalogName,
452 szSchemaName, cbSchemaName,
453 szTableName, cbTableName);
454#endif
455}
456
457#ifdef ENABLE_ODBC_WIDE
458static SQLRETURN odbc_SQLConnect(SQLHDBC hdbc,
459 ODBC_CHAR * szDSN, SQLSMALLINT cbDSN,
460 ODBC_CHAR * szUID, SQLSMALLINT cbUID,
461 ODBC_CHAR * szAuthStr, SQLSMALLINT cbAuthStr, int wide);
462
463SQLRETURN ODBC_PUBLIC ODBC_API SQLConnectW(
464 SQLHDBC hdbc,
465 SQLWCHAR * szDSN, SQLSMALLINT cbDSN,
466 SQLWCHAR * szUID, SQLSMALLINT cbUID,
467 SQLWCHAR * szAuthStr, SQLSMALLINT cbAuthStr)
468{
469 if (TDS_UNLIKELY(tds_write_dump)) {
470 SQLWSTR_BUFS(3);
471 tdsdump_log_impl(TDS_DBG_FUNC, "SQLConnectW(%p, %ls, %d, %ls, %d, %ls, %d)\n",
472 hdbc,
473 SQLWSTR(szDSN), (int) cbDSN,
474 SQLWSTR(szUID), (int) cbUID,
475 SQLWSTR(szAuthStr), (int) cbAuthStr);
476 SQLWSTR_FREE();
477 }
478 return odbc_SQLConnect(hdbc,
479 (ODBC_CHAR*) szDSN, cbDSN,
480 (ODBC_CHAR*) szUID, cbUID,
481 (ODBC_CHAR*) szAuthStr, cbAuthStr, 1);
482}
483#endif
484
485SQLRETURN ODBC_PUBLIC ODBC_API SQLConnect(
486 SQLHDBC hdbc,
487 SQLCHAR * szDSN, SQLSMALLINT cbDSN,
488 SQLCHAR * szUID, SQLSMALLINT cbUID,
489 SQLCHAR * szAuthStr, SQLSMALLINT cbAuthStr)
490{
491 tdsdump_log(TDS_DBG_FUNC, "SQLConnect(%p, %s, %d, %s, %d, %s, %d)\n",
492 hdbc,
493 (const char*) szDSN, (int) cbDSN,
494 (const char*) szUID, (int) cbUID,
495 (const char*) szAuthStr, (int) cbAuthStr);
496#ifdef ENABLE_ODBC_WIDE
497 return odbc_SQLConnect(hdbc,
498 (ODBC_CHAR*) szDSN, cbDSN,
499 (ODBC_CHAR*) szUID, cbUID,
500 (ODBC_CHAR*) szAuthStr, cbAuthStr, 0);
501#else
502 return odbc_SQLConnect(hdbc,
503 szDSN, cbDSN,
504 szUID, cbUID,
505 szAuthStr, cbAuthStr);
506#endif
507}
508
509#ifdef ENABLE_ODBC_WIDE
510static SQLRETURN odbc_SQLDescribeCol(SQLHSTMT hstmt,
511 SQLUSMALLINT icol,
512 ODBC_CHAR * szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR* pcbColName,
513 SQLSMALLINT * pfSqlType,
514 SQLULEN * pcbColDef,
515 SQLSMALLINT * pibScale,
516 SQLSMALLINT * pfNullable, int wide);
517
518SQLRETURN ODBC_PUBLIC ODBC_API SQLDescribeColW(
519 SQLHSTMT hstmt,
520 SQLUSMALLINT icol,
521 SQLWCHAR * szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR* pcbColName,
522 SQLSMALLINT * pfSqlType,
523 SQLULEN * pcbColDef,
524 SQLSMALLINT * pibScale,
525 SQLSMALLINT * pfNullable)
526{
527 tdsdump_log(TDS_DBG_FUNC, "SQLDescribeColW(%p, %u, %p, %d, %p, %p, %p, %p, %p)\n",
528 hstmt,
529 (unsigned int) icol,
530 szColName, (int) cbColNameMax, pcbColName,
531 pfSqlType,
532 pcbColDef,
533 pibScale,
534 pfNullable);
535 return odbc_SQLDescribeCol(hstmt,
536 icol,
537 (ODBC_CHAR*) szColName, cbColNameMax, pcbColName,
538 pfSqlType,
539 pcbColDef,
540 pibScale,
541 pfNullable, 1);
542}
543#endif
544
545SQLRETURN ODBC_PUBLIC ODBC_API SQLDescribeCol(
546 SQLHSTMT hstmt,
547 SQLUSMALLINT icol,
548 SQLCHAR * szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR* pcbColName,
549 SQLSMALLINT * pfSqlType,
550 SQLULEN * pcbColDef,
551 SQLSMALLINT * pibScale,
552 SQLSMALLINT * pfNullable)
553{
554 tdsdump_log(TDS_DBG_FUNC, "SQLDescribeCol(%p, %u, %p, %d, %p, %p, %p, %p, %p)\n",
555 hstmt,
556 (unsigned int) icol,
557 szColName, (int) cbColNameMax, pcbColName,
558 pfSqlType,
559 pcbColDef,
560 pibScale,
561 pfNullable);
562#ifdef ENABLE_ODBC_WIDE
563 return odbc_SQLDescribeCol(hstmt,
564 icol,
565 (ODBC_CHAR*) szColName, cbColNameMax, pcbColName,
566 pfSqlType,
567 pcbColDef,
568 pibScale,
569 pfNullable, 0);
570#else
571 return odbc_SQLDescribeCol(hstmt,
572 icol,
573 szColName, cbColNameMax, pcbColName,
574 pfSqlType,
575 pcbColDef,
576 pibScale,
577 pfNullable);
578#endif
579}
580
581#ifdef ENABLE_ODBC_WIDE
582static SQLRETURN odbc_SQLGetDescRec(SQLHDESC hdesc,
583 SQLSMALLINT RecordNumber,
584 ODBC_CHAR * szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR* pcbName,
585 SQLSMALLINT * Type,
586 SQLSMALLINT * SubType,
587 SQLLEN * Length,
588 SQLSMALLINT * Precision,
589 SQLSMALLINT * Scale,
590 SQLSMALLINT * Nullable, int wide);
591
592SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescRecW(
593 SQLHDESC hdesc,
594 SQLSMALLINT RecordNumber,
595 SQLWCHAR * szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR* pcbName,
596 SQLSMALLINT * Type,
597 SQLSMALLINT * SubType,
598 SQLLEN * Length,
599 SQLSMALLINT * Precision,
600 SQLSMALLINT * Scale,
601 SQLSMALLINT * Nullable)
602{
603 tdsdump_log(TDS_DBG_FUNC, "SQLGetDescRecW(%p, %d, %p, %d, %p, %p, %p, %p, %p, %p, %p)\n",
604 hdesc,
605 (int) RecordNumber,
606 szName, (int) cbNameMax, pcbName,
607 Type,
608 SubType,
609 Length,
610 Precision,
611 Scale,
612 Nullable);
613 return odbc_SQLGetDescRec(hdesc,
614 RecordNumber,
615 (ODBC_CHAR*) szName, cbNameMax, pcbName,
616 Type,
617 SubType,
618 Length,
619 Precision,
620 Scale,
621 Nullable, 1);
622}
623#endif
624
625SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescRec(
626 SQLHDESC hdesc,
627 SQLSMALLINT RecordNumber,
628 SQLCHAR * szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR* pcbName,
629 SQLSMALLINT * Type,
630 SQLSMALLINT * SubType,
631 SQLLEN * Length,
632 SQLSMALLINT * Precision,
633 SQLSMALLINT * Scale,
634 SQLSMALLINT * Nullable)
635{
636 tdsdump_log(TDS_DBG_FUNC, "SQLGetDescRec(%p, %d, %p, %d, %p, %p, %p, %p, %p, %p, %p)\n",
637 hdesc,
638 (int) RecordNumber,
639 szName, (int) cbNameMax, pcbName,
640 Type,
641 SubType,
642 Length,
643 Precision,
644 Scale,
645 Nullable);
646#ifdef ENABLE_ODBC_WIDE
647 return odbc_SQLGetDescRec(hdesc,
648 RecordNumber,
649 (ODBC_CHAR*) szName, cbNameMax, pcbName,
650 Type,
651 SubType,
652 Length,
653 Precision,
654 Scale,
655 Nullable, 0);
656#else
657 return odbc_SQLGetDescRec(hdesc,
658 RecordNumber,
659 szName, cbNameMax, pcbName,
660 Type,
661 SubType,
662 Length,
663 Precision,
664 Scale,
665 Nullable);
666#endif
667}
668
669#ifdef ENABLE_ODBC_WIDE
670static SQLRETURN odbc_SQLGetDescField(SQLHDESC hdesc,
671 SQLSMALLINT icol,
672 SQLSMALLINT fDescType,
673 SQLPOINTER Value,
674 SQLINTEGER BufferLength,
675 SQLINTEGER * StringLength, int wide);
676
677SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescFieldW(
678 SQLHDESC hdesc,
679 SQLSMALLINT icol,
680 SQLSMALLINT fDescType,
681 SQLPOINTER Value,
682 SQLINTEGER BufferLength,
683 SQLINTEGER * StringLength)
684{
685 tdsdump_log(TDS_DBG_FUNC, "SQLGetDescFieldW(%p, %d, %d, %p, %d, %p)\n",
686 hdesc,
687 (int) icol,
688 (int) fDescType,
689 Value,
690 (int) BufferLength,
691 StringLength);
692 return odbc_SQLGetDescField(hdesc,
693 icol,
694 fDescType,
695 Value,
696 BufferLength,
697 StringLength, 1);
698}
699#endif
700
701SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescField(
702 SQLHDESC hdesc,
703 SQLSMALLINT icol,
704 SQLSMALLINT fDescType,
705 SQLPOINTER Value,
706 SQLINTEGER BufferLength,
707 SQLINTEGER * StringLength)
708{
709 tdsdump_log(TDS_DBG_FUNC, "SQLGetDescField(%p, %d, %d, %p, %d, %p)\n",
710 hdesc,
711 (int) icol,
712 (int) fDescType,
713 Value,
714 (int) BufferLength,
715 StringLength);
716#ifdef ENABLE_ODBC_WIDE
717 return odbc_SQLGetDescField(hdesc,
718 icol,
719 fDescType,
720 Value,
721 BufferLength,
722 StringLength, 0);
723#else
724 return odbc_SQLGetDescField(hdesc,
725 icol,
726 fDescType,
727 Value,
728 BufferLength,
729 StringLength);
730#endif
731}
732
733#ifdef ENABLE_ODBC_WIDE
734static SQLRETURN odbc_SQLSetDescField(SQLHDESC hdesc,
735 SQLSMALLINT icol,
736 SQLSMALLINT fDescType,
737 SQLPOINTER Value,
738 SQLINTEGER BufferLength, int wide);
739
740SQLRETURN ODBC_PUBLIC ODBC_API SQLSetDescFieldW(
741 SQLHDESC hdesc,
742 SQLSMALLINT icol,
743 SQLSMALLINT fDescType,
744 SQLPOINTER Value,
745 SQLINTEGER BufferLength)
746{
747 tdsdump_log(TDS_DBG_FUNC, "SQLSetDescFieldW(%p, %d, %d, %p, %d)\n",
748 hdesc,
749 (int) icol,
750 (int) fDescType,
751 Value,
752 (int) BufferLength);
753 return odbc_SQLSetDescField(hdesc,
754 icol,
755 fDescType,
756 Value,
757 BufferLength, 1);
758}
759#endif
760
761SQLRETURN ODBC_PUBLIC ODBC_API SQLSetDescField(
762 SQLHDESC hdesc,
763 SQLSMALLINT icol,
764 SQLSMALLINT fDescType,
765 SQLPOINTER Value,
766 SQLINTEGER BufferLength)
767{
768 tdsdump_log(TDS_DBG_FUNC, "SQLSetDescField(%p, %d, %d, %p, %d)\n",
769 hdesc,
770 (int) icol,
771 (int) fDescType,
772 Value,
773 (int) BufferLength);
774#ifdef ENABLE_ODBC_WIDE
775 return odbc_SQLSetDescField(hdesc,
776 icol,
777 fDescType,
778 Value,
779 BufferLength, 0);
780#else
781 return odbc_SQLSetDescField(hdesc,
782 icol,
783 fDescType,
784 Value,
785 BufferLength);
786#endif
787}
788
789#ifdef ENABLE_ODBC_WIDE
790static SQLRETURN odbc_SQLExecDirect(SQLHSTMT hstmt,
791 ODBC_CHAR * szSqlStr, SQLINTEGER cbSqlStr, int wide);
792
793SQLRETURN ODBC_PUBLIC ODBC_API SQLExecDirectW(
794 SQLHSTMT hstmt,
795 SQLWCHAR * szSqlStr, SQLINTEGER cbSqlStr)
796{
797 if (TDS_UNLIKELY(tds_write_dump)) {
798 SQLWSTR_BUFS(1);
799 tdsdump_log_impl(TDS_DBG_FUNC, "SQLExecDirectW(%p, %ls, %d)\n",
800 hstmt,
801 SQLWSTR(szSqlStr), (int) cbSqlStr);
802 SQLWSTR_FREE();
803 }
804 return odbc_SQLExecDirect(hstmt,
805 (ODBC_CHAR*) szSqlStr, cbSqlStr, 1);
806}
807#endif
808
809SQLRETURN ODBC_PUBLIC ODBC_API SQLExecDirect(
810 SQLHSTMT hstmt,
811 SQLCHAR * szSqlStr, SQLINTEGER cbSqlStr)
812{
813 tdsdump_log(TDS_DBG_FUNC, "SQLExecDirect(%p, %s, %d)\n",
814 hstmt,
815 (const char*) szSqlStr, (int) cbSqlStr);
816#ifdef ENABLE_ODBC_WIDE
817 return odbc_SQLExecDirect(hstmt,
818 (ODBC_CHAR*) szSqlStr, cbSqlStr, 0);
819#else
820 return odbc_SQLExecDirect(hstmt,
821 szSqlStr, cbSqlStr);
822#endif
823}
824
825#ifdef ENABLE_ODBC_WIDE
826static SQLRETURN odbc_SQLPrepare(SQLHSTMT hstmt,
827 ODBC_CHAR * szSqlStr, SQLINTEGER cbSqlStr, int wide);
828
829SQLRETURN ODBC_PUBLIC ODBC_API SQLPrepareW(
830 SQLHSTMT hstmt,
831 SQLWCHAR * szSqlStr, SQLINTEGER cbSqlStr)
832{
833 if (TDS_UNLIKELY(tds_write_dump)) {
834 SQLWSTR_BUFS(1);
835 tdsdump_log_impl(TDS_DBG_FUNC, "SQLPrepareW(%p, %ls, %d)\n",
836 hstmt,
837 SQLWSTR(szSqlStr), (int) cbSqlStr);
838 SQLWSTR_FREE();
839 }
840 return odbc_SQLPrepare(hstmt,
841 (ODBC_CHAR*) szSqlStr, cbSqlStr, 1);
842}
843#endif
844
845SQLRETURN ODBC_PUBLIC ODBC_API SQLPrepare(
846 SQLHSTMT hstmt,
847 SQLCHAR * szSqlStr, SQLINTEGER cbSqlStr)
848{
849 tdsdump_log(TDS_DBG_FUNC, "SQLPrepare(%p, %s, %d)\n",
850 hstmt,
851 (const char*) szSqlStr, (int) cbSqlStr);
852#ifdef ENABLE_ODBC_WIDE
853 return odbc_SQLPrepare(hstmt,
854 (ODBC_CHAR*) szSqlStr, cbSqlStr, 0);
855#else
856 return odbc_SQLPrepare(hstmt,
857 szSqlStr, cbSqlStr);
858#endif
859}
860
861#ifdef ENABLE_ODBC_WIDE
862static SQLRETURN odbc_SQLSetCursorName(SQLHSTMT hstmt,
863 ODBC_CHAR * szCursor, SQLSMALLINT cbCursor, int wide);
864
865SQLRETURN ODBC_PUBLIC ODBC_API SQLSetCursorNameW(
866 SQLHSTMT hstmt,
867 SQLWCHAR * szCursor, SQLSMALLINT cbCursor)
868{
869 if (TDS_UNLIKELY(tds_write_dump)) {
870 SQLWSTR_BUFS(1);
871 tdsdump_log_impl(TDS_DBG_FUNC, "SQLSetCursorNameW(%p, %ls, %d)\n",
872 hstmt,
873 SQLWSTR(szCursor), (int) cbCursor);
874 SQLWSTR_FREE();
875 }
876 return odbc_SQLSetCursorName(hstmt,
877 (ODBC_CHAR*) szCursor, cbCursor, 1);
878}
879#endif
880
881SQLRETURN ODBC_PUBLIC ODBC_API SQLSetCursorName(
882 SQLHSTMT hstmt,
883 SQLCHAR * szCursor, SQLSMALLINT cbCursor)
884{
885 tdsdump_log(TDS_DBG_FUNC, "SQLSetCursorName(%p, %s, %d)\n",
886 hstmt,
887 (const char*) szCursor, (int) cbCursor);
888#ifdef ENABLE_ODBC_WIDE
889 return odbc_SQLSetCursorName(hstmt,
890 (ODBC_CHAR*) szCursor, cbCursor, 0);
891#else
892 return odbc_SQLSetCursorName(hstmt,
893 szCursor, cbCursor);
894#endif
895}
896
897#ifdef ENABLE_ODBC_WIDE
898static SQLRETURN odbc_SQLGetCursorName(SQLHSTMT hstmt,
899 ODBC_CHAR * szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR* pcbCursor, int wide);
900
901SQLRETURN ODBC_PUBLIC ODBC_API SQLGetCursorNameW(
902 SQLHSTMT hstmt,
903 SQLWCHAR * szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR* pcbCursor)
904{
905 tdsdump_log(TDS_DBG_FUNC, "SQLGetCursorNameW(%p, %p, %d, %p)\n",
906 hstmt,
907 szCursor, (int) cbCursorMax, pcbCursor);
908 return odbc_SQLGetCursorName(hstmt,
909 (ODBC_CHAR*) szCursor, cbCursorMax, pcbCursor, 1);
910}
911#endif
912
913SQLRETURN ODBC_PUBLIC ODBC_API SQLGetCursorName(
914 SQLHSTMT hstmt,
915 SQLCHAR * szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR* pcbCursor)
916{
917 tdsdump_log(TDS_DBG_FUNC, "SQLGetCursorName(%p, %p, %d, %p)\n",
918 hstmt,
919 szCursor, (int) cbCursorMax, pcbCursor);
920#ifdef ENABLE_ODBC_WIDE
921 return odbc_SQLGetCursorName(hstmt,
922 (ODBC_CHAR*) szCursor, cbCursorMax, pcbCursor, 0);
923#else
924 return odbc_SQLGetCursorName(hstmt,
925 szCursor, cbCursorMax, pcbCursor);
926#endif
927}
928
929#ifdef ENABLE_ODBC_WIDE
930static SQLRETURN odbc_SQLColumns(SQLHSTMT hstmt,
931 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
932 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
933 ODBC_CHAR * szTableName, SQLSMALLINT cbTableName,
934 ODBC_CHAR * szColumnName, SQLSMALLINT cbColumnName, int wide);
935
936SQLRETURN ODBC_PUBLIC ODBC_API SQLColumnsW(
937 SQLHSTMT hstmt,
938 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
939 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
940 SQLWCHAR * szTableName, SQLSMALLINT cbTableName,
941 SQLWCHAR * szColumnName, SQLSMALLINT cbColumnName)
942{
943 if (TDS_UNLIKELY(tds_write_dump)) {
944 SQLWSTR_BUFS(4);
945 tdsdump_log_impl(TDS_DBG_FUNC, "SQLColumnsW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n",
946 hstmt,
947 SQLWSTR(szCatalogName), (int) cbCatalogName,
948 SQLWSTR(szSchemaName), (int) cbSchemaName,
949 SQLWSTR(szTableName), (int) cbTableName,
950 SQLWSTR(szColumnName), (int) cbColumnName);
951 SQLWSTR_FREE();
952 }
953 return odbc_SQLColumns(hstmt,
954 (ODBC_CHAR*) szCatalogName, cbCatalogName,
955 (ODBC_CHAR*) szSchemaName, cbSchemaName,
956 (ODBC_CHAR*) szTableName, cbTableName,
957 (ODBC_CHAR*) szColumnName, cbColumnName, 1);
958}
959#endif
960
961SQLRETURN ODBC_PUBLIC ODBC_API SQLColumns(
962 SQLHSTMT hstmt,
963 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
964 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
965 SQLCHAR * szTableName, SQLSMALLINT cbTableName,
966 SQLCHAR * szColumnName, SQLSMALLINT cbColumnName)
967{
968 tdsdump_log(TDS_DBG_FUNC, "SQLColumns(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n",
969 hstmt,
970 (const char*) szCatalogName, (int) cbCatalogName,
971 (const char*) szSchemaName, (int) cbSchemaName,
972 (const char*) szTableName, (int) cbTableName,
973 (const char*) szColumnName, (int) cbColumnName);
974#ifdef ENABLE_ODBC_WIDE
975 return odbc_SQLColumns(hstmt,
976 (ODBC_CHAR*) szCatalogName, cbCatalogName,
977 (ODBC_CHAR*) szSchemaName, cbSchemaName,
978 (ODBC_CHAR*) szTableName, cbTableName,
979 (ODBC_CHAR*) szColumnName, cbColumnName, 0);
980#else
981 return odbc_SQLColumns(hstmt,
982 szCatalogName, cbCatalogName,
983 szSchemaName, cbSchemaName,
984 szTableName, cbTableName,
985 szColumnName, cbColumnName);
986#endif
987}
988
989#ifdef ENABLE_ODBC_WIDE
990static SQLRETURN odbc_SQLGetConnectAttr(SQLHDBC hdbc,
991 SQLINTEGER Attribute,
992 SQLPOINTER Value,
993 SQLINTEGER BufferLength,
994 SQLINTEGER * StringLength, int wide);
995
996SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectAttrW(
997 SQLHDBC hdbc,
998 SQLINTEGER Attribute,
999 SQLPOINTER Value,
1000 SQLINTEGER BufferLength,
1001 SQLINTEGER * StringLength)
1002{
1003 tdsdump_log(TDS_DBG_FUNC, "SQLGetConnectAttrW(%p, %d, %p, %d, %p)\n",
1004 hdbc,
1005 (int) Attribute,
1006 Value,
1007 (int) BufferLength,
1008 StringLength);
1009 return odbc_SQLGetConnectAttr(hdbc,
1010 Attribute,
1011 Value,
1012 BufferLength,
1013 StringLength, 1);
1014}
1015#endif
1016
1017SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectAttr(
1018 SQLHDBC hdbc,
1019 SQLINTEGER Attribute,
1020 SQLPOINTER Value,
1021 SQLINTEGER BufferLength,
1022 SQLINTEGER * StringLength)
1023{
1024 tdsdump_log(TDS_DBG_FUNC, "SQLGetConnectAttr(%p, %d, %p, %d, %p)\n",
1025 hdbc,
1026 (int) Attribute,
1027 Value,
1028 (int) BufferLength,
1029 StringLength);
1030#ifdef ENABLE_ODBC_WIDE
1031 return odbc_SQLGetConnectAttr(hdbc,
1032 Attribute,
1033 Value,
1034 BufferLength,
1035 StringLength, 0);
1036#else
1037 return odbc_SQLGetConnectAttr(hdbc,
1038 Attribute,
1039 Value,
1040 BufferLength,
1041 StringLength);
1042#endif
1043}
1044
1045#ifdef ENABLE_ODBC_WIDE
1046static SQLRETURN odbc_SQLSetConnectAttr(SQLHDBC hdbc,
1047 SQLINTEGER Attribute,
1048 SQLPOINTER ValuePtr,
1049 SQLINTEGER StringLength, int wide);
1050
1051SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectAttrW(
1052 SQLHDBC hdbc,
1053 SQLINTEGER Attribute,
1054 SQLPOINTER ValuePtr,
1055 SQLINTEGER StringLength)
1056{
1057 tdsdump_log(TDS_DBG_FUNC, "SQLSetConnectAttrW(%p, %d, %p, %d)\n",
1058 hdbc,
1059 (int) Attribute,
1060 ValuePtr,
1061 (int) StringLength);
1062 return odbc_SQLSetConnectAttr(hdbc,
1063 Attribute,
1064 ValuePtr,
1065 StringLength, 1);
1066}
1067#endif
1068
1069SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectAttr(
1070 SQLHDBC hdbc,
1071 SQLINTEGER Attribute,
1072 SQLPOINTER ValuePtr,
1073 SQLINTEGER StringLength)
1074{
1075 tdsdump_log(TDS_DBG_FUNC, "SQLSetConnectAttr(%p, %d, %p, %d)\n",
1076 hdbc,
1077 (int) Attribute,
1078 ValuePtr,
1079 (int) StringLength);
1080#ifdef ENABLE_ODBC_WIDE
1081 return odbc_SQLSetConnectAttr(hdbc,
1082 Attribute,
1083 ValuePtr,
1084 StringLength, 0);
1085#else
1086 return odbc_SQLSetConnectAttr(hdbc,
1087 Attribute,
1088 ValuePtr,
1089 StringLength);
1090#endif
1091}
1092
1093#ifdef ENABLE_ODBC_WIDE
1094static SQLRETURN odbc_SQLSpecialColumns(SQLHSTMT hstmt,
1095 SQLUSMALLINT fColType,
1096 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1097 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1098 ODBC_CHAR * szTableName, SQLSMALLINT cbTableName,
1099 SQLUSMALLINT fScope,
1100 SQLUSMALLINT fNullable, int wide);
1101
1102SQLRETURN ODBC_PUBLIC ODBC_API SQLSpecialColumnsW(
1103 SQLHSTMT hstmt,
1104 SQLUSMALLINT fColType,
1105 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1106 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1107 SQLWCHAR * szTableName, SQLSMALLINT cbTableName,
1108 SQLUSMALLINT fScope,
1109 SQLUSMALLINT fNullable)
1110{
1111 if (TDS_UNLIKELY(tds_write_dump)) {
1112 SQLWSTR_BUFS(3);
1113 tdsdump_log_impl(TDS_DBG_FUNC, "SQLSpecialColumnsW(%p, %u, %ls, %d, %ls, %d, %ls, %d, %u, %u)\n",
1114 hstmt,
1115 (unsigned int) fColType,
1116 SQLWSTR(szCatalogName), (int) cbCatalogName,
1117 SQLWSTR(szSchemaName), (int) cbSchemaName,
1118 SQLWSTR(szTableName), (int) cbTableName,
1119 (unsigned int) fScope,
1120 (unsigned int) fNullable);
1121 SQLWSTR_FREE();
1122 }
1123 return odbc_SQLSpecialColumns(hstmt,
1124 fColType,
1125 (ODBC_CHAR*) szCatalogName, cbCatalogName,
1126 (ODBC_CHAR*) szSchemaName, cbSchemaName,
1127 (ODBC_CHAR*) szTableName, cbTableName,
1128 fScope,
1129 fNullable, 1);
1130}
1131#endif
1132
1133SQLRETURN ODBC_PUBLIC ODBC_API SQLSpecialColumns(
1134 SQLHSTMT hstmt,
1135 SQLUSMALLINT fColType,
1136 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1137 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1138 SQLCHAR * szTableName, SQLSMALLINT cbTableName,
1139 SQLUSMALLINT fScope,
1140 SQLUSMALLINT fNullable)
1141{
1142 tdsdump_log(TDS_DBG_FUNC, "SQLSpecialColumns(%p, %u, %s, %d, %s, %d, %s, %d, %u, %u)\n",
1143 hstmt,
1144 (unsigned int) fColType,
1145 (const char*) szCatalogName, (int) cbCatalogName,
1146 (const char*) szSchemaName, (int) cbSchemaName,
1147 (const char*) szTableName, (int) cbTableName,
1148 (unsigned int) fScope,
1149 (unsigned int) fNullable);
1150#ifdef ENABLE_ODBC_WIDE
1151 return odbc_SQLSpecialColumns(hstmt,
1152 fColType,
1153 (ODBC_CHAR*) szCatalogName, cbCatalogName,
1154 (ODBC_CHAR*) szSchemaName, cbSchemaName,
1155 (ODBC_CHAR*) szTableName, cbTableName,
1156 fScope,
1157 fNullable, 0);
1158#else
1159 return odbc_SQLSpecialColumns(hstmt,
1160 fColType,
1161 szCatalogName, cbCatalogName,
1162 szSchemaName, cbSchemaName,
1163 szTableName, cbTableName,
1164 fScope,
1165 fNullable);
1166#endif
1167}
1168
1169#ifdef ENABLE_ODBC_WIDE
1170static SQLRETURN odbc_SQLStatistics(SQLHSTMT hstmt,
1171 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1172 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1173 ODBC_CHAR * szTableName, SQLSMALLINT cbTableName,
1174 SQLUSMALLINT fUnique,
1175 SQLUSMALLINT fAccuracy, int wide);
1176
1177SQLRETURN ODBC_PUBLIC ODBC_API SQLStatisticsW(
1178 SQLHSTMT hstmt,
1179 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1180 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1181 SQLWCHAR * szTableName, SQLSMALLINT cbTableName,
1182 SQLUSMALLINT fUnique,
1183 SQLUSMALLINT fAccuracy)
1184{
1185 if (TDS_UNLIKELY(tds_write_dump)) {
1186 SQLWSTR_BUFS(3);
1187 tdsdump_log_impl(TDS_DBG_FUNC, "SQLStatisticsW(%p, %ls, %d, %ls, %d, %ls, %d, %u, %u)\n",
1188 hstmt,
1189 SQLWSTR(szCatalogName), (int) cbCatalogName,
1190 SQLWSTR(szSchemaName), (int) cbSchemaName,
1191 SQLWSTR(szTableName), (int) cbTableName,
1192 (unsigned int) fUnique,
1193 (unsigned int) fAccuracy);
1194 SQLWSTR_FREE();
1195 }
1196 return odbc_SQLStatistics(hstmt,
1197 (ODBC_CHAR*) szCatalogName, cbCatalogName,
1198 (ODBC_CHAR*) szSchemaName, cbSchemaName,
1199 (ODBC_CHAR*) szTableName, cbTableName,
1200 fUnique,
1201 fAccuracy, 1);
1202}
1203#endif
1204
1205SQLRETURN ODBC_PUBLIC ODBC_API SQLStatistics(
1206 SQLHSTMT hstmt,
1207 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1208 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1209 SQLCHAR * szTableName, SQLSMALLINT cbTableName,
1210 SQLUSMALLINT fUnique,
1211 SQLUSMALLINT fAccuracy)
1212{
1213 tdsdump_log(TDS_DBG_FUNC, "SQLStatistics(%p, %s, %d, %s, %d, %s, %d, %u, %u)\n",
1214 hstmt,
1215 (const char*) szCatalogName, (int) cbCatalogName,
1216 (const char*) szSchemaName, (int) cbSchemaName,
1217 (const char*) szTableName, (int) cbTableName,
1218 (unsigned int) fUnique,
1219 (unsigned int) fAccuracy);
1220#ifdef ENABLE_ODBC_WIDE
1221 return odbc_SQLStatistics(hstmt,
1222 (ODBC_CHAR*) szCatalogName, cbCatalogName,
1223 (ODBC_CHAR*) szSchemaName, cbSchemaName,
1224 (ODBC_CHAR*) szTableName, cbTableName,
1225 fUnique,
1226 fAccuracy, 0);
1227#else
1228 return odbc_SQLStatistics(hstmt,
1229 szCatalogName, cbCatalogName,
1230 szSchemaName, cbSchemaName,
1231 szTableName, cbTableName,
1232 fUnique,
1233 fAccuracy);
1234#endif
1235}
1236
1237#ifdef ENABLE_ODBC_WIDE
1238static SQLRETURN odbc_SQLTables(SQLHSTMT hstmt,
1239 ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1240 ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1241 ODBC_CHAR * szTableName, SQLSMALLINT cbTableName,
1242 ODBC_CHAR * szTableType, SQLSMALLINT cbTableType, int wide);
1243
1244SQLRETURN ODBC_PUBLIC ODBC_API SQLTablesW(
1245 SQLHSTMT hstmt,
1246 SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1247 SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1248 SQLWCHAR * szTableName, SQLSMALLINT cbTableName,
1249 SQLWCHAR * szTableType, SQLSMALLINT cbTableType)
1250{
1251 if (TDS_UNLIKELY(tds_write_dump)) {
1252 SQLWSTR_BUFS(4);
1253 tdsdump_log_impl(TDS_DBG_FUNC, "SQLTablesW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n",
1254 hstmt,
1255 SQLWSTR(szCatalogName), (int) cbCatalogName,
1256 SQLWSTR(szSchemaName), (int) cbSchemaName,
1257 SQLWSTR(szTableName), (int) cbTableName,
1258 SQLWSTR(szTableType), (int) cbTableType);
1259 SQLWSTR_FREE();
1260 }
1261 return odbc_SQLTables(hstmt,
1262 (ODBC_CHAR*) szCatalogName, cbCatalogName,
1263 (ODBC_CHAR*) szSchemaName, cbSchemaName,
1264 (ODBC_CHAR*) szTableName, cbTableName,
1265 (ODBC_CHAR*) szTableType, cbTableType, 1);
1266}
1267#endif
1268
1269SQLRETURN ODBC_PUBLIC ODBC_API SQLTables(
1270 SQLHSTMT hstmt,
1271 SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName,
1272 SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName,
1273 SQLCHAR * szTableName, SQLSMALLINT cbTableName,
1274 SQLCHAR * szTableType, SQLSMALLINT cbTableType)
1275{
1276 tdsdump_log(TDS_DBG_FUNC, "SQLTables(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n",
1277 hstmt,
1278 (const char*) szCatalogName, (int) cbCatalogName,
1279 (const char*) szSchemaName, (int) cbSchemaName,
1280 (const char*) szTableName, (int) cbTableName,
1281 (const char*) szTableType, (int) cbTableType);
1282#ifdef ENABLE_ODBC_WIDE
1283 return odbc_SQLTables(hstmt,
1284 (ODBC_CHAR*) szCatalogName, cbCatalogName,
1285 (ODBC_CHAR*) szSchemaName, cbSchemaName,
1286 (ODBC_CHAR*) szTableName, cbTableName,
1287 (ODBC_CHAR*) szTableType, cbTableType, 0);
1288#else
1289 return odbc_SQLTables(hstmt,
1290 szCatalogName, cbCatalogName,
1291 szSchemaName, cbSchemaName,
1292 szTableName, cbTableName,
1293 szTableType, cbTableType);
1294#endif
1295}
1296