diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2009-10-01 09:16:17 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2009-10-01 09:16:17 +0000 |
commit | f1de5cd0088faac5c320a0a1f828583ab7606379 (patch) | |
tree | c87b4222b69f5be5100c4260ccff67e44536ef3e /unixODBC/inc | |
parent | 93b228f440495561b7fa6ba65ea67203804082d4 (diff) |
CWS-TOOLING: integrate CWS cmcfixes62
2009-09-22 21:19:24 +0200 cmc r276365 : #i100000# that's the most plausible explanation, -D$(CVER) is needed by scp2 under windows
2009-09-19 16:10:36 +0200 cmc r276303 : #i100000# revert this for no partically good reason
2009-09-18 14:16:47 +0200 cmc r276279 : remove extra build depend
2009-09-18 08:56:15 +0200 cmc r276265 : #i100000# rerun autoconf
2009-09-17 14:59:38 +0200 cmc r276245 : CWS-TOOLING: rebase CWS cmcfixes62 to trunk@276192 (milestone: DEV300:m59)
2009-09-10 16:40:49 +0200 pl r276041 : fix warning
2009-09-10 11:34:55 +0200 pl r276026 : disable warning from system header
2009-09-09 19:30:45 +0200 pl r276013 : use osl_getAsciiFunctionSymbol instead of strange cast
2009-09-09 19:25:32 +0200 pl r276012 : add some casting hacks to make compile on solaris cc
2009-09-09 19:10:48 +0200 pl r276009 : add missing Configure option for solaris sparce 32bit
2009-09-09 18:37:05 +0200 pl r276008 : merge fix for #i104525# into moved code
2009-09-07 13:28:08 +0200 cmc r275894 : CWS-TOOLING: rebase CWS cmcfixes62 to trunk@275801 (milestone: DEV300:m57)
2009-08-28 12:36:27 +0200 cmc r275523 : CWS-TOOLING: rebase CWS cmcfixes62 to trunk@275331 (milestone: DEV300:m56)
2009-08-26 12:56:18 +0200 cmc r275413 : #i104088# use the right headers in the right place
2009-08-25 17:07:50 +0200 cmc r275372 : #i104500# make openssl build on linux that isn't x86 or x86_64
2009-08-25 13:08:48 +0200 cmc r275347 : #i89237# pretty picswitch up
2009-08-25 10:58:09 +0200 cmc r275342 : #i104489# remove last unused code in starmath
2009-08-25 10:23:33 +0200 cmc r275338 : #i104088# clean up the define post-move
2009-08-24 13:46:57 +0200 cmc r275310 : #i104088# 64bit odbc api changes
2009-08-24 13:42:52 +0200 cmc r275309 : #i89237# unify linux platform mks under a generic parent
2009-08-24 13:19:52 +0200 cmc r275307 : #i104455# remove unused code
2009-08-24 13:10:56 +0200 cmc r275306 : #i104088# 64bit odbc api changes
2009-08-24 10:07:50 +0200 cmc r275293 : #i104306# move recent-used to vcl
2009-08-24 09:32:08 +0200 cmc r275291 : #i104306# move recent-used to vcl
2009-08-23 22:01:07 +0200 cmc r275286 : #i104306# move recently-used to vcl
2009-08-22 15:25:25 +0200 cmc r275285 : #i104088# 64bit odbc api changes
2009-08-21 17:52:40 +0200 cmc r275268 : #i104306# move recently-used to vcl
2009-08-21 14:38:26 +0200 cmc r275257 : #i104408 make these headers ready for c++0x
2009-08-21 14:20:19 +0200 cmc r275251 : #i104406# avoid overlapping strcpy to avoid bustage on recent toolchains
2009-08-21 14:14:25 +0200 cmc r275250 : #i104385# silence 64bit warnings
Diffstat (limited to 'unixODBC/inc')
-rw-r--r-- | unixODBC/inc/sql.h | 337 | ||||
-rw-r--r-- | unixODBC/inc/sqlext.h | 171 | ||||
-rw-r--r-- | unixODBC/inc/sqltypes.h | 261 | ||||
-rw-r--r-- | unixODBC/inc/sqlucode.h | 789 |
4 files changed, 1290 insertions, 268 deletions
diff --git a/unixODBC/inc/sql.h b/unixODBC/inc/sql.h index cf2ffa1f592e..a81c482b0f5c 100644 --- a/unixODBC/inc/sql.h +++ b/unixODBC/inc/sql.h @@ -7,6 +7,7 @@ #ifndef __SQL_H #define __SQL_H + /**************************** * default to 3.51 declare something else before here and you get a whole new ball of wax ***************************/ @@ -14,7 +15,9 @@ #define ODBCVER 0x0351 #endif -#include "sqltypes.h" +#ifndef __SQLTYPES_H +#include "odbc/sqltypes.h" +#endif #ifdef __cplusplus extern "C" { @@ -270,6 +273,7 @@ extern "C" { #define SQL_NULL_HSTMT 0 #if (ODBCVER >= 0x0300) #define SQL_NULL_HDESC 0 +#define SQL_NULL_DESC 0 #endif /* null handle used in place of parent handle when allocating HENV */ @@ -562,254 +566,257 @@ extern "C" { #define SQL_NC_HIGH 0 #define SQL_NC_LOW 1 -SQLRETURN SQLAllocConnect(SQLHENV EnvironmentHandle, - SQLHDBC *ConnectionHandle); + SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle, + SQLHDBC *ConnectionHandle); -SQLRETURN SQLAllocEnv(SQLHENV *EnvironmentHandle); + SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLAllocHandle(SQLSMALLINT HandleType, - SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); + SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, + SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); #endif -SQLRETURN SQLAllocStmt(SQLHDBC ConnectionHandle, - SQLHSTMT *StatementHandle); + SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle, + SQLHSTMT *StatementHandle); -SQLRETURN SQLBindCol(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLINTEGER BufferLength, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, + SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) -SQLRETURN SQLBindParam(SQLHSTMT StatementHandle, - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, - SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, + SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, + SQLLEN *StrLen_or_Ind); #endif -SQLRETURN SQLCancel(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLCloseCursor(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle); + + SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, + SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength, SQLLEN *NumericAttribute + /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ ); + /* Ms now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */ -SQLRETURN SQLColAttribute (SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, - SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute); #endif -SQLRETURN SQLColumns(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLCHAR *ColumnName, SQLSMALLINT NameLength4); + SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *ColumnName, SQLSMALLINT NameLength4); -SQLRETURN SQLConnect(SQLHDBC ConnectionHandle, - SQLCHAR *ServerName, SQLSMALLINT NameLength1, - SQLCHAR *UserName, SQLSMALLINT NameLength2, - SQLCHAR *Authentication, SQLSMALLINT NameLength3); + SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, + SQLCHAR *ServerName, SQLSMALLINT NameLength1, + SQLCHAR *UserName, SQLSMALLINT NameLength2, + SQLCHAR *Authentication, SQLSMALLINT NameLength3); #if (ODBCVER >= 0x0300) -SQLRETURN SQLCopyDesc(SQLHDESC SourceDescHandle, - SQLHDESC TargetDescHandle); + SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, + SQLHDESC TargetDescHandle); #endif -SQLRETURN SQLDataSources(SQLHENV EnvironmentHandle, - SQLUSMALLINT Direction, SQLCHAR *ServerName, - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, - SQLCHAR *Description, SQLSMALLINT BufferLength2, - SQLSMALLINT *NameLength2); + SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle, + SQLUSMALLINT Direction, SQLCHAR *ServerName, + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, + SQLCHAR *Description, SQLSMALLINT BufferLength2, + SQLSMALLINT *NameLength2); -SQLRETURN SQLDescribeCol(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, - SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, - SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, - SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); + SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, + SQLSMALLINT *DataType, SQLULEN *ColumnSize, + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); -SQLRETURN SQLDisconnect(SQLHDBC ConnectionHandle); + SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT CompletionType); + SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, + SQLSMALLINT CompletionType); #endif -SQLRETURN SQLError(SQLHENV EnvironmentHandle, - SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, - SQLCHAR *Sqlstate, SQLINTEGER *NativeError, - SQLCHAR *MessageText, SQLSMALLINT BufferLength, - SQLSMALLINT *TextLength); + SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle, + SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, + SQLCHAR *Sqlstate, SQLINTEGER *NativeError, + SQLCHAR *MessageText, SQLSMALLINT BufferLength, + SQLSMALLINT *TextLength); -SQLRETURN SQLExecDirect(SQLHSTMT StatementHandle, - SQLCHAR *StatementText, SQLINTEGER TextLength); + SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle, + SQLCHAR *StatementText, SQLINTEGER TextLength); -SQLRETURN SQLExecute(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle); -SQLRETURN SQLFetch(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLFetchScroll(SQLHSTMT StatementHandle, - SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset); + SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, + SQLSMALLINT FetchOrientation, SQLLEN FetchOffset); #endif -SQLRETURN SQLFreeConnect(SQLHDBC ConnectionHandle); + SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle); -SQLRETURN SQLFreeEnv(SQLHENV EnvironmentHandle); + SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); + SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); #endif -SQLRETURN SQLFreeStmt(SQLHSTMT StatementHandle, - SQLUSMALLINT Option); + SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, + SQLUSMALLINT Option); #if (ODBCVER >= 0x0300) -SQLRETURN SQLGetConnectAttr(SQLHDBC ConnectionHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength); + SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif -SQLRETURN SQLGetConnectOption(SQLHDBC ConnectionHandle, - SQLUSMALLINT Option, SQLPOINTER Value); + SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle, + SQLUSMALLINT Option, SQLPOINTER Value); -SQLRETURN SQLGetCursorName(SQLHSTMT StatementHandle, - SQLCHAR *CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT *NameLength); + SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle, + SQLCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength); -SQLRETURN SQLGetData(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLINTEGER BufferLength, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, + SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) -SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER *StringLength); + SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength, + SQLINTEGER *StringLength); -SQLRETURN SQLGetDescRec(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLCHAR *Name, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, - SQLSMALLINT *Type, SQLSMALLINT *SubType, - SQLINTEGER *Length, SQLSMALLINT *Precision, - SQLSMALLINT *Scale, SQLSMALLINT *Nullable); + SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLCHAR *Name, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLSMALLINT *Type, SQLSMALLINT *SubType, + SQLLEN *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable); -SQLRETURN SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, - SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength); + SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, + SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, + SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength); -SQLRETURN SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, - SQLINTEGER *NativeError, SQLCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); + SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, + SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, + SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); -SQLRETURN SQLGetEnvAttr(SQLHENV EnvironmentHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength); + SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLGetFunctions(SQLHDBC ConnectionHandle, - SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); + SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle, + SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); -SQLRETURN SQLGetInfo(SQLHDBC ConnectionHandle, - SQLUSMALLINT InfoType, SQLPOINTER InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); + SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, + SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); #if (ODBCVER >= 0x0300) -SQLRETURN SQLGetStmtAttr(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength); + SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLGetStmtOption(SQLHSTMT StatementHandle, - SQLUSMALLINT Option, SQLPOINTER Value); + SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle, + SQLUSMALLINT Option, SQLPOINTER Value); -SQLRETURN SQLGetTypeInfo(SQLHSTMT StatementHandle, - SQLSMALLINT DataType); + SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, + SQLSMALLINT DataType); -SQLRETURN SQLNumResultCols(SQLHSTMT StatementHandle, - SQLSMALLINT *ColumnCount); + SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, + SQLSMALLINT *ColumnCount); -SQLRETURN SQLParamData(SQLHSTMT StatementHandle, - SQLPOINTER *Value); + SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, + SQLPOINTER *Value); -SQLRETURN SQLPrepare(SQLHSTMT StatementHandle, - SQLCHAR *StatementText, SQLINTEGER TextLength); + SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle, + SQLCHAR *StatementText, SQLINTEGER TextLength); -SQLRETURN SQLPutData(SQLHSTMT StatementHandle, - SQLPOINTER Data, SQLINTEGER StrLen_or_Ind); + SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, + SQLPOINTER Data, SQLLEN StrLen_or_Ind); -SQLRETURN SQLRowCount(SQLHSTMT StatementHandle, - SQLINTEGER *RowCount); + SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle, + SQLLEN *RowCount); #if (ODBCVER >= 0x0300) -SQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength); + SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLSetConnectOption(SQLHDBC ConnectionHandle, - SQLUSMALLINT Option, SQLUINTEGER Value); + SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle, + SQLUSMALLINT Option, SQLULEN Value); -SQLRETURN SQLSetCursorName(SQLHSTMT StatementHandle, - SQLCHAR *CursorName, SQLSMALLINT NameLength); + SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle, + SQLCHAR *CursorName, SQLSMALLINT NameLength); #if (ODBCVER >= 0x0300) -SQLRETURN SQLSetDescField(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength); + SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength); -SQLRETURN SQLSetDescRec(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT Type, - SQLSMALLINT SubType, SQLINTEGER Length, - SQLSMALLINT Precision, SQLSMALLINT Scale, - SQLPOINTER Data, SQLINTEGER *StringLength, - SQLINTEGER *Indicator); + SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLSMALLINT Type, + SQLSMALLINT SubType, SQLLEN Length, + SQLSMALLINT Precision, SQLSMALLINT Scale, + SQLPOINTER Data, SQLLEN *StringLength, + SQLLEN *Indicator); -SQLRETURN SQLSetEnvAttr(SQLHENV EnvironmentHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength); + SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLSetParam(SQLHSTMT StatementHandle, - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, - SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, + SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, + SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) -SQLRETURN SQLSetStmtAttr(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength); + SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength); #endif -SQLRETURN SQLSetStmtOption(SQLHSTMT StatementHandle, - SQLUSMALLINT Option, SQLUINTEGER Value); + SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle, + SQLUSMALLINT Option, SQLULEN Value); -SQLRETURN SQLSpecialColumns(SQLHSTMT StatementHandle, - SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, - SQLSMALLINT NameLength1, SQLCHAR *SchemaName, - SQLSMALLINT NameLength2, SQLCHAR *TableName, - SQLSMALLINT NameLength3, SQLUSMALLINT Scope, - SQLUSMALLINT Nullable); + SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, + SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, + SQLSMALLINT NameLength1, SQLCHAR *SchemaName, + SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLUSMALLINT Scope, + SQLUSMALLINT Nullable); -SQLRETURN SQLStatistics(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLUSMALLINT Unique, SQLUSMALLINT Reserved); + SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLUSMALLINT Unique, SQLUSMALLINT Reserved); -SQLRETURN SQLTables(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLCHAR *TableType, SQLSMALLINT NameLength4); + SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *TableType, SQLSMALLINT NameLength4); -SQLRETURN SQLTransact(SQLHENV EnvironmentHandle, - SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); + SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, + SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); #ifdef __cplusplus } diff --git a/unixODBC/inc/sqlext.h b/unixODBC/inc/sqlext.h index eadde16594c7..e35af92e3522 100644 --- a/unixODBC/inc/sqlext.h +++ b/unixODBC/inc/sqlext.h @@ -39,7 +39,9 @@ /* END - unixODBC ONLY */ -#include "sql.h" +#ifndef __SQL_H +#include "odbc/sql.h" +#endif #ifdef __cplusplus extern "C" { /* Assume C declarations for C++ */ @@ -47,8 +49,8 @@ extern "C" { /* Assume C declarations for C++ */ /* generally useful constants */ #define SQL_SPEC_MAJOR 3 /* Major version of specification */ -#define SQL_SPEC_MINOR 51 /* Minor version of specification */ -#define SQL_SPEC_STRING "03.51" /* String constant for version */ +#define SQL_SPEC_MINOR 52 /* Minor version of specification */ +#define SQL_SPEC_STRING "03.52" /* String constant for version */ #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */ #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */ @@ -72,6 +74,11 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_ATTR_ODBC_VERSION 200 #define SQL_ATTR_CONNECTION_POOLING 201 #define SQL_ATTR_CP_MATCH 202 + +/* unixODBC additions */ +#define SQL_ATTR_UNIXODBC_SYSPATH 65001 +#define SQL_ATTR_UNIXODBC_VERSION 65002 +#define SQL_ATTR_UNIXODBC_ENVATTR 65003 #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER >= 0x0300) @@ -127,6 +134,8 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */ +#define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */ + #if (ODBCVER >= 0x0351) /* ODBC Driver Manager sets this connection attribute to a unicode driver (which supports SQLConnectW) when the application is an ANSI application @@ -170,7 +179,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_OPT_TRACE_OFF 0UL #define SQL_OPT_TRACE_ON 1UL #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF -#define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG" +#define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG" /* SQL_ODBC_CURSORS options */ #define SQL_CUR_USE_IF_NEEDED 0UL @@ -516,7 +525,12 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/ #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/ #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/ + +#if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE) +#define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */ +#else #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */ +#endif #if (ODBCVER >= 0x0350) #define SQL_C_GUID SQL_GUID @@ -751,6 +765,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_CONVERT_VARBINARY 69 #define SQL_CONVERT_VARCHAR 70 #define SQL_CONVERT_LONGVARBINARY 71 +#define SQL_CONVERT_GUID 173 #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */ #define SQL_CORRELATION_NAME 74 #define SQL_NON_NULLABLE_COLUMNS 75 @@ -780,7 +795,9 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_QUALIFIER_LOCATION 114 #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300) +#ifndef SQL_OJ_CAPABILITIES #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ +#endif #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */ /*----------------------------------------------*/ @@ -927,6 +944,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_CVT_WCHAR 0x00200000L #define SQL_CVT_WLONGVARCHAR 0x00400000L #define SQL_CVT_WVARCHAR 0x00800000L +#define SQL_CVT_GUID 0x01000000L #endif /* ODBCVER >= 0x0300 */ @@ -1199,7 +1217,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_FILE_NOT_SUPPORTED 0x0000 #define SQL_FILE_TABLE 0x0001 #define SQL_FILE_QUALIFIER 0x0002 -#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER // ODBC 3.0 +#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */ /* SQL_GETDATA_EXTENSIONS values */ @@ -1688,7 +1706,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_DRIVER_PROMPT 2 #define SQL_DRIVER_COMPLETE_REQUIRED 3 -SQLRETURN SQLDriverConnect( +SQLRETURN SQL_API SQLDriverConnect( SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *szConnStrIn, @@ -1762,8 +1780,7 @@ SQLRETURN SQLDriverConnect( #define SQL_PT_FUNCTION 2 /* This define is too large for RC */ -#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS," -/* +#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ @@ -1794,9 +1811,8 @@ SQLRETURN SQLDriverConnect( "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\ "YEAR,ZONE" -*/ -SQLRETURN SQLBrowseConnect( +SQLRETURN SQL_API SQLBrowseConnect( SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, @@ -1805,21 +1821,21 @@ SQLRETURN SQLBrowseConnect( SQLSMALLINT *pcbConnStrOut); #if (ODBCVER >= 0x0300) -SQLRETURN SQLBulkOperations( +SQLRETURN SQL_API SQLBulkOperations( SQLHSTMT StatementHandle, SQLSMALLINT Operation); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLColAttributes( +SQLRETURN SQL_API SQLColAttributes( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, - SQLINTEGER *pfDesc); + SQLLEN *pfDesc); -SQLRETURN SQLColumnPrivileges( +SQLRETURN SQL_API SQLColumnPrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1830,22 +1846,22 @@ SQLRETURN SQLColumnPrivileges( SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); -SQLRETURN SQLDescribeParam( +SQLRETURN SQL_API SQLDescribeParam( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, - SQLUINTEGER *pcbParamDef, + SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable); -SQLRETURN SQLExtendedFetch( +SQLRETURN SQL_API SQLExtendedFetch( SQLHSTMT hstmt, SQLUSMALLINT fFetchType, - SQLINTEGER irow, - SQLUINTEGER *pcrow, - SQLUSMALLINT *rgfRowStatus); + SQLLEN irow, + SQLULEN *pcrow, + SQLUSMALLINT *rgfRowStatus); -SQLRETURN SQLForeignKeys( +SQLRETURN SQL_API SQLForeignKeys( SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, @@ -1860,10 +1876,10 @@ SQLRETURN SQLForeignKeys( SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName); -SQLRETURN SQLMoreResults( +SQLRETURN SQL_API SQLMoreResults( SQLHSTMT hstmt); -SQLRETURN SQLNativeSql( +SQLRETURN SQL_API SQLNativeSql( SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, @@ -1871,16 +1887,16 @@ SQLRETURN SQLNativeSql( SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr); -SQLRETURN SQLNumParams( +SQLRETURN SQL_API SQLNumParams( SQLHSTMT hstmt, SQLSMALLINT *pcpar); -SQLRETURN SQLParamOptions( +SQLRETURN SQL_API SQLParamOptions( SQLHSTMT hstmt, - SQLUINTEGER crow, - SQLUINTEGER *pirow); + SQLULEN crow, + SQLULEN *pirow); -SQLRETURN SQLPrimaryKeys( +SQLRETURN SQL_API SQLPrimaryKeys( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1889,7 +1905,7 @@ SQLRETURN SQLPrimaryKeys( SQLCHAR *szTableName, SQLSMALLINT cbTableName); -SQLRETURN SQLProcedureColumns( +SQLRETURN SQL_API SQLProcedureColumns( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1900,7 +1916,7 @@ SQLRETURN SQLProcedureColumns( SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); -SQLRETURN SQLProcedures( +SQLRETURN SQL_API SQLProcedures( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1909,13 +1925,13 @@ SQLRETURN SQLProcedures( SQLCHAR *szProcName, SQLSMALLINT cbProcName); -SQLRETURN SQLSetPos( +SQLRETURN SQL_API SQLSetPos( SQLHSTMT hstmt, - SQLUSMALLINT irow, + SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock); -SQLRETURN SQLTablePrivileges( +SQLRETURN SQL_API SQLTablePrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1924,7 +1940,7 @@ SQLRETURN SQLTablePrivileges( SQLCHAR *szTableName, SQLSMALLINT cbTableName); -SQLRETURN SQLDrivers( +SQLRETURN SQL_API SQLDrivers( SQLHENV henv, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, @@ -1934,17 +1950,17 @@ SQLRETURN SQLDrivers( SQLSMALLINT cbDrvrAttrMax, SQLSMALLINT *pcbDrvrAttr); -SQLRETURN SQLBindParameter( +SQLRETURN SQL_API SQLBindParameter( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType, - SQLUINTEGER cbColDef, + SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, - SQLINTEGER cbValueMax, - SQLINTEGER *pcbValue); + SQLLEN cbValueMax, + SQLLEN *pcbValue); /*---------------------------------------------------------*/ /* SQLAllocHandleStd is implemented to make SQLAllocHandle */ @@ -1972,7 +1988,7 @@ SQLRETURN SQLBindParameter( #endif /* ODBC_STD */ #if (ODBCVER >= 0x0300) -SQLRETURN SQLAllocHandleStd( +SQLRETURN SQL_API SQLAllocHandleStd( SQLSMALLINT fHandleType, SQLHANDLE hInput, SQLHANDLE *phOutput); @@ -1999,20 +2015,56 @@ SQLRETURN SQLAllocHandleStd( #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */ /* Deprecated functions from prior versions of ODBC */ -SQLRETURN SQLSetScrollOptions( /* Use SQLSetStmtOptions */ +SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */ SQLHSTMT hstmt, SQLUSMALLINT fConcurrency, - SQLINTEGER crowKeyset, + SQLLEN crowKeyset, SQLUSMALLINT crowRowset); -/* Tracing section */ - -#define TRACE_VERSION 1000 /* Version of trace API */ - -RETCODE TraceOpenLogFile(LPWSTR,LPWSTR,DWORD); /* open a trace log file */ -RETCODE TraceCloseLogFile(); /* Request to close a trace log */ -VOID TraceReturn(RETCODE,RETCODE); /* Processes trace after FN is called */ -DWORD TraceVersion(); /* Returns trace API version */ +/*! + * \defgroup Tracing. + * + * unixODBC implements a slight variation of the tracing mechanism used + * on MS platforms. The unixODBC method loses the ability to produce trace + * output for invalid handles but gains the following; + * + * - better concurrency + * - allows tracing to be turned on/off and configured at finer granularity + * - hopefully; better performance + * + * unixODBC provides a cross-platform helper library called 'trace' and an + * example/default trace plugin called 'odbctrac'. Those writing an ODBC + * driver can use the 'trace' helper library (a static library). Those wanting + * to create custom trace output can implement a different version of the + * 'odbctrac' plugin. + * + * The text file driver (odbctxt) included with unixODBC is an example of a + * driver using the 'trace' helper library. + * + * The 'trace' library and the example plugin 'odbctrac' are designed to be + * portable on all platforms where unixODBC is available and on MS platforms. + * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly + * portable. On MS platforms - this compliments traditional tracing (mostly + * just used by the Driver Manager). + * + * \sa trace + * odbctxt + * odbctrac + */ +/*@{*/ +#define TRACE_VERSION 1000 /*!< Version of trace API */ +#ifdef UNICODE +RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */ +#else +RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */ +#endif +RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */ +SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */ +#ifdef __cplusplus +DWORD TraceVersion(); /*!< Returns trace API version */ +#else +DWORD TraceVersion(VOID); /*!< Returns trace API version */ +#endif /* Functions for Visual Studio Analyzer*/ /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */ @@ -2028,7 +2080,11 @@ RETCODE TraceVSControl(DWORD); #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */ typedef struct tagODBC_VS_ARGS { +#ifdef GUID_DEFINED const GUID *pguidEvent; /* the GUID for event */ +#else + const void *pguidEvent; /* the GUID for event */ +#endif DWORD dwFlags; /* flags for the call */ union { WCHAR *wszArg; @@ -2042,10 +2098,25 @@ typedef struct tagODBC_VS_ARGS { } ODBC_VS_ARGS, *PODBC_VS_ARGS; VOID FireVSDebugEvent(PODBC_VS_ARGS); - +/*@}*/ #ifdef __cplusplus } #endif +/* + * connection pooling retry times + */ + +BOOL ODBCSetTryWaitValue ( DWORD dwValue ); +#ifdef __cplusplus +DWORD ODBCGetTryWaitValue ( ); +#else +DWORD ODBCGetTryWaitValue ( VOID ); +#endif + +#ifndef __SQLUCODE_H +#include "odbc/sqlucode.h" +#endif + #endif diff --git a/unixODBC/inc/sqltypes.h b/unixODBC/inc/sqltypes.h index 3e7c46454bc6..b0c5b6d8cab6 100644 --- a/unixODBC/inc/sqltypes.h +++ b/unixODBC/inc/sqltypes.h @@ -26,47 +26,110 @@ #define ODBCVER 0x0351 #endif +/* + * if thi sis set, then use a 4 byte unicode definition, insteead of the 2 bye that MS use + */ + +#ifdef SQL_WCHART_CONVERT +/* + * Use this if you want to use the C/C++ portable definition of a wide char, wchar_t + * Microsoft hardcoded a definition of unsigned short which may not be compatible with + * your platform specific wide char definition. + */ +#include <wchar.h> +#endif + +#include <sal/types.h> + #ifdef __cplusplus extern "C" { #endif -#ifndef SIZEOF_LONG -# if defined(__alpha__) || defined(__x86_64__) || defined(__ia64__) || defined(__s390x__) || defined(__sparcv9) || defined(__LP64__) -# define SIZEOF_LONG 8 -#else -# define SIZEOF_LONG 4 +#ifndef SIZEOF_LONG_INT +# define SIZEOF_LONG_INT SAL_TYPES_SIZEOFLONG #endif +#ifndef ODBCINT64 +# define ODBCINT64 sal_Int64 +#endif +#ifndef UODBCINT64 +# define UODBCINT64 sal_uInt64 +#endif + +/* + * this is defined by configure, but will not be on a normal application build + * the install creates a unixodbc_conf.h file that contains the current build settings + */ + +#ifndef SIZEOF_LONG_INT +#include <unixodbc_conf.h> +#endif + +#ifndef SIZEOF_LONG_INT +#error "Needs to know how big a long int is to continue!!!" #endif /**************************** * These make up for having no windows.h ***************************/ +#ifndef ALLREADY_HAVE_WINDOWS_TYPE + #define FAR #define CALLBACK +#ifdef __OS2__ +#define SQL_API _System +#else #define SQL_API +#endif #define BOOL int typedef void* HWND; -#ifndef CHAR -typedef char* GUID; -#endif -#define GUID_DEFINED typedef char CHAR; +#ifdef UNICODE + +/* + * NOTE: The Microsoft unicode define is only for apps that want to use TCHARs and + * be able to compile for both unicode and non-unicode with the same source. + * This is not recommanded for linux applications and is not supported + * by the standard linux string header files. + */ +#ifdef SQL_WCHART_CONVERT +typedef wchar_t TCHAR; +#else +typedef signed short TCHAR; +#endif + +#else +typedef char TCHAR; +#endif + #ifndef DONT_TD_VOID typedef void VOID; #endif + typedef unsigned short WORD; -#if SIZEOF_LONG == 4 - typedef unsigned long DWORD; +#if (SIZEOF_LONG_INT == 4) +typedef unsigned long DWORD; #else - typedef unsigned int DWORD; +typedef unsigned int DWORD; #endif typedef unsigned char BYTE; + +#ifdef SQL_WCHART_CONVERT +typedef wchar_t WCHAR; +#else typedef unsigned short WCHAR; +#endif + typedef WCHAR* LPWSTR; typedef const char* LPCSTR; +typedef const WCHAR* LPCWSTR; +typedef TCHAR* LPTSTR; typedef char* LPSTR; typedef DWORD* LPDWORD; +typedef void* HINSTANCE; + +#endif + /**************************** * standard SQL* data types. use these as much as possible when using ODBC calls/vars @@ -80,10 +143,60 @@ typedef double SQLDOUBLE; typedef double SQLFLOAT; #endif -#if SIZEOF_LONG == 4 - typedef long SQLINTEGER; +/* + * can't use a long it fails on 64 platforms + */ + +/* + * Hopefully by now it should be safe to assume most drivers know about SQLLEN now + * and the defaukt is now sizeof( SQLLEN ) = 8 on 64 bit platforms + * + */ + +#if (SIZEOF_LONG_INT == 8) +#ifdef BUILD_LEGACY_64_BIT_MODE +typedef int SQLINTEGER; +typedef unsigned int SQLUINTEGER; +#define SQLLEN SQLINTEGER +#define SQLULEN SQLUINTEGER +#define SQLSETPOSIROW SQLUSMALLINT +/* + * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril + * + typedef SQLULEN SQLROWCOUNT; + typedef SQLULEN SQLROWSETSIZE; + typedef SQLULEN SQLTRANSID; + typedef SQLLEN SQLROWOFFSET; +*/ +#else +typedef int SQLINTEGER; +typedef unsigned int SQLUINTEGER; +typedef long SQLLEN; +typedef unsigned long SQLULEN; +typedef unsigned long SQLSETPOSIROW; +/* + * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril + * + typedef SQLULEN SQLTRANSID; + typedef SQLULEN SQLROWCOUNT; + typedef SQLUINTEGER SQLROWSETSIZE; + typedef SQLLEN SQLROWOFFSET; + */ +typedef SQLULEN SQLROWCOUNT; +typedef SQLULEN SQLROWSETSIZE; +typedef SQLULEN SQLTRANSID; +typedef SQLLEN SQLROWOFFSET; +#endif #else - typedef int SQLINTEGER; +typedef long SQLINTEGER; +typedef unsigned long SQLUINTEGER; +#define SQLLEN SQLINTEGER +#define SQLULEN SQLUINTEGER +#define SQLSETPOSIROW SQLUSMALLINT +typedef SQLULEN SQLROWCOUNT; +typedef SQLULEN SQLROWSETSIZE; +typedef SQLULEN SQLTRANSID; +typedef SQLLEN SQLROWOFFSET; #endif #if (ODBCVER >= 0x0300) @@ -107,39 +220,58 @@ typedef unsigned char SQLVARCHAR; typedef SQLSMALLINT SQLRETURN; -/* typedef void * SQLHANDLE; */ - -typedef SQLINTEGER SQLHANDLE; #if (ODBCVER >= 0x0300) - +typedef void * SQLHANDLE; typedef SQLHANDLE SQLHENV; typedef SQLHANDLE SQLHDBC; typedef SQLHANDLE SQLHSTMT; typedef SQLHANDLE SQLHDESC; +#else +typedef void * SQLHENV; +typedef void * SQLHDBC; +typedef void * SQLHSTMT; +/* + * some things like PHP won't build without this + */ +typedef void * SQLHANDLE; +#endif +/**************************** + * These are cast into the actual struct that is being passed around. The + * DriverManager knows what its structs look like and the Driver knows about its + * structs... the app knows nothing about them... just void* + * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT + ***************************/ + +#if (ODBCVER >= 0x0300) +typedef SQLHANDLE HENV; +typedef SQLHANDLE HDBC; +typedef SQLHANDLE HSTMT; #else -typedef SQLINTEGER SQLHENV; -typedef SQLINTEGER SQLHDBC; -typedef SQLINTEGER SQLHSTMT; +typedef void * HENV; +typedef void * HDBC; +typedef void * HSTMT; #endif /**************************** * more basic data types to augment what windows.h provides ***************************/ +#ifndef ALLREADY_HAVE_WINDOWS_TYPE + typedef unsigned char UCHAR; typedef signed char SCHAR; typedef SCHAR SQLSCHAR; -#if SIZEOF_LONG == 4 - typedef long int SDWORD; - typedef unsigned long int UDWORD; +#if (SIZEOF_LONG_INT == 4) +typedef long int SDWORD; +typedef unsigned long int UDWORD; #else - typedef signed int SDWORD; - typedef unsigned int UDWORD; +typedef int SDWORD; +typedef unsigned int UDWORD; #endif typedef signed short int SWORD; typedef unsigned short int UWORD; -typedef UDWORD SQLUINTEGER; +typedef unsigned int UINT; typedef signed long SLONG; typedef signed short SSHORT; typedef unsigned long ULONG; @@ -151,20 +283,7 @@ typedef void* PTR; typedef signed short RETCODE; typedef void* SQLHWND; -/**************************** - * These are cast into the actual struct that is being passed around. The - * DriverManager knows what its structs look like and the Driver knows about its - * structs... the app knows nothing about them... just void* - * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT - ***************************/ -/* -typedef void* HENV; -typedef void* HDBC; -typedef void* HSTMT; -*/ -typedef SQLHANDLE HENV; -typedef SQLHANDLE HDBC; -typedef SQLHANDLE HSTMT; +#endif /**************************** * standard structs for working with date/times @@ -263,12 +382,41 @@ typedef struct tagSQL_INTERVAL_STRUCT /**************************** * ***************************/ -#if (ODBCVER >= 0x0300) -#define ODBCINT64 long +#ifndef ODBCINT64 +# if (ODBCVER >= 0x0300) +# if (SIZEOF_LONG_INT == 8) +# define ODBCINT64 long +# define UODBCINT64 unsigned long +# else +# ifdef HAVE_LONG_LONG +# define ODBCINT64 long long +# define UODBCINT64 unsigned long long +# else +/* + * may fail in some cases, but what else can we do ? + */ +struct __bigint_struct +{ + int hiword; + unsigned int loword; +}; +struct __bigint_struct_u +{ + unsigned int hiword; + unsigned int loword; +}; +# define ODBCINT64 struct __bigint_struct +# define UODBCINT64 struct __bigint_struct_u +# endif +# endif +#endif +#endif + #ifdef ODBCINT64 typedef ODBCINT64 SQLBIGINT; -typedef unsigned ODBCINT64 SQLUBIGINT; #endif +#ifdef UODBCINT64 +typedef UODBCINT64 SQLUBIGINT; #endif @@ -288,6 +436,7 @@ typedef struct tagSQL_NUMERIC_STRUCT #if (ODBCVER >= 0x0350) #ifdef GUID_DEFINED +#ifndef ALLREADY_HAVE_WINDOWS_TYPE typedef GUID SQLGUID; #else typedef struct tagSQLGUID @@ -298,17 +447,20 @@ typedef struct tagSQLGUID BYTE Data4[ 8 ]; } SQLGUID; #endif +#else +typedef struct tagSQLGUID +{ + DWORD Data1; + WORD Data2; + WORD Data3; + BYTE Data4[ 8 ]; +} SQLGUID; +#endif #endif +typedef SQLULEN BOOKMARK; -typedef unsigned long int BOOKMARK; - - -#ifdef _WCHAR_T_DEFINED -typedef wchar_t SQLWCHAR; -#else -typedef unsigned short SQLWCHAR; -#endif +typedef WCHAR SQLWCHAR; #ifdef UNICODE typedef SQLWCHAR SQLTCHAR; @@ -321,3 +473,6 @@ typedef SQLCHAR SQLTCHAR; #endif #endif + + + diff --git a/unixODBC/inc/sqlucode.h b/unixODBC/inc/sqlucode.h new file mode 100644 index 000000000000..366dab75127a --- /dev/null +++ b/unixODBC/inc/sqlucode.h @@ -0,0 +1,789 @@ +/************************************************** + * sqlucode.h + * + * These should be consistent with the MS version. + * + **************************************************/ +#ifndef __SQLUCODE_H +#define __SQLUCODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define SQL_WCHAR (-8) +#define SQL_WVARCHAR (-9) +#define SQL_WLONGVARCHAR (-10) +#define SQL_C_WCHAR SQL_WCHAR + +#ifdef UNICODE +#define SQL_C_TCHAR SQL_C_WCHAR +#else +#define SQL_C_TCHAR SQL_C_CHAR +#endif + +#define SQL_SQLSTATE_SIZEW 10 /* size of SQLSTATE for unicode */ + +/* UNICODE versions */ + +SQLRETURN SQL_API SQLColAttributeW( + SQLHSTMT hstmt, + SQLUSMALLINT iCol, + SQLUSMALLINT iField, + SQLPOINTER pCharAttr, + SQLSMALLINT cbCharAttrMax, + SQLSMALLINT *pcbCharAttr, + SQLLEN *pNumAttr); + +SQLRETURN SQL_API SQLColAttributesW( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, + SQLSMALLINT cbDescMax, + SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc); + +SQLRETURN SQL_API SQLConnectW( + SQLHDBC hdbc, + SQLWCHAR *szDSN, + SQLSMALLINT cbDSN, + SQLWCHAR *szUID, + SQLSMALLINT cbUID, + SQLWCHAR *szAuthStr, + SQLSMALLINT cbAuthStr); + + +SQLRETURN SQL_API SQLDescribeColW( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLWCHAR *szColName, + SQLSMALLINT cbColNameMax, + SQLSMALLINT *pcbColName, + SQLSMALLINT *pfSqlType, + SQLULEN *pcbColDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + + +SQLRETURN SQL_API SQLErrorW( + SQLHENV henv, + SQLHDBC hdbc, + SQLHSTMT hstmt, + SQLWCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLWCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + +SQLRETURN SQL_API SQLExecDirectW( + SQLHSTMT hstmt, + SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLGetConnectAttrW( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetCursorNameW( + SQLHSTMT hstmt, + SQLWCHAR *szCursor, + SQLSMALLINT cbCursorMax, + SQLSMALLINT *pcbCursor); + +#if (ODBCVER >= 0x0300) +SQLRETURN SQL_API SQLSetDescFieldW(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, + SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, + SQLINTEGER BufferLength); + + + +SQLRETURN SQL_API SQLGetDescFieldW( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLSMALLINT iField, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetDescRecW( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLWCHAR *szName, + SQLSMALLINT cbNameMax, + SQLSMALLINT *pcbName, + SQLSMALLINT *pfType, + SQLSMALLINT *pfSubType, + SQLLEN *pLength, + SQLSMALLINT *pPrecision, + SQLSMALLINT *pScale, + SQLSMALLINT *pNullable); + +SQLRETURN SQL_API SQLGetDiagFieldW( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLSMALLINT fDiagField, + SQLPOINTER rgbDiagInfo, + SQLSMALLINT cbDiagInfoMax, + SQLSMALLINT *pcbDiagInfo); + +SQLRETURN SQL_API SQLGetDiagRecW( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLWCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLWCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + + +#endif + + +SQLRETURN SQL_API SQLPrepareW( + SQLHSTMT hstmt, + SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLSetConnectAttrW( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValue); + +SQLRETURN SQL_API SQLSetCursorNameW( + SQLHSTMT hstmt, + SQLWCHAR *szCursor, + SQLSMALLINT cbCursor); + + + + + + + +SQLRETURN SQL_API SQLColumnsW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLWCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLGetConnectOptionW( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLPOINTER pvParam); + + + +SQLRETURN SQL_API SQLGetInfoW( + SQLHDBC hdbc, + SQLUSMALLINT fInfoType, + SQLPOINTER rgbInfoValue, + SQLSMALLINT cbInfoValueMax, + SQLSMALLINT *pcbInfoValue); + +SQLRETURN SQL_API SQLGetTypeInfoW( + SQLHSTMT StatementHandle, + SQLSMALLINT DataType); + + +SQLRETURN SQL_API SQLSetConnectOptionW( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLULEN vParam); + + +SQLRETURN SQL_API SQLSpecialColumnsW( + SQLHSTMT hstmt, + SQLUSMALLINT fColType, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fScope, + SQLUSMALLINT fNullable); + +SQLRETURN SQL_API SQLStatisticsW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fUnique, + SQLUSMALLINT fAccuracy); + +SQLRETURN SQL_API SQLTablesW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLWCHAR *szTableType, + SQLSMALLINT cbTableType); + + + +SQLRETURN SQL_API SQLDataSourcesW( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLWCHAR *szDSN, + SQLSMALLINT cbDSNMax, + SQLSMALLINT *pcbDSN, + SQLWCHAR *szDescription, + SQLSMALLINT cbDescriptionMax, + SQLSMALLINT *pcbDescription); + + + + +SQLRETURN SQL_API SQLDriverConnectW( + SQLHDBC hdbc, + SQLHWND hwnd, + SQLWCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLWCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut, + SQLUSMALLINT fDriverCompletion); + + +SQLRETURN SQL_API SQLBrowseConnectW( + SQLHDBC hdbc, + SQLWCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLWCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut); + +SQLRETURN SQL_API SQLColumnPrivilegesW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLWCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLGetStmtAttrW( + SQLHSTMT hstmt, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLSetStmtAttrW( + SQLHSTMT hstmt, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax); + +SQLRETURN SQL_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); + + +SQLRETURN SQL_API SQLNativeSqlW( + SQLHDBC hdbc, + SQLWCHAR *szSqlStrIn, + SQLINTEGER cbSqlStrIn, + SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, + SQLINTEGER *pcbSqlStr); + + +SQLRETURN SQL_API SQLPrimaryKeysW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLProcedureColumnsW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szProcName, + SQLSMALLINT cbProcName, + SQLWCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLProceduresW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szProcName, + SQLSMALLINT cbProcName); + + +SQLRETURN SQL_API SQLTablePrivilegesW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLDriversW( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLWCHAR *szDriverDesc, + SQLSMALLINT cbDriverDescMax, + SQLSMALLINT *pcbDriverDesc, + SQLWCHAR *szDriverAttributes, + SQLSMALLINT cbDrvrAttrMax, + SQLSMALLINT *pcbDrvrAttr); + + +/* ANSI versions */ + +SQLRETURN SQL_API SQLColAttributeA( + SQLHSTMT hstmt, + SQLSMALLINT iCol, + SQLSMALLINT iField, + SQLPOINTER pCharAttr, + SQLSMALLINT cbCharAttrMax, + SQLSMALLINT *pcbCharAttr, + SQLLEN *pNumAttr); + +SQLRETURN SQL_API SQLColAttributesA( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, + SQLSMALLINT cbDescMax, + SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc); + +SQLRETURN SQL_API SQLConnectA( + SQLHDBC hdbc, + SQLCHAR *szDSN, + SQLSMALLINT cbDSN, + SQLCHAR *szUID, + SQLSMALLINT cbUID, + SQLCHAR *szAuthStr, + SQLSMALLINT cbAuthStr); + + +SQLRETURN SQL_API SQLDescribeColA( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLCHAR *szColName, + SQLSMALLINT cbColNameMax, + SQLSMALLINT *pcbColName, + SQLSMALLINT *pfSqlType, + SQLULEN *pcbColDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + + +SQLRETURN SQL_API SQLErrorA( + SQLHENV henv, + SQLHDBC hdbc, + SQLHSTMT hstmt, + SQLCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + +SQLRETURN SQL_API SQLExecDirectA( + SQLHSTMT hstmt, + SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLGetConnectAttrA( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetCursorNameA( + SQLHSTMT hstmt, + SQLCHAR *szCursor, + SQLSMALLINT cbCursorMax, + SQLSMALLINT *pcbCursor); + +#if (ODBCVER >= 0x0300) +SQLRETURN SQL_API SQLGetDescFieldA( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLSMALLINT iField, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetDescRecA( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLCHAR *szName, + SQLSMALLINT cbNameMax, + SQLSMALLINT *pcbName, + SQLSMALLINT *pfType, + SQLSMALLINT *pfSubType, + SQLLEN *pLength, + SQLSMALLINT *pPrecision, + SQLSMALLINT *pScale, + SQLSMALLINT *pNullable); + +SQLRETURN SQL_API SQLGetDiagFieldA( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLSMALLINT fDiagField, + SQLPOINTER rgbDiagInfo, + SQLSMALLINT cbDiagInfoMax, + SQLSMALLINT *pcbDiagInfo); + +SQLRETURN SQL_API SQLGetDiagRecA( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + + +SQLRETURN SQL_API SQLGetStmtAttrA( + SQLHSTMT hstmt, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +#endif + +SQLRETURN SQL_API SQLGetTypeInfoA( + SQLHSTMT StatementHandle, + SQLSMALLINT DataTyoe); + +SQLRETURN SQL_API SQLPrepareA( + SQLHSTMT hstmt, + SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLSetConnectAttrA( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValue); + +SQLRETURN SQL_API SQLSetCursorNameA( + SQLHSTMT hstmt, + SQLCHAR *szCursor, + SQLSMALLINT cbCursor); + + + + + + + +SQLRETURN SQL_API SQLColumnsA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLGetConnectOptionA( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLPOINTER pvParam); + + + +SQLRETURN SQL_API SQLGetInfoA( + SQLHDBC hdbc, + SQLUSMALLINT fInfoType, + SQLPOINTER rgbInfoValue, + SQLSMALLINT cbInfoValueMax, + SQLSMALLINT* pcbInfoValue); + +SQLRETURN SQL_API SQLGetStmtOptionA( + SQLHSTMT hstmt, + SQLUSMALLINT fOption, + SQLPOINTER pvParam); + +SQLRETURN SQL_API SQLSetConnectOptionA( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLULEN vParam); + +SQLRETURN SQL_API SQLSetStmtOptionA( + SQLHSTMT hstmt, + SQLUSMALLINT fOption, + SQLULEN vParam); + +SQLRETURN SQL_API SQLSpecialColumnsA( + SQLHSTMT hstmt, + SQLUSMALLINT fColType, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fScope, + SQLUSMALLINT fNullable); + +SQLRETURN SQL_API SQLStatisticsA( + SQLHSTMT hstmt, + + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fUnique, + SQLUSMALLINT fAccuracy); + +SQLRETURN SQL_API SQLTablesA( + SQLHSTMT hstmt, + + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLCHAR *szTableType, + + SQLSMALLINT cbTableType); + + + +SQLRETURN SQL_API SQLDataSourcesA( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLCHAR *szDSN, + SQLSMALLINT cbDSNMax, + SQLSMALLINT *pcbDSN, + SQLCHAR *szDescription, + SQLSMALLINT cbDescriptionMax, + SQLSMALLINT *pcbDescription); + + + + +SQLRETURN SQL_API SQLDriverConnectA( + SQLHDBC hdbc, + SQLHWND hwnd, + SQLCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut, + SQLUSMALLINT fDriverCompletion); + + +SQLRETURN SQL_API SQLBrowseConnectA( + SQLHDBC hdbc, + SQLCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut); + +SQLRETURN SQL_API SQLColumnPrivilegesA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLDescribeParamA( + SQLHSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT *pfSqlType, + SQLUINTEGER *pcbParamDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + + +SQLRETURN SQL_API SQLForeignKeysA( + 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); + + +SQLRETURN SQL_API SQLNativeSqlA( + SQLHDBC hdbc, + SQLCHAR *szSqlStrIn, + SQLINTEGER cbSqlStrIn, + SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, + SQLINTEGER *pcbSqlStr); + + +SQLRETURN SQL_API SQLPrimaryKeysA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLProcedureColumnsA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szProcName, + SQLSMALLINT cbProcName, + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLProceduresA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szProcName, + SQLSMALLINT cbProcName); + + +SQLRETURN SQL_API SQLTablePrivilegesA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLDriversA( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLCHAR *szDriverDesc, + SQLSMALLINT cbDriverDescMax, + SQLSMALLINT *pcbDriverDesc, + SQLCHAR *szDriverAttributes, + SQLSMALLINT cbDrvrAttrMax, + SQLSMALLINT *pcbDrvrAttr); + + + + + +/*---------------------------------------------*/ +/* Mapping macros for Unicode */ +/*---------------------------------------------*/ + +#ifndef SQL_NOUNICODEMAP /* define this to disable the mapping */ +#ifdef UNICODE + +#define SQLColAttribute SQLColAttributeW +#define SQLColAttributes SQLColAttributesW +#define SQLConnect SQLConnectW +#define SQLDescribeCol SQLDescribeColW +#define SQLError SQLErrorW +#define SQLExecDirect SQLExecDirectW +#define SQLGetConnectAttr SQLGetConnectAttrW +#define SQLGetCursorName SQLGetCursorNameW +#define SQLGetDescField SQLGetDescFieldW +#define SQLGetDescRec SQLGetDescRecW +#define SQLGetDiagField SQLGetDiagFieldW +#define SQLGetDiagRec SQLGetDiagRecW +#define SQLPrepare SQLPrepareW +#define SQLSetConnectAttr SQLSetConnectAttrW +#define SQLSetCursorName SQLSetCursorNameW +#define SQLSetDescField SQLSetDescFieldW +#define SQLSetStmtAttr SQLSetStmtAttrW +#define SQLGetStmtAttr SQLGetStmtAttrW +#define SQLColumns SQLColumnsW +#define SQLGetConnectOption SQLGetConnectOptionW +#define SQLGetInfo SQLGetInfoW +#define SQLGetTypeInfo SQLGetTypeInfoW +#define SQLSetConnectOption SQLSetConnectOptionW +#define SQLSpecialColumns SQLSpecialColumnsW +#define SQLStatistics SQLStatisticsW +#define SQLTables SQLTablesW +#define SQLDataSources SQLDataSourcesW +#define SQLDriverConnect SQLDriverConnectW +#define SQLBrowseConnect SQLBrowseConnectW +#define SQLColumnPrivileges SQLColumnPrivilegesW +#define SQLForeignKeys SQLForeignKeysW +#define SQLNativeSql SQLNativeSqlW +#define SQLPrimaryKeys SQLPrimaryKeysW +#define SQLProcedureColumns SQLProcedureColumnsW +#define SQLProcedures SQLProceduresW +#define SQLTablePrivileges SQLTablePrivilegesW +#define SQLDrivers SQLDriversW + +#endif /* UNICODE */ +#endif /* SQL_NOUNICODEMAP */ + +#ifdef __cplusplus +} +#endif + +#ifndef __SQLEXT_H +#include <odbx/sqlext.h> + +#endif + + +#endif |