apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r667311 [3/3] - in /apr/apr-util/trunk: dbd/apr_dbd_odbc.c dbd/apr_dbd_odbc.dsp include/private/apr_dbd_odbc_v2.h
Date Fri, 13 Jun 2008 01:34:23 GMT
Propchange: apr/apr-util/trunk/dbd/apr_dbd_odbc.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: apr/apr-util/trunk/dbd/apr_dbd_odbc.dsp
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/dbd/apr_dbd_odbc.dsp?rev=667311&r1=667310&r2=667311&view=diff
==============================================================================
--- apr/apr-util/trunk/dbd/apr_dbd_odbc.dsp (original)
+++ apr/apr-util/trunk/dbd/apr_dbd_odbc.dsp Thu Jun 12 18:34:23 2008
@@ -1,125 +1,125 @@
-# Microsoft Developer Studio Project File - Name="apr_dbd_odbc" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=apr_dbd_odbc - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "apr_dbd_odbc.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "apr_dbd_odbc.mak" CFG="apr_dbd_odbc - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "apr_dbd_odbc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "apr_dbd_odbc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "apr_dbd_odbc - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D
"_USRDLL" /D "APR_DBD_ODBC_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../include" /I "../../apr/include" /I "../include/private"
/D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DBD_DSO_BUILD" /D APU_HAVE_ODBC=1
/FD /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /i "../include" /i "../../apr/include" /d "NDEBUG" /d DLL_NAME="apr_dbd_odbc"
/d "APU_VERSION_ONLY"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /incremental:no
/machine:I386 /out:"Release/apr_dbd_odbc-1.dll" /opt:ref
-# Begin Special Build Tool
-TargetPath=.\Release\apr_dbd_odbc-1.dll
-SOURCE="$(InputPath)"
-PostBuild_Desc=embed.manifest
-PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
-# End Special Build Tool
-
-!ELSEIF  "$(CFG)" == "apr_dbd_odbc - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS"
/D "_USRDLL" /D "APR_DBD_ODBC_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private"
/D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DBD_DSO_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H"
/FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /i "../include" /i "../../apr/include" /d "_DEBUG" /d DLL_NAME="apr_dbd_odbc"
/d "APU_VERSION_ONLY"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386
/pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug
/machine:I386 /out:"Debug/apr_dbd_odbc-1.dll"
-# Begin Special Build Tool
-TargetPath=.\Debug\apr_dbd_odbc-1.dll
-SOURCE="$(InputPath)"
-PostBuild_Desc=embed.manifest
-PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
-# End Special Build Tool
-
-!ENDIF 
-
-# Begin Target
-
-# Name "apr_dbd_odbc - Win32 Release"
-# Name "apr_dbd_odbc - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\apr_dbd_odbc.c
-# End Source File
-# End Group
-# Begin Group "Public Header Files"
-
-# PROP Default_Filter ".h"
-# Begin Source File
-
-SOURCE=..\include\apr_dbd.h
-# End Source File
-# End Group
-# Begin Group "Internal Header Files"
-
-# PROP Default_Filter ".h"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="apr_dbd_odbc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=apr_dbd_odbc - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE 
+!MESSAGE NMAKE /f "apr_dbd_odbc.mak".
+!MESSAGE 
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE 
+!MESSAGE NMAKE /f "apr_dbd_odbc.mak" CFG="apr_dbd_odbc - Win32 Debug"
+!MESSAGE 
+!MESSAGE Possible choices for configuration are:
+!MESSAGE 
+!MESSAGE "apr_dbd_odbc - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "apr_dbd_odbc - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "apr_dbd_odbc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D
"_USRDLL" /D "APR_DBD_ODBC_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /Zi /O2 /I "../include" /I "../../apr/include" /I "../include/private"
/D "NDEBUG" /D "HAVE_SQL_H" /D "WIN32" /D "_WINDOWS" /D "APU_DBD_DSO_BUILD" /D APU_HAVE_ODBC=1
/FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /i "../include" /i "../../apr/include" /d "NDEBUG" /d DLL_NAME="apr_dbd_odbc"
/d "APU_VERSION_ONLY"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /incremental:no
/machine:I386 /out:"Release/apr_dbd_odbc-1.dll" /opt:ref
+# Begin Special Build Tool
+TargetPath=.\Release\apr_dbd_odbc-1.dll
+SOURCE="$(InputPath)"
+PostBuild_Desc=embed.manifest
+PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "apr_dbd_odbc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS"
/D "_USRDLL" /D "APR_DBD_ODBC_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Zi /Od /I "../include" /I "../../apr/include" /I "../include/private"
/D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "APU_DBD_DSO_BUILD" /D APU_HAVE_ODBC=1 /D "HAVE_SQL_H"
/FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /i "../include" /i "../../apr/include" /d "_DEBUG" /d DLL_NAME="apr_dbd_odbc"
/d "APU_VERSION_ONLY"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386
/pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /debug
/machine:I386 /out:"Debug/apr_dbd_odbc-1.dll"
+# Begin Special Build Tool
+TargetPath=.\Debug\apr_dbd_odbc-1.dll
+SOURCE="$(InputPath)"
+PostBuild_Desc=embed.manifest
+PostBuild_Cmds=if exist $(TargetPath).manifest mt.exe -manifest $(TargetPath).manifest -outputresource:$(TargetPath);2
+# End Special Build Tool
+
+!ENDIF 
+
+# Begin Target
+
+# Name "apr_dbd_odbc - Win32 Release"
+# Name "apr_dbd_odbc - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\apr_dbd_odbc.c
+# End Source File
+# End Group
+# Begin Group "Public Header Files"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\include\apr_dbd.h
+# End Source File
+# End Group
+# Begin Group "Internal Header Files"
+
+# PROP Default_Filter ".h"
+# End Group
+# End Target
+# End Project

Propchange: apr/apr-util/trunk/dbd/apr_dbd_odbc.dsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: apr/apr-util/trunk/include/private/apr_dbd_odbc_v2.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/private/apr_dbd_odbc_v2.h?rev=667311&r1=667310&r2=667311&view=diff
==============================================================================
--- apr/apr-util/trunk/include/private/apr_dbd_odbc_v2.h (original)
+++ apr/apr-util/trunk/include/private/apr_dbd_odbc_v2.h Thu Jun 12 18:34:23 2008
@@ -1,119 +1,119 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/*  ONLY USED FOR ODBC Version 2   -DODBCV2
-*
-*   Re-define everything to work (more-or-less) in an ODBC V2 environment 
-*       Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select()
cannot
-*       have a 'random' argument of 1.  apr_dbd_get_row() must always pass rownum as 0 (get
next row)
-*
-*/
-
-#define SQLHANDLE SQLHENV   // Presumes that ENV, DBC, and STMT handles are all the same
datatype
-#define SQL_NULL_HANDLE 0
-#define SQL_HANDLE_STMT 1
-#define SQL_HANDLE_DBC  2
-#define SQL_HANDLE_ENV  3
-#define SQL_NO_DATA     SQL_NO_DATA_FOUND
-
-#ifndef SQL_SUCCEEDED
-#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
-#endif
-
-#undef SQLSetEnvAttr
-#define SQLSetEnvAttr(henv, Attribute, Value, StringLength)  (0)
-
-#undef SQLAllocHandle
-#define SQLAllocHandle(type, parent, hndl) \
-(     (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \
-    : (type == SQL_HANDLE_ENV)  ? SQLAllocEnv(hndl) \
-    :                             SQLAllocConnect(parent, hndl)  \
-)
-
-#undef SQLFreeHandle
-#define SQLFreeHandle(type, hndl) \
-(     (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \
-    : (type == SQL_HANDLE_ENV)  ? SQLFreeEnv(hndl) \
-    :                             SQLFreeConnect(hndl)  \
-)
-
-#undef SQLGetDiagRec
-#define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \
-        SQLError(  (type == SQL_HANDLE_ENV) ? h : NULL, \
-                   (type == SQL_HANDLE_DBC) ? h : NULL, \
-                   (type == SQL_HANDLE_STMT) ? h : NULL, \
-                   state, native, buffer, bufsize, reslen)
-
-#undef SQLCloseCursor
-#define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE)
-
-#undef SQLGetConnectAttr
-#define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \
-    SQLGetConnectOption(hdbc, fOption, ValuePtr)
-
-#undef SQLSetConnectAttr
-#define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \
-        SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr)
-
-#undef SQLSetStmtAttr
-#define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL;
-
-#undef SQLEndTran
-#define SQLEndTran(hType, hdbc,type)  SQLTransact(henv, hdbc, type)
-
-#undef SQLFetchScroll
-#define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL;
-
-#define SQL_DESC_TYPE           SQL_COLUMN_TYPE
-#define SQL_DESC_CONCISE_TYPE   SQL_COLUMN_TYPE
-#define SQL_DESC_DISPLAY_SIZE   SQL_COLUMN_DISPLAY_SIZE
-#define SQL_DESC_OCTET_LENGTH   SQL_COLUMN_LENGTH
-#define SQL_DESC_UNSIGNED       SQL_COLUMN_UNSIGNED
-
-#undef SQLColAttribute
-#define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n)
-
-#define SQL_ATTR_ACCESS_MODE		SQL_ACCESS_MODE
-#define SQL_ATTR_AUTOCOMMIT			SQL_AUTOCOMMIT
-#define SQL_ATTR_CONNECTION_TIMEOUT	113
-#define SQL_ATTR_CURRENT_CATALOG	SQL_CURRENT_QUALIFIER
-#define SQL_ATTR_DISCONNECT_BEHAVIOR	114
-#define SQL_ATTR_ENLIST_IN_DTC		1207
-#define SQL_ATTR_ENLIST_IN_XA		1208
-
-#define SQL_ATTR_CONNECTION_DEAD	1209
-#define SQL_CD_TRUE					1L		/* Connection is closed/dead */
-#define SQL_CD_FALSE				0L		/* Connection is open/available */
-
-#define SQL_ATTR_LOGIN_TIMEOUT		SQL_LOGIN_TIMEOUT
-#define SQL_ATTR_ODBC_CURSORS		SQL_ODBC_CURSORS
-#define SQL_ATTR_PACKET_SIZE		SQL_PACKET_SIZE
-#define SQL_ATTR_QUIET_MODE			SQL_QUIET_MODE
-#define SQL_ATTR_TRACE				SQL_OPT_TRACE
-#define SQL_ATTR_TRACEFILE			SQL_OPT_TRACEFILE
-#define SQL_ATTR_TRANSLATE_LIB		SQL_TRANSLATE_DLL
-#define SQL_ATTR_TRANSLATE_OPTION	SQL_TRANSLATE_OPTION
-#define SQL_ATTR_TXN_ISOLATION		SQL_TXN_ISOLATION
-
-#define SQL_ATTR_CURSOR_SCROLLABLE -1
-
-#define SQL_C_SBIGINT	(SQL_BIGINT+SQL_SIGNED_OFFSET)	   /* SIGNED BIGINT */
-#define SQL_C_UBIGINT	(SQL_BIGINT+SQL_UNSIGNED_OFFSET)   /* UNSIGNED BIGINT */
-
-#define SQL_FALSE           0
-#define SQL_TRUE            1
-
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*  ONLY USED FOR ODBC Version 2   -DODBCV2
+*
+*   Re-define everything to work (more-or-less) in an ODBC V2 environment 
+*       Random access to retrieved rows is not supported - i.e. calls to apr_dbd_select()
cannot
+*       have a 'random' argument of 1.  apr_dbd_get_row() must always pass rownum as 0 (get
next row)
+*
+*/
+
+#define SQLHANDLE SQLHENV   // Presumes that ENV, DBC, and STMT handles are all the same
datatype
+#define SQL_NULL_HANDLE 0
+#define SQL_HANDLE_STMT 1
+#define SQL_HANDLE_DBC  2
+#define SQL_HANDLE_ENV  3
+#define SQL_NO_DATA     SQL_NO_DATA_FOUND
+
+#ifndef SQL_SUCCEEDED
+#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)
+#endif
+
+#undef SQLSetEnvAttr
+#define SQLSetEnvAttr(henv, Attribute, Value, StringLength)  (0)
+
+#undef SQLAllocHandle
+#define SQLAllocHandle(type, parent, hndl) \
+(     (type == SQL_HANDLE_STMT) ? SQLAllocStmt(parent, hndl) \
+    : (type == SQL_HANDLE_ENV)  ? SQLAllocEnv(hndl) \
+    :                             SQLAllocConnect(parent, hndl)  \
+)
+
+#undef SQLFreeHandle
+#define SQLFreeHandle(type, hndl) \
+(     (type == SQL_HANDLE_STMT) ? SQLFreeStmt(hndl, SQL_DROP) \
+    : (type == SQL_HANDLE_ENV)  ? SQLFreeEnv(hndl) \
+    :                             SQLFreeConnect(hndl)  \
+)
+
+#undef SQLGetDiagRec
+#define SQLGetDiagRec(type, h, i, state, native, buffer, bufsize, reslen) \
+        SQLError(  (type == SQL_HANDLE_ENV) ? h : NULL, \
+                   (type == SQL_HANDLE_DBC) ? h : NULL, \
+                   (type == SQL_HANDLE_STMT) ? h : NULL, \
+                   state, native, buffer, bufsize, reslen)
+
+#undef SQLCloseCursor
+#define SQLCloseCursor(stmt) SQLFreeStmt(stmt, SQL_CLOSE)
+
+#undef SQLGetConnectAttr
+#define SQLGetConnectAttr(hdbc, fOption, ValuePtr, BufferLength, NULL) \
+    SQLGetConnectOption(hdbc, fOption, ValuePtr)
+
+#undef SQLSetConnectAttr
+#define SQLSetConnectAttr(hdbc, fOption, ValuePtr, BufferLength) \
+        SQLSetConnectOption(hdbc, fOption, (SQLUINTEGER) ValuePtr)
+
+#undef SQLSetStmtAttr
+#define SQLSetStmtAttr(hstmt, fOption, ValuePtr, BufferLength) (0); return APR_ENOTIMPL;
+
+#undef SQLEndTran
+#define SQLEndTran(hType, hdbc,type)  SQLTransact(henv, hdbc, type)
+
+#undef SQLFetchScroll
+#define SQLFetchScroll(stmt, orient, rownum) (0); return APR_ENOTIMPL;
+
+#define SQL_DESC_TYPE           SQL_COLUMN_TYPE
+#define SQL_DESC_CONCISE_TYPE   SQL_COLUMN_TYPE
+#define SQL_DESC_DISPLAY_SIZE   SQL_COLUMN_DISPLAY_SIZE
+#define SQL_DESC_OCTET_LENGTH   SQL_COLUMN_LENGTH
+#define SQL_DESC_UNSIGNED       SQL_COLUMN_UNSIGNED
+
+#undef SQLColAttribute
+#define SQLColAttribute(s, c, f, a, l, m, n) SQLColAttributes(s, c, f, a, l, m, n)
+
+#define SQL_ATTR_ACCESS_MODE		SQL_ACCESS_MODE
+#define SQL_ATTR_AUTOCOMMIT			SQL_AUTOCOMMIT
+#define SQL_ATTR_CONNECTION_TIMEOUT	113
+#define SQL_ATTR_CURRENT_CATALOG	SQL_CURRENT_QUALIFIER
+#define SQL_ATTR_DISCONNECT_BEHAVIOR	114
+#define SQL_ATTR_ENLIST_IN_DTC		1207
+#define SQL_ATTR_ENLIST_IN_XA		1208
+
+#define SQL_ATTR_CONNECTION_DEAD	1209
+#define SQL_CD_TRUE					1L		/* Connection is closed/dead */
+#define SQL_CD_FALSE				0L		/* Connection is open/available */
+
+#define SQL_ATTR_LOGIN_TIMEOUT		SQL_LOGIN_TIMEOUT
+#define SQL_ATTR_ODBC_CURSORS		SQL_ODBC_CURSORS
+#define SQL_ATTR_PACKET_SIZE		SQL_PACKET_SIZE
+#define SQL_ATTR_QUIET_MODE			SQL_QUIET_MODE
+#define SQL_ATTR_TRACE				SQL_OPT_TRACE
+#define SQL_ATTR_TRACEFILE			SQL_OPT_TRACEFILE
+#define SQL_ATTR_TRANSLATE_LIB		SQL_TRANSLATE_DLL
+#define SQL_ATTR_TRANSLATE_OPTION	SQL_TRANSLATE_OPTION
+#define SQL_ATTR_TXN_ISOLATION		SQL_TXN_ISOLATION
+
+#define SQL_ATTR_CURSOR_SCROLLABLE -1
+
+#define SQL_C_SBIGINT	(SQL_BIGINT+SQL_SIGNED_OFFSET)	   /* SIGNED BIGINT */
+#define SQL_C_UBIGINT	(SQL_BIGINT+SQL_UNSIGNED_OFFSET)   /* UNSIGNED BIGINT */
+
+#define SQL_FALSE           0
+#define SQL_TRUE            1
+

Propchange: apr/apr-util/trunk/include/private/apr_dbd_odbc_v2.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message