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

FreeTDS API

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
odbc_export.h
1 #undef tdsdump_log
2
3 #ifdef ENABLE_ODBC_WIDE
4 static SQLRETURN _SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, ODBC_CHAR * szConnStrIn, SQLSMALLINT cbConnStrIn, ODBC_CHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR* pcbConnStrOut, SQLUSMALLINT fDriverCompletion, int wide);
5 SQLRETURN ODBC_PUBLIC ODBC_API SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR * szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR* pcbConnStrOut, SQLUSMALLINT fDriverCompletion) {
6 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLDriverConnect(%p, %p, %s, %d, %p, %d, %p, %u)\n", hdbc, hwnd, (const char*) szConnStrIn, (int) cbConnStrIn, szConnStrOut, (int) cbConnStrOutMax, pcbConnStrOut, (unsigned int) fDriverCompletion);
7 return _SQLDriverConnect(hdbc, hwnd, (ODBC_CHAR*) szConnStrIn, cbConnStrIn, (ODBC_CHAR*) szConnStrOut, cbConnStrOutMax, pcbConnStrOut, fDriverCompletion, 0);
8 }
9 SQLRETURN ODBC_PUBLIC ODBC_API SQLDriverConnectW(SQLHDBC hdbc, SQLHWND hwnd, SQLWCHAR * szConnStrIn, SQLSMALLINT cbConnStrIn, SQLWCHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR* pcbConnStrOut, SQLUSMALLINT fDriverCompletion) {
10 if (TDS_UNLIKELY(tds_write_dump)) {
11 SQLWSTR_BUFS(1);
12 tdsdump_log(TDS_DBG_FUNC, "SQLDriverConnectW(%p, %p, %ls, %d, %p, %d, %p, %u)\n", hdbc, hwnd, SQLWSTR(szConnStrIn), (int) cbConnStrIn, szConnStrOut, (int) cbConnStrOutMax, pcbConnStrOut, (unsigned int) fDriverCompletion);
13 SQLWSTR_FREE();
14 }
15 return _SQLDriverConnect(hdbc, hwnd, (ODBC_CHAR*) szConnStrIn, cbConnStrIn, (ODBC_CHAR*) szConnStrOut, cbConnStrOutMax, pcbConnStrOut, fDriverCompletion, 1);
16 }
17 #else
18 SQLRETURN ODBC_PUBLIC ODBC_API SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR * szConnStrIn, SQLSMALLINT cbConnStrIn, SQLCHAR * szConnStrOut, SQLSMALLINT cbConnStrOutMax, SQLSMALLINT FAR* pcbConnStrOut, SQLUSMALLINT fDriverCompletion) {
19 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLDriverConnect(%p, %p, %s, %d, %p, %d, %p, %u)\n", hdbc, hwnd, (const char*) szConnStrIn, (int) cbConnStrIn, szConnStrOut, (int) cbConnStrOutMax, pcbConnStrOut, (unsigned int) fDriverCompletion);
20 return _SQLDriverConnect(hdbc, hwnd, szConnStrIn, cbConnStrIn, szConnStrOut, cbConnStrOutMax, pcbConnStrOut, fDriverCompletion);
21 }
22 #endif
23
24 #ifdef ENABLE_ODBC_WIDE
25 static SQLRETURN _SQLColumnPrivileges(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, ODBC_CHAR * szColumnName, SQLSMALLINT cbColumnName, int wide);
26 SQLRETURN ODBC_PUBLIC ODBC_API SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLCHAR * szColumnName, SQLSMALLINT cbColumnName) {
27 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLColumnPrivileges(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (const char*) szColumnName, (int) cbColumnName);
28 return _SQLColumnPrivileges(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, (ODBC_CHAR*) szColumnName, cbColumnName, 0);
29 }
30 SQLRETURN ODBC_PUBLIC ODBC_API SQLColumnPrivilegesW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szTableName, SQLSMALLINT cbTableName, SQLWCHAR * szColumnName, SQLSMALLINT cbColumnName) {
31 if (TDS_UNLIKELY(tds_write_dump)) {
32 SQLWSTR_BUFS(4);
33 tdsdump_log(TDS_DBG_FUNC, "SQLColumnPrivilegesW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szTableName), (int) cbTableName, SQLWSTR(szColumnName), (int) cbColumnName);
34 SQLWSTR_FREE();
35 }
36 return _SQLColumnPrivileges(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, (ODBC_CHAR*) szColumnName, cbColumnName, 1);
37 }
38 #else
39 SQLRETURN ODBC_PUBLIC ODBC_API SQLColumnPrivileges(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLCHAR * szColumnName, SQLSMALLINT cbColumnName) {
40 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLColumnPrivileges(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (const char*) szColumnName, (int) cbColumnName);
41 return _SQLColumnPrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, szColumnName, cbColumnName);
42 }
43 #endif
44
45 #ifdef ENABLE_ODBC_WIDE
46 static SQLRETURN _SQLForeignKeys(SQLHSTMT hstmt, ODBC_CHAR * szPkCatalogName, SQLSMALLINT cbPkCatalogName, ODBC_CHAR * szPkSchemaName, SQLSMALLINT cbPkSchemaName, ODBC_CHAR * szPkTableName, SQLSMALLINT cbPkTableName, ODBC_CHAR * szFkCatalogName, SQLSMALLINT cbFkCatalogName, ODBC_CHAR * szFkSchemaName, SQLSMALLINT cbFkSchemaName, ODBC_CHAR * szFkTableName, SQLSMALLINT cbFkTableName, int wide);
47 SQLRETURN ODBC_PUBLIC ODBC_API SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR * szPkCatalogName, SQLSMALLINT cbPkCatalogName, SQLCHAR * szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR * szPkTableName, SQLSMALLINT cbPkTableName, SQLCHAR * szFkCatalogName, SQLSMALLINT cbFkCatalogName, SQLCHAR * szFkSchemaName, SQLSMALLINT cbFkSchemaName, SQLCHAR * szFkTableName, SQLSMALLINT cbFkTableName) {
48 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLForeignKeys(%p, %s, %d, %s, %d, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szPkCatalogName, (int) cbPkCatalogName, (const char*) szPkSchemaName, (int) cbPkSchemaName, (const char*) szPkTableName, (int) cbPkTableName, (const char*) szFkCatalogName, (int) cbFkCatalogName, (const char*) szFkSchemaName, (int) cbFkSchemaName, (const char*) szFkTableName, (int) cbFkTableName);
49 return _SQLForeignKeys(hstmt, (ODBC_CHAR*) szPkCatalogName, cbPkCatalogName, (ODBC_CHAR*) szPkSchemaName, cbPkSchemaName, (ODBC_CHAR*) szPkTableName, cbPkTableName, (ODBC_CHAR*) szFkCatalogName, cbFkCatalogName, (ODBC_CHAR*) szFkSchemaName, cbFkSchemaName, (ODBC_CHAR*) szFkTableName, cbFkTableName, 0);
50 }
51 SQLRETURN ODBC_PUBLIC ODBC_API SQLForeignKeysW(SQLHSTMT hstmt, SQLWCHAR * szPkCatalogName, SQLSMALLINT cbPkCatalogName, SQLWCHAR * szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLWCHAR * szPkTableName, SQLSMALLINT cbPkTableName, SQLWCHAR * szFkCatalogName, SQLSMALLINT cbFkCatalogName, SQLWCHAR * szFkSchemaName, SQLSMALLINT cbFkSchemaName, SQLWCHAR * szFkTableName, SQLSMALLINT cbFkTableName) {
52 if (TDS_UNLIKELY(tds_write_dump)) {
53 SQLWSTR_BUFS(6);
54 tdsdump_log(TDS_DBG_FUNC, "SQLForeignKeysW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szPkCatalogName), (int) cbPkCatalogName, SQLWSTR(szPkSchemaName), (int) cbPkSchemaName, SQLWSTR(szPkTableName), (int) cbPkTableName, SQLWSTR(szFkCatalogName), (int) cbFkCatalogName, SQLWSTR(szFkSchemaName), (int) cbFkSchemaName, SQLWSTR(szFkTableName), (int) cbFkTableName);
55 SQLWSTR_FREE();
56 }
57 return _SQLForeignKeys(hstmt, (ODBC_CHAR*) szPkCatalogName, cbPkCatalogName, (ODBC_CHAR*) szPkSchemaName, cbPkSchemaName, (ODBC_CHAR*) szPkTableName, cbPkTableName, (ODBC_CHAR*) szFkCatalogName, cbFkCatalogName, (ODBC_CHAR*) szFkSchemaName, cbFkSchemaName, (ODBC_CHAR*) szFkTableName, cbFkTableName, 1);
58 }
59 #else
60 SQLRETURN ODBC_PUBLIC ODBC_API SQLForeignKeys(SQLHSTMT hstmt, SQLCHAR * szPkCatalogName, SQLSMALLINT cbPkCatalogName, SQLCHAR * szPkSchemaName, SQLSMALLINT cbPkSchemaName, SQLCHAR * szPkTableName, SQLSMALLINT cbPkTableName, SQLCHAR * szFkCatalogName, SQLSMALLINT cbFkCatalogName, SQLCHAR * szFkSchemaName, SQLSMALLINT cbFkSchemaName, SQLCHAR * szFkTableName, SQLSMALLINT cbFkTableName) {
61 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLForeignKeys(%p, %s, %d, %s, %d, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szPkCatalogName, (int) cbPkCatalogName, (const char*) szPkSchemaName, (int) cbPkSchemaName, (const char*) szPkTableName, (int) cbPkTableName, (const char*) szFkCatalogName, (int) cbFkCatalogName, (const char*) szFkSchemaName, (int) cbFkSchemaName, (const char*) szFkTableName, (int) cbFkTableName);
62 return _SQLForeignKeys(hstmt, szPkCatalogName, cbPkCatalogName, szPkSchemaName, cbPkSchemaName, szPkTableName, cbPkTableName, szFkCatalogName, cbFkCatalogName, szFkSchemaName, cbFkSchemaName, szFkTableName, cbFkTableName);
63 }
64 #endif
65
66 #ifdef ENABLE_ODBC_WIDE
67 static SQLRETURN _SQLNativeSql(SQLHDBC hdbc, ODBC_CHAR * szSqlStrIn, SQLINTEGER cbSqlStrIn, ODBC_CHAR * szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR* pcbSqlStr, int wide);
68 SQLRETURN ODBC_PUBLIC ODBC_API SQLNativeSql(SQLHDBC hdbc, SQLCHAR * szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR * szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR* pcbSqlStr) {
69 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLNativeSql(%p, %s, %d, %p, %d, %p)\n", hdbc, (const char*) szSqlStrIn, (int) cbSqlStrIn, szSqlStr, (int) cbSqlStrMax, pcbSqlStr);
70 return _SQLNativeSql(hdbc, (ODBC_CHAR*) szSqlStrIn, cbSqlStrIn, (ODBC_CHAR*) szSqlStr, cbSqlStrMax, pcbSqlStr, 0);
71 }
72 SQLRETURN ODBC_PUBLIC ODBC_API SQLNativeSqlW(SQLHDBC hdbc, SQLWCHAR * szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLWCHAR * szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR* pcbSqlStr) {
73 if (TDS_UNLIKELY(tds_write_dump)) {
74 SQLWSTR_BUFS(1);
75 tdsdump_log(TDS_DBG_FUNC, "SQLNativeSqlW(%p, %ls, %d, %p, %d, %p)\n", hdbc, SQLWSTR(szSqlStrIn), (int) cbSqlStrIn, szSqlStr, (int) cbSqlStrMax, pcbSqlStr);
76 SQLWSTR_FREE();
77 }
78 return _SQLNativeSql(hdbc, (ODBC_CHAR*) szSqlStrIn, cbSqlStrIn, (ODBC_CHAR*) szSqlStr, cbSqlStrMax, pcbSqlStr, 1);
79 }
80 #else
81 SQLRETURN ODBC_PUBLIC ODBC_API SQLNativeSql(SQLHDBC hdbc, SQLCHAR * szSqlStrIn, SQLINTEGER cbSqlStrIn, SQLCHAR * szSqlStr, SQLINTEGER cbSqlStrMax, SQLINTEGER FAR* pcbSqlStr) {
82 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLNativeSql(%p, %s, %d, %p, %d, %p)\n", hdbc, (const char*) szSqlStrIn, (int) cbSqlStrIn, szSqlStr, (int) cbSqlStrMax, pcbSqlStr);
83 return _SQLNativeSql(hdbc, szSqlStrIn, cbSqlStrIn, szSqlStr, cbSqlStrMax, pcbSqlStr);
84 }
85 #endif
86
87 #ifdef ENABLE_ODBC_WIDE
88 static SQLRETURN _SQLPrimaryKeys(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, int wide);
89 SQLRETURN ODBC_PUBLIC ODBC_API SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName) {
90 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLPrimaryKeys(%p, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName);
91 return _SQLPrimaryKeys(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, 0);
92 }
93 SQLRETURN ODBC_PUBLIC ODBC_API SQLPrimaryKeysW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szTableName, SQLSMALLINT cbTableName) {
94 if (TDS_UNLIKELY(tds_write_dump)) {
95 SQLWSTR_BUFS(3);
96 tdsdump_log(TDS_DBG_FUNC, "SQLPrimaryKeysW(%p, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szTableName), (int) cbTableName);
97 SQLWSTR_FREE();
98 }
99 return _SQLPrimaryKeys(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, 1);
100 }
101 #else
102 SQLRETURN ODBC_PUBLIC ODBC_API SQLPrimaryKeys(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName) {
103 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLPrimaryKeys(%p, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName);
104 return _SQLPrimaryKeys(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName);
105 }
106 #endif
107
108 #ifdef ENABLE_ODBC_WIDE
109 static SQLRETURN _SQLProcedureColumns(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szProcName, SQLSMALLINT cbProcName, ODBC_CHAR * szColumnName, SQLSMALLINT cbColumnName, int wide);
110 SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szProcName, SQLSMALLINT cbProcName, SQLCHAR * szColumnName, SQLSMALLINT cbColumnName) {
111 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLProcedureColumns(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szProcName, (int) cbProcName, (const char*) szColumnName, (int) cbColumnName);
112 return _SQLProcedureColumns(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szProcName, cbProcName, (ODBC_CHAR*) szColumnName, cbColumnName, 0);
113 }
114 SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedureColumnsW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szProcName, SQLSMALLINT cbProcName, SQLWCHAR * szColumnName, SQLSMALLINT cbColumnName) {
115 if (TDS_UNLIKELY(tds_write_dump)) {
116 SQLWSTR_BUFS(4);
117 tdsdump_log(TDS_DBG_FUNC, "SQLProcedureColumnsW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szProcName), (int) cbProcName, SQLWSTR(szColumnName), (int) cbColumnName);
118 SQLWSTR_FREE();
119 }
120 return _SQLProcedureColumns(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szProcName, cbProcName, (ODBC_CHAR*) szColumnName, cbColumnName, 1);
121 }
122 #else
123 SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedureColumns(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szProcName, SQLSMALLINT cbProcName, SQLCHAR * szColumnName, SQLSMALLINT cbColumnName) {
124 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLProcedureColumns(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szProcName, (int) cbProcName, (const char*) szColumnName, (int) cbColumnName);
125 return _SQLProcedureColumns(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, cbProcName, szColumnName, cbColumnName);
126 }
127 #endif
128
129 #ifdef ENABLE_ODBC_WIDE
130 static SQLRETURN _SQLProcedures(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szProcName, SQLSMALLINT cbProcName, int wide);
131 SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedures(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szProcName, SQLSMALLINT cbProcName) {
132 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLProcedures(%p, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szProcName, (int) cbProcName);
133 return _SQLProcedures(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szProcName, cbProcName, 0);
134 }
135 SQLRETURN ODBC_PUBLIC ODBC_API SQLProceduresW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szProcName, SQLSMALLINT cbProcName) {
136 if (TDS_UNLIKELY(tds_write_dump)) {
137 SQLWSTR_BUFS(3);
138 tdsdump_log(TDS_DBG_FUNC, "SQLProceduresW(%p, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szProcName), (int) cbProcName);
139 SQLWSTR_FREE();
140 }
141 return _SQLProcedures(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szProcName, cbProcName, 1);
142 }
143 #else
144 SQLRETURN ODBC_PUBLIC ODBC_API SQLProcedures(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szProcName, SQLSMALLINT cbProcName) {
145 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLProcedures(%p, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szProcName, (int) cbProcName);
146 return _SQLProcedures(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szProcName, cbProcName);
147 }
148 #endif
149
150 #ifdef ENABLE_ODBC_WIDE
151 static SQLRETURN _SQLTablePrivileges(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, int wide);
152 SQLRETURN ODBC_PUBLIC ODBC_API SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName) {
153 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLTablePrivileges(%p, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName);
154 return _SQLTablePrivileges(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, 0);
155 }
156 SQLRETURN ODBC_PUBLIC ODBC_API SQLTablePrivilegesW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szTableName, SQLSMALLINT cbTableName) {
157 if (TDS_UNLIKELY(tds_write_dump)) {
158 SQLWSTR_BUFS(3);
159 tdsdump_log(TDS_DBG_FUNC, "SQLTablePrivilegesW(%p, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szTableName), (int) cbTableName);
160 SQLWSTR_FREE();
161 }
162 return _SQLTablePrivileges(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, 1);
163 }
164 #else
165 SQLRETURN ODBC_PUBLIC ODBC_API SQLTablePrivileges(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName) {
166 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLTablePrivileges(%p, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName);
167 return _SQLTablePrivileges(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName);
168 }
169 #endif
170
171 #ifdef ENABLE_ODBC_WIDE
172 static SQLRETURN _SQLConnect(SQLHDBC hdbc, ODBC_CHAR * szDSN, SQLSMALLINT cbDSN, ODBC_CHAR * szUID, SQLSMALLINT cbUID, ODBC_CHAR * szAuthStr, SQLSMALLINT cbAuthStr, int wide);
173 SQLRETURN ODBC_PUBLIC ODBC_API SQLConnect(SQLHDBC hdbc, SQLCHAR * szDSN, SQLSMALLINT cbDSN, SQLCHAR * szUID, SQLSMALLINT cbUID, SQLCHAR * szAuthStr, SQLSMALLINT cbAuthStr) {
174 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLConnect(%p, %s, %d, %s, %d, %s, %d)\n", hdbc, (const char*) szDSN, (int) cbDSN, (const char*) szUID, (int) cbUID, (const char*) szAuthStr, (int) cbAuthStr);
175 return _SQLConnect(hdbc, (ODBC_CHAR*) szDSN, cbDSN, (ODBC_CHAR*) szUID, cbUID, (ODBC_CHAR*) szAuthStr, cbAuthStr, 0);
176 }
177 SQLRETURN ODBC_PUBLIC ODBC_API SQLConnectW(SQLHDBC hdbc, SQLWCHAR * szDSN, SQLSMALLINT cbDSN, SQLWCHAR * szUID, SQLSMALLINT cbUID, SQLWCHAR * szAuthStr, SQLSMALLINT cbAuthStr) {
178 if (TDS_UNLIKELY(tds_write_dump)) {
179 SQLWSTR_BUFS(3);
180 tdsdump_log(TDS_DBG_FUNC, "SQLConnectW(%p, %ls, %d, %ls, %d, %ls, %d)\n", hdbc, SQLWSTR(szDSN), (int) cbDSN, SQLWSTR(szUID), (int) cbUID, SQLWSTR(szAuthStr), (int) cbAuthStr);
181 SQLWSTR_FREE();
182 }
183 return _SQLConnect(hdbc, (ODBC_CHAR*) szDSN, cbDSN, (ODBC_CHAR*) szUID, cbUID, (ODBC_CHAR*) szAuthStr, cbAuthStr, 1);
184 }
185 #else
186 SQLRETURN ODBC_PUBLIC ODBC_API SQLConnect(SQLHDBC hdbc, SQLCHAR * szDSN, SQLSMALLINT cbDSN, SQLCHAR * szUID, SQLSMALLINT cbUID, SQLCHAR * szAuthStr, SQLSMALLINT cbAuthStr) {
187 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLConnect(%p, %s, %d, %s, %d, %s, %d)\n", hdbc, (const char*) szDSN, (int) cbDSN, (const char*) szUID, (int) cbUID, (const char*) szAuthStr, (int) cbAuthStr);
188 return _SQLConnect(hdbc, szDSN, cbDSN, szUID, cbUID, szAuthStr, cbAuthStr);
189 }
190 #endif
191
192 #ifdef ENABLE_ODBC_WIDE
193 static SQLRETURN _SQLDescribeCol(SQLHSTMT hstmt, SQLUSMALLINT icol, ODBC_CHAR * szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR* pcbColName, SQLSMALLINT * pfSqlType, SQLULEN * pcbColDef, SQLSMALLINT * pibScale, SQLSMALLINT * pfNullable, int wide);
194 SQLRETURN ODBC_PUBLIC ODBC_API SQLDescribeCol(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLCHAR * szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR* pcbColName, SQLSMALLINT * pfSqlType, SQLULEN * pcbColDef, SQLSMALLINT * pibScale, SQLSMALLINT * pfNullable) {
195 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLDescribeCol(%p, %u, %p, %d, %p, %p, %p, %p, %p)\n", hstmt, (unsigned int) icol, szColName, (int) cbColNameMax, pcbColName, pfSqlType, pcbColDef, pibScale, pfNullable);
196 return _SQLDescribeCol(hstmt, icol, (ODBC_CHAR*) szColName, cbColNameMax, pcbColName, pfSqlType, pcbColDef, pibScale, pfNullable, 0);
197 }
198 SQLRETURN ODBC_PUBLIC ODBC_API SQLDescribeColW(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLWCHAR * szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR* pcbColName, SQLSMALLINT * pfSqlType, SQLULEN * pcbColDef, SQLSMALLINT * pibScale, SQLSMALLINT * pfNullable) {
199 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLDescribeColW(%p, %u, %p, %d, %p, %p, %p, %p, %p)\n", hstmt, (unsigned int) icol, szColName, (int) cbColNameMax, pcbColName, pfSqlType, pcbColDef, pibScale, pfNullable);
200 return _SQLDescribeCol(hstmt, icol, (ODBC_CHAR*) szColName, cbColNameMax, pcbColName, pfSqlType, pcbColDef, pibScale, pfNullable, 1);
201 }
202 #else
203 SQLRETURN ODBC_PUBLIC ODBC_API SQLDescribeCol(SQLHSTMT hstmt, SQLUSMALLINT icol, SQLCHAR * szColName, SQLSMALLINT cbColNameMax, SQLSMALLINT FAR* pcbColName, SQLSMALLINT * pfSqlType, SQLULEN * pcbColDef, SQLSMALLINT * pibScale, SQLSMALLINT * pfNullable) {
204 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLDescribeCol(%p, %u, %p, %d, %p, %p, %p, %p, %p)\n", hstmt, (unsigned int) icol, szColName, (int) cbColNameMax, pcbColName, pfSqlType, pcbColDef, pibScale, pfNullable);
205 return _SQLDescribeCol(hstmt, icol, szColName, cbColNameMax, pcbColName, pfSqlType, pcbColDef, pibScale, pfNullable);
206 }
207 #endif
208
209 #ifdef ENABLE_ODBC_WIDE
210 static SQLRETURN _SQLGetDescRec(SQLHDESC hdesc, SQLSMALLINT RecordNumber, ODBC_CHAR * szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR* pcbName, SQLSMALLINT * Type, SQLSMALLINT * SubType, SQLLEN * Length, SQLSMALLINT * Precision, SQLSMALLINT * Scale, SQLSMALLINT * Nullable, int wide);
211 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescRec(SQLHDESC hdesc, SQLSMALLINT RecordNumber, SQLCHAR * szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR* pcbName, SQLSMALLINT * Type, SQLSMALLINT * SubType, SQLLEN * Length, SQLSMALLINT * Precision, SQLSMALLINT * Scale, SQLSMALLINT * Nullable) {
212 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDescRec(%p, %d, %p, %d, %p, %p, %p, %p, %p, %p, %p)\n", hdesc, (int) RecordNumber, szName, (int) cbNameMax, pcbName, Type, SubType, Length, Precision, Scale, Nullable);
213 return _SQLGetDescRec(hdesc, RecordNumber, (ODBC_CHAR*) szName, cbNameMax, pcbName, Type, SubType, Length, Precision, Scale, Nullable, 0);
214 }
215 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescRecW(SQLHDESC hdesc, SQLSMALLINT RecordNumber, SQLWCHAR * szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR* pcbName, SQLSMALLINT * Type, SQLSMALLINT * SubType, SQLLEN * Length, SQLSMALLINT * Precision, SQLSMALLINT * Scale, SQLSMALLINT * Nullable) {
216 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDescRecW(%p, %d, %p, %d, %p, %p, %p, %p, %p, %p, %p)\n", hdesc, (int) RecordNumber, szName, (int) cbNameMax, pcbName, Type, SubType, Length, Precision, Scale, Nullable);
217 return _SQLGetDescRec(hdesc, RecordNumber, (ODBC_CHAR*) szName, cbNameMax, pcbName, Type, SubType, Length, Precision, Scale, Nullable, 1);
218 }
219 #else
220 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescRec(SQLHDESC hdesc, SQLSMALLINT RecordNumber, SQLCHAR * szName, SQLSMALLINT cbNameMax, SQLSMALLINT FAR* pcbName, SQLSMALLINT * Type, SQLSMALLINT * SubType, SQLLEN * Length, SQLSMALLINT * Precision, SQLSMALLINT * Scale, SQLSMALLINT * Nullable) {
221 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDescRec(%p, %d, %p, %d, %p, %p, %p, %p, %p, %p, %p)\n", hdesc, (int) RecordNumber, szName, (int) cbNameMax, pcbName, Type, SubType, Length, Precision, Scale, Nullable);
222 return _SQLGetDescRec(hdesc, RecordNumber, szName, cbNameMax, pcbName, Type, SubType, Length, Precision, Scale, Nullable);
223 }
224 #endif
225
226 #ifdef ENABLE_ODBC_WIDE
227 static SQLRETURN _SQLGetDescField(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength, int wide);
228 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescField(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength) {
229 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDescField(%p, %d, %d, %p, %d, %p)\n", hdesc, (int) icol, (int) fDescType, Value, (int) BufferLength, StringLength);
230 return _SQLGetDescField(hdesc, icol, fDescType, Value, BufferLength, StringLength, 0);
231 }
232 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescFieldW(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength) {
233 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDescFieldW(%p, %d, %d, %p, %d, %p)\n", hdesc, (int) icol, (int) fDescType, Value, (int) BufferLength, StringLength);
234 return _SQLGetDescField(hdesc, icol, fDescType, Value, BufferLength, StringLength, 1);
235 }
236 #else
237 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetDescField(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength) {
238 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetDescField(%p, %d, %d, %p, %d, %p)\n", hdesc, (int) icol, (int) fDescType, Value, (int) BufferLength, StringLength);
239 return _SQLGetDescField(hdesc, icol, fDescType, Value, BufferLength, StringLength);
240 }
241 #endif
242
243 #ifdef ENABLE_ODBC_WIDE
244 static SQLRETURN _SQLSetDescField(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength, int wide);
245 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetDescField(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength) {
246 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetDescField(%p, %d, %d, %p, %d)\n", hdesc, (int) icol, (int) fDescType, Value, (int) BufferLength);
247 return _SQLSetDescField(hdesc, icol, fDescType, Value, BufferLength, 0);
248 }
249 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetDescFieldW(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength) {
250 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetDescFieldW(%p, %d, %d, %p, %d)\n", hdesc, (int) icol, (int) fDescType, Value, (int) BufferLength);
251 return _SQLSetDescField(hdesc, icol, fDescType, Value, BufferLength, 1);
252 }
253 #else
254 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetDescField(SQLHDESC hdesc, SQLSMALLINT icol, SQLSMALLINT fDescType, SQLPOINTER Value, SQLINTEGER BufferLength) {
255 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetDescField(%p, %d, %d, %p, %d)\n", hdesc, (int) icol, (int) fDescType, Value, (int) BufferLength);
256 return _SQLSetDescField(hdesc, icol, fDescType, Value, BufferLength);
257 }
258 #endif
259
260 #ifdef ENABLE_ODBC_WIDE
261 static SQLRETURN _SQLExecDirect(SQLHSTMT hstmt, ODBC_CHAR * szSqlStr, SQLINTEGER cbSqlStr, int wide);
262 SQLRETURN ODBC_PUBLIC ODBC_API SQLExecDirect(SQLHSTMT hstmt, SQLCHAR * szSqlStr, SQLINTEGER cbSqlStr) {
263 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLExecDirect(%p, %s, %d)\n", hstmt, (const char*) szSqlStr, (int) cbSqlStr);
264 return _SQLExecDirect(hstmt, (ODBC_CHAR*) szSqlStr, cbSqlStr, 0);
265 }
266 SQLRETURN ODBC_PUBLIC ODBC_API SQLExecDirectW(SQLHSTMT hstmt, SQLWCHAR * szSqlStr, SQLINTEGER cbSqlStr) {
267 if (TDS_UNLIKELY(tds_write_dump)) {
268 SQLWSTR_BUFS(1);
269 tdsdump_log(TDS_DBG_FUNC, "SQLExecDirectW(%p, %ls, %d)\n", hstmt, SQLWSTR(szSqlStr), (int) cbSqlStr);
270 SQLWSTR_FREE();
271 }
272 return _SQLExecDirect(hstmt, (ODBC_CHAR*) szSqlStr, cbSqlStr, 1);
273 }
274 #else
275 SQLRETURN ODBC_PUBLIC ODBC_API SQLExecDirect(SQLHSTMT hstmt, SQLCHAR * szSqlStr, SQLINTEGER cbSqlStr) {
276 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLExecDirect(%p, %s, %d)\n", hstmt, (const char*) szSqlStr, (int) cbSqlStr);
277 return _SQLExecDirect(hstmt, szSqlStr, cbSqlStr);
278 }
279 #endif
280
281 #ifdef ENABLE_ODBC_WIDE
282 static SQLRETURN _SQLPrepare(SQLHSTMT hstmt, ODBC_CHAR * szSqlStr, SQLINTEGER cbSqlStr, int wide);
283 SQLRETURN ODBC_PUBLIC ODBC_API SQLPrepare(SQLHSTMT hstmt, SQLCHAR * szSqlStr, SQLINTEGER cbSqlStr) {
284 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLPrepare(%p, %s, %d)\n", hstmt, (const char*) szSqlStr, (int) cbSqlStr);
285 return _SQLPrepare(hstmt, (ODBC_CHAR*) szSqlStr, cbSqlStr, 0);
286 }
287 SQLRETURN ODBC_PUBLIC ODBC_API SQLPrepareW(SQLHSTMT hstmt, SQLWCHAR * szSqlStr, SQLINTEGER cbSqlStr) {
288 if (TDS_UNLIKELY(tds_write_dump)) {
289 SQLWSTR_BUFS(1);
290 tdsdump_log(TDS_DBG_FUNC, "SQLPrepareW(%p, %ls, %d)\n", hstmt, SQLWSTR(szSqlStr), (int) cbSqlStr);
291 SQLWSTR_FREE();
292 }
293 return _SQLPrepare(hstmt, (ODBC_CHAR*) szSqlStr, cbSqlStr, 1);
294 }
295 #else
296 SQLRETURN ODBC_PUBLIC ODBC_API SQLPrepare(SQLHSTMT hstmt, SQLCHAR * szSqlStr, SQLINTEGER cbSqlStr) {
297 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLPrepare(%p, %s, %d)\n", hstmt, (const char*) szSqlStr, (int) cbSqlStr);
298 return _SQLPrepare(hstmt, szSqlStr, cbSqlStr);
299 }
300 #endif
301
302 #ifdef ENABLE_ODBC_WIDE
303 static SQLRETURN _SQLSetCursorName(SQLHSTMT hstmt, ODBC_CHAR * szCursor, SQLSMALLINT cbCursor, int wide);
304 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetCursorName(SQLHSTMT hstmt, SQLCHAR * szCursor, SQLSMALLINT cbCursor) {
305 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetCursorName(%p, %s, %d)\n", hstmt, (const char*) szCursor, (int) cbCursor);
306 return _SQLSetCursorName(hstmt, (ODBC_CHAR*) szCursor, cbCursor, 0);
307 }
308 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetCursorNameW(SQLHSTMT hstmt, SQLWCHAR * szCursor, SQLSMALLINT cbCursor) {
309 if (TDS_UNLIKELY(tds_write_dump)) {
310 SQLWSTR_BUFS(1);
311 tdsdump_log(TDS_DBG_FUNC, "SQLSetCursorNameW(%p, %ls, %d)\n", hstmt, SQLWSTR(szCursor), (int) cbCursor);
312 SQLWSTR_FREE();
313 }
314 return _SQLSetCursorName(hstmt, (ODBC_CHAR*) szCursor, cbCursor, 1);
315 }
316 #else
317 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetCursorName(SQLHSTMT hstmt, SQLCHAR * szCursor, SQLSMALLINT cbCursor) {
318 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetCursorName(%p, %s, %d)\n", hstmt, (const char*) szCursor, (int) cbCursor);
319 return _SQLSetCursorName(hstmt, szCursor, cbCursor);
320 }
321 #endif
322
323 #ifdef ENABLE_ODBC_WIDE
324 static SQLRETURN _SQLGetCursorName(SQLHSTMT hstmt, ODBC_CHAR * szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR* pcbCursor, int wide);
325 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetCursorName(SQLHSTMT hstmt, SQLCHAR * szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR* pcbCursor) {
326 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetCursorName(%p, %p, %d, %p)\n", hstmt, szCursor, (int) cbCursorMax, pcbCursor);
327 return _SQLGetCursorName(hstmt, (ODBC_CHAR*) szCursor, cbCursorMax, pcbCursor, 0);
328 }
329 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetCursorNameW(SQLHSTMT hstmt, SQLWCHAR * szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR* pcbCursor) {
330 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetCursorNameW(%p, %p, %d, %p)\n", hstmt, szCursor, (int) cbCursorMax, pcbCursor);
331 return _SQLGetCursorName(hstmt, (ODBC_CHAR*) szCursor, cbCursorMax, pcbCursor, 1);
332 }
333 #else
334 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetCursorName(SQLHSTMT hstmt, SQLCHAR * szCursor, SQLSMALLINT cbCursorMax, SQLSMALLINT FAR* pcbCursor) {
335 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetCursorName(%p, %p, %d, %p)\n", hstmt, szCursor, (int) cbCursorMax, pcbCursor);
336 return _SQLGetCursorName(hstmt, szCursor, cbCursorMax, pcbCursor);
337 }
338 #endif
339
340 #ifdef ENABLE_ODBC_WIDE
341 static SQLRETURN _SQLColumns(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, ODBC_CHAR * szColumnName, SQLSMALLINT cbColumnName, int wide);
342 SQLRETURN ODBC_PUBLIC ODBC_API SQLColumns(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLCHAR * szColumnName, SQLSMALLINT cbColumnName) {
343 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLColumns(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (const char*) szColumnName, (int) cbColumnName);
344 return _SQLColumns(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, (ODBC_CHAR*) szColumnName, cbColumnName, 0);
345 }
346 SQLRETURN ODBC_PUBLIC ODBC_API SQLColumnsW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szTableName, SQLSMALLINT cbTableName, SQLWCHAR * szColumnName, SQLSMALLINT cbColumnName) {
347 if (TDS_UNLIKELY(tds_write_dump)) {
348 SQLWSTR_BUFS(4);
349 tdsdump_log(TDS_DBG_FUNC, "SQLColumnsW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szTableName), (int) cbTableName, SQLWSTR(szColumnName), (int) cbColumnName);
350 SQLWSTR_FREE();
351 }
352 return _SQLColumns(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, (ODBC_CHAR*) szColumnName, cbColumnName, 1);
353 }
354 #else
355 SQLRETURN ODBC_PUBLIC ODBC_API SQLColumns(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLCHAR * szColumnName, SQLSMALLINT cbColumnName) {
356 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLColumns(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (const char*) szColumnName, (int) cbColumnName);
357 return _SQLColumns(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, szColumnName, cbColumnName);
358 }
359 #endif
360
361 #ifdef ENABLE_ODBC_WIDE
362 static SQLRETURN _SQLGetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength, int wide);
363 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength) {
364 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetConnectAttr(%p, %d, %p, %d, %p)\n", hdbc, (int) Attribute, Value, (int) BufferLength, StringLength);
365 return _SQLGetConnectAttr(hdbc, Attribute, Value, BufferLength, StringLength, 0);
366 }
367 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectAttrW(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength) {
368 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetConnectAttrW(%p, %d, %p, %d, %p)\n", hdbc, (int) Attribute, Value, (int) BufferLength, StringLength);
369 return _SQLGetConnectAttr(hdbc, Attribute, Value, BufferLength, StringLength, 1);
370 }
371 #else
372 SQLRETURN ODBC_PUBLIC ODBC_API SQLGetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER Value, SQLINTEGER BufferLength, SQLINTEGER * StringLength) {
373 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLGetConnectAttr(%p, %d, %p, %d, %p)\n", hdbc, (int) Attribute, Value, (int) BufferLength, StringLength);
374 return _SQLGetConnectAttr(hdbc, Attribute, Value, BufferLength, StringLength);
375 }
376 #endif
377
378 #ifdef ENABLE_ODBC_WIDE
379 static SQLRETURN _SQLSetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength, int wide);
380 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength) {
381 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetConnectAttr(%p, %d, %p, %d)\n", hdbc, (int) Attribute, ValuePtr, (int) StringLength);
382 return _SQLSetConnectAttr(hdbc, Attribute, ValuePtr, StringLength, 0);
383 }
384 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectAttrW(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength) {
385 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetConnectAttrW(%p, %d, %p, %d)\n", hdbc, (int) Attribute, ValuePtr, (int) StringLength);
386 return _SQLSetConnectAttr(hdbc, Attribute, ValuePtr, StringLength, 1);
387 }
388 #else
389 SQLRETURN ODBC_PUBLIC ODBC_API SQLSetConnectAttr(SQLHDBC hdbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength) {
390 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSetConnectAttr(%p, %d, %p, %d)\n", hdbc, (int) Attribute, ValuePtr, (int) StringLength);
391 return _SQLSetConnectAttr(hdbc, Attribute, ValuePtr, StringLength);
392 }
393 #endif
394
395 #ifdef ENABLE_ODBC_WIDE
396 static SQLRETURN _SQLSpecialColumns(SQLHSTMT hstmt, SQLUSMALLINT fColType, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fScope, SQLUSMALLINT fNullable, int wide);
397 SQLRETURN ODBC_PUBLIC ODBC_API SQLSpecialColumns(SQLHSTMT hstmt, SQLUSMALLINT fColType, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fScope, SQLUSMALLINT fNullable) {
398 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSpecialColumns(%p, %u, %s, %d, %s, %d, %s, %d, %u, %u)\n", hstmt, (unsigned int) fColType, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (unsigned int) fScope, (unsigned int) fNullable);
399 return _SQLSpecialColumns(hstmt, fColType, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, fScope, fNullable, 0);
400 }
401 SQLRETURN ODBC_PUBLIC ODBC_API SQLSpecialColumnsW(SQLHSTMT hstmt, SQLUSMALLINT fColType, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fScope, SQLUSMALLINT fNullable) {
402 if (TDS_UNLIKELY(tds_write_dump)) {
403 SQLWSTR_BUFS(3);
404 tdsdump_log(TDS_DBG_FUNC, "SQLSpecialColumnsW(%p, %u, %ls, %d, %ls, %d, %ls, %d, %u, %u)\n", hstmt, (unsigned int) fColType, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szTableName), (int) cbTableName, (unsigned int) fScope, (unsigned int) fNullable);
405 SQLWSTR_FREE();
406 }
407 return _SQLSpecialColumns(hstmt, fColType, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, fScope, fNullable, 1);
408 }
409 #else
410 SQLRETURN ODBC_PUBLIC ODBC_API SQLSpecialColumns(SQLHSTMT hstmt, SQLUSMALLINT fColType, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fScope, SQLUSMALLINT fNullable) {
411 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLSpecialColumns(%p, %u, %s, %d, %s, %d, %s, %d, %u, %u)\n", hstmt, (unsigned int) fColType, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (unsigned int) fScope, (unsigned int) fNullable);
412 return _SQLSpecialColumns(hstmt, fColType, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, fScope, fNullable);
413 }
414 #endif
415
416 #ifdef ENABLE_ODBC_WIDE
417 static SQLRETURN _SQLStatistics(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fUnique, SQLUSMALLINT fAccuracy, int wide);
418 SQLRETURN ODBC_PUBLIC ODBC_API SQLStatistics(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fUnique, SQLUSMALLINT fAccuracy) {
419 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLStatistics(%p, %s, %d, %s, %d, %s, %d, %u, %u)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (unsigned int) fUnique, (unsigned int) fAccuracy);
420 return _SQLStatistics(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, fUnique, fAccuracy, 0);
421 }
422 SQLRETURN ODBC_PUBLIC ODBC_API SQLStatisticsW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fUnique, SQLUSMALLINT fAccuracy) {
423 if (TDS_UNLIKELY(tds_write_dump)) {
424 SQLWSTR_BUFS(3);
425 tdsdump_log(TDS_DBG_FUNC, "SQLStatisticsW(%p, %ls, %d, %ls, %d, %ls, %d, %u, %u)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szTableName), (int) cbTableName, (unsigned int) fUnique, (unsigned int) fAccuracy);
426 SQLWSTR_FREE();
427 }
428 return _SQLStatistics(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, fUnique, fAccuracy, 1);
429 }
430 #else
431 SQLRETURN ODBC_PUBLIC ODBC_API SQLStatistics(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLUSMALLINT fUnique, SQLUSMALLINT fAccuracy) {
432 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLStatistics(%p, %s, %d, %s, %d, %s, %d, %u, %u)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (unsigned int) fUnique, (unsigned int) fAccuracy);
433 return _SQLStatistics(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, fUnique, fAccuracy);
434 }
435 #endif
436
437 #ifdef ENABLE_ODBC_WIDE
438 static SQLRETURN _SQLTables(SQLHSTMT hstmt, ODBC_CHAR * szCatalogName, SQLSMALLINT cbCatalogName, ODBC_CHAR * szSchemaName, SQLSMALLINT cbSchemaName, ODBC_CHAR * szTableName, SQLSMALLINT cbTableName, ODBC_CHAR * szTableType, SQLSMALLINT cbTableType, int wide);
439 SQLRETURN ODBC_PUBLIC ODBC_API SQLTables(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLCHAR * szTableType, SQLSMALLINT cbTableType) {
440 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLTables(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (const char*) szTableType, (int) cbTableType);
441 return _SQLTables(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, (ODBC_CHAR*) szTableType, cbTableType, 0);
442 }
443 SQLRETURN ODBC_PUBLIC ODBC_API SQLTablesW(SQLHSTMT hstmt, SQLWCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLWCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLWCHAR * szTableName, SQLSMALLINT cbTableName, SQLWCHAR * szTableType, SQLSMALLINT cbTableType) {
444 if (TDS_UNLIKELY(tds_write_dump)) {
445 SQLWSTR_BUFS(4);
446 tdsdump_log(TDS_DBG_FUNC, "SQLTablesW(%p, %ls, %d, %ls, %d, %ls, %d, %ls, %d)\n", hstmt, SQLWSTR(szCatalogName), (int) cbCatalogName, SQLWSTR(szSchemaName), (int) cbSchemaName, SQLWSTR(szTableName), (int) cbTableName, SQLWSTR(szTableType), (int) cbTableType);
447 SQLWSTR_FREE();
448 }
449 return _SQLTables(hstmt, (ODBC_CHAR*) szCatalogName, cbCatalogName, (ODBC_CHAR*) szSchemaName, cbSchemaName, (ODBC_CHAR*) szTableName, cbTableName, (ODBC_CHAR*) szTableType, cbTableType, 1);
450 }
451 #else
452 SQLRETURN ODBC_PUBLIC ODBC_API SQLTables(SQLHSTMT hstmt, SQLCHAR * szCatalogName, SQLSMALLINT cbCatalogName, SQLCHAR * szSchemaName, SQLSMALLINT cbSchemaName, SQLCHAR * szTableName, SQLSMALLINT cbTableName, SQLCHAR * szTableType, SQLSMALLINT cbTableType) {
453 TDSDUMP_LOG_FAST(TDS_DBG_FUNC, "SQLTables(%p, %s, %d, %s, %d, %s, %d, %s, %d)\n", hstmt, (const char*) szCatalogName, (int) cbCatalogName, (const char*) szSchemaName, (int) cbSchemaName, (const char*) szTableName, (int) cbTableName, (const char*) szTableType, (int) cbTableType);
454 return _SQLTables(hstmt, szCatalogName, cbCatalogName, szSchemaName, cbSchemaName, szTableName, cbTableName, szTableType, cbTableType);
455 }
456 #endif
457
458 #define tdsdump_log TDSDUMP_LOG_FAST
tdsdump_log
void tdsdump_log(const char *file, unsigned int level_line, const char *fmt,...)
Write a message to the debug log.
Definition: log.c:353
tds_write_dump
int tds_write_dump
Tell if TDS debug logging is turned on or off.
Definition: log.c:57