├── cur ├── cur.exp ├── README └── odbccr.pc.in ├── DRVConfig ├── template │ ├── Makefile.am │ └── README ├── drvcfg2 │ ├── ChangeLog │ ├── Makefile.am │ └── drvcfg2.c ├── tds │ └── Makefile.am ├── Mimer │ └── Makefile.am ├── MySQL │ ├── Makefile.am │ └── README ├── esoob │ └── Makefile.am ├── nn │ ├── Makefile.am │ ├── README │ └── drvcfg.c ├── txt │ ├── Makefile.am │ └── README ├── Oracle │ └── Makefile.am ├── oplodbc │ ├── Makefile.am │ └── README ├── MiniSQL │ ├── Makefile.am │ └── README ├── Makefile.am ├── PostgreSQL │ ├── Makefile.am │ └── README ├── drvcfg1 │ └── Makefile.am ├── sapdb │ ├── Makefile.am │ └── README └── README ├── man ├── iusql.1 ├── Makefile.am └── dltest.1 ├── Drivers ├── Postgre7.1 │ ├── isql.h │ ├── isqlext.h │ ├── driver.exp │ ├── tuplelist.h │ ├── md5.h │ ├── environ.h │ ├── lobj.h │ └── notice.txt ├── nn │ ├── SQLSetParam.c │ ├── ChangeLog │ ├── TODO │ ├── stmt.h │ ├── nntp.ci │ ├── SQLFreeStmt.c │ ├── SQLFreeEnv.c │ ├── convert.h │ ├── hstmt.h │ ├── SQLExecute.c │ ├── nndate.h │ ├── yylex.h │ ├── SQLPrepare.c │ ├── SQLNumParams.c │ ├── SQLAllocEnv.c │ ├── SQLRowCount.c │ ├── SQLDisconnect.c │ ├── connect.h │ ├── SQLNumResultCols.c │ ├── SQLExecDirect.c │ ├── SQLCancel.c │ ├── SQLAllocConnect.c │ ├── SQLFreeConnect.c │ └── misc.c ├── Makefile.am ├── MiniSQL │ ├── ChangeLog │ ├── _NativeTypePrecision.c │ ├── SQLAllocConnect.c │ ├── _NativeTypeDesc.c │ ├── SQLAllocEnv.c │ ├── SQLExecute.c │ ├── SQLFreeStmt.c │ ├── _FreeDbcList.c │ ├── SQLAllocStmt.c │ ├── SQLPrepare.c │ ├── SQLFreeEnv.c │ ├── _FreeStmtList.c │ ├── SQLCopyDesc.c │ ├── SQLFreeConnect.c │ ├── SQLEndTran.c │ ├── SQLSetEnvAttr.c │ ├── SQLGetEnvAttr.c │ ├── SQLSetDescField.c │ ├── SQLGetDescField.c │ ├── SQLGetDiagField.c │ ├── SQLGetData.c │ ├── SQLGetDiagRec.c │ ├── SQLAllocHandle.c │ ├── SQLFreeHandle.c │ ├── _NativeToSQLType.c │ ├── SQLCancel.c │ ├── SQLCloseCursor.c │ ├── SQLMoreResults.c │ ├── SQLSetDescRec.c │ ├── SQLParamData.c │ ├── SQLNumParams.c │ ├── SQLGetTypeInfo.c │ ├── SQLParamOptions.c │ ├── SQLGetConnectOption.c │ ├── SQLSetStmtOption.c │ ├── SQLGetDescRec.c │ └── SQLGetStmtOption.c └── template │ ├── _NativeTypeLength.c │ ├── _NativeToSQLType.c │ ├── _NativeTypePrecision.c │ ├── _NativeTypeDesc.c │ ├── _NativeToSQLColumnHeader.c │ ├── SQLCopyDesc.c │ ├── SQLEndTran.c │ ├── SQLGetInfo.c │ ├── _FreeDbcList.c │ ├── SQLSetEnvAttr.c │ ├── _FreeStmtList.c │ ├── SQLGetEnvAttr.c │ ├── SQLSetDescField.c │ ├── SQLGetDescField.c │ ├── SQLGetDiagField.c │ ├── SQLGetData.c │ ├── SQLFreeHandle.c │ ├── SQLAllocHandle.c │ ├── SQLCancel.c │ ├── SQLCloseCursor.c │ ├── SQLMoreResults.c │ ├── SQLSetDescRec.c │ ├── SQLParamData.c │ ├── SQLGetTypeInfo.c │ ├── SQLNumParams.c │ ├── SQLParamOptions.c │ ├── SQLGetDescRec.c │ ├── SQLGetConnectOption.c │ └── SQLSetStmtOption.c ├── autogen.sh ├── doc ├── UserManual │ ├── My.sql │ ├── Figure1.gif │ ├── Figure2.gif │ ├── Figure3.gif │ ├── Figure4.gif │ ├── Figure6.gif │ ├── unixODBC.gif │ ├── StarOfficeDataGrid.gif │ └── Makefile.am ├── lst │ ├── back.gif │ ├── next.gif │ ├── InternalStructure.gif │ ├── InternalStructure.vsd │ ├── InternalStructure2.gif │ ├── InternalStructure3.gif │ ├── InternalStructure4.gif │ ├── InternalStructure5.gif │ ├── InternalStructure6.gif │ ├── InternalStructure7.gif │ ├── InternalStructure8.gif │ ├── InternalStructure9.gif │ └── Makefile.am ├── smallbook.gif ├── unixODBC.gif ├── ProgrammerManual │ ├── Makefile.am │ ├── unixODBC.gif │ └── Tutorial │ │ ├── Makefile.am │ │ ├── index.html │ │ └── navi.html ├── AdministratorManual │ ├── unixODBC.gif │ └── Makefile.am └── Makefile.am ├── samples └── Makefile.am ├── ChangeLog ├── .github ├── MariaDB_odbc_driver_template.ini ├── MariaDB_odbc_data_source_template.ini └── postgres_odbc.ini ├── lst ├── lstEOL.c ├── lstSetFreeFunc.c ├── lstGotoBookMark.c ├── lstSeek.c ├── lstSeekItem.c ├── lstGetBookMark.c ├── lstLast.c ├── lstFirst.c ├── _lstVisible.c ├── _lstNextValidItem.c ├── _lstPrevValidItem.c ├── lstNext.c ├── lstPrev.c ├── lstGet.c ├── lstOpen.c ├── Makefile.am ├── lstSet.c ├── ChangeLog ├── _lstDump.c ├── _lstAdjustCurrent.c ├── lstGoto.c ├── lstOpenCursor.c └── lstClose.c ├── extras ├── Makefile.am └── strcasecmp.c ├── SECURITY.md ├── log ├── Makefile.am ├── logClear.c ├── README ├── _logFreeMsg.c └── logOn.c ├── odbcinst ├── odbcinst.pc.in ├── ODBCINSTValidateProperty.c ├── ODBCINSTValidateProperties.c ├── SQLGetConfigMode.c ├── SQLRemoveTranslator.c ├── SQLRemoveDriverManager.c ├── SQLGetAvailableDrivers.c ├── SQLInstallTranslatorEx.c └── SQLGetTranslator.c ├── unixodbc.h.in ├── include └── Makefile.am ├── DriverManager ├── odbc.pc.in ├── TODO └── ChangeLog ├── vms ├── odbc_setup.com ├── install_image.com └── odbcinst_axp.opt ├── README.INTERIX ├── Makefile.svn ├── README.CYGWIN ├── ini ├── iniToUpper.c ├── iniObjectEOL.c ├── iniPropertyEOL.c ├── iniCursor.c ├── iniObjectUpdate.c ├── iniPropertyFirst.c ├── iniPropertyLast.c ├── iniDelete.c ├── iniGotoBookmark.c ├── iniProperty.c ├── iniGetBookmark.c ├── iniObject.c ├── iniObjectFirst.c ├── iniObjectLast.c ├── iniPropertyNext.c ├── iniObjectSeekSure.c ├── iniClose.c ├── iniValue.c ├── iniObjectNext.c ├── iniPropertyUpdate.c ├── iniObjectSeek.c ├── Makefile.am ├── iniElementCount.c ├── README ├── _iniPropertyRead.c ├── iniAllTrim.c ├── _iniObjectRead.c └── iniPropertySeekSure.c ├── m4 └── ltversion.m4 ├── README.CROSS ├── Makefile.am ├── .gitignore └── NEWS /cur/cur.exp: -------------------------------------------------------------------------------- 1 | CLConnect 2 | -------------------------------------------------------------------------------- /DRVConfig/template/Makefile.am: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /man/iusql.1: -------------------------------------------------------------------------------- 1 | .so man1/isql.1 2 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/isql.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/isqlext.h: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | autoreconf --install 3 | -------------------------------------------------------------------------------- /doc/UserManual/My.sql: -------------------------------------------------------------------------------- 1 | select * from tbSysInfo 2 | 3 | -------------------------------------------------------------------------------- /samples/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | cursor.c 3 | -------------------------------------------------------------------------------- /Drivers/nn/SQLSetParam.c: -------------------------------------------------------------------------------- 1 | /* Moved to SQLBindParameter.c. */ 2 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/ChangeLog -------------------------------------------------------------------------------- /doc/lst/back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/back.gif -------------------------------------------------------------------------------- /doc/lst/next.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/next.gif -------------------------------------------------------------------------------- /doc/smallbook.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/smallbook.gif -------------------------------------------------------------------------------- /doc/unixODBC.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/unixODBC.gif -------------------------------------------------------------------------------- /doc/UserManual/Figure1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/UserManual/Figure1.gif -------------------------------------------------------------------------------- /doc/UserManual/Figure2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/UserManual/Figure2.gif -------------------------------------------------------------------------------- /doc/UserManual/Figure3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/UserManual/Figure3.gif -------------------------------------------------------------------------------- /doc/UserManual/Figure4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/UserManual/Figure4.gif -------------------------------------------------------------------------------- /doc/UserManual/Figure6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/UserManual/Figure6.gif -------------------------------------------------------------------------------- /doc/UserManual/unixODBC.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/UserManual/unixODBC.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure.vsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure.vsd -------------------------------------------------------------------------------- /doc/lst/InternalStructure2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure2.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure3.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure4.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure5.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure6.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure7.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure8.gif -------------------------------------------------------------------------------- /doc/lst/InternalStructure9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/lst/InternalStructure9.gif -------------------------------------------------------------------------------- /doc/ProgrammerManual/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = Tutorial 2 | 3 | EXTRA_DIST = \ 4 | index.html \ 5 | unixODBC.gif 6 | -------------------------------------------------------------------------------- /doc/ProgrammerManual/unixODBC.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/ProgrammerManual/unixODBC.gif -------------------------------------------------------------------------------- /DRVConfig/drvcfg2/ChangeLog: -------------------------------------------------------------------------------- 1 | 1999-04-10 Peter Harvey 2 | 3 | * All: Created ChangeLog 4 | 5 | 6 | -------------------------------------------------------------------------------- /doc/AdministratorManual/unixODBC.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/AdministratorManual/unixODBC.gif -------------------------------------------------------------------------------- /doc/UserManual/StarOfficeDataGrid.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lurcher/unixODBC/HEAD/doc/UserManual/StarOfficeDataGrid.gif -------------------------------------------------------------------------------- /man/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man_MANS = isql.1 odbc.ini.5 odbcinst.1 odbcinst.ini.5 unixODBC.7 dltest.1 iusql.1 odbc_config.1 2 | 3 | -------------------------------------------------------------------------------- /Drivers/Makefile.am: -------------------------------------------------------------------------------- 1 | if DRIVERS 2 | 3 | SUBDIRS = \ 4 | Postgre7.1 \ 5 | template \ 6 | MiniSQL \ 7 | nn 8 | 9 | endif 10 | -------------------------------------------------------------------------------- /doc/AdministratorManual/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | index.html \ 3 | unixODBC.gif \ 4 | odbcinst.html \ 5 | php3.html \ 6 | unixODBCsetup.html 7 | -------------------------------------------------------------------------------- /.github/MariaDB_odbc_driver_template.ini: -------------------------------------------------------------------------------- 1 | [MariaDB ODBC 3.0 Driver] 2 | Description = MariaDB Connector/ODBC v.3.0 3 | Driver = /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.so 4 | -------------------------------------------------------------------------------- /cur/README: -------------------------------------------------------------------------------- 1 | A ODBC cursor lib provides cursor functionality 2 | ( client-side data caching and navigation ) in 3 | a generic manner so that drivers of any type 4 | can rely on it. 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = \ 2 | AdministratorManual \ 3 | ProgrammerManual \ 4 | UserManual \ 5 | lst 6 | 7 | EXTRA_DIST = \ 8 | index.html \ 9 | smallbook.gif \ 10 | unixODBC.gif 11 | -------------------------------------------------------------------------------- /doc/UserManual/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | Figure1.gif \ 3 | Figure2.gif \ 4 | Figure3.gif \ 5 | Figure4.gif \ 6 | Figure6.gif \ 7 | My.sql \ 8 | StarOfficeDataGrid.gif \ 9 | index.html \ 10 | unixODBC.gif 11 | -------------------------------------------------------------------------------- /.github/MariaDB_odbc_data_source_template.ini: -------------------------------------------------------------------------------- 1 | [MariaDB-server] 2 | Description=MariaDB server 3 | Driver=MariaDB ODBC 3.0 Driver 4 | SERVER=127.0.0.1 5 | USER=test_user 6 | PASSWORD=test_password 7 | DATABASE=test_db 8 | PORT=3306 9 | -------------------------------------------------------------------------------- /doc/ProgrammerManual/Tutorial/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | close.html \ 3 | conne.html \ 4 | dsn.html \ 5 | gloss.html \ 6 | index.html \ 7 | intro.html \ 8 | navi.html \ 9 | odbc.css \ 10 | query.html \ 11 | resul.html 12 | -------------------------------------------------------------------------------- /lst/lstEOL.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | int lstEOL( HLST hLst ) 5 | { 6 | if ( !hLst ) 7 | return true; 8 | 9 | if ( !hLst->hCurrent ) 10 | return true; 11 | 12 | return false; 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /DRVConfig/tds/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libtdsS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libtdsS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libtdsS_la_SOURCES = tdsS.c 8 | 9 | -------------------------------------------------------------------------------- /lst/lstSetFreeFunc.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | int lstSetFreeFunc( HLST hLst, void (*pFree)( void *pData ) ) 5 | { 6 | if ( !hLst ) 7 | return false; 8 | 9 | hLst->pFree = pFree; 10 | 11 | return true; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /DRVConfig/Mimer/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libmimerS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libmimerS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libmimerS_la_SOURCES = mimerS.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/MySQL/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libodbcmyS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libodbcmyS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libodbcmyS_la_SOURCES = odbcmyS.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/esoob/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libesoobS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libesoobS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libesoobS_la_SOURCES = esoobS.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/nn/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libodbcnnS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libodbcnnS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libodbcnnS_la_SOURCES = drvcfg.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/txt/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libodbctxtS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libodbctxtS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libodbctxtS_la_SOURCES = drvcfg.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/Oracle/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = liboraodbcS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | liboraodbcS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | liboraodbcS_la_SOURCES = oraodbcS.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/oplodbc/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = liboplodbcS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | liboplodbcS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | liboplodbcS_la_SOURCES = oplodbc.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/MiniSQL/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libodbcminiS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libodbcminiS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libodbcminiS_la_SOURCES = odbcminiS.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/Makefile.am: -------------------------------------------------------------------------------- 1 | if DRIVERC 2 | 3 | SUBDIRS = \ 4 | drvcfg1 \ 5 | drvcfg2 \ 6 | PostgreSQL \ 7 | MiniSQL \ 8 | MySQL \ 9 | nn \ 10 | esoob \ 11 | oplodbc \ 12 | template \ 13 | tds \ 14 | txt \ 15 | Oracle \ 16 | sapdb \ 17 | Mimer 18 | 19 | endif 20 | -------------------------------------------------------------------------------- /DRVConfig/PostgreSQL/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libodbcpsqlS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libodbcpsqlS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libodbcpsqlS_la_SOURCES = odbcpsqlS.c 8 | 9 | -------------------------------------------------------------------------------- /extras/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libodbcextraslc.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include 4 | 5 | EXTRA_DIST = vms.c 6 | 7 | libodbcextraslc_la_SOURCES = \ 8 | strcasecmp.c \ 9 | snprintf.c 10 | 11 | libodbcextraslc_la_LDFLAGS = -no-undefined 12 | -------------------------------------------------------------------------------- /DRVConfig/drvcfg1/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libodbcdrvcfg1S.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libodbcdrvcfg1S_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libodbcdrvcfg1S_la_SOURCES = drvcfg1.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/drvcfg2/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libodbcdrvcfg2S.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libodbcdrvcfg2S_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libodbcdrvcfg2S_la_SOURCES = drvcfg2.c 8 | 9 | -------------------------------------------------------------------------------- /DRVConfig/sapdb/Makefile.am: -------------------------------------------------------------------------------- 1 | lib_LTLIBRARIES = libsapdbS.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include $(LTDLINCL) 4 | 5 | libsapdbS_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 -avoid-version -shared 6 | 7 | libsapdbS_la_SOURCES = sapdb.c 8 | 9 | EXTRA_DIST = README 10 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | ------- | ------------------ | 7 | | 2.3.11 | :white_check_mark: | 8 | | < 2.3.x | :x: | 9 | 10 | ## Reporting a Vulnerability 11 | 12 | Contact nick.gorham@easysoft.com 13 | -------------------------------------------------------------------------------- /log/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libloglc.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include 4 | 5 | libloglc_la_SOURCES = \ 6 | _logFreeMsg.c \ 7 | logClear.c \ 8 | logClose.c \ 9 | logOn.c \ 10 | logOpen.c \ 11 | logPeekMsg.c \ 12 | logPopMsg.c \ 13 | logPushMsg.c 14 | 15 | libloglc_la_LIBADD = 16 | -------------------------------------------------------------------------------- /lst/lstGotoBookMark.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | int lstGotoBookMark( HLSTBOOKMARK hLstBookMark ) 5 | { 6 | if ( !hLstBookMark ) 7 | return LST_ERROR; 8 | 9 | hLstBookMark->hLst->hCurrent = hLstBookMark->hCurrent; 10 | 11 | return LST_SUCCESS; 12 | } 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /cur/odbccr.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | includedir=@includedir@ 4 | libdir=@libdir@ 5 | 6 | Name: odbccr (@PACKAGE_NAME@) 7 | Description: unixODBC Cursor Library 8 | URL: http://unixodbc.org 9 | Version: @PACKAGE_VERSION@ 10 | Requires: odbc 11 | Cflags: -I${includedir} 12 | Libs: -L${libdir} -lodbccr 13 | -------------------------------------------------------------------------------- /doc/ProgrammerManual/Tutorial/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dokumenttitel 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Drivers/nn/ChangeLog: -------------------------------------------------------------------------------- 1 | 1999-05-15 Peter Harvey 2 | 3 | * All: Started code resconstruction to unixODBC framework. 4 | 5 | 1999-05-13 Peter Harvey 6 | 7 | * All: adapted Ke Jin's NN ODBC driver for unixODBC (1st clean compile and successfull query) 8 | * ChangeLog: Started ChangeLog 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /odbcinst/odbcinst.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | includedir=@includedir@ 4 | libdir=@libdir@ 5 | 6 | Name: odbcinst (@PACKAGE_NAME@) 7 | Description: unixODBC Configuration Library 8 | URL: http://unixodbc.org 9 | Version: @PACKAGE_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs: -L${libdir} -lodbcinst 12 | Libs.private: @LIBLTDL@ @LIBS@ 13 | -------------------------------------------------------------------------------- /lst/lstSeek.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | int lstSeek( HLST hLst, void *pData ) 5 | { 6 | if ( !hLst ) 7 | return false; 8 | 9 | lstFirst( hLst ); 10 | while ( !lstEOL( hLst ) ) 11 | { 12 | if ( lstGet( hLst ) == pData ) 13 | return true; 14 | 15 | lstNext( hLst ); 16 | } 17 | 18 | return false; 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drivers/nn/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | ---- 3 | 4 | 0. standardize makefile(s) 5 | 1. modularize to the function level 6 | 2. get all sources to reside in one dir 7 | 3. replace redundent code with unixODBC libs such as odbcinst 8 | 4. update function declares to ODBC 3.5.1 standard 9 | 5. implement catalog functions ( SQLTables, SQLColumns... ) 10 | 11 | 12 | 13 | - Peter Harvey 14 | 15 | 16 | -------------------------------------------------------------------------------- /lst/lstSeekItem.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | int lstSeekItem( HLST hLst, HLSTITEM hItem ) 5 | { 6 | if ( !hLst ) 7 | return false; 8 | 9 | lstFirst( hLst ); 10 | while ( !lstEOL( hLst ) ) 11 | { 12 | if ( hLst->hCurrent == hItem ) 13 | return true; 14 | 15 | lstNext( hLst ); 16 | } 17 | 18 | return false; 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /lst/lstGetBookMark.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | int lstGetBookMark( HLST hLst, HLSTBOOKMARK hLstBookMark ) 5 | { 6 | if ( !hLst ) 7 | return LST_ERROR; 8 | 9 | if ( !hLstBookMark ) 10 | return LST_ERROR; 11 | 12 | hLstBookMark->hCurrent = hLst->hCurrent; 13 | hLstBookMark->hLst = hLst; 14 | 15 | return LST_SUCCESS; 16 | } 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /lst/lstLast.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | void *lstLast( HLST hLst ) 5 | { 6 | if ( !hLst ) 7 | return NULL; 8 | 9 | if ( !hLst->hLast ) 10 | return NULL; 11 | 12 | if ( !_lstVisible( hLst->hLast ) ) 13 | hLst->hCurrent = _lstPrevValidItem( hLst, hLst->hLast ); 14 | else 15 | hLst->hCurrent = hLst->hLast; 16 | 17 | return hLst->hCurrent; 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /lst/lstFirst.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | void *lstFirst( HLST hLst ) 5 | { 6 | if ( !hLst ) 7 | return NULL; 8 | 9 | if ( !hLst->hFirst ) 10 | return NULL; 11 | 12 | if ( !_lstVisible( hLst->hFirst ) ) 13 | hLst->hCurrent = _lstNextValidItem( hLst, hLst->hFirst ); 14 | else 15 | hLst->hCurrent = hLst->hFirst; 16 | 17 | return hLst->hCurrent; 18 | } 19 | 20 | 21 | -------------------------------------------------------------------------------- /lst/_lstVisible.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | int _lstVisible( HLSTITEM hItem ) 5 | { 6 | HLST hLst; 7 | 8 | if ( !hItem ) 9 | return false; 10 | 11 | hLst = (HLST)hItem->hLst; 12 | 13 | if ( hItem->bDelete && hLst->bShowDeleted == false ) 14 | return false; 15 | 16 | if ( hItem->bHide && hLst->bShowHidden == false ) 17 | return false; 18 | 19 | return true; 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /lst/_lstNextValidItem.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | HLSTITEM _lstNextValidItem( HLST hLst, HLSTITEM hItem ) 5 | { 6 | 7 | if ( !hLst ) 8 | return NULL; 9 | 10 | if ( !hItem ) 11 | return NULL; 12 | 13 | hItem = hItem->pNext; 14 | while ( hItem ) 15 | { 16 | if ( _lstVisible( hItem ) ) 17 | return hItem; 18 | 19 | hItem = hItem->pNext; 20 | } 21 | 22 | return NULL; 23 | } 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lst/_lstPrevValidItem.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | HLSTITEM _lstPrevValidItem( HLST hLst, HLSTITEM hItem ) 5 | { 6 | 7 | if ( !hLst ) 8 | return NULL; 9 | 10 | if ( !hItem ) 11 | return NULL; 12 | 13 | hItem = hItem->pPrev; 14 | while ( hItem ) 15 | { 16 | if ( _lstVisible( hItem ) ) 17 | return hItem; 18 | 19 | hItem = hItem->pPrev; 20 | } 21 | 22 | 23 | return NULL; 24 | } 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /lst/lstNext.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | void *lstNext( HLST hLst ) 5 | { 6 | if ( !hLst ) 7 | return NULL; 8 | 9 | if ( !hLst->hCurrent ) 10 | return NULL; 11 | 12 | hLst->hCurrent = hLst->hCurrent->pNext; 13 | 14 | if ( hLst->hCurrent ) 15 | { 16 | if ( !_lstVisible( hLst->hCurrent ) ) 17 | hLst->hCurrent = _lstNextValidItem( hLst, hLst->hCurrent ); 18 | } 19 | 20 | return hLst->hCurrent; 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /lst/lstPrev.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | void *lstPrev( HLST hLst ) 5 | { 6 | if ( !hLst ) 7 | return NULL; 8 | 9 | if ( !hLst->hCurrent ) 10 | return NULL; 11 | 12 | hLst->hCurrent = hLst->hCurrent->pPrev; 13 | 14 | if ( hLst->hCurrent ) 15 | { 16 | if ( !_lstVisible( hLst->hCurrent ) ) 17 | hLst->hCurrent = _lstPrevValidItem( hLst, hLst->hCurrent ); 18 | } 19 | 20 | return hLst->hCurrent; 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /unixodbc.h.in: -------------------------------------------------------------------------------- 1 | /* Preprocessor constants for unixODBC */ 2 | 3 | /* Define to 1 if `long long' is available */ 4 | #undef HAVE_LONG_LONG 5 | 6 | /* Define to 1 if the header file is present */ 7 | #undef HAVE_PWD_H 8 | 9 | /* Define to 1 if the header file is present */ 10 | #undef HAVE_SYS_TYPES_H 11 | 12 | /* Define to 1 if the header file is present */ 13 | #undef HAVE_UNISTD_H 14 | 15 | /* Define to the value of sizeof(long) */ 16 | #undef SIZEOF_LONG_INT 17 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/ChangeLog: -------------------------------------------------------------------------------- 1 | 1999-05-03 Peter Harvey 2 | 3 | * SQLColAttribute: Returned SQL_ERROR even when all was ok. 4 | 5 | 1999-04-03 Peter Harvey 6 | 7 | * SQLSpecialColumns: Mostly implemented. Simply returns _rowid. Quick and dirty. 8 | 9 | 1999-04-02 Peter Harvey 10 | 11 | * SQLFetchScroll: Mostly implemented 12 | * SQLExecDirect: Created _Execute 13 | * SQLPrepare: Created _Prepare 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | ini.h \ 3 | log.h \ 4 | lst.h \ 5 | odbcinst.h \ 6 | odbcinstext.h \ 7 | sql.h \ 8 | sqlext.h \ 9 | sqltypes.h \ 10 | sqlucode.h \ 11 | sqlspi.h \ 12 | sqp.h \ 13 | uodbc_stats.h \ 14 | uodbc_extras.h \ 15 | autotest.h \ 16 | odbctrace.h \ 17 | odbctrac.h 18 | 19 | include_HEADERS = \ 20 | odbcinst.h \ 21 | odbcinstext.h \ 22 | sql.h \ 23 | sqlext.h \ 24 | sqltypes.h \ 25 | sqlucode.h \ 26 | sqlspi.h \ 27 | autotest.h \ 28 | uodbc_stats.h \ 29 | uodbc_extras.h 30 | -------------------------------------------------------------------------------- /DriverManager/odbc.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | includedir=@includedir@ 4 | libdir=@libdir@ 5 | sysconfdir=@sysconfdir@ 6 | 7 | odbcversion=3 8 | longodbcversion=3.52 9 | odbcini=${sysconfdir}/odbc.ini 10 | odbcinstini=${sysconfdir}/odbcinst.ini 11 | ulen=@ODBC_ULEN@ 12 | build_cflags=@ODBC_CFLAGS@ 13 | 14 | Name: odbc (@PACKAGE_NAME@) 15 | Description: unixODBC Driver Manager library 16 | URL: http://unixodbc.org 17 | Version: @PACKAGE_VERSION@ 18 | Cflags: -I${includedir} 19 | Libs: -L${libdir} -lodbc 20 | Libs.private: @LIBLTDL@ @LIBICONV@ @LIBS@ 21 | -------------------------------------------------------------------------------- /vms/odbc_setup.com: -------------------------------------------------------------------------------- 1 | $ whoami = f$parse(f$environment("PROCEDURE"),,,,"NO_CONCEAL") 2 | $ whereami = f$parse(whoami,,,"DEVICE") + f$parse(whoami,,,"DIRECTORY") - ".][000000]" - "][" - ".]" - "]" + "]" 3 | $ define ODBC_LIBDIR 'whereami' 4 | $! 5 | $ file_loop: 6 | $ file = f$search("ODBC_LIBDIR:*ODBC*.EXE") 7 | $ if file .eqs. "" then goto file_loop_end 8 | $ image_name = f$parse(file,,,"NAME") 9 | $ define 'f$edit(image_name,"UPCASE")' "ODBC_LIBDIR:''image_name'.EXE" 10 | $ goto file_loop 11 | $ file_loop_end: 12 | $! 13 | $ isql :== $ODBC_LIBDIR:ISQL.EXE 14 | $ exit 15 | -------------------------------------------------------------------------------- /README.INTERIX: -------------------------------------------------------------------------------- 1 | Some notes on building UnixODBC on Microsoft Interix 2 | 3 | First use the modified configure and config.guess 4 | included in the Interix directory, copy them up into the main 5 | directory. 6 | 7 | Then build with the following line 8 | 9 | CFLAGS="-D_ALL_SOURCE -I/usr/local/include" CPPFLAGS="-D_ALL_SOURCE 10 | -I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure 11 | 12 | After running configure, copy libtool from the Interix directory 13 | into the build directory 14 | 15 | Thanks to the MS group for supplying this info. 16 | 17 | Thats all for now. 18 | 19 | Nick. 20 | -------------------------------------------------------------------------------- /lst/lstGet.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | /* 4 | * 5 | */ 6 | void *lstGet( HLST hLst ) 7 | { 8 | HLSTITEM hItem; 9 | 10 | if ( !hLst ) 11 | return NULL; 12 | 13 | if ( !hLst->hCurrent ) 14 | return NULL; 15 | 16 | if ( hLst->hLstBase ) 17 | hItem = (HLSTITEM)hLst->hCurrent->pData; /* cursor pData points directly to the root Item (not the roots pData) */ 18 | else /* a cursor may be based upon another cursor but pData is always ptr to root item */ 19 | hItem = hLst->hCurrent; 20 | 21 | 22 | return hItem->pData; 23 | } 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Drivers/template/_NativeTypeLength.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | int _NativeTypeLength( void *pNativeColumnHeader ) 16 | { 17 | return 0; 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drivers/template/_NativeToSQLType.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | int _NativeToSQLType( void *pNativeColumnHeader ) 16 | { 17 | return SQL_CHAR; 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drivers/template/_NativeTypePrecision.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | int _NativeTypePrecision( void *pNativeColumnHeader ) 16 | { 17 | 18 | return 0; 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /lst/lstOpen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | HLST lstOpen() 5 | { 6 | HLST hLst = NULL; 7 | 8 | hLst = malloc( sizeof(LST) ); 9 | 10 | if ( hLst ) 11 | { 12 | hLst->bExclusive = false; 13 | hLst->hCurrent = NULL; 14 | hLst->hFirst = NULL; 15 | hLst->hLast = NULL; 16 | hLst->hLstBase = NULL; 17 | hLst->nRefs = 1; /* someone created us so lets assume that it counts as one ref */ 18 | hLst->pFilter = NULL; 19 | hLst->pFree = free; 20 | hLst->nItems = 0; 21 | hLst->bShowDeleted = false; 22 | hLst->bShowHidden = false; 23 | } 24 | 25 | return hLst; 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Drivers/template/_NativeTypeDesc.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | char *_NativeTypeDesc( char *pszTypeName, int nMySQLType ) 16 | { 17 | return pszTypeName; 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/_NativeTypePrecision.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * _NativeTypePrecision 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | int _NativeTypePrecision( void *pNativeColumnHeader ) 16 | { 17 | return 4; 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/lst/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = \ 2 | InternalStructure.gif \ 3 | InternalStructure.html \ 4 | InternalStructure.vsd \ 5 | InternalStructure2.gif \ 6 | InternalStructure2.html \ 7 | InternalStructure3.gif \ 8 | InternalStructure3.html \ 9 | InternalStructure4.gif \ 10 | InternalStructure4.html \ 11 | InternalStructure5.gif \ 12 | InternalStructure5.html \ 13 | InternalStructure6.gif \ 14 | InternalStructure6.html \ 15 | InternalStructure7.gif \ 16 | InternalStructure7.html \ 17 | InternalStructure8.gif \ 18 | InternalStructure8.html \ 19 | InternalStructure9.gif \ 20 | InternalStructure9.html \ 21 | back.gif \ 22 | next.gif 23 | -------------------------------------------------------------------------------- /.github/postgres_odbc.ini: -------------------------------------------------------------------------------- 1 | [PostgreSQL-server] 2 | Description=PostgreSQL server 3 | Driver=PostgreSQL Unicode 4 | Servername = 127.0.0.1 5 | Username = test_user 6 | Password = test_password 7 | Database = test_db 8 | Port = 5432 9 | 10 | [PostgreSQL ANSI] 11 | Description = PostgreSQL ODBC driver (ANSI version) 12 | Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so 13 | Setup = libodbcpsqlS.so 14 | Debug = 0 15 | CommLog = 1 16 | 17 | [PostgreSQL Unicode] 18 | Description = PostgreSQL ODBC driver (Unicode version) 19 | Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so 20 | Setup = libodbcpsqlS.so 21 | Debug = 0 22 | CommLog = 1 23 | 24 | -------------------------------------------------------------------------------- /DriverManager/TODO: -------------------------------------------------------------------------------- 1 | Add explicit descriptor allocation and release. 2 | 3 | Keep track of bound columns to check if SQLGetData is valid. (may not be 4 | posible). 5 | 6 | Pass any connect and env attr onto driver when connected. 7 | 8 | Handle Env attrs (Set/Get EnvAttr). 9 | 10 | GetDescField needs finishing. 11 | 12 | Manage file DSN's. 13 | 14 | Interface to Cursor and Translator libs. 15 | 16 | Clear errors at the start of each function. 17 | 18 | Handle SQLCopyDesc where the source and destination is on different connections. 19 | 20 | SQLBulkoperations needs some conditions testing. 21 | 22 | SQLBrowseConnect needs some conditions testing. 23 | -------------------------------------------------------------------------------- /Makefile.svn: -------------------------------------------------------------------------------- 1 | svn: 2 | @echo "*** Retrieving configure tests needed by configure.in" 3 | @libtoolize --copy --ltdl --force 4 | @aclocal -I m4 5 | @echo "*** Building Makefile templates (step one)" 6 | @automake --add-missing 7 | @automake 8 | @echo "*** Building config.h" 9 | @autoheader 10 | @sed -i '/UNIXODBC_SOURCE/d' unixodbc_conf.h.in 11 | @sed -i '/ VERSION/d' unixodbc_conf.h.in 12 | @sed -i '/ PACKAGE/d' unixodbc_conf.h.in 13 | @echo "*** Building configure" 14 | @autoconf 15 | @echo "*** Finished" 16 | @echo " Don't forget to run ./configure" 17 | @echo " If you haven't done so in a while, run ./configure --help" 18 | 19 | 20 | -------------------------------------------------------------------------------- /README.CYGWIN: -------------------------------------------------------------------------------- 1 | To build unixODBC on cygwin, all you need to do is to rerun the autoconf 2 | tools to create versions that seem to play on windows, then build as normal. 3 | 4 | Of course to do this you need to have installed the Cygwin development 5 | packages. 6 | 7 | So: 8 | 9 | aclocal 10 | automake --add-missing 11 | automake 12 | autoconf 13 | libtoolize --copy --ltdl --force 14 | 15 | Then you can run configure as normal 16 | 17 | ./configure --enable-gui=no 18 | make 19 | make install 20 | 21 | At least that seems to work when I tried it... If you find problems 22 | just let me know. 23 | 24 | -- 25 | Nick Gorham (nick.gorham@easysoft.com) 26 | -------------------------------------------------------------------------------- /Drivers/template/_NativeToSQLColumnHeader.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | SQLRETURN _NativeToSQLColumnHeader( COLUMNHDR *pColumnHeader, void *pNativeColumnHeader ) 16 | { 17 | return SQL_SUCCESS; 18 | } 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /vms/install_image.com: -------------------------------------------------------------------------------- 1 | $ 2 | $ if p1 .eqs. "" then $goto ERR_NOPARAMS 3 | $ 4 | $ install :== $install/command 5 | $ 6 | $ if (f$file ("''p1'", "KNOWN")) 7 | $ then install replace/open/header/shared 'p1' 8 | $ else install create/open/header/shared 'p1' 9 | $ endif 10 | $done: 11 | $ exit 12 | $ 13 | $ERR_NOPARAMS: 14 | $ write sys$output " " 15 | $ write sys$output "The correct calling sequence is: " 16 | $ write sys$output " " 17 | $ write sys$output "$ @install_server p1 18 | $ write sys$output " " 19 | $ write sys$output "Where: " 20 | $ write sys$output " " 21 | $ write sys$output " p1 = Image to be installed" 22 | $ write sys$output " " 23 | $ exit 44 24 | $ 25 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLAllocConnect.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * SQLAllocConnect 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLAllocConnect( SQLHENV hDrvEnv, 17 | SQLHDBC *phDrvDbc ) 18 | { 19 | return _AllocConnect( hDrvEnv, phDrvDbc ); 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /lst/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = liblstlc.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include 4 | 5 | liblstlc_la_LDFLAGS = -no-undefined 6 | 7 | liblstlc_la_SOURCES = \ 8 | _lstAdjustCurrent.c \ 9 | _lstDump.c \ 10 | _lstFreeItem.c \ 11 | _lstNextValidItem.c \ 12 | _lstPrevValidItem.c \ 13 | _lstVisible.c \ 14 | lstAppend.c \ 15 | lstClose.c \ 16 | lstDelete.c \ 17 | lstEOL.c \ 18 | lstFirst.c \ 19 | lstGet.c \ 20 | lstGetBookMark.c \ 21 | lstGoto.c \ 22 | lstGotoBookMark.c \ 23 | lstInsert.c \ 24 | lstLast.c \ 25 | lstNext.c \ 26 | lstOpen.c \ 27 | lstOpenCursor.c \ 28 | lstPrev.c \ 29 | lstSeek.c \ 30 | lstSeekItem.c \ 31 | lstSet.c \ 32 | lstSetFreeFunc.c 33 | -------------------------------------------------------------------------------- /lst/lstSet.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | void *lstSet( HLST hLst, void *pData ) 5 | { 6 | HLSTITEM hItem; 7 | HLST hLstRoot; 8 | 9 | if ( !hLst ) 10 | return NULL; 11 | 12 | if ( !hLst->hCurrent ) 13 | return NULL; 14 | 15 | 16 | if ( hLst->hLstBase ) 17 | hItem = (HLSTITEM)hLst->hCurrent->pData; 18 | else 19 | hItem = hLst->hCurrent; 20 | 21 | hLstRoot = (HLST)hItem->hLst; 22 | 23 | /************************** 24 | * SET VALUE 25 | **************************/ 26 | if ( hItem->pData && hLstRoot->pFree ) 27 | hLstRoot->pFree( hItem->pData ); 28 | 29 | hItem->pData = pData; 30 | 31 | return pData; 32 | } 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /odbcinst/ODBCINSTValidateProperty.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * ODBCINSTValidateProperty 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 28.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include 14 | 15 | int ODBCINSTValidateProperty( HODBCINSTPROPERTY hFirstProperty, char *pszProperty, char *pszMessage ) 16 | { 17 | return ODBCINST_SUCCESS; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /lst/ChangeLog: -------------------------------------------------------------------------------- 1 | 1999-04-30 Peter Harvey 2 | 3 | * bVisible: Added bVisible to HLSTITEM and it is used by nav funcs. 4 | 5 | 1999-04-28 Peter Harvey 6 | 7 | * lstOpen: Now inits nItem to 0 (got removed somehow) 8 | 9 | 1999-04-21 Peter Harvey 10 | 11 | * _lstDump: Added 12 | 13 | 1999-04-15 Peter Harvey 14 | 15 | * All: Added lstOpenCursor and cursor support (still needs locking) 16 | 17 | 1999-04-07 Peter Harvey 18 | 19 | * BookMarks: Added 20 | 21 | 1999-04-04 Peter Harvey 22 | 23 | * ChangeLog: Started ChangeLog 24 | 25 | -------------------------------------------------------------------------------- /odbcinst/ODBCINSTValidateProperties.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * ODBCINSTValidateProperties 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 28.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | 13 | #include 14 | #include 15 | 16 | int ODBCINSTValidateProperties( HODBCINSTPROPERTY hFirstProperty, HODBCINSTPROPERTY hBadProperty, char *pszMessage ) 17 | { 18 | 19 | return ODBCINST_SUCCESS; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/_NativeTypeDesc.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * _NativeTypeDesc 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | char *_NativeTypeDesc( char *pszTypeName, int nMiniSQLType ) 16 | { 17 | 18 | sprintf( pszTypeName, "%s", msqlTypeNames[nMiniSQLType] ); 19 | 20 | return pszTypeName; 21 | } 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLAllocEnv.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLAllocEnv 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLAllocEnv( SQLHENV *phDrvEnv ) 17 | { 18 | return _AllocEnv( phDrvEnv ); 19 | } 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLExecute.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLExecute 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLExecute( SQLHSTMT hDrvStmt ) 17 | { 18 | return _Execute( hDrvStmt ); 19 | } 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ini/iniToUpper.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniToUpper( char *pszString ) 18 | { 19 | int n = 0; 20 | 21 | for ( n = 0; pszString[n] != '\0'; n++ ) 22 | pszString[n] = toupper((unsigned char)pszString[n]); 23 | 24 | return INI_SUCCESS; 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /ini/iniObjectEOL.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniObjectEOL( HINI hIni ) 18 | { 19 | /* SANITY CHECKS */ 20 | if ( hIni == NULL ) 21 | return INI_ERROR; 22 | 23 | if ( hIni->hCurObject == NULL ) 24 | return TRUE; 25 | 26 | return FALSE; 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLFreeStmt.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLFreeStmt 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLFreeStmt( SQLHSTMT hDrvStmt, 17 | SQLUSMALLINT nOption ) 18 | { 19 | return sqlFreeStmt( hDrvStmt, nOption ); 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/_FreeDbcList.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * _FreeDbcList 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | SQLRETURN _FreeDbcList( SQLHENV hDrvEnv ) 16 | { 17 | HDRVENV hEnv = (HDRVENV)hDrvEnv; 18 | 19 | if ( hEnv == SQL_NULL_HENV ) 20 | return SQL_SUCCESS; 21 | 22 | while ( _FreeDbc( hEnv->hFirstDbc ) == SQL_SUCCESS ) 23 | { 24 | } 25 | 26 | return SQL_SUCCESS; 27 | } 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 4179 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.6]) 16 | m4_define([LT_PACKAGE_REVISION], [2.4.6]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.6' 20 | macro_revision='2.4.6' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /lst/_lstDump.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | void _lstDump( HLST hLst ) 5 | { 6 | HLSTITEM hItem; 7 | int nItem = 0; 8 | 9 | printf( "LST - BEGIN DUMP\n" ); 10 | 11 | if ( hLst ) 12 | { 13 | printf( "\thLst = %p\n", hLst ); 14 | printf( "\t\thLst->hLstBase = %p\n", hLst->hLstBase ); 15 | 16 | hItem = hLst->hFirst; 17 | while ( hItem ) 18 | { 19 | printf( "\t%d\n", nItem ); 20 | printf( "\t\thItem = %p\n", hItem ); 21 | printf( "\t\thItem->bDelete = %d\n", hItem->bDelete ); 22 | printf( "\t\thItem->bHide = %d\n", hItem->bHide ); 23 | printf( "\t\thItem->pData = %p\n", hItem->pData ); 24 | printf( "\t\thItem->hLst = %p\n", hItem->hLst ); 25 | 26 | nItem++; 27 | hItem = hItem->pNext; 28 | } 29 | } 30 | printf( "LST - END DUMP\n" ); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /odbcinst/SQLGetConfigMode.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * SQLGetConfigMode 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 28.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | * Nick Gorham - nick@lurcher.org 12 | **************************************************/ 13 | #include 14 | #include 15 | #include 16 | 17 | BOOL SQLGetConfigMode( UWORD *pnConfigMode ) 18 | { 19 | inst_logClear(); 20 | 21 | __lock_config_mode(); 22 | *pnConfigMode = __get_config_mode(); 23 | __unlock_config_mode(); 24 | 25 | return TRUE; 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLAllocStmt.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLAllocStmt (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLAllocStmt( SQLHDBC hDrvDbc, 17 | SQLHSTMT *phDrvStmt ) 18 | { 19 | return _AllocStmt( hDrvDbc, phDrvStmt ); 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /ini/iniPropertyEOL.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniPropertyEOL( HINI hIni ) 18 | { 19 | /* SANITY CHECKS */ 20 | if ( hIni == NULL ) 21 | return TRUE; 22 | 23 | if ( hIni->hCurObject == NULL ) 24 | return TRUE; 25 | 26 | if ( hIni->hCurProperty == NULL ) 27 | return TRUE; 28 | 29 | return FALSE; 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLPrepare.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLPrepare 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLPrepare( SQLHSTMT hDrvStmt, 17 | SQLCHAR *szSqlStr, 18 | SQLINTEGER nSqlStrLength ) 19 | { 20 | return _Prepare( hDrvStmt, szSqlStr, nSqlStrLength ); 21 | } 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Drivers/nn/stmt.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #ifndef _STMT_H 16 | # define _STMT_H 17 | 18 | # include 19 | # include 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /odbcinst/SQLRemoveTranslator.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | ************************************************** 4 | * This code was created by Peter Harvey @ CodeByDesign. 5 | * Released under LGPL 28.JAN.99 6 | * 7 | * Contributions from... 8 | * ----------------------------------------------- 9 | * Peter Harvey - pharvey@codebydesign.com 10 | **************************************************/ 11 | #include 12 | #include 13 | 14 | BOOL SQLRemoveTranslator( LPCSTR pszTranslator, 15 | LPDWORD pnUsageCount ) 16 | { 17 | inst_logClear(); 18 | 19 | return FALSE; 20 | } 21 | 22 | BOOL INSTAPI SQLRemoveTranslatorW(LPCWSTR lpszTranslator, 23 | LPDWORD lpdwUsageCount) 24 | { 25 | inst_logClear(); 26 | 27 | return FALSE; 28 | } 29 | -------------------------------------------------------------------------------- /DriverManager/ChangeLog: -------------------------------------------------------------------------------- 1 | 1999-05-19 Peter Harvey 2 | 3 | * ALL: Added logging for Top and Bottom of funcs... errors still need to go to log 4 | * ALL: numcols now calced for catalog funcs 5 | 6 | 1999-05-10 Peter Harvey 7 | 8 | * SQLPrepare: Code, here and elsewhere, dependent upon num result cols being known before execute has been commented out. 9 | * SQLConnect: Used to try to search-a-path for DSN but now lets odbcinst do this. 10 | 11 | 1999-05-09 Nick Gorham 12 | 13 | * ALL: Total rewrite by Nick. Has much more functionality and compliance. 14 | 15 | 1999-04-14 Peter Harvey 16 | 17 | * sqltypes.h: Changed ODBCINT64 to long long 18 | 19 | 1999-03-30 Peter Harvey 20 | 21 | * SQLDrivers.c: added 22 | 23 | -------------------------------------------------------------------------------- /odbcinst/SQLRemoveDriverManager.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | ************************************************** 4 | * This code was created by Peter Harvey @ CodeByDesign. 5 | * Released under LGPL 28.JAN.99 6 | * 7 | * Contributions from... 8 | * ----------------------------------------------- 9 | * Peter Harvey - pharvey@codebydesign.com 10 | **************************************************/ 11 | #include 12 | #include 13 | 14 | BOOL SQLRemoveDriverManager( LPDWORD pnUsageCount ) 15 | { 16 | inst_logClear(); 17 | 18 | if ( pnUsageCount == NULL ) 19 | { 20 | inst_logPushMsg( __FILE__, __FILE__, __LINE__, LOG_CRITICAL, ODBC_ERROR_GENERAL_ERR, "" ); 21 | return FALSE; 22 | } 23 | 24 | *pnUsageCount = 1; 25 | 26 | return TRUE; 27 | } 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /README.CROSS: -------------------------------------------------------------------------------- 1 | In case of cross compilation, the odbc_config cannot run, the error message 2 | would be like below: 3 | 4 | /bin/bash: line 1: ../exe/odbc_config: cannot execute binary file: Exec format error 5 | 6 | Add CROSS_LAUNCHER to allow the possibility of running odbc_config correctly in 7 | case of cross compilation. 8 | 9 | For example, here's a possible value for it (Yocto project environment, aarch64 target). 10 | export CROSS_LAUNCHER="PSEUDO_UNLOAD=1 qemu-aarch64 -r 5.15 \ 11 | -L /PATH/TO/unixodbc/2.3.11/recipe-sysroot \ 12 | -E LD_LIBRARY_PATH=/PATH/TO/unixodbc/2.3.11/recipe-sysroot//usr/lib:/PATH/TO/unixodbc/2.3.11/recipe-sysroot//usr/lib " 13 | 14 | Other projects can use the launcher they like to allow correct generation of 15 | the odbc.pc file in cross compilation environment. 16 | 17 | Signed-off-by: Chen Qi 18 | -------------------------------------------------------------------------------- /ini/iniCursor.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * iniCursor 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * PAH = Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 18.MAR.99 Created. 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniCursor( HINI hIni, HINI hIniCursor ) 21 | { 22 | if ( hIni == NULL || hIniCursor == NULL ) 23 | return INI_ERROR; 24 | 25 | memcpy( hIniCursor, hIni, sizeof(INI) ); 26 | 27 | return INI_SUCCESS; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLFreeEnv.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLFreeEnv 3 | * 4 | * Do not try to Free Env if there are Dbcs... return an error. Let the 5 | * Driver Manager do a recursive clean up if it wants. 6 | * 7 | ********************************************************************** 8 | * 9 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 10 | * This code is LGPL. Please ensure that this message remains in future 11 | * distributions and uses of this code (thats about all I get out of it). 12 | * - Peter Harvey pharvey@codebydesign.com 13 | * 14 | **********************************************************************/ 15 | 16 | #include 17 | #include "driver.h" 18 | 19 | SQLRETURN SQLFreeEnv( SQLHENV hDrvEnv ) 20 | { 21 | return sqlFreeEnv( hDrvEnv ); 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /Drivers/nn/nntp.ci: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | # define MSGHEAD "[INN][NNRP server]" 4 | 5 | static struct { 6 | int code; 7 | char* msg; 8 | } nntp_msg[] = { 9 | NNTP_POSTING, MSGHEAD "Article in posting", 10 | NNTP_SERVICE_DOWN, MSGHEAD "NNTP Server down", 11 | NNTP_INVALID_GROUP, MSGHEAD "No such news group on this server", 12 | NNTP_NOT_IN_GROUP, MSGHEAD "Not in a news group", 13 | NNTP_NOT_IN_ARTICLE, MSGHEAD "Not in a article", 14 | NNTP_END_OF_GROUP, MSGHEAD "End of news group", 15 | NNTP_TOP_OF_GROUP, MSGHEAD "Top of news group", 16 | NNTP_INVALID_MSGNUM, MSGHEAD "Invalid article number", 17 | NNTP_INVALID_MSGID, MSGHEAD "Invalid article ID", 18 | NNTP_UNWANTED_MSG, MSGHEAD "Unwanted article", 19 | NNTP_REJECTED_MSG, MSGHEAD "Article rejected", 20 | NNTP_CANNOT_POST, MSGHEAD "Can't post", 21 | NNTP_POSTING_FAILED, MSGHEAD "NNTP Posting failed" 22 | }; 23 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/_FreeStmtList.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * _FreeStmtList 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | SQLRETURN _FreeStmtList( SQLHDBC hDrvDbc ) 16 | { 17 | HDRVDBC hDbc = (HDRVDBC)hDrvDbc; 18 | 19 | if ( hDbc == SQL_NULL_HDBC ) 20 | return SQL_SUCCESS; 21 | 22 | if ( hDbc->hFirstStmt == NULL ) 23 | return SQL_SUCCESS; 24 | 25 | while ( _FreeStmt( hDbc->hFirstStmt ) == SQL_SUCCESS ) 26 | { 27 | } 28 | 29 | return SQL_SUCCESS; 30 | } 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLCopyDesc.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLCopyDesc 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLCopyDesc( 17 | SQLHDESC hSourceDescHandle, 18 | SQLHDESC hTargetDescHandle 19 | ) 20 | { 21 | 22 | return SQL_ERROR; 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLFreeConnect.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLFreeConnect 3 | * 4 | * Do not try to Free Dbc if there are Stmts... return an error. Let the 5 | * Driver Manager do a recursive clean up if it wants. 6 | * 7 | ********************************************************************** 8 | * 9 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 10 | * This code is LGPL. Please ensure that this message remains in future 11 | * distributions and uses of this code (thats about all I get out of it). 12 | * - Peter Harvey pharvey@codebydesign.com 13 | * 14 | **********************************************************************/ 15 | 16 | #include 17 | #include "driver.h" 18 | 19 | SQLRETURN SQLFreeConnect( SQLHDBC hDrvDbc ) 20 | { 21 | return sqlFreeConnect( hDrvDbc ); 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /Drivers/template/SQLCopyDesc.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLCopyDesc 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLCopyDesc( 17 | SQLHDESC hSourceDescHandle, 18 | SQLHDESC hTargetDescHandle 19 | ) 20 | { 21 | 22 | return SQL_ERROR; 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLEndTran.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLEndTran 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLEndTran( SQLSMALLINT nHandleType, 17 | SQLHANDLE nHandle, 18 | SQLSMALLINT nCompletionType 19 | ) 20 | { 21 | 22 | return SQL_ERROR; 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /Drivers/template/SQLEndTran.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLEndTran 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLEndTran( SQLSMALLINT nHandleType, 17 | SQLHANDLE nHandle, 18 | SQLSMALLINT nCompletionType 19 | ) 20 | { 21 | 22 | return SQL_ERROR; 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetInfo.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetInfo 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetInfo( 17 | SQLHDBC hDbc, 18 | SQLUSMALLINT nInfoType, 19 | SQLPOINTER pInfoValue, 20 | SQLSMALLINT nInfoValueMax, 21 | SQLSMALLINT *pnLength) 22 | { 23 | 24 | return SQL_ERROR; 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /DRVConfig/oplodbc/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. This software is a LinuxODBC component and * 4 | * may NOT be distributed seperately. * 5 | * * 6 | * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * 7 | *************************************************************** 8 | 9 | +-------------------------------------------------------------+ 10 | | LinuxODBC | 11 | | Driver Config for OpenLinks ODBC driver | 12 | +-------------------------------------------------------------+ 13 | 14 | Use this Driver Config when using the OpenLink 15 | ODBC Driver. 16 | 17 | Peter Harvey 18 | pharvey@codebydesign.com 19 | 25.FEB.99 20 | 21 | -------------------------------------------------------------------------------- /ini/iniObjectUpdate.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniObjectUpdate( HINI hIni, char *pszObject ) 18 | { 19 | /* SANITY CHECKS */ 20 | if ( hIni == NULL ) 21 | return INI_ERROR; 22 | 23 | if ( hIni->hCurObject == NULL ) 24 | return INI_ERROR; 25 | 26 | /* Ok */ 27 | strncpy( hIni->hCurObject->szName, pszObject, INI_MAX_OBJECT_NAME ); 28 | 29 | return INI_SUCCESS; 30 | } 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Drivers/template/_FreeDbcList.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * _FreeDbcList 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN _FreeDbcList( SQLHENV hDrvEnv ) 17 | { 18 | HDRVENV hEnv = (HDRVENV)hDrvEnv; 19 | 20 | if ( hEnv == SQL_NULL_HENV ) 21 | return SQL_SUCCESS; 22 | 23 | while ( _FreeDbc( hEnv->hFirstDbc ) == SQL_SUCCESS ) 24 | { 25 | } 26 | 27 | return SQL_SUCCESS; 28 | } 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /log/logClear.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "log.h" 3 | 4 | /*! 5 | * \brief Clear all log messages. 6 | * 7 | * \param hLog 8 | * 9 | * \return int 10 | * \retval LOG_ERROR 11 | * \retval LOG_SUCCESS 12 | * 13 | * \sa logOpen 14 | * logClose 15 | */ 16 | int logClear( HLOG hLog ) 17 | { 18 | /* we have to be logOpen to logClear messages */ 19 | if ( !hLog ) return LOG_ERROR; 20 | 21 | /* We rely upon a callback being set to handle clearing mem used by each msg. 22 | This should be set in logOpen but just in case - we check it here. */ 23 | if ( !hLog->hMessages->pFree ) return LOG_ERROR; 24 | 25 | /* go to last message and delete until no more messages */ 26 | lstLast( hLog->hMessages ); 27 | while ( !lstEOL( hLog->hMessages ) ) 28 | { 29 | lstDelete( hLog->hMessages ); 30 | } 31 | 32 | return LOG_SUCCESS; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /ini/iniPropertyFirst.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniPropertyFirst( HINI hIni ) 18 | { 19 | /* SANITY CHECKS */ 20 | if ( hIni == NULL ) 21 | return INI_ERROR; 22 | 23 | if ( hIni->hCurObject == NULL ) 24 | return INI_NO_DATA; 25 | 26 | hIni->hCurProperty = hIni->hCurObject->hFirstProperty; 27 | 28 | if ( hIni->hCurProperty == NULL ) 29 | return INI_NO_DATA; 30 | 31 | return INI_SUCCESS; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /Drivers/nn/SQLFreeStmt.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLFreeStmt( 19 | HSTMT hstmt, 20 | UWORD fOption ) 21 | { 22 | return nnodbc_sqlfreestmt(hstmt, fOption); 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /ini/iniPropertyLast.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * iniPropertyLast 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniPropertyLast( HINI hIni ) 18 | { 19 | /* SANITY CHECKS */ 20 | if ( hIni == NULL ) 21 | return INI_ERROR; 22 | 23 | if ( hIni->hCurObject == NULL ) 24 | return INI_NO_DATA; 25 | 26 | hIni->hCurProperty = hIni->hCurObject->hLastProperty; 27 | 28 | if ( hIni->hCurProperty == NULL ) 29 | return INI_NO_DATA; 30 | 31 | return INI_SUCCESS; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /Drivers/nn/SQLFreeEnv.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLFreeEnv( 19 | HENV henv) 20 | { 21 | CLEAR_ERROR( ((env_t*)henv)->herr ); 22 | MEM_FREE( henv ); 23 | 24 | return SQL_SUCCESS; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Drivers/nn/convert.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #ifndef _CONVERT_H 16 | # define _CONVERT_H 17 | 18 | typedef char* (*fptr_t)(); 19 | 20 | extern fptr_t nnodbc_get_c2sql_cvt(int ctype, int sqltype); 21 | extern fptr_t nnodbc_get_sql2c_cvt(int sqltype, int ctype); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ini/iniDelete.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | /****************************** 18 | * iniDelete 19 | * 20 | ******************************/ 21 | int iniDelete( HINI hIni ) 22 | { 23 | 24 | /* SANITY CHECKS */ 25 | if ( hIni == NULL ) 26 | return INI_ERROR; 27 | 28 | /* REMOVE ALL SUBORDINATE INFO */ 29 | iniObjectFirst( hIni ); 30 | while ( iniObjectDelete( hIni ) == INI_SUCCESS ) 31 | { 32 | } 33 | 34 | return INI_SUCCESS; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /ini/iniGotoBookmark.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * iniGotoBookmark 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * PAH = Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 18.MAR.99 Created. 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniGotoBookmark( INIBOOKMARK IniBookmark ) 21 | { 22 | if ( IniBookmark.hIni == NULL ) 23 | return INI_ERROR; 24 | 25 | (IniBookmark.hIni)->hCurObject = IniBookmark.hCurObject; 26 | (IniBookmark.hIni)->hCurProperty = IniBookmark.hCurProperty; 27 | 28 | return INI_SUCCESS; 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /Drivers/nn/hstmt.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #ifndef _HSTMT_H 16 | # define _HSTMT_H 17 | 18 | extern int nnodbc_sqlfreestmt(void* hstmt, int flag); 19 | extern int nnodbc_sqlprepare(void* hstmt, char* str, int len); 20 | extern void* nnodbc_getstmterrstack(void* hstmt); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /Drivers/nn/SQLExecute.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLExecute ( 19 | HSTMT hstmt ) 20 | { 21 | stmt_t* pstmt = hstmt; 22 | 23 | UNSET_ERROR( pstmt->herr ); 24 | 25 | return sqlexecute(hstmt); 26 | } 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLSetEnvAttr.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetEnvAttr 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetEnvAttr( SQLHENV EnvironmentHandle, 17 | SQLINTEGER Attribute, 18 | SQLPOINTER Value, 19 | SQLINTEGER StringLength 20 | ) 21 | { 22 | 23 | return SQL_ERROR; 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /Drivers/template/SQLSetEnvAttr.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetEnvAttr 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetEnvAttr( SQLHENV EnvironmentHandle, 17 | SQLINTEGER Attribute, 18 | SQLPOINTER Value, 19 | SQLINTEGER StringLength 20 | ) 21 | { 22 | 23 | return SQL_ERROR; 24 | } 25 | 26 | 27 | -------------------------------------------------------------------------------- /ini/iniProperty.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniProperty( HINI hIni, char *pszProperty ) 18 | { 19 | /* SANITY CHECKS */ 20 | if ( hIni == NULL ) 21 | return INI_ERROR; 22 | 23 | if ( hIni->hCurObject == NULL ) 24 | return INI_NO_DATA; 25 | 26 | if ( hIni->hCurProperty == NULL ) 27 | return INI_NO_DATA; 28 | 29 | /* Ok */ 30 | strncpy( pszProperty, hIni->hCurProperty->szName, INI_MAX_PROPERTY_NAME ); 31 | 32 | return INI_SUCCESS; 33 | } 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ini/iniGetBookmark.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * iniGetBookmark 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * PAH = Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 18.MAR.99 Created. 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniGetBookmark( HINI hIni, HINIBOOKMARK hIniBookmark ) 21 | { 22 | if ( hIni == NULL || hIniBookmark == NULL ) 23 | return INI_ERROR; 24 | 25 | hIniBookmark->hIni = hIni; 26 | hIniBookmark->hCurObject = hIni->hCurObject; 27 | hIniBookmark->hCurProperty = hIni->hCurProperty; 28 | 29 | return INI_SUCCESS; 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /ini/iniObject.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | /****************************** 18 | * iniObject 19 | * 20 | ******************************/ 21 | int iniObject( HINI hIni, char *pszObject ) 22 | { 23 | /* SANITY CHECKS */ 24 | if ( hIni == NULL ) 25 | return INI_ERROR; 26 | 27 | if ( hIni->hCurObject == NULL ) 28 | return INI_NO_DATA; 29 | 30 | /* Ok */ 31 | strncpy( pszObject, hIni->hCurObject->szName, INI_MAX_OBJECT_NAME ); 32 | 33 | return INI_SUCCESS; 34 | } 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Drivers/template/_FreeStmtList.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * _FreeStmtList 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN _FreeStmtList( SQLHDBC hDrvDbc ) 17 | { 18 | HDRVDBC hDbc = (HDRVDBC)hDrvDbc; 19 | 20 | if ( hDbc == SQL_NULL_HDBC ) 21 | return SQL_SUCCESS; 22 | 23 | if ( hDbc->hFirstStmt == NULL ) 24 | return SQL_SUCCESS; 25 | 26 | while ( _FreeStmt( hDbc->hFirstStmt ) == SQL_SUCCESS ) 27 | { 28 | } 29 | 30 | return SQL_SUCCESS; 31 | } 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ini/iniObjectFirst.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * PAH = Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniObjectFirst( HINI hIni ) 21 | { 22 | /* SANITY CHECKS */ 23 | if ( hIni == NULL ) 24 | return INI_ERROR; 25 | 26 | hIni->hCurObject = hIni->hFirstObject; 27 | iniPropertyFirst( hIni ); 28 | 29 | if ( hIni->hCurObject == NULL ) 30 | return INI_NO_DATA; 31 | 32 | return INI_SUCCESS; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /ini/iniObjectLast.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * iniObjectLast 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * PAH = Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniObjectLast( HINI hIni ) 21 | { 22 | /* SANITY CHECKS */ 23 | if ( hIni == NULL ) 24 | return INI_ERROR; 25 | 26 | hIni->hCurObject = hIni->hLastObject; 27 | iniPropertyFirst( hIni ); 28 | 29 | if ( hIni->hCurObject == NULL ) 30 | return INI_NO_DATA; 31 | 32 | return INI_SUCCESS; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /ini/iniPropertyNext.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniPropertyNext( HINI hIni ) 18 | { 19 | 20 | /* SANITY CHECKS */ 21 | if ( hIni == NULL ) 22 | return INI_ERROR; 23 | 24 | if ( hIni->hCurObject == NULL ) 25 | return INI_NO_DATA; 26 | 27 | if ( hIni->hCurProperty == NULL ) 28 | return INI_NO_DATA; 29 | 30 | hIni->hCurProperty = hIni->hCurProperty->pNext; 31 | 32 | if ( hIni->hCurProperty == NULL ) 33 | return INI_NO_DATA; 34 | 35 | return INI_SUCCESS; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/driver.exp: -------------------------------------------------------------------------------- 1 | SQLAllocConnect 2 | SQLAllocEnv 3 | SQLAllocStmt 4 | SQLBindCol 5 | SQLBindParameter 6 | SQLBrowseConnect 7 | SQLCancel 8 | SQLColAttributes 9 | SQLColumnPrivileges 10 | SQLColumns 11 | SQLConnect 12 | SQLDescribeCol 13 | SQLDescribeParam 14 | SQLDisconnect 15 | SQLDriverConnect 16 | SQLError 17 | SQLExecDirect 18 | SQLExecute 19 | SQLExtendedFetch 20 | SQLFetch 21 | SQLForeignKeys 22 | SQLFreeConnect 23 | SQLFreeEnv 24 | SQLFreeStmt 25 | SQLGetConnectOption 26 | SQLGetCursorName 27 | SQLGetData 28 | SQLGetFunctions 29 | SQLGetInfo 30 | SQLGetStmtOption 31 | SQLGetTypeInfo 32 | SQLMoreResults 33 | SQLNativeSql 34 | SQLNumParams 35 | SQLNumResultCols 36 | SQLParamData 37 | SQLParamOptions 38 | SQLPrepare 39 | SQLPrimaryKeys 40 | SQLProcedureColumns 41 | SQLProcedures 42 | SQLPutData 43 | SQLRowCount 44 | SQLSetConnectOption 45 | SQLSetCursorName 46 | SQLSetPos 47 | SQLSetScrollOptions 48 | SQLSetStmtOption 49 | SQLSpecialColumns 50 | SQLStatistics 51 | SQLTablePrivileges 52 | SQLTables 53 | SQLTransact 54 | -------------------------------------------------------------------------------- /Drivers/nn/nndate.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #ifndef _NN_DATE_H 16 | # define _NN_DATE_H 17 | 18 | typedef struct 19 | { 20 | int year; 21 | int month; 22 | int day; 23 | } date_t; 24 | 25 | extern int nnsql_odbcdatestr2date(char*, date_t*); 26 | extern int nnsql_nndatestr2date(char*, date_t*); 27 | extern int nnsql_datecmp(date_t*, date_t*); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ini/iniObjectSeekSure.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 06.MAR.99 Added this func 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniObjectSeekSure( HINI hIni, char *pszObject ) 21 | { 22 | int nReturn; 23 | 24 | /* SANITY CHECKS */ 25 | if ( hIni == NULL ) 26 | return INI_ERROR; 27 | if ( !pszObject ) 28 | return INI_ERROR; 29 | 30 | if ( (nReturn = iniObjectSeek( hIni, pszObject )) == INI_NO_DATA ) 31 | return iniObjectInsert( hIni, pszObject ); 32 | 33 | return nReturn; 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/tuplelist.h: -------------------------------------------------------------------------------- 1 | 2 | /* File: tuplelist.h 3 | * 4 | * Description: See "tuplelist.c" 5 | * 6 | * Important Note: This structure and its functions are ONLY used in building manual result 7 | * sets for info functions (SQLTables, SQLColumns, etc.) 8 | * 9 | * Comments: See "notice.txt" for copyright and license information. 10 | * 11 | */ 12 | 13 | #ifndef __TUPLELIST_H__ 14 | #define __TUPLELIST_H__ 15 | 16 | #include "psqlodbc.h" 17 | 18 | struct TupleListClass_ { 19 | Int4 num_fields; 20 | Int4 num_tuples; 21 | TupleNode *list_start, *list_end, *lastref; 22 | Int4 last_indexed; 23 | }; 24 | 25 | #define TL_get_num_tuples(x) (x->num_tuples) 26 | 27 | /* Create a TupleList. Each tuple consits of fieldcnt columns */ 28 | TupleListClass *TL_Constructor(UInt4 fieldcnt); 29 | void TL_Destructor(TupleListClass *self); 30 | void *TL_get_fieldval(TupleListClass *self, Int4 tupleno, Int2 fieldno); 31 | char TL_add_tuple(TupleListClass *self, TupleNode *new_field); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /vms/odbcinst_axp.opt: -------------------------------------------------------------------------------- 1 | CASE_SENSITIVE=YES 2 | SYMBOL_VECTOR = (- 3 | _SQLDriverConnectPrompt=PROCEDURE,- 4 | SQLManageDataSources=PROCEDURE,- 5 | SQLCreateDataSource=PROCEDURE,- 6 | SQLGetTranslator=PROCEDURE,- 7 | SQLInstallDriverManager=PROCEDURE,- 8 | SQLGetInstalledDrivers=PROCEDURE,- 9 | SQLGetAvailableDrivers=PROCEDURE,- 10 | SQLConfigDataSource=PROCEDURE,- 11 | SQLWriteDSNToIni=PROCEDURE,- 12 | SQLRemoveDSNFromIni=PROCEDURE,- 13 | SQLValidDSN=PROCEDURE,- 14 | SQLWritePrivateProfileString=PROCEDURE,- 15 | SQLGetPrivateProfileString=PROCEDURE,- 16 | SQLRemoveDriverManager=PROCEDURE,- 17 | SQLRemoveTranslator=PROCEDURE,- 18 | SQLRemoveDriver=PROCEDURE,- 19 | SQLConfigDriver=PROCEDURE,- 20 | SQLInstallerError=PROCEDURE,- 21 | SQLPostInstallerError=PROCEDURE,- 22 | SQLWriteFileDSN=PROCEDURE,- 23 | SQLReadFileDSN=PROCEDURE,- 24 | SQLInstallDriverEx=PROCEDURE,- 25 | SQLInstallTranslatorEx=PROCEDURE,- 26 | SQLGetConfigMode=PROCEDURE,- 27 | SQLSetConfigMode=PROCEDURE,- 28 | odbcinst_system_file_name=PROCEDURE,- 29 | odbcinst_system_file_path=PROCEDURE) 30 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetEnvAttr.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetEnvAttr 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetEnvAttr( SQLHENV EnvironmentHandle, 17 | SQLINTEGER Attribute, 18 | SQLPOINTER Value, 19 | SQLINTEGER BufferLength, 20 | SQLINTEGER *StringLength 21 | ) 22 | { 23 | 24 | return SQL_ERROR; 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetEnvAttr.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetEnvAttr 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetEnvAttr( SQLHENV EnvironmentHandle, 17 | SQLINTEGER Attribute, 18 | SQLPOINTER Value, 19 | SQLINTEGER BufferLength, 20 | SQLINTEGER *StringLength 21 | ) 22 | { 23 | 24 | return SQL_ERROR; 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /ini/iniClose.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | /****************************** 18 | * iniClose 19 | * 20 | * 1. free memory previously allocated for HINI 21 | * 2. DO NOT save any changes (see iniCommit) 22 | ******************************/ 23 | int iniClose( HINI hIni ) 24 | { 25 | /* SANITY CHECKS */ 26 | if ( hIni == NULL ) 27 | return INI_ERROR; 28 | 29 | hIni->hCurObject = hIni->hFirstObject; 30 | while ( iniObjectDelete( hIni ) == INI_SUCCESS ) 31 | { 32 | } 33 | 34 | free( hIni ); 35 | 36 | return INI_SUCCESS; 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /Drivers/nn/yylex.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #ifndef _YYLEX_H 16 | # define _YYLEX_H 17 | 18 | typedef struct { 19 | int idx; 20 | char* name; 21 | } keywd_ent_t; 22 | 23 | enum { 24 | en_cmpop_eq, 25 | en_cmpop_ne, 26 | en_cmpop_gt, 27 | en_cmpop_lt, 28 | en_cmpop_ge, 29 | en_cmpop_le, 30 | 31 | en_logop_and, 32 | en_logop_or, 33 | en_logop_not 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ini/iniValue.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | /****************************** 18 | * iniValue 19 | * 20 | ******************************/ 21 | int iniValue( HINI hIni, char *pszValue ) 22 | { 23 | /* SANITY CHECKS */ 24 | if ( hIni == NULL ) 25 | return INI_ERROR; 26 | 27 | if ( hIni->hCurObject == NULL ) 28 | return INI_NO_DATA; 29 | 30 | if ( hIni->hCurProperty == NULL ) 31 | return INI_NO_DATA; 32 | 33 | strncpy( pszValue, hIni->hCurProperty->szValue, INI_MAX_PROPERTY_VALUE ); 34 | 35 | return INI_SUCCESS; 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLSetDescField.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetDescField 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetDescField( SQLHDESC DescriptorHandle, 17 | SQLSMALLINT RecordNumber, 18 | SQLSMALLINT FieldIdentifier, 19 | SQLPOINTER Value, 20 | SQLINTEGER BufferLength 21 | ) 22 | { 23 | 24 | return SQL_ERROR; 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /Drivers/template/SQLSetDescField.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetDescField 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetDescField( SQLHDESC DescriptorHandle, 17 | SQLSMALLINT RecordNumber, 18 | SQLSMALLINT FieldIdentifier, 19 | SQLPOINTER Value, 20 | SQLINTEGER BufferLength 21 | ) 22 | { 23 | 24 | return SQL_ERROR; 25 | } 26 | 27 | 28 | -------------------------------------------------------------------------------- /DRVConfig/txt/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. * 4 | *************************************************************** 5 | 6 | +-------------------------------------------------------------+ 7 | | unixODBC | 8 | | Driver Config for the Text File Driver | 9 | +-------------------------------------------------------------+ 10 | 11 | This is a driver setup which can be called 12 | by ODBC Config to allow the driver specific options to 13 | be set for the Text File Driver. 14 | 15 | This will allow ODBCConfig to prompt for Data Source 16 | options. 17 | 18 | +-------------------------------------------------------------+ 19 | | Peter Harvey pharvey@codebydesign.com | 20 | | http://www.unixodbc.org | 21 | +-------------------------------------------------------------+ 22 | 23 | -------------------------------------------------------------------------------- /Drivers/nn/SQLPrepare.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLPrepare( 19 | HSTMT hstmt, 20 | UCHAR* szSqlStr, 21 | SDWORD cbSqlStr ) 22 | { 23 | stmt_t* pstmt = hstmt; 24 | 25 | UNSET_ERROR( pstmt->herr ); 26 | 27 | return nnodbc_sqlprepare(hstmt, (char*)szSqlStr, cbSqlStr); 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /lst/_lstAdjustCurrent.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | /*************************** 5 | * ENSURE CURRENT IS NOT ON A bDelete ITEM 6 | * 7 | * 1. Should only be required for root list. 8 | ***************************/ 9 | void *_lstAdjustCurrent( HLST hLst ) 10 | { 11 | HLSTITEM h; 12 | 13 | if ( !hLst ) 14 | return NULL; 15 | 16 | if ( !hLst->hCurrent ) 17 | return NULL; 18 | 19 | if ( _lstVisible( hLst->hCurrent ) ) 20 | return hLst->hCurrent; 21 | 22 | h = hLst->hCurrent; 23 | while ( !_lstVisible( hLst->hCurrent ) && hLst->hCurrent->pPrev ) 24 | { 25 | hLst->hCurrent = hLst->hCurrent->pPrev; 26 | } 27 | 28 | if ( _lstVisible( hLst->hCurrent ) ) 29 | return hLst->hCurrent; 30 | 31 | hLst->hCurrent = h; 32 | while ( !_lstVisible( hLst->hCurrent ) && hLst->hCurrent->pNext ) 33 | { 34 | hLst->hCurrent = hLst->hCurrent->pNext; 35 | } 36 | 37 | if ( _lstVisible( hLst->hCurrent ) ) 38 | return hLst->hCurrent; 39 | 40 | hLst->hCurrent = NULL; 41 | 42 | return NULL; 43 | } 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Drivers/nn/SQLNumParams.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLNumParams( 19 | HSTMT hstmt, 20 | SWORD *pcpar ) 21 | { 22 | stmt_t* pstmt = hstmt; 23 | 24 | UNSET_ERROR( pstmt->herr ); 25 | 26 | if ( pcpar ) 27 | *pcpar = nnsql_getparnum( ((stmt_t*)hstmt)->yystmt ); 28 | 29 | return SQL_SUCCESS; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /Drivers/nn/SQLAllocEnv.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLAllocEnv( 19 | HENV* phenv) 20 | { 21 | env_t* penv; 22 | 23 | *phenv = penv = (env_t*)MEM_ALLOC(sizeof(env_t)); 24 | 25 | if ( ! penv ) 26 | return SQL_ERROR; 27 | 28 | penv->herr = 0; 29 | penv->hdbc = 0; 30 | 31 | return SQL_SUCCESS; 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /Drivers/nn/SQLRowCount.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLRowCount( 19 | HSTMT hstmt, 20 | SDWORD* pcrow ) 21 | { 22 | stmt_t* pstmt = hstmt; 23 | 24 | UNSET_ERROR( pstmt->herr ); 25 | 26 | if ( pcrow ) 27 | *pcrow = nnsql_getrowcount( ((stmt_t*)hstmt)->yystmt ); 28 | 29 | return SQL_SUCCESS; 30 | } 31 | 32 | 33 | -------------------------------------------------------------------------------- /ini/iniObjectNext.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * PAH = Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniObjectNext( HINI hIni ) 21 | { 22 | /* SANITY CHECKS */ 23 | if ( hIni == NULL ) 24 | return INI_ERROR; 25 | 26 | if ( hIni->hCurObject == NULL ) 27 | return INI_NO_DATA; 28 | 29 | hIni->hCurObject = hIni->hCurObject->pNext; 30 | iniPropertyFirst( hIni ); 31 | 32 | if ( hIni->hCurObject == NULL ) 33 | return INI_NO_DATA; 34 | 35 | return INI_SUCCESS; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /man/dltest.1: -------------------------------------------------------------------------------- 1 | .TH dltest 1 "Thu 07 Jan 2021" "version 2.3.12" "unixODBC manual pages" 2 | 3 | .SH NAME 4 | dltest - A simple library symbol test program 5 | 6 | .SH SYNOPSIS 7 | .B dltest 8 | [ 9 | .I library symbol 10 | ] 11 | 12 | .SH DESCRIPTION 13 | \fBdltest\fR is a simple program that determines whether a \fIsymbol\fR 14 | appears in a (shared object) \fIlibrary\fR. 15 | 16 | The name of the \fIlibrary\fR must be prefixed by a full system path. 17 | 18 | If no parameters are provided, \fBdltest\fR prints a short help message. 19 | 20 | .SH EXAMPLES 21 | To determine if the symbol \fBprintf\fR is found in \fIlibc-2\.18\.so\fR, run: 22 | 23 | .RS 24 | $ dltest /usr/lib/libc-2.18.so printf 25 | .RE 26 | 27 | .SH AUTHORS 28 | The authors of unixODBC are Peter Harvey <\fIpharvey@codebydesign.com\fR> and 29 | Nick Gorham <\fInick@lurcher.org\fR>. 30 | 31 | For a full list of contributors, refer to the \fIAUTHORS\fR file. 32 | 33 | .SH COPYRIGHT 34 | unixODBC is licensed under the GNU Lesser General Public License. For details 35 | about the license, see the \fICOPYING\fR file. 36 | -------------------------------------------------------------------------------- /ini/iniPropertyUpdate.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniPropertyUpdate( HINI hIni, char *pszProperty, char *pszValue ) 18 | { 19 | /* SANITY CHECKS */ 20 | if ( hIni == NULL ) 21 | return INI_ERROR; 22 | 23 | if ( hIni->hCurObject == NULL ) 24 | return INI_ERROR; 25 | 26 | if ( hIni->hCurProperty == NULL ) 27 | return INI_ERROR; 28 | 29 | /* Ok */ 30 | strncpy( hIni->hCurProperty->szName, pszProperty, INI_MAX_PROPERTY_NAME ); 31 | strncpy( hIni->hCurProperty->szValue, pszValue, INI_MAX_PROPERTY_VALUE ); 32 | 33 | return INI_SUCCESS; 34 | } 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ini/iniObjectSeek.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * PAH = Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 19.MAR.99 Now sets hCurProperty to hFirstProperty when found 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniObjectSeek( HINI hIni, char *pszObject ) 21 | { 22 | /* SANITY CHECKS */ 23 | if ( hIni == NULL ) 24 | return INI_ERROR; 25 | 26 | iniObjectFirst( hIni ); 27 | while ( iniObjectEOL( hIni ) == FALSE ) 28 | { 29 | if ( strcasecmp( pszObject, hIni->hCurObject->szName ) == 0 ) 30 | return INI_SUCCESS; 31 | iniObjectNext( hIni ); 32 | } 33 | 34 | return INI_NO_DATA; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /odbcinst/SQLGetAvailableDrivers.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * SQLGetAvailableDrivers 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 28.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include 14 | 15 | BOOL SQLGetAvailableDrivers( LPCSTR pszInfFile, 16 | LPSTR pszBuf, 17 | WORD nBufMax, 18 | WORD *pnBufOut) 19 | { 20 | return SQLGetInstalledDrivers( pszBuf, nBufMax, pnBufOut ); 21 | } 22 | 23 | BOOL INSTAPI SQLGetAvailableDriversW (LPCWSTR lpszInfFile, 24 | LPWSTR lpszBuf, 25 | WORD cbBufMax, 26 | WORD * pcbBufOut) 27 | { 28 | return SQLGetInstalledDriversW( lpszBuf, cbBufMax, pcbBufOut ); 29 | } 30 | -------------------------------------------------------------------------------- /Drivers/nn/SQLDisconnect.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLDisconnect( 19 | HDBC hdbc) 20 | { 21 | dbc_t* pdbc = hdbc; 22 | 23 | UNSET_ERROR( pdbc->herr ); 24 | 25 | for (;pdbc->stmt;) 26 | nnodbc_sqlfreestmt(pdbc->stmt->hstmt, SQL_DROP); 27 | 28 | nntp_close( pdbc->hcndes ); 29 | pdbc->hcndes = 0; 30 | 31 | return SQL_SUCCESS; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /DRVConfig/MySQL/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. This software is a LinuxODBC component and * 4 | * may NOT be distributed seperately. * 5 | * * 6 | * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * 7 | *************************************************************** 8 | 9 | +-------------------------------------------------------------+ 10 | | unixODBC | 11 | | Driver Config for MySQL ODBC driver | 12 | +-------------------------------------------------------------+ 13 | 14 | Use this Driver Config when using the MySQL 15 | ODBC Driver. 16 | 17 | It allows ODBCConfig to prompt the user for Data Source 18 | options. 19 | 20 | ODBCConfig will read the "Setup" entry in 21 | /etc/odbcinst.ini to determine the name of the config 22 | lib to use. 23 | 24 | Peter Harvey 25 | pharvey@codebydesign.com 26 | 19.FEB.99 27 | 28 | -------------------------------------------------------------------------------- /DRVConfig/MiniSQL/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. This software is a LinuxODBC component and * 4 | * may NOT be distributed seperately. * 5 | * * 6 | * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * 7 | *************************************************************** 8 | 9 | +-------------------------------------------------------------+ 10 | | LinuxODBC | 11 | | Driver Config for MiniSQL ODBC driver | 12 | +-------------------------------------------------------------+ 13 | 14 | Use this Driver Config when using the MiniSQL 15 | ODBC Driver. 16 | 17 | It allows ODBCConfig to prompt the user for Data Source 18 | options. 19 | 20 | ODBCConfig will read the "Setup" entry in 21 | /etc/odbcinst.ini to determine the name of the config 22 | lib to use. 23 | 24 | Peter Harvey 25 | pharvey@codebydesign.com 26 | 10.FEB.99 27 | 28 | -------------------------------------------------------------------------------- /DRVConfig/PostgreSQL/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. This software is a LinuxODBC component and * 4 | * may NOT be distributed seperately. * 5 | * * 6 | * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * 7 | *************************************************************** 8 | 9 | +-------------------------------------------------------------+ 10 | | LinuxODBC | 11 | | Driver Config for PostgreSQL ODBC driver | 12 | +-------------------------------------------------------------+ 13 | 14 | Use this Driver Config when using the PostgreSQL 15 | ODBC Driver. 16 | 17 | It allows ODBCConfig to prompt the user for Data Source 18 | options. 19 | 20 | ODBCConfig will read the "Setup" entry in 21 | /etc/odbcinst.ini to determine the name of the config 22 | lib to use. 23 | 24 | Peter Harvey 25 | pharvey@codebydesign.com 26 | 02.FEB.99 27 | 28 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetDescField.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetDescField 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetDescField( SQLHDESC DescriptorHandle, 17 | SQLSMALLINT RecordNumber, 18 | SQLSMALLINT FieldIdentifier, 19 | SQLPOINTER Value, 20 | SQLINTEGER BufferLength, 21 | SQLINTEGER *StringLength 22 | ) 23 | { 24 | 25 | return SQL_ERROR; 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /Drivers/nn/connect.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #ifndef _CONNECT_H 16 | # define _CONNECT_H 17 | 18 | extern int nnodbc_attach_stmt(void* hdbc, void* hstmt); 19 | extern int nnodbc_detach_stmt(void* hdbc, void* hstmt); 20 | extern void* nnodbc_getenverrstack(void* henv); 21 | extern void* nnodbc_getdbcerrstack(void* hdbc); 22 | extern void nnodbc_pushdbcerr(void* hdbc, int code, char* msg); 23 | extern void* nnodbc_getnntpcndes(void* hdbc); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetDescField.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetDescField 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetDescField( SQLHDESC DescriptorHandle, 17 | SQLSMALLINT RecordNumber, 18 | SQLSMALLINT FieldIdentifier, 19 | SQLPOINTER Value, 20 | SQLINTEGER BufferLength, 21 | SQLINTEGER *StringLength 22 | ) 23 | { 24 | 25 | return SQL_ERROR; 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /ini/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LTLIBRARIES = libinilc.la 2 | 3 | AM_CPPFLAGS = -I@top_srcdir@/include 4 | 5 | libinilc_la_LDFLAGS = -no-undefined 6 | 7 | libinilc_la_LIBADD = \ 8 | ../extras/libodbcextraslc.la 9 | 10 | libinilc_la_SOURCES = \ 11 | iniAllTrim.c \ 12 | iniAppend.c \ 13 | iniDelete.c \ 14 | iniClose.c \ 15 | iniCommit.c \ 16 | iniObject.c \ 17 | iniObjectFirst.c \ 18 | iniObjectLast.c \ 19 | iniObjectNext.c \ 20 | iniObjectSeek.c \ 21 | iniObjectSeekSure.c \ 22 | iniObjectUpdate.c \ 23 | iniObjectInsert.c \ 24 | iniObjectDelete.c \ 25 | iniObjectEOL.c \ 26 | iniOpen.c \ 27 | iniProperty.c \ 28 | iniPropertyFirst.c \ 29 | iniPropertyLast.c \ 30 | iniPropertyNext.c \ 31 | iniPropertySeek.c \ 32 | iniPropertySeekSure.c \ 33 | iniPropertyUpdate.c \ 34 | iniPropertyInsert.c \ 35 | iniPropertyDelete.c \ 36 | iniPropertyEOL.c \ 37 | iniPropertyValue.c \ 38 | iniValue.c \ 39 | iniToUpper.c \ 40 | iniElement.c \ 41 | iniElementCount.c \ 42 | iniGetBookmark.c \ 43 | iniGotoBookmark.c \ 44 | iniCursor.c \ 45 | _iniObjectRead.c \ 46 | _iniPropertyRead.c \ 47 | _iniDump.c \ 48 | _iniScanUntilObject.c 49 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/md5.h: -------------------------------------------------------------------------------- 1 | /* File: md5.h 2 | * 3 | * Description: See "md5.h" 4 | * 5 | * Comments: See "notice.txt" for copyright and license information. 6 | * 7 | */ 8 | 9 | #ifndef __MD5_H__ 10 | #define __MD5_H__ 11 | 12 | #include "psqlodbc.h" 13 | 14 | #include 15 | #include 16 | 17 | #define MD5_PASSWD_LEN 35 18 | 19 | /* From c.h */ 20 | #ifndef __BEOS__ 21 | 22 | #ifndef __cplusplus 23 | 24 | #if !defined(bool) || defined(__APPLE_ALTIVEC__) 25 | typedef char bool; 26 | #endif 27 | 28 | #ifndef true 29 | #define true ((bool) 1) 30 | #endif 31 | 32 | #ifndef false 33 | #define false ((bool) 0) 34 | #endif 35 | #endif /* not C++ */ 36 | #endif /* __BEOS__ */ 37 | 38 | /* Also defined in include/c.h */ 39 | #ifndef HAVE_UINT8 40 | typedef unsigned char uint8; /* == 8 bits */ 41 | typedef unsigned short uint16; /* == 16 bits */ 42 | typedef unsigned int uint32; /* == 32 bits */ 43 | #endif /* not HAVE_UINT8 */ 44 | 45 | extern bool md5_hash(const void *buff, size_t len, char *hexsum); 46 | extern bool EncryptMD5(const char *passwd, const char *salt, 47 | size_t salt_len, char *buf); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/environ.h: -------------------------------------------------------------------------------- 1 | 2 | /* File: environ.h 3 | * 4 | * Description: See "environ.c" 5 | * 6 | * Comments: See "notice.txt" for copyright and license information. 7 | * 8 | */ 9 | 10 | #ifndef __ENVIRON_H__ 11 | #define __ENVIRON_H__ 12 | 13 | #ifdef HAVE_CONFIG_H 14 | #include "config.h" 15 | #endif 16 | 17 | #include "psqlodbc.h" 18 | 19 | #ifndef WIN32 20 | #include "isql.h" 21 | #include "isqlext.h" 22 | #else 23 | #include 24 | #include 25 | #include 26 | #endif 27 | 28 | #define ENV_ALLOC_ERROR 1 29 | 30 | /********** Environment Handle *************/ 31 | struct EnvironmentClass_ { 32 | char *errormsg; 33 | int errornumber; 34 | }; 35 | 36 | /* Environment prototypes */ 37 | EnvironmentClass *EN_Constructor(void); 38 | char EN_Destructor(EnvironmentClass *self); 39 | char EN_get_error(EnvironmentClass *self, int *number, char **message); 40 | char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn); 41 | char EN_remove_connection(EnvironmentClass *self, ConnectionClass *conn); 42 | void EN_log_error(char *func, char *desc, EnvironmentClass *self); 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS=-I m4 2 | 3 | pkgconfigdir = $(libdir)/pkgconfig 4 | pkgconfig_DATA = \ 5 | cur/odbccr.pc \ 6 | DriverManager/odbc.pc \ 7 | odbcinst/odbcinst.pc 8 | 9 | SUBDIRS = \ 10 | extras \ 11 | log \ 12 | lst \ 13 | ini \ 14 | libltdl \ 15 | odbcinst \ 16 | DriverManager \ 17 | exe \ 18 | cur \ 19 | DRVConfig \ 20 | Drivers \ 21 | include \ 22 | doc \ 23 | man \ 24 | samples 25 | 26 | EXTRA_DIST = \ 27 | README.OSX \ 28 | README.VMS \ 29 | README.QNX \ 30 | README.CYGWIN \ 31 | README.AIX \ 32 | README.SOLARIS \ 33 | README.INTERIX \ 34 | vms/install_image.com \ 35 | vms/odbc2_axp.opt \ 36 | vms/odbc_axp.opt \ 37 | vms/odbcinst_axp.opt \ 38 | vms/odbc_setup.com \ 39 | vms/drivermanager_axp.opt \ 40 | vmsbuild.com \ 41 | Interix/configure \ 42 | Interix/config.guess \ 43 | Interix/libtool \ 44 | m4 \ 45 | configure.ac \ 46 | Makefile.svn 47 | 48 | include_HEADERS = unixodbc.h 49 | 50 | pkginclude_HEADERS = unixodbc_conf.h 51 | 52 | install-data-hook: 53 | -$(MKDIR_P) $(DESTDIR)$(sysconfdir)/ODBCDataSources 54 | -touch $(DESTDIR)$(sysconfdir)/odbcinst.ini 55 | -touch $(DESTDIR)$(sysconfdir)/odbc.ini 56 | -------------------------------------------------------------------------------- /Drivers/nn/SQLNumResultCols.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLNumResultCols( 19 | HSTMT hstmt, 20 | SWORD* pccol ) 21 | { 22 | stmt_t* pstmt = hstmt; 23 | 24 | UNSET_ERROR( pstmt->herr ); 25 | 26 | if ( pccol ) 27 | { 28 | int ncol; 29 | 30 | ncol = nnsql_getcolnum(((stmt_t*)hstmt)->yystmt); 31 | 32 | *pccol = (ncol)? ncol-1:0; 33 | } 34 | 35 | return SQL_SUCCESS; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.la 2 | *.pc 3 | *.lo 4 | *.o 5 | /libltdl 6 | 7 | # From https://github.com/github/gitignore/blob/main/Autotools.gitignore 8 | # CC0-1.0 9 | # http://www.gnu.org/software/automake 10 | 11 | Makefile.in 12 | /ar-lib 13 | /mdate-sh 14 | /py-compile 15 | /test-driver 16 | /ylwrap 17 | .deps/ 18 | .dirstamp 19 | 20 | # http://www.gnu.org/software/autoconf 21 | 22 | autom4te.cache 23 | /autoscan.log 24 | /autoscan-*.log 25 | /aclocal.m4 26 | /compile 27 | /config.cache 28 | /config.guess 29 | /config.h.in 30 | /config.log 31 | /config.status 32 | /config.sub 33 | /config.h.in 34 | /configure 35 | /configure.scan 36 | /depcomp 37 | /install-sh 38 | /missing 39 | /stamp-h1 40 | 41 | # https://www.gnu.org/software/libtool/ 42 | 43 | /ltmain.sh 44 | 45 | # http://www.gnu.org/software/texinfo 46 | 47 | /texinfo.tex 48 | 49 | # http://www.gnu.org/software/m4/ 50 | 51 | m4/libtool.m4 52 | m4/ltoptions.m4 53 | m4/ltsugar.m4 54 | m4/ltversion.m4 55 | m4/lt~obsolete.m4 56 | 57 | # Generated Makefile 58 | # (meta build system like autotools, 59 | # can automatically generate from config.status script 60 | # (which is called by configure script)) 61 | Makefile 62 | -------------------------------------------------------------------------------- /DRVConfig/template/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. This software is a LinuxODBC component and * 4 | * may NOT be distributed seperately. * 5 | * * 6 | * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * 7 | *************************************************************** 8 | 9 | +-------------------------------------------------------------+ 10 | | LinuxODBC | 11 | | Driver Config template | 12 | +-------------------------------------------------------------+ 13 | 14 | A Driver Config is too simple. So simple in fact 15 | that it would be pointless to create a real template. 16 | 17 | So go to a working Driver Config and check it out. I 18 | recommend starting with; 19 | 20 | 1. drvcfg1 - basics for an SQL Server type data source 21 | 2. drvcfg2 - basics for a File type data source 22 | 23 | Enjoy... 24 | 25 | Peter Harvey 26 | pharvey@codebydesign.com 27 | 25.FEB.99 28 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetDiagField.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetDiagField 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetDiagField( SQLSMALLINT HandleType, 17 | SQLHANDLE Handle, 18 | SQLSMALLINT RecordNumber, 19 | SQLSMALLINT DiagIdentifier, 20 | SQLPOINTER DiagInfo, 21 | SQLSMALLINT BufferLength, 22 | SQLSMALLINT *StringLength 23 | ) 24 | { 25 | 26 | return SQL_ERROR; 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetDiagField.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetDiagField 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetDiagField( SQLSMALLINT HandleType, 17 | SQLHANDLE Handle, 18 | SQLSMALLINT RecordNumber, 19 | SQLSMALLINT DiagIdentifier, 20 | SQLPOINTER DiagInfo, 21 | SQLSMALLINT BufferLength, 22 | SQLSMALLINT *StringLength 23 | ) 24 | { 25 | 26 | return SQL_ERROR; 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /ini/iniElementCount.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * iniElementCount 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 05.APR.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | 13 | #include 14 | #include "ini.h" 15 | 16 | int iniElementCount( char *pszData, char cSeperator, char cTerminator ) 17 | { 18 | int nToManyElements = 30000; 19 | int nCurElement = 0; 20 | int nChar = 0; 21 | 22 | for ( ; nCurElement <= nToManyElements; nChar++ ) 23 | { 24 | /* check for end of data */ 25 | if ( cSeperator != cTerminator && pszData[nChar] == cTerminator ) 26 | break; 27 | 28 | if ( cSeperator == cTerminator && pszData[nChar] == cSeperator && pszData[nChar+1] == cTerminator ) 29 | break; 30 | 31 | /* check for end of element */ 32 | if ( pszData[nChar] == cSeperator ) 33 | nCurElement++; 34 | } 35 | 36 | return nCurElement; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /DRVConfig/nn/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. * 4 | *************************************************************** 5 | 6 | +-------------------------------------------------------------+ 7 | | unixODBC | 8 | | Driver Config for the Internet News Server (NN) driver | 9 | +-------------------------------------------------------------+ 10 | 11 | This is a driver setup which can be called 12 | by ODBC Config to allow the driver specific options to 13 | be set for the internet News Server (NN) ODBC driver. 14 | 15 | Each driver in /etc/odbcinst.ini should have a Setup 16 | entry such as; 17 | 18 | Setup = /usr/lib/libodbcnnS.so 19 | 20 | This will allow ODBCConfig to prompt for Data Source 21 | options. 22 | 23 | +-------------------------------------------------------------+ 24 | | Peter Harvey pharvey@codebydesign.com | 25 | | http://www.genix.net/unixODBC | 26 | +-------------------------------------------------------------+ 27 | 28 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetData.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetData 3 | * 4 | * 1. mSQL server sends all data as ascii strings so things are 5 | * simplified. We always convert from string to nTargetType. 6 | * 7 | ********************************************************************** 8 | * 9 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 10 | * This code is LGPL. Please ensure that this message remains in future 11 | * distributions and uses of this code (thats about all I get out of it). 12 | * - Peter Harvey pharvey@codebydesign.com 13 | * 14 | **********************************************************************/ 15 | 16 | #include 17 | #include "driver.h" 18 | 19 | SQLRETURN SQLGetData( SQLHSTMT hDrvStmt, 20 | SQLUSMALLINT nCol, 21 | SQLSMALLINT nTargetType, /* C DATA TYPE */ 22 | SQLPOINTER pTarget, 23 | SQLLEN nTargetLength, 24 | SQLLEN *pnLengthOrIndicator ) 25 | { 26 | return _GetData( hDrvStmt, 27 | nCol, 28 | nTargetType, 29 | pTarget, 30 | nTargetLength, 31 | pnLengthOrIndicator ); 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetData.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetData 3 | * 4 | * 1. MiniSQL server sends all data as ascii strings so things are 5 | * simplified. We always convert from string to nTargetType. 6 | * 7 | ********************************************************************** 8 | * 9 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 10 | * This code is LGPL. Please ensure that this message remains in future 11 | * distributions and uses of this code (thats about all I get out of it). 12 | * - Peter Harvey pharvey@codebydesign.com 13 | * 14 | **********************************************************************/ 15 | 16 | #include 17 | #include "driver.h" 18 | 19 | SQLRETURN SQLGetData( SQLHSTMT hDrvStmt, 20 | SQLUSMALLINT nCol, 21 | SQLSMALLINT nTargetType, /* C DATA TYPE */ 22 | SQLPOINTER pTarget, 23 | SQLINTEGER nTargetLength, 24 | SQLINTEGER *pnLengthOrIndicator ) 25 | { 26 | return _GetData( hDrvStmt, 27 | nCol, 28 | nTargetType, 29 | pTarget, 30 | nTargetLength, 31 | pnLengthOrIndicator ); 32 | } 33 | 34 | 35 | -------------------------------------------------------------------------------- /log/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. * 4 | * * 5 | * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * 6 | *************************************************************** 7 | 8 | +-------------------------------------------------------------+ 9 | | unixODBC | 10 | | LOG lib (liblog.so) | 11 | +-------------------------------------------------------------+ 12 | 13 | This library provides some usefull functions 14 | for managing log/debug messages. 15 | 16 | 17 | +-------------------------------------------------------------+ 18 | | Peter Harvey | 19 | | http://www.genix.net/unixODBC | 20 | | pharvey@codebydesign.com | 21 | | 10.APR.99 | 22 | +-------------------------------------------------------------+ 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /log/_logFreeMsg.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * _logFreeMsg 3 | * 4 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 5 | * This code is LGPL. Please ensure that this message remains in future 6 | * distributions and uses of this code (thats about all I get out of it). 7 | * - Peter Harvey pharvey@codebydesign.com 8 | * 9 | **********************************************************************/ 10 | 11 | #include 12 | #include "log.h" 13 | 14 | /*! 15 | * \brief Callback function to free mem used by a message. 16 | * 17 | * This function is set in logOpen and is automatically used 18 | * to free mem used by a message when the message is deleted. 19 | * 20 | * \param pMsg 21 | * 22 | * \sa logOpen 23 | */ 24 | void _logFreeMsg( void *pMsg ) 25 | { 26 | HLOGMSG hMsg = (HLOGMSG)pMsg; 27 | 28 | if ( !hMsg ) return; 29 | 30 | /* free msg memory */ 31 | if ( hMsg->pszModuleName != NULL ) free(hMsg->pszModuleName); 32 | if ( hMsg->pszFunctionName != NULL ) free(hMsg->pszFunctionName); 33 | if ( hMsg->pszMessage != NULL ) free(hMsg->pszMessage); 34 | 35 | free( hMsg ); 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /lst/lstGoto.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | /*! 5 | * \brief Returns the data stored at nIndex. 6 | * 7 | * This does a scan from first-to-last until nIndex or until EOL. This 8 | * can be slow if there are many items in the list. 9 | * 10 | * This does not return the item handle - it returns the user data stored 11 | * in the item. 12 | * 13 | * When done; the current item is either the item at nIndex or EOL. 14 | * 15 | * \param hLst Input. Viable list handle. 16 | * \param nIndex Input. 0-based index of the desired item. 17 | * 18 | * \return void* 19 | * \retval NULL Item at index could not be found - effectively data is NULL. 20 | * \retval !NULL Reference to the data stored at nIndex 21 | */ 22 | void *lstGoto( HLST hLst, long nIndex ) 23 | { 24 | long n = 0; 25 | 26 | if ( !hLst ) 27 | return NULL; 28 | 29 | lstFirst( hLst ); 30 | while ( n <= nIndex ) 31 | { 32 | if ( lstEOL( hLst ) ) 33 | break; 34 | if ( n == nIndex ) 35 | return hLst->hCurrent->pData; 36 | n++; 37 | lstNext( hLst ); 38 | } 39 | 40 | return NULL; 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetDiagRec.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetDiagRec 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetDiagRec( SQLSMALLINT HandleType, 17 | SQLHANDLE Handle, 18 | SQLSMALLINT RecordNumber, 19 | SQLCHAR *Sqlstate, 20 | SQLINTEGER *NativeError, 21 | SQLCHAR *MessageText, 22 | SQLSMALLINT BufferLength, 23 | SQLSMALLINT *StringLength 24 | ) 25 | { 26 | 27 | return SQL_ERROR; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /Drivers/template/SQLFreeHandle.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLFreeHandle 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLFreeHandle( SQLSMALLINT nHandleType, 17 | SQLHANDLE nHandle 18 | ) 19 | { 20 | switch( nHandleType ) 21 | { 22 | case SQL_HANDLE_ENV: 23 | return _FreeEnv( (SQLHENV)nHandle ); 24 | 25 | case SQL_HANDLE_DBC: 26 | return _FreeConnect( (SQLHDBC)nHandle ); 27 | 28 | case SQL_HANDLE_STMT: 29 | return _FreeStmt( (SQLHSTMT)nHandle ); 30 | 31 | case SQL_HANDLE_DESC: 32 | break; 33 | 34 | default: 35 | return SQL_ERROR; 36 | } 37 | 38 | return SQL_ERROR; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLAllocHandle.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLAllocHandle 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLAllocHandle( SQLSMALLINT nHandleType, 17 | SQLHANDLE nInputHandle, 18 | SQLHANDLE *pnOutputHandle ) 19 | { 20 | switch ( nHandleType ) 21 | { 22 | case SQL_HANDLE_ENV: 23 | return _AllocEnv( (SQLHENV *)pnOutputHandle ); 24 | case SQL_HANDLE_DBC: 25 | return _AllocConnect( (SQLHENV)nInputHandle, (SQLHDBC *)pnOutputHandle ); 26 | case SQL_HANDLE_STMT: 27 | return _AllocStmt( (SQLHDBC)nInputHandle, (SQLHSTMT *)pnOutputHandle ); 28 | case SQL_HANDLE_DESC: 29 | break; 30 | default: 31 | return SQL_ERROR; 32 | break; 33 | } 34 | 35 | return SQL_ERROR; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLFreeHandle.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLFreeHandle 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLFreeHandle( SQLSMALLINT nHandleType, 17 | SQLHANDLE nHandle 18 | ) 19 | { 20 | switch( nHandleType ) 21 | { 22 | case SQL_HANDLE_ENV: 23 | return sqlFreeEnv( (SQLHENV)nHandle ); 24 | 25 | case SQL_HANDLE_DBC: 26 | return sqlFreeConnect( (SQLHDBC)nHandle ); 27 | 28 | case SQL_HANDLE_STMT: 29 | return sqlFreeStmt( (SQLHSTMT)nHandle, 0 ); 30 | 31 | case SQL_HANDLE_DESC: 32 | break; 33 | 34 | default: 35 | return SQL_ERROR; 36 | } 37 | 38 | return SQL_ERROR; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /ini/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. * 4 | * * 5 | * Peter Harvey 21.FEB.99 pharvey@codebydesign.com * 6 | *************************************************************** 7 | 8 | +-------------------------------------------------------------+ 9 | | unixODBC | 10 | | INI lib (libini.so) | 11 | +-------------------------------------------------------------+ 12 | 13 | This library provides some usefull functions 14 | for processing INI files (such as odbc.ini). 15 | It is heavily used in unixODBC by the ODBCConfig 16 | and unixODBC Driver Config libs. 17 | 18 | 19 | Peter Harvey 20 | pharvey@codebydesign.com 21 | 22.MAR.99 22 | 23 | +-------------------------------------------------------------+ 24 | | Please visit; | 25 | | www.unixodbc.org | 26 | +-------------------------------------------------------------+ 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Drivers/template/SQLAllocHandle.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLAllocHandle 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLAllocHandle( SQLSMALLINT nHandleType, 17 | SQLHANDLE nInputHandle, 18 | SQLHANDLE *pnOutputHandle ) 19 | { 20 | switch ( nHandleType ) 21 | { 22 | case SQL_HANDLE_ENV: 23 | return _AllocEnv( (SQLHENV *)pnOutputHandle ); 24 | case SQL_HANDLE_DBC: 25 | return _AllocConnect( (SQLHENV)nInputHandle, (SQLHDBC *)pnOutputHandle ); 26 | case SQL_HANDLE_STMT: 27 | return _AllocStmt( (SQLHDBC)nInputHandle, (SQLHSTMT *)pnOutputHandle ); 28 | case SQL_HANDLE_DESC: 29 | break; 30 | default: 31 | return SQL_ERROR; 32 | break; 33 | } 34 | 35 | return SQL_ERROR; 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/lobj.h: -------------------------------------------------------------------------------- 1 | 2 | /* File: lobj.h 3 | * 4 | * Description: See "lobj.c" 5 | * 6 | * Comments: See "notice.txt" for copyright and license information. 7 | * 8 | */ 9 | 10 | #ifndef __LOBJ_H__ 11 | #define __LOBJ_H__ 12 | 13 | 14 | #include "psqlodbc.h" 15 | 16 | struct lo_arg { 17 | int isint; 18 | int len; 19 | union 20 | { 21 | int integer; 22 | char *ptr; 23 | } u; 24 | }; 25 | 26 | #define LO_CREAT 957 27 | #define LO_OPEN 952 28 | #define LO_CLOSE 953 29 | #define LO_READ 954 30 | #define LO_WRITE 955 31 | #define LO_LSEEK 956 32 | #define LO_TELL 958 33 | #define LO_UNLINK 964 34 | 35 | #define INV_WRITE 0x00020000 36 | #define INV_READ 0x00040000 37 | 38 | Oid odbc_lo_creat(ConnectionClass *conn, int mode); 39 | int odbc_lo_open(ConnectionClass *conn, int lobjId, int mode); 40 | int odbc_lo_close(ConnectionClass *conn, int fd); 41 | int odbc_lo_read(ConnectionClass *conn, int fd, char *buf, int len); 42 | int odbc_lo_write(ConnectionClass *conn, int fd, char *buf, int len); 43 | int odbc_lo_lseek(ConnectionClass *conn, int fd, int offset, int len); 44 | int odbc_lo_tell(ConnectionClass *conn, int fd); 45 | int odbc_lo_unlink(ConnectionClass *conn, Oid lobjId); 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Release History 2 | =============== 3 | 4 | NOTE: I have moved what was here into ChangeLog, it seemed to 5 | make more sense that way (NG). 6 | 7 | Release 2.2.10 29-Sep-2004 8 | Release 2.2.9 24-Jan-2004 9 | Release 2.2.8 17-Feb-2004 10 | Release 2.2.7 02-Dec-2003 11 | Release 2.2.6 21-July-2003 12 | Release 2.2.5 26-Feb-2003 13 | Release 2.2.4 24-January-2003 14 | Release 2.2.3 23-August-2002 15 | Release 2.2.2 8-July-2002 16 | Release 2.2.1 23-Mar-2002 17 | Release 2.2.0 30-Jan-2002 18 | Release 2.1.1 2001-12-21 19 | Release 2.1.0 2001-11-27 20 | Release 2.0.10 2001-10-14 21 | Release 2.0.9 2001-08-14 22 | Release 2.0.8 2001-06-25 23 | Release 2.0.7 2001-06-06 24 | Release 2.0.6 2001-04-18 25 | Release 2.0.5 2001-03-21 26 | Release 2.0.4 2001-02-02 27 | Release 2.0.3 2001-01-13 28 | Release 2.0.2 2001-01-08 29 | Release 2.0.1 2001-01-06 30 | Release 2.0.0 2001-01-04 31 | Release 1.8.13 2000-11-14 32 | Release 1.8.12 2000-08-18 33 | Release 1.8.11 2000-08-16 34 | Release 1.8.10 2000-06-15 35 | Release 1.8.9 2000-06-13 36 | Release 1.8.8 2000-05-03 37 | Release 1.8.6 2000-02-21 38 | Release 1.8.4 2000-02-12 39 | Release 1.8.3 1999-12-28 40 | Release 1.8.2 1999-12-11 41 | Release 1.8.1 1999-11-17 42 | Release 1.8 1999-11-13 43 | Release 1.7 1999-07-26 44 | -------------------------------------------------------------------------------- /DRVConfig/nn/drvcfg.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 13.MAY.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include 14 | 15 | static const char *aServer[] = 16 | { 17 | "localhost", /* put some public news servers here */ 18 | NULL 19 | }; 20 | 21 | 22 | int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) 23 | { 24 | hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); 25 | hLastProperty = hLastProperty->pNext; 26 | memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); 27 | hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_COMBOBOX; 28 | hLastProperty->aPromptData = malloc( sizeof( aServer ) ); 29 | memcpy( hLastProperty->aPromptData, aServer, sizeof( aServer ) ); 30 | strncpy( hLastProperty->szName, "Server", INI_MAX_PROPERTY_NAME ); 31 | strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); 32 | 33 | return 1; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Drivers/nn/SQLExecDirect.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLExecDirect( 19 | HSTMT hstmt, 20 | UCHAR* szSqlStr, 21 | SDWORD cbSqlStr ) 22 | { 23 | stmt_t* pstmt = hstmt; 24 | int sqlcode; 25 | 26 | UNSET_ERROR( pstmt->herr ); 27 | 28 | sqlcode = nnodbc_sqlprepare( hstmt, (char*)szSqlStr, cbSqlStr); 29 | 30 | if ( sqlcode != SQL_SUCCESS 31 | && sqlcode != SQL_SUCCESS_WITH_INFO ) 32 | return sqlcode; 33 | 34 | sqlcode |= sqlexecute(hstmt); 35 | 36 | return sqlcode; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /log/logOn.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * logOn 3 | * 4 | * 5 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 6 | * This code is LGPL. Please ensure that this message remains in future 7 | * distributions and uses of this code (thats about all I get out of it). 8 | * - Peter Harvey pharvey@codebydesign.com 9 | * 10 | **********************************************************************/ 11 | 12 | #include 13 | #include "log.h" 14 | 15 | /*! 16 | * \brief Turn logging on/off. 17 | * 18 | * Logging is turned OFF by default. Turn it on when you want 19 | * logged messages to be stored. Turn it back off when you want to 20 | * 'pause' logging. 21 | * 22 | * This may be used during debugging sessions to reduce clutter 23 | * in the log results. 24 | * 25 | * \param hLog 26 | * \param bOn 27 | * 28 | * \return int 29 | * \retval LOG_SUCCESS 30 | * 31 | * \sa logOpen 32 | * logClose 33 | */ 34 | int logOn( HLOG hLog, int bOn ) 35 | { 36 | /* log must be logOpen to logOn */ 37 | if ( !hLog ) return LOG_ERROR; 38 | 39 | hLog->bOn = bOn; 40 | 41 | return LOG_SUCCESS; 42 | } 43 | 44 | 45 | -------------------------------------------------------------------------------- /DRVConfig/drvcfg2/drvcfg2.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 18.FEB.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include 14 | 15 | /********************************************** 16 | * HELP 17 | **********************************************/ 18 | 19 | /********************************************** 20 | * STATIC LOOKUP VALUES 21 | **********************************************/ 22 | 23 | 24 | int ODBCINSTGetProperties( HODBCINSTPROPERTY hLastProperty ) 25 | { 26 | hLastProperty->pNext = (HODBCINSTPROPERTY)malloc( sizeof(ODBCINSTPROPERTY) ); 27 | hLastProperty = hLastProperty->pNext; 28 | memset( hLastProperty, 0, sizeof(ODBCINSTPROPERTY) ); 29 | hLastProperty->nPromptType = ODBCINST_PROMPTTYPE_FILENAME; 30 | strncpy( hLastProperty->szName, "Database", INI_MAX_PROPERTY_NAME ); 31 | strncpy( hLastProperty->szValue, "", INI_MAX_PROPERTY_VALUE ); 32 | 33 | return 1; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /ini/_iniPropertyRead.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * _iniPropertyRead 3 | * 4 | * 5 | * 6 | ************************************************** 7 | * This code was created by Peter Harvey @ CodeByDesign. 8 | * Released under LGPL 28.JAN.99 9 | * 10 | * Contributions from... 11 | * ----------------------------------------------- 12 | * Peter Harvey - pharvey@codebydesign.com 13 | **************************************************/ 14 | 15 | #include 16 | #include "ini.h" 17 | 18 | int _iniPropertyRead( HINI hIni, char *szLine, char *pszPropertyName, char *pszPropertyValue ) 19 | { 20 | 21 | /* SANITY CHECKS */ 22 | if ( hIni == NULL ) 23 | return INI_ERROR; 24 | if ( hIni->hCurObject == NULL ) 25 | return INI_ERROR; 26 | 27 | /* SCAN LINE TO EXTRACT PROPERTY NAME AND VALUE WITH NO TRAILING SPACES */ 28 | strcpy( pszPropertyName, "" ); 29 | strcpy( pszPropertyValue, "" ); 30 | 31 | iniElement( szLine, '=', '\0', 0, pszPropertyName, INI_MAX_PROPERTY_NAME ); 32 | iniElementToEnd( szLine, '=', '\0', 1, pszPropertyValue, INI_MAX_PROPERTY_VALUE ); 33 | iniAllTrim( pszPropertyName ); 34 | iniAllTrim( pszPropertyValue ); 35 | 36 | return INI_SUCCESS; 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /doc/ProgrammerManual/Tutorial/navi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Navigation 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
ODBC Programming Tutorial
14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 25 | 26 | 27 | 29 | 30 | 31 | 33 | 34 | 35 | 37 | 38 | 39 | 41 | 42 | 43 | 46 | 47 | 48 | 51 | 52 |
 
Introduction 20 |
Connection 24 |
Closing 28 |
Queries 32 |
Results 36 |
Obtaining DSN 40 |
44 | Index / Glossary 45 |
49 | unixODBC Home 50 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /odbcinst/SQLInstallTranslatorEx.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | ************************************************** 4 | * This code was created by Peter Harvey @ CodeByDesign. 5 | * Released under LGPL 28.JAN.99 6 | * 7 | * Contributions from... 8 | * ----------------------------------------------- 9 | * Peter Harvey - pharvey@codebydesign.com 10 | **************************************************/ 11 | #include 12 | #include 13 | 14 | BOOL SQLInstallTranslatorEx( LPCSTR pszTranslator, 15 | LPCSTR pszPathIn, 16 | LPSTR pszPathOut, 17 | WORD nPathOutMax, 18 | WORD *pnPathOut, 19 | WORD nRequest, 20 | LPDWORD pnUsageCount ) 21 | 22 | { 23 | inst_logClear(); 24 | 25 | return FALSE; 26 | } 27 | 28 | BOOL INSTAPI SQLInstallTranslatorExW(LPCWSTR lpszTranslator, 29 | LPCWSTR lpszPathIn, 30 | LPWSTR lpszPathOut, 31 | WORD cbPathOutMax, 32 | WORD *pcbPathOut, 33 | WORD fRequest, 34 | LPDWORD lpdwUsageCount) 35 | { 36 | inst_logClear(); 37 | 38 | return FALSE; 39 | } 40 | -------------------------------------------------------------------------------- /DRVConfig/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. * 4 | *************************************************************** 5 | 6 | +-------------------------------------------------------------+ 7 | | unixODBC | 8 | | DRVConfig | 9 | +-------------------------------------------------------------+ 10 | 11 | These are the setup libs for the various drivers. There are two 12 | generic ones; 13 | 14 | drvcfg1 - SQL servers (host, port etc) 15 | drvcfg2 - file based (database dir) 16 | 17 | These are typically installed into the same directory as the 18 | drivers (often /usr/local/lib) and are denoted by a simple 19 | naming convention (*S.so). 20 | 21 | The driver lib and setup lib are key to registering an ODBC 22 | driver - a task which is done by a root user. 23 | 24 | +-------------------------------------------------------------+ 25 | | Peter Harvey pharvey@codebydesign.com | 26 | | http://www.unixodbc.org | 27 | +-------------------------------------------------------------+ 28 | 29 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/_NativeToSQLType.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * _NativeToSQLType 3 | * 4 | ************************************************** 5 | * This code was created by Peter Harvey @ CodeByDesign. 6 | * Released under LGPL 31.JAN.99 7 | * 8 | * Contributions from... 9 | * ----------------------------------------------- 10 | * Peter Harvey - pharvey@codebydesign.com 11 | **************************************************/ 12 | #include 13 | #include "driver.h" 14 | 15 | int _NativeToSQLType( void *pNativeColumnHeader ) 16 | { 17 | m_field *pField = (m_field*)pNativeColumnHeader; 18 | 19 | switch ( pField->type ) 20 | { 21 | case MONEY_TYPE: 22 | return SQL_REAL; 23 | 24 | case INT_TYPE: 25 | return SQL_INTEGER; 26 | 27 | case UINT_TYPE: 28 | return SQL_INTEGER; 29 | 30 | case TIME_TYPE: 31 | return SQL_CHAR; 32 | 33 | case DATE_TYPE: 34 | return SQL_CHAR; 35 | 36 | case REAL_TYPE: 37 | return SQL_REAL; 38 | 39 | case CHAR_TYPE: 40 | return SQL_CHAR; 41 | 42 | case TEXT_TYPE: 43 | return SQL_CHAR; 44 | 45 | case IDENT_TYPE: 46 | return SQL_CHAR; 47 | 48 | default: 49 | return SQL_UNKNOWN_TYPE; 50 | } 51 | 52 | 53 | return SQL_CHAR; 54 | } 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLCancel.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLCancel 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLCancel( SQLHSTMT hDrvStmt ) 17 | { 18 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 19 | 20 | /* SANITY CHECKS */ 21 | if( NULL == hStmt ) 22 | return SQL_INVALID_HANDLE; 23 | 24 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 25 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 26 | 27 | /************************ 28 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 29 | ************************/ 30 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 31 | 32 | return SQL_ERROR; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLCloseCursor.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLCloseCursor 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLCloseCursor( SQLHSTMT hDrvStmt ) 17 | { 18 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 19 | 20 | /* SANITY CHECKS */ 21 | if( NULL == hStmt ) 22 | return SQL_INVALID_HANDLE; 23 | 24 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 25 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 26 | 27 | /************************ 28 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 29 | ************************/ 30 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 31 | 32 | return SQL_ERROR; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLMoreResults.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLMoreResults 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLMoreResults( SQLHSTMT hDrvStmt ) 17 | { 18 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 19 | 20 | /* SANITY CHECKS */ 21 | if ( NULL == hStmt ) 22 | return SQL_INVALID_HANDLE; 23 | 24 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 25 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 26 | 27 | /************************ 28 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 29 | ************************/ 30 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 31 | 32 | 33 | return SQL_ERROR; 34 | } 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Drivers/template/SQLCancel.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLCancel 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLCancel( SQLHSTMT hDrvStmt ) 17 | { 18 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 19 | 20 | /* SANITY CHECKS */ 21 | if( NULL == hStmt ) 22 | return SQL_INVALID_HANDLE; 23 | 24 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 25 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 26 | 27 | /************************ 28 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 29 | ************************/ 30 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 31 | 32 | return SQL_ERROR; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /extras/strcasecmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #ifndef HAVE_STRCASECMP 6 | 7 | int strcasecmp( const char *s1, const char * s2 ) 8 | { 9 | const unsigned char *p1 = (const unsigned char *) s1; 10 | const unsigned char *p2 = (const unsigned char *) s2; 11 | unsigned char c1, c2; 12 | 13 | if (p1 == p2) 14 | return 0; 15 | 16 | do 17 | { 18 | c1 = tolower(*p1++); 19 | c2 = tolower(*p2++); 20 | if (c1 == '\0') 21 | break; 22 | } 23 | while (c1 == c2); 24 | 25 | return c1 - c2; 26 | } 27 | 28 | #endif 29 | #ifndef HAVE_STRNCASECMP 30 | 31 | int strncasecmp (const char *s1, const char *s2, int n ) 32 | { 33 | const unsigned char *p1 = (const unsigned char *) s1; 34 | const unsigned char *p2 = (const unsigned char *) s2; 35 | unsigned char c1, c2; 36 | 37 | if (p1 == p2) 38 | return 0; 39 | 40 | do 41 | { 42 | c1 = tolower(*p1++); 43 | c2 = tolower(*p2++); 44 | if (c1 == '\0') 45 | break; 46 | 47 | n --; 48 | } 49 | while (c1 == c2 && n > 0 ); 50 | 51 | if ( n == 0 ) 52 | return 0; 53 | 54 | return c1 - c2; 55 | } 56 | 57 | #endif 58 | 59 | void ___extra_func_to_mollify_linker( void ) 60 | { 61 | } 62 | -------------------------------------------------------------------------------- /Drivers/nn/SQLCancel.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLCancel( 19 | HSTMT hstmt) 20 | { 21 | stmt_t* pstmt = hstmt; 22 | param_t* ppar; 23 | int i, npar; 24 | 25 | UNSET_ERROR( pstmt->herr ); 26 | 27 | npar = nnsql_getparnum(pstmt->yystmt); 28 | 29 | for (i=1, ppar = pstmt->ppar; ppar && i < npar + 1; i++, ppar++ ) 30 | { 31 | nnsql_yyunbindpar( pstmt->yystmt, i); 32 | MEM_FREE(ppar->putdtbuf); 33 | ppar->putdtbuf = 0; 34 | ppar->putdtlen = 0; 35 | ppar->need = 0; 36 | } 37 | 38 | pstmt->ndelay = 0; 39 | pstmt->putipar= 0; 40 | 41 | return SQL_SUCCESS; 42 | } 43 | -------------------------------------------------------------------------------- /Drivers/template/SQLCloseCursor.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLCloseCursor 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLCloseCursor( SQLHSTMT hDrvStmt ) 17 | { 18 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 19 | 20 | /* SANITY CHECKS */ 21 | if( NULL == hStmt ) 22 | return SQL_INVALID_HANDLE; 23 | 24 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 25 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 26 | 27 | /************************ 28 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 29 | ************************/ 30 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 31 | 32 | return SQL_ERROR; 33 | } 34 | 35 | 36 | -------------------------------------------------------------------------------- /Drivers/template/SQLMoreResults.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLMoreResults 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLMoreResults( SQLHSTMT hDrvStmt ) 17 | { 18 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 19 | 20 | /* SANITY CHECKS */ 21 | if ( NULL == hStmt ) 22 | return SQL_INVALID_HANDLE; 23 | 24 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 25 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 26 | 27 | /************************ 28 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 29 | ************************/ 30 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 31 | 32 | 33 | return SQL_ERROR; 34 | } 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ini/iniAllTrim.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * . 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int iniAllTrim( char *pszString ) 18 | { 19 | int nForwardCursor = 0; 20 | int nTrailingCursor = 0; 21 | int bTrim = 1; 22 | 23 | /* TRIM LEFT */ 24 | for ( nForwardCursor=0; pszString[nForwardCursor] != '\0'; nForwardCursor++ ) 25 | { 26 | if ( bTrim && isspace( pszString[nForwardCursor] ) ) 27 | { 28 | /* DO NOTHING */ 29 | } 30 | else 31 | { 32 | bTrim = 0; 33 | pszString[nTrailingCursor] = pszString[nForwardCursor]; 34 | nTrailingCursor++; 35 | } 36 | } 37 | pszString[nTrailingCursor] = '\0'; 38 | 39 | /* TRIM RIGHT */ 40 | for ( nForwardCursor=strlen(pszString)-1; 41 | nForwardCursor >= 0 && isspace( pszString[nForwardCursor] ); 42 | nForwardCursor-- ) 43 | { 44 | } 45 | pszString[nForwardCursor+1] = '\0'; 46 | 47 | return INI_SUCCESS; 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLSetDescRec.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetDescRec 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetDescRec( SQLHDESC hDescriptorHandle, 17 | SQLSMALLINT nRecordNumber, 18 | SQLSMALLINT nType, 19 | SQLSMALLINT nSubType, 20 | SQLINTEGER nLength, 21 | SQLSMALLINT nPrecision, 22 | SQLSMALLINT nScale, 23 | SQLPOINTER pData, 24 | SQLINTEGER *pnStringLength, 25 | SQLINTEGER *pnIndicator 26 | ) 27 | { 28 | 29 | return SQL_ERROR; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /lst/lstOpenCursor.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | HLST lstOpenCursor( HLST hBase, int (*pFilterFunc)( HLST, void * ), void *pExtras ) 5 | { 6 | HLST hLst = NULL; 7 | 8 | if ( !hBase ) 9 | return NULL; 10 | 11 | /************************* 12 | * CREATE A NEW LIST 13 | *************************/ 14 | hLst = lstOpen(); 15 | if ( !hLst ) 16 | return NULL; 17 | 18 | hBase->nRefs++; 19 | 20 | hLst->pFilter = pFilterFunc; 21 | hLst->pFree = NULL; /* never free pData in a cursor */ 22 | hLst->pExtras = pExtras; 23 | 24 | /************************* 25 | * ADD ITEMS FROM hBase (skipping any bDelete items) 26 | *************************/ 27 | lstFirst( hBase ); 28 | if ( pFilterFunc ) 29 | { 30 | while ( !lstEOL( hBase ) ) 31 | { 32 | if ( pFilterFunc( hLst, lstGet( hBase ) ) ) 33 | lstAppend( hLst, hBase->hCurrent ); 34 | 35 | lstNext( hBase ); 36 | } 37 | } 38 | else 39 | { 40 | while ( !lstEOL( hBase ) ) 41 | { 42 | lstAppend( hLst, hBase->hCurrent ); 43 | 44 | lstNext( hBase ); 45 | } 46 | } 47 | 48 | /************************* 49 | * THIS *MUST* BE DONE AFTER THE LIST IS LOADED 50 | * OTHERWISE lstAppend() WILL APPEND INTO ROOT LIST AND MAKE A REF IN THIS LIST 51 | *************************/ 52 | hLst->hLstBase = hBase; 53 | 54 | return hLst; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /Drivers/template/SQLSetDescRec.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetDescRec 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetDescRec( SQLHDESC hDescriptorHandle, 17 | SQLSMALLINT nRecordNumber, 18 | SQLSMALLINT nType, 19 | SQLSMALLINT nSubType, 20 | SQLLEN nLength, 21 | SQLSMALLINT nPrecision, 22 | SQLSMALLINT nScale, 23 | SQLPOINTER pData, 24 | SQLLEN *pnStringLength, 25 | SQLLEN *pnIndicator 26 | ) 27 | { 28 | 29 | return SQL_ERROR; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /DRVConfig/sapdb/README: -------------------------------------------------------------------------------- 1 | *************************************************************** 2 | * This code is LGPL. You CAN make commercial solutions using * 3 | * LGPL software. * 4 | *************************************************************** 5 | 6 | +-------------------------------------------------------------+ 7 | | unixODBC | 8 | | Driver Config for SAP DB SQL Server options | 9 | +-------------------------------------------------------------+ 10 | 11 | 12 | SAP DB awaits it's odbc.ini file in /usr/spool/sql/config/odbc.ini. 13 | That's weird enought, because it's not even FHS (that would be 14 | /var/spool/...) There are two ways you can fix this: 15 | 16 | - Edit the libsqlod.so file 17 | - make a symlink from /usr/spool/sql/config/odbc.ini to /etc/odbc.ini 18 | 19 | Also note that currently (09-Mar-2001) unixODBC crashes when you 20 | use the libsqlod from the sapdb-srv or sapdb-if RPM packages. If you 21 | use the one from the sapdb-web RPM, then it works. 22 | 23 | +-------------------------------------------------------------+ 24 | | Holger Schurig holgerschurig@gmx.de | 25 | | http://home.nikocity.de/hschurig | 26 | +-------------------------------------------------------------+ 27 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLParamData.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLParamData 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLParamData( SQLHSTMT hDrvStmt, 17 | SQLPOINTER *pValue ) 18 | { 19 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 20 | 21 | /* SANITY CHECKS */ 22 | if ( NULL == hStmt ) 23 | return SQL_INVALID_HANDLE; 24 | 25 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 26 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 27 | 28 | /************************ 29 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 30 | ************************/ 31 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 32 | 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Drivers/Postgre7.1/notice.txt: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************** 3 | 4 | PSQLODBC.DLL - A library to talk to the PostgreSQL DBMS using ODBC. 5 | 6 | 7 | Copyright (C) 1998; Insight Distribution Systems 8 | 9 | The code contained in this library is based on code written by 10 | Christian Czezatke and Dan McGuirk, (C) 1996. 11 | 12 | 13 | This library is free software; you can redistribute it and/or modify 14 | it under the terms of the GNU Library General Public License as 15 | published by the Free Software Foundation; either version 2 of the 16 | License, or (at your option) any later version. 17 | 18 | This library is distributed in the hope that it will be useful, but 19 | WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | Library General Public License for more details. 22 | 23 | You should have received a copy of the GNU Library General Public 24 | License along with this library (see "license.txt"); if not, write to 25 | the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 26 | 02139, USA. 27 | 28 | 29 | How to contact the author: 30 | 31 | email: byronn@insightdist.com (Byron Nikolaidis) 32 | 33 | 34 | ***********************************************************************/ 35 | 36 | -------------------------------------------------------------------------------- /ini/_iniObjectRead.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * _iniObjectRead 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | **************************************************/ 13 | 14 | #include 15 | #include "ini.h" 16 | 17 | int _iniObjectRead( HINI hIni, char *szLine, char *pszObjectName ) 18 | { 19 | int nChar; 20 | 21 | /* SANITY CHECK */ 22 | if ( hIni == NULL ) 23 | return INI_ERROR; 24 | 25 | /* SCAN LINE TO EXTRACT OBJECT NAME WITH NO BRACKETS */ 26 | nChar = 1; 27 | while ( 1 ) 28 | { 29 | if ( (szLine[nChar] == '\0') || (nChar == INI_MAX_OBJECT_NAME) ) 30 | { 31 | pszObjectName[nChar-1] = '\0'; 32 | break; 33 | } 34 | 35 | if ( szLine[nChar] == hIni->cRightBracket ) 36 | { 37 | pszObjectName[nChar-1] = '\0'; 38 | break; 39 | } 40 | pszObjectName[nChar-1] = szLine[nChar]; 41 | nChar++; 42 | } 43 | iniAllTrim( pszObjectName ); 44 | 45 | return INI_SUCCESS; 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /ini/iniPropertySeekSure.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************** 2 | * iniPropertySeek 3 | * 4 | * 5 | ************************************************** 6 | * This code was created by Peter Harvey @ CodeByDesign. 7 | * Released under LGPL 28.JAN.99 8 | * 9 | * Contributions from... 10 | * ----------------------------------------------- 11 | * Peter Harvey - pharvey@codebydesign.com 12 | * ----------------------------------------------- 13 | * 14 | * PAH 06.MAR.99 Added this func 15 | **************************************************/ 16 | 17 | #include 18 | #include "ini.h" 19 | 20 | int iniPropertySeekSure( HINI hIni, char *pszObject, char *pszProperty, char *pszValue ) 21 | { 22 | int nReturn; 23 | 24 | /* SANITY CHECKS */ 25 | if ( hIni == NULL ) 26 | return INI_ERROR; 27 | if ( !pszObject ) 28 | return INI_ERROR; 29 | if ( !pszProperty ) 30 | return INI_ERROR; 31 | if ( !pszValue ) 32 | return INI_ERROR; 33 | 34 | /* OK */ 35 | if ( (nReturn = iniPropertySeek( hIni, pszObject, pszProperty, "" )) == INI_NO_DATA ) 36 | { 37 | iniObjectSeekSure( hIni, pszObject ); 38 | return iniPropertyInsert( hIni, pszProperty, pszValue ); 39 | } 40 | else if ( nReturn == INI_SUCCESS ) 41 | return iniValue( hIni, pszValue ); 42 | 43 | return nReturn; 44 | } 45 | 46 | 47 | -------------------------------------------------------------------------------- /Drivers/nn/SQLAllocConnect.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | 16 | #include 17 | #include "driver.h" 18 | 19 | RETCODE SQL_API SQLAllocConnect( 20 | HENV henv, 21 | HDBC * phdbc) 22 | { 23 | env_t* penv = henv; 24 | dbc_t* pdbc; 25 | int i; 26 | 27 | UNSET_ERROR( penv->herr ); 28 | 29 | pdbc = *phdbc = (void*)MEM_ALLOC( sizeof(dbc_t) ); 30 | 31 | if (! pdbc ) 32 | { 33 | PUSHSQLERR( penv->herr, en_S1001 ); 34 | return SQL_ERROR; 35 | } 36 | 37 | pdbc->next = penv->hdbc; 38 | penv->hdbc = pdbc; 39 | 40 | pdbc->henv = henv; 41 | pdbc->stmt= 0; 42 | pdbc->herr = 0; 43 | 44 | pdbc->hcndes = 0; 45 | 46 | return SQL_SUCCESS; 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLNumParams.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLNumParams 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLNumParams( SQLHSTMT hDrvStmt, 17 | SQLSMALLINT *pnParamCount ) 18 | { 19 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 20 | 21 | /* SANITY CHECKS */ 22 | if ( NULL == hStmt ) 23 | return SQL_INVALID_HANDLE; 24 | 25 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 26 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 27 | 28 | /************************ 29 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 30 | ************************/ 31 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 32 | 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drivers/nn/SQLFreeConnect.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | #include 16 | #include "driver.h" 17 | 18 | RETCODE SQL_API SQLFreeConnect( 19 | HDBC hdbc) 20 | { 21 | dbc_t* tpdbc; 22 | dbc_t* pdbc = hdbc; 23 | env_t* penv = pdbc->henv; 24 | 25 | UNSET_ERROR( pdbc->herr ); 26 | 27 | for ( tpdbc = penv->hdbc; 28 | tpdbc; 29 | tpdbc = tpdbc->next ) 30 | { 31 | if ( pdbc == tpdbc ) 32 | { 33 | penv->hdbc = pdbc->next; 34 | break; 35 | } 36 | 37 | if ( pdbc == tpdbc->next ) 38 | { 39 | tpdbc->next = pdbc->next; 40 | break; 41 | } 42 | } 43 | 44 | CLEAR_ERROR( pdbc->herr ); 45 | MEM_FREE( pdbc ); 46 | 47 | return SQL_SUCCESS; 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetTypeInfo.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetTypeInfo 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetTypeInfo( SQLHSTMT hDrvStmt, 17 | SQLSMALLINT nSqlType ) 18 | { 19 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 20 | 21 | /* SANITY CHECKS */ 22 | if ( NULL == hStmt ) 23 | return SQL_INVALID_HANDLE; 24 | 25 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 26 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 27 | 28 | /************************ 29 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 30 | ************************/ 31 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 32 | 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLParamOptions.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLParamOptions (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLParamOptions( SQLHSTMT hDrvStmt, 17 | SQLULEN nRow, 18 | SQLULEN *pnRow ) 19 | { 20 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 21 | 22 | /* SANITY CHECKS */ 23 | if ( NULL == hStmt ) 24 | return SQL_INVALID_HANDLE; 25 | 26 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 27 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 28 | 29 | /************************ 30 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 31 | ************************/ 32 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 33 | 34 | 35 | return SQL_ERROR; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Drivers/nn/misc.c: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (C) 1995, 1996 by Ke Jin 3 | Enhanced for unixODBC (1999) by Peter Harvey 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | **/ 15 | 16 | #include 17 | #include 18 | #include "driver.h" 19 | 20 | int upper_strneq( 21 | char* s1, 22 | char* s2, 23 | int n ) 24 | { 25 | int i; 26 | char c1, c2; 27 | 28 | for(i=0;i= 'a' && c1 <= 'z' ) 34 | c1 += ('A' - 'a'); 35 | else if( c1 == '\n' ) 36 | c1 = '\0'; 37 | 38 | if( c2 >= 'a' && c2 <= 'z' ) 39 | c2 += ('A' - 'a'); 40 | else if( c2 == '\n' ) 41 | c2 = '\0'; 42 | 43 | if( (c1 - c2) || !c1 || !c2 ) 44 | break; 45 | } 46 | 47 | return (int)!(c1 - c2); 48 | } 49 | 50 | int nnodbc_conndialog() 51 | { 52 | return -1; 53 | } 54 | -------------------------------------------------------------------------------- /odbcinst/SQLGetTranslator.c: -------------------------------------------------------------------------------- 1 | /************************************************** 2 | * 3 | ************************************************** 4 | * This code was created by Peter Harvey @ CodeByDesign. 5 | * Released under LGPL 28.JAN.99 6 | * 7 | * Contributions from... 8 | * ----------------------------------------------- 9 | * Peter Harvey - pharvey@codebydesign.com 10 | **************************************************/ 11 | #include 12 | #include 13 | 14 | 15 | BOOL SQLGetTranslator( HWND hWnd, 16 | LPSTR pszName, 17 | WORD nNameMax, 18 | WORD *pnNameOut, 19 | LPSTR pszPath, 20 | WORD nPathMax, 21 | WORD *pnPathOut, 22 | DWORD *pnOption ) 23 | { 24 | inst_logClear(); 25 | 26 | return FALSE; 27 | } 28 | 29 | 30 | BOOL INSTAPI SQLGetTranslatorW (HWND hwnd, 31 | LPWSTR lpszName, 32 | WORD cbNameMax, 33 | WORD *pcbNameOut, 34 | LPWSTR lpszPath, 35 | WORD cbPathMax, 36 | WORD *pcbPathOut, 37 | DWORD *pvOption) 38 | { 39 | inst_logClear(); 40 | 41 | return FALSE; 42 | } 43 | -------------------------------------------------------------------------------- /Drivers/template/SQLParamData.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLParamData 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLParamData( SQLHSTMT hDrvStmt, 17 | SQLPOINTER *pValue ) 18 | { 19 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 20 | 21 | /* SANITY CHECKS */ 22 | if ( NULL == hStmt ) 23 | return SQL_INVALID_HANDLE; 24 | 25 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 26 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 27 | 28 | /************************ 29 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 30 | ************************/ 31 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 32 | 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetConnectOption.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetConnectOption (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetConnectOption( SQLHDBC hDrvDbc, 17 | UWORD fOption, 18 | PTR pvParam ) 19 | { 20 | HDRVDBC hDbc = (HDRVDBC)hDrvDbc; 21 | 22 | /* SANITY CHECKS */ 23 | if( NULL == hDbc ) 24 | return SQL_INVALID_HANDLE; 25 | 26 | sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); 27 | logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); 28 | 29 | /************************ 30 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 31 | ************************/ 32 | logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetTypeInfo.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetTypeInfo 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetTypeInfo( SQLHSTMT hDrvStmt, 17 | SQLSMALLINT nSqlType ) 18 | { 19 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 20 | 21 | /* SANITY CHECKS */ 22 | if ( NULL == hStmt ) 23 | return SQL_INVALID_HANDLE; 24 | 25 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 26 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 27 | 28 | /************************ 29 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 30 | ************************/ 31 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 32 | 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Drivers/template/SQLNumParams.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLNumParams 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLNumParams( SQLHSTMT hDrvStmt, 17 | SQLSMALLINT *pnParamCount ) 18 | { 19 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 20 | 21 | /* SANITY CHECKS */ 22 | if ( NULL == hStmt ) 23 | return SQL_INVALID_HANDLE; 24 | 25 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 26 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 27 | 28 | /************************ 29 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 30 | ************************/ 31 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 32 | 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Drivers/template/SQLParamOptions.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLParamOptions (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLParamOptions( SQLHSTMT hDrvStmt, 17 | SQLULEN nRow, 18 | SQLULEN *pnRow ) 19 | { 20 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 21 | 22 | /* SANITY CHECKS */ 23 | if ( NULL == hStmt ) 24 | return SQL_INVALID_HANDLE; 25 | 26 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 27 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 28 | 29 | /************************ 30 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 31 | ************************/ 32 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 33 | 34 | 35 | return SQL_ERROR; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLSetStmtOption.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetStmtOption (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetStmtOption( SQLHSTMT hDrvStmt, 17 | UWORD fOption, 18 | UDWORD vParam) 19 | { 20 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 21 | 22 | /* SANITY CHECKS */ 23 | if( hStmt == SQL_NULL_HSTMT ) 24 | return SQL_INVALID_HANDLE; 25 | 26 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 27 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 28 | 29 | /************************ 30 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 31 | ************************/ 32 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 33 | 34 | 35 | return SQL_ERROR; 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetDescRec.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetDescRec 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetDescRec( SQLHDESC DescriptorHandle, 17 | SQLSMALLINT RecordNumber, 18 | SQLCHAR *Name, 19 | SQLSMALLINT BufferLength, 20 | SQLSMALLINT *StringLength, 21 | SQLSMALLINT *Type, 22 | SQLSMALLINT *SubType, 23 | SQLINTEGER *Length, 24 | SQLSMALLINT *Precision, 25 | SQLSMALLINT *Scale, 26 | SQLSMALLINT *Nullable 27 | ) 28 | { 29 | 30 | return SQL_ERROR; 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetDescRec.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetDescRec 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetDescRec( SQLHDESC DescriptorHandle, 17 | SQLSMALLINT RecordNumber, 18 | SQLCHAR *Name, 19 | SQLSMALLINT BufferLength, 20 | SQLSMALLINT *StringLength, 21 | SQLSMALLINT *Type, 22 | SQLSMALLINT *SubType, 23 | SQLLEN *Length, 24 | SQLSMALLINT *Precision, 25 | SQLSMALLINT *Scale, 26 | SQLSMALLINT *Nullable 27 | ) 28 | { 29 | 30 | return SQL_ERROR; 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /Drivers/template/SQLGetConnectOption.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetConnectOption (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetConnectOption( SQLHDBC hDrvDbc, 17 | UWORD fOption, 18 | PTR pvParam ) 19 | { 20 | HDRVDBC hDbc = (HDRVDBC)hDrvDbc; 21 | 22 | /* SANITY CHECKS */ 23 | if( NULL == hDbc ) 24 | return SQL_INVALID_HANDLE; 25 | 26 | sprintf((char*) hDbc->szSqlMsg, "hDbc = $%08lX", (long)hDbc ); 27 | logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hDbc->szSqlMsg ); 28 | 29 | /************************ 30 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 31 | ************************/ 32 | logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /lst/lstClose.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lst.h" 3 | 4 | /********************* 5 | * lstClose 6 | * 7 | * Call for Cursor or root list. 8 | *********************/ 9 | int lstClose( HLST hLst ) 10 | { 11 | HLSTITEM hItem; 12 | 13 | if ( !hLst ) 14 | return LST_ERROR; 15 | 16 | hLst->nRefs--; 17 | 18 | /********************* 19 | * We will not really remove the list if we have 20 | * refs to it... we will just decrement ref. 21 | * We will be deleted when the last ref is being removed. 22 | *********************/ 23 | if ( hLst->nRefs > 0 ) 24 | return LST_SUCCESS; 25 | 26 | /************************ 27 | * DELETE ITEMS (and their refs) 28 | * - do not use standard nav funcs because they will skip items where bDelete 29 | ************************/ 30 | hItem = hLst->hFirst; 31 | while ( hItem ) 32 | { 33 | _lstFreeItem( hItem ); 34 | hItem = hLst->hFirst; 35 | } 36 | 37 | /************************ 38 | * RECURSE AS REQUIRED. RECURSION WILL STOP AS SOON AS WE GET TO A LIST WHICH 39 | * DOES NOT NEED TO BE DELETED YET (refs >= 0). 40 | ************************/ 41 | if ( hLst->hLstBase ) /* we are a cursor */ 42 | lstClose( hLst->hLstBase ); /* dec ref count and close if < 0 */ 43 | 44 | /************************ 45 | * FREE LIST HANDLE 46 | ************************/ 47 | free( hLst ); 48 | 49 | return LST_SUCCESS; 50 | } 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Drivers/template/SQLSetStmtOption.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLSetStmtOption (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLSetStmtOption( SQLHSTMT hDrvStmt, 17 | UWORD fOption, 18 | SQLULEN vParam) 19 | { 20 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 21 | 22 | /* SANITY CHECKS */ 23 | if( hStmt == SQL_NULL_HSTMT ) 24 | return SQL_INVALID_HANDLE; 25 | 26 | sprintf((char*) hStmt->szSqlMsg, "hStmt = $%08lX", (long)hStmt ); 27 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING,(char*) hStmt->szSqlMsg ); 28 | 29 | /************************ 30 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 31 | ************************/ 32 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 33 | 34 | 35 | return SQL_ERROR; 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Drivers/MiniSQL/SQLGetStmtOption.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * SQLGetStmtOption (deprecated) 3 | * 4 | ********************************************************************** 5 | * 6 | * This code was created by Peter Harvey (mostly during Christmas 98/99). 7 | * This code is LGPL. Please ensure that this message remains in future 8 | * distributions and uses of this code (thats about all I get out of it). 9 | * - Peter Harvey pharvey@codebydesign.com 10 | * 11 | **********************************************************************/ 12 | 13 | #include 14 | #include "driver.h" 15 | 16 | SQLRETURN SQLGetStmtOption( SQLHSTMT hDrvStmt, 17 | UWORD fOption, 18 | PTR pvParam) 19 | { 20 | HDRVSTMT hStmt = (HDRVSTMT)hDrvStmt; 21 | 22 | /* SANITY CHECKS */ 23 | if ( NULL == hStmt ) 24 | return SQL_INVALID_HANDLE; 25 | 26 | sprintf( hStmt->szSqlMsg, "hStmt = $%08lX", hStmt ); 27 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hStmt->szSqlMsg ); 28 | 29 | /************************ 30 | * REPLACE THIS COMMENT WITH SOMETHING USEFULL 31 | ************************/ 32 | logPushMsg( hStmt->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR This function not supported" ); 33 | 34 | return SQL_ERROR; 35 | } 36 | 37 | 38 | --------------------------------------------------------------------------------