andreas | 26 Apr 12:03

[chatter] r11775 - in trunk/fundev/sources: databases/odbc-ffi databases/sql-odbc registry/generic

Author: andreas
Date: Sat Apr 26 12:05:14 2008
New Revision: 11775

Added:
   trunk/fundev/sources/databases/odbc-ffi/sql-unix.dylan
      - copied, changed from r11774, trunk/fundev/sources/databases/odbc-ffi/sql.dylan
   trunk/fundev/sources/databases/odbc-ffi/sqlext-unix.dylan
      - copied, changed from r11774, trunk/fundev/sources/databases/odbc-ffi/sqlext.dylan
   trunk/fundev/sources/registry/generic/odbc-ffi   (contents, props changed)
Modified:
   trunk/fundev/sources/databases/odbc-ffi/constant.dylan
   trunk/fundev/sources/databases/odbc-ffi/odbc-library.dylan
   trunk/fundev/sources/databases/odbc-ffi/unix-odbc.lid
   trunk/fundev/sources/databases/sql-odbc/binding.dylan
   trunk/fundev/sources/databases/sql-odbc/conditions.dylan
Log:
job: fd

Make ODBC binding work on Unixen, support for LONGVARCHAR.

Modified: trunk/fundev/sources/databases/odbc-ffi/constant.dylan
==============================================================================
--- trunk/fundev/sources/databases/odbc-ffi/constant.dylan	(original)
+++ trunk/fundev/sources/databases/odbc-ffi/constant.dylan	Sat Apr 26 12:05:14 2008
@@ -90,6 +90,14 @@
 define constant $SQL-DOUBLE                         =    8;
 define constant $SQL-DATETIME                       =    9;
 define constant $SQL-VARCHAR                        =   12;
+define constant $SQL-LONGVARCHAR                    =   -1;
+define constant $SQL-BINARY                         =   -2;
+define constant $SQL-VARBINARY                      =   -3;
+define constant $SQL-LONGVARBINARY                  =   -4;
+define constant $SQL-BIGINT                         =   -5;
+define constant $SQL-TINYINT                        =   -6;
+define constant $SQL-BIT                            =   -7;
+
 define constant $SQL-TYPE-DATE                      =   91;
 define constant $SQL-TYPE-TIME                      =   92;
 define constant $SQL-TYPE-TIMESTAMP                 =   93;

Modified: trunk/fundev/sources/databases/odbc-ffi/odbc-library.dylan
==============================================================================
--- trunk/fundev/sources/databases/odbc-ffi/odbc-library.dylan	(original)
+++ trunk/fundev/sources/databases/odbc-ffi/odbc-library.dylan	Sat Apr 26 12:05:14 2008
@@ -126,7 +126,8 @@
         $SQL-DIAG-UPDATE-WHERE, $SQL-UNKNOWN-TYPE, $SQL-CHAR, $SQL-NUMERIC,
         $SQL-DECIMAL, $SQL-INTEGER, $SQL-SMALLINT, $SQL-FLOAT, $SQL-REAL,
         $SQL-DOUBLE, $SQL-DATETIME, $SQL-VARCHAR, $SQL-TYPE-DATE,
-        $SQL-TYPE-TIME, $SQL-TYPE-TIMESTAMP, $SQL-UNSPECIFIED,
+        $SQL-TYPE-TIME, $SQL-TYPE-TIMESTAMP, $SQL-LONGVARCHAR, $SQL-BINARY, 
+        $SQL-VARBINARY, $SQL-LONGVARBINARY, $SQL-BIGINT, $SQL-TINYINT, $SQL-BIT, $SQL-UNSPECIFIED,
         $SQL-INSENSITIVE, $SQL-SENSITIVE, $SQL-ALL-TYPES, $SQL-DEFAULT,
         $SQL-ARD-TYPE, $SQL-CODE-DATE, $SQL-CODE-TIME, $SQL-CODE-TIMESTAMP,
         $SQL-FALSE, $SQL-TRUE, $SQL-NO-NULLS, $SQL-NULLABLE,

Copied: trunk/fundev/sources/databases/odbc-ffi/sql-unix.dylan (from r11774, trunk/fundev/sources/databases/odbc-ffi/sql.dylan)
==============================================================================
--- trunk/fundev/sources/databases/odbc-ffi/sql.dylan	(original)
+++ trunk/fundev/sources/databases/odbc-ffi/sql-unix.dylan	Sat Apr 26 12:05:14 2008
@@ -15,13 +15,13 @@
   parameter EnvironmentHandle :: <SQLHENV>;
   output parameter ConnectionHandle :: <LPSQLHDBC>;
   result value :: <SQLRETURN>;
-  c-name: "SQLAllocConnect", c-modifiers: "__stdcall";
+  c-name: "SQLAllocConnect";
 end;

 define c-func-with-err SQLAllocEnv
   output parameter EnvironmentHandle :: <LPSQLHENV>;
   result value :: <SQLRETURN>;
-  c-name: "SQLAllocEnv", c-modifiers: "__stdcall";
+  c-name: "SQLAllocEnv";
 end;

 define c-func-with-err SQLAllocHandle
@@ -29,14 +29,14 @@
   parameter InputHandle :: <SQLHANDLE>;
   output parameter OutputHandle :: <LPSQLHANDLE>;
   result value :: <SQLRETURN>;
-  c-name: "SQLAllocHandle", c-modifiers: "__stdcall";
+  c-name: "SQLAllocHandle";
 end;

 define c-func-with-err SQLAllocStmt
   parameter ConnectionHandle :: <SQLHDBC>;
   output parameter StatementHandle :: <LPSQLHSTMT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLAllocStmt", c-modifiers: "__stdcall";
+  c-name: "SQLAllocStmt";
 end;

 define c-func-with-err SQLBindCol
@@ -47,7 +47,7 @@
   parameter BufferLength :: <SQLINTEGER>;
   parameter StrLen_or_Ind :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLBindCol", c-modifiers: "__stdcall";
+  c-name: "SQLBindCol";
 end;

 define c-func-with-err SQLBindParam
@@ -60,19 +60,19 @@
   parameter ParameterValue :: <SQLPOINTER>;
   parameter StrLen_or_Ind :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLBindParam", c-modifiers: "__stdcall";
+  c-name: "SQLBindParam";
 end;

 define c-func-with-err SQLCancel
   parameter StatementHandle :: <SQLHSTMT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLCancel", c-modifiers: "__stdcall";
+  c-name: "SQLCancel";
 end;

 define c-func-with-err SQLCloseCursor
   parameter StatementHandle :: <SQLHSTMT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLCloseCursor", c-modifiers: "__stdcall";
+  c-name: "SQLCloseCursor";
 end;

 define c-func-with-err SQLColAttribute
@@ -84,7 +84,7 @@
   output parameter StringLength :: <LPSQLSMALLINT>;
   parameter NumericAttribute :: <SQLPOINTER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLColAttribute", c-modifiers: "__stdcall";
+  c-name: "SQLColAttribute";
 end;

 define c-func-with-err SQLColumns
@@ -98,7 +98,7 @@
   parameter ColumnName :: <LPSQLCHAR>;
   parameter NameLength4 :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLColumns", c-modifiers: "__stdcall";
+  c-name: "SQLColumns";
 end;

 define c-func-with-err SQLConnect
@@ -110,14 +110,14 @@
   parameter Authentication :: <LPSQLCHAR>;
   parameter NameLength3 :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLConnect", c-modifiers: "__stdcall";
+  c-name: "SQLConnect";
 end;

 define c-func-with-err SQLCopyDesc
   parameter SourceDescHandle :: <SQLHDESC>;
   parameter TargetDescHandle :: <SQLHDESC>;
   result value :: <SQLRETURN>;
-  c-name: "SQLCopyDesc", c-modifiers: "__stdcall";
+  c-name: "SQLCopyDesc";
 end;

 define c-func-with-err SQLDataSources
@@ -130,7 +130,7 @@
   parameter BufferLength2 :: <SQLSMALLINT>;
   output parameter NameLength2 :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLDataSources", c-modifiers: "__stdcall";
+  c-name: "SQLDataSources";
 end;

 define c-func-with-err SQLDescribeCol
@@ -144,13 +144,13 @@
   output parameter DecimalDigits :: <LPSQLSMALLINT>;
   output parameter Nullable   :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLDescribeCol", c-modifiers: "__stdcall";
+  c-name: "SQLDescribeCol";
 end;

 define c-func-with-err SQLDisconnect
   parameter ConnectionHandle :: <SQLHDBC>;
   result value :: <SQLRETURN>;
-  c-name: "SQLDisconnect", c-modifiers: "__stdcall";
+  c-name: "SQLDisconnect";
 end;

 define c-func-with-err SQLEndTran
@@ -158,7 +158,7 @@
   parameter Handle     :: <SQLHANDLE>;
   parameter CompletionType :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLEndTran", c-modifiers: "__stdcall";
+  c-name: "SQLEndTran";
 end;

 define C-function SQLError
@@ -171,7 +171,7 @@
   parameter BufferLength :: <SQLSMALLINT>;
   output parameter TextLength :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLError", c-modifiers: "__stdcall";
+  c-name: "SQLError";
 end;

 define c-func-with-err SQLExecDirect
@@ -179,19 +179,19 @@
   parameter StatementText :: <LPSQLCHAR>;
   parameter TextLength :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLExecDirect", c-modifiers: "__stdcall";
+  c-name: "SQLExecDirect";
 end;

 define c-func-with-err SQLExecute
   parameter StatementHandle :: <SQLHSTMT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLExecute", c-modifiers: "__stdcall";
+  c-name: "SQLExecute";
 end;

 define c-func-with-err SQLFetch
   parameter StatementHandle :: <SQLHSTMT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLFetch", c-modifiers: "__stdcall";
+  c-name: "SQLFetch";
 end;

 define c-func-with-err SQLFetchScroll
@@ -199,33 +199,33 @@
   parameter FetchOrientation :: <SQLSMALLINT>;
   parameter FetchOffset :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLFetchScroll", c-modifiers: "__stdcall";
+  c-name: "SQLFetchScroll";
 end;

 define c-func-with-err SQLFreeConnect
   parameter ConnectionHandle :: <SQLHDBC>;
   result value :: <SQLRETURN>;
-  c-name: "SQLFreeConnect", c-modifiers: "__stdcall";
+  c-name: "SQLFreeConnect";
 end;

 define c-func-with-err SQLFreeEnv
   parameter EnvironmentHandle :: <SQLHENV>;
   result value :: <SQLRETURN>;
-  c-name: "SQLFreeEnv", c-modifiers: "__stdcall";
+  c-name: "SQLFreeEnv";
 end;

 define c-func-with-err SQLFreeHandle
   parameter HandleType :: <SQLSMALLINT>;
   parameter Handle     :: <SQLHANDLE>;
   result value :: <SQLRETURN>;
-  c-name: "SQLFreeHandle", c-modifiers: "__stdcall";
+  c-name: "SQLFreeHandle";
 end;

 define c-func-with-err SQLFreeStmt
   parameter StatementHandle :: <SQLHSTMT>;
   parameter Option     :: <SQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLFreeStmt", c-modifiers: "__stdcall";
+  c-name: "SQLFreeStmt";
 end;

 define c-func-with-err SQLGetConnectAttr
@@ -235,7 +235,7 @@
   parameter BufferLength :: <SQLINTEGER>;
   output parameter StringLength :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetConnectAttr", c-modifiers: "__stdcall";
+  c-name: "SQLGetConnectAttr";
 end;

 define c-func-with-err SQLGetConnectOption
@@ -243,7 +243,7 @@
   parameter Option     :: <SQLUSMALLINT>;
   parameter Value      :: <SQLPOINTER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetConnectOption", c-modifiers: "__stdcall";
+  c-name: "SQLGetConnectOption";
 end;

 define c-func-with-err SQLGetCursorName
@@ -252,7 +252,7 @@
   parameter BufferLength :: <SQLSMALLINT>;
   output parameter NameLength :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetCursorName", c-modifiers: "__stdcall";
+  c-name: "SQLGetCursorName";
 end;

 define c-func-with-err SQLGetData
@@ -263,7 +263,7 @@
   parameter BufferLength :: <SQLINTEGER>;
   output parameter StrLen_or_Ind :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetData", c-modifiers: "__stdcall";
+  c-name: "SQLGetData";
 end;

 define c-func-with-err SQLGetDescField
@@ -274,7 +274,7 @@
   parameter BufferLength :: <SQLINTEGER>;
   output parameter StringLength :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetDescField", c-modifiers: "__stdcall";
+  c-name: "SQLGetDescField";
 end;

 define c-func-with-err SQLGetDescRec
@@ -290,7 +290,7 @@
   output parameter Scale      :: <LPSQLSMALLINT>;
   output parameter Nullable   :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetDescRec", c-modifiers: "__stdcall";
+  c-name: "SQLGetDescRec";
 end;

 define c-func-with-err SQLGetDiagField
@@ -302,7 +302,7 @@
   parameter BufferLength :: <SQLSMALLINT>;
   output parameter StringLength :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetDiagField", c-modifiers: "__stdcall";
+  c-name: "SQLGetDiagField";
 end;

 define c-func-with-err SQLGetDiagRec
@@ -315,7 +315,7 @@
   parameter BufferLength :: <SQLSMALLINT>;
   output parameter TextLength :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetDiagRec", c-modifiers: "__stdcall";
+  c-name: "SQLGetDiagRec";
 end;

 define c-func-with-err SQLGetEnvAttr
@@ -325,7 +325,7 @@
   parameter BufferLength :: <SQLINTEGER>;
   output parameter StringLength :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetEnvAttr", c-modifiers: "__stdcall";
+  c-name: "SQLGetEnvAttr";
 end;

 define c-func-with-err SQLGetFunctions
@@ -333,7 +333,7 @@
   parameter FunctionId :: <SQLUSMALLINT>;
   output parameter Supported  :: <LPSQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetFunctions", c-modifiers: "__stdcall";
+  c-name: "SQLGetFunctions";
 end;

 define c-func-with-err SQLGetInfo
@@ -343,7 +343,7 @@
   parameter BufferLength :: <SQLSMALLINT>;
   output parameter StringLength :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetInfo", c-modifiers: "__stdcall";
+  c-name: "SQLGetInfo";
 end;

 define c-func-with-err SQLGetStmtAttr
@@ -353,7 +353,7 @@
   parameter BufferLength :: <SQLINTEGER>;
   output parameter StringLength :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetStmtAttr", c-modifiers: "__stdcall";
+  c-name: "SQLGetStmtAttr";
 end;

 define c-func-with-err SQLGetStmtOption
@@ -361,28 +361,28 @@
   parameter Option     :: <SQLUSMALLINT>;
   parameter Value      :: <SQLPOINTER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetStmtOption", c-modifiers: "__stdcall";
+  c-name: "SQLGetStmtOption";
 end;

 define c-func-with-err SQLGetTypeInfo
   parameter StatementHandle :: <SQLHSTMT>;
   parameter DataType   :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLGetTypeInfo", c-modifiers: "__stdcall";
+  c-name: "SQLGetTypeInfo";
 end;

 define c-func-with-err SQLNumResultCols
   parameter StatementHandle :: <SQLHSTMT>;
   output parameter ColumnCount :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLNumResultCols", c-modifiers: "__stdcall";
+  c-name: "SQLNumResultCols";
 end;

 define c-func-with-err SQLParamData
   parameter StatementHandle :: <SQLHSTMT>;
   parameter Value      :: <LPSQLPOINTER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLParamData", c-modifiers: "__stdcall";
+  c-name: "SQLParamData";
 end;

 define c-func-with-err SQLPrepare
@@ -390,7 +390,7 @@
   parameter StatementText :: <LPSQLCHAR>;
   parameter TextLength :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLPrepare", c-modifiers: "__stdcall";
+  c-name: "SQLPrepare";
 end;

 define c-func-with-err SQLPutData
@@ -398,14 +398,14 @@
   parameter Data       :: <SQLPOINTER>;
   parameter StrLen_or_Ind :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLPutData", c-modifiers: "__stdcall";
+  c-name: "SQLPutData";
 end;

 define c-func-with-err SQLRowCount
   parameter StatementHandle :: <SQLHSTMT>;
   output parameter RowCount   :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLRowCount", c-modifiers: "__stdcall";
+  c-name: "SQLRowCount";
 end;

 define c-func-with-err SQLSetConnectAttr
@@ -414,7 +414,7 @@
   parameter Value      :: <SQLUINTEGER>; // is this going to work for strings?
   parameter StringLength :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetConnectAttr", c-modifiers: "__stdcall";
+  c-name: "SQLSetConnectAttr";
 end;

 define c-func-with-err SQLSetConnectOption
@@ -422,7 +422,7 @@
   parameter Option     :: <SQLUSMALLINT>;
   parameter Value      :: <SQLUINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetConnectOption", c-modifiers: "__stdcall";
+  c-name: "SQLSetConnectOption";
 end;

 define c-func-with-err SQLSetCursorName
@@ -430,7 +430,7 @@
   parameter CursorName :: <LPSQLCHAR>;
   parameter NameLength :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetCursorName", c-modifiers: "__stdcall";
+  c-name: "SQLSetCursorName";
 end;

 define c-func-with-err SQLSetDescField
@@ -440,7 +440,7 @@
   parameter Value      :: <SQLPOINTER>;
   parameter BufferLength :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetDescField", c-modifiers: "__stdcall";
+  c-name: "SQLSetDescField";
 end;

 define c-func-with-err SQLSetDescRec
@@ -455,7 +455,7 @@
   parameter StringLength :: <LPSQLINTEGER>;
   parameter Indicator  :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetDescRec", c-modifiers: "__stdcall";
+  c-name: "SQLSetDescRec";
 end;

 define c-func-with-err SQLSetEnvAttr
@@ -464,7 +464,7 @@
   parameter Value      :: <SQLINTEGER>; //was sqlpointer
   parameter StringLength :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetEnvAttr", c-modifiers: "__stdcall";
+  c-name: "SQLSetEnvAttr";
 end;

 define c-func-with-err SQLSetParam
@@ -477,7 +477,7 @@
   parameter ParameterValue :: <SQLPOINTER>;
   parameter StrLen_or_Ind :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetParam", c-modifiers: "__stdcall";
+  c-name: "SQLSetParam";
 end;

 define c-func-with-err SQLSetStmtAttr
@@ -486,7 +486,7 @@
   parameter Value      :: <SQLPOINTER>;
   parameter StringLength :: <SQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetStmtAttr", c-modifiers: "__stdcall";
+  c-name: "SQLSetStmtAttr";
 end;

 define c-func-with-err SQLSetStmtOption
@@ -494,7 +494,7 @@
   parameter Option     :: <SQLUSMALLINT>;
   parameter Value      :: <SQLUINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetStmtOption", c-modifiers: "__stdcall";
+  c-name: "SQLSetStmtOption";
 end;

 define c-func-with-err SQLSpecialColumns
@@ -509,7 +509,7 @@
   parameter Scope      :: <SQLUSMALLINT>;
   parameter Nullable   :: <SQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSpecialColumns", c-modifiers: "__stdcall";
+  c-name: "SQLSpecialColumns";
 end;

 define c-func-with-err SQLStatistics
@@ -523,7 +523,7 @@
   parameter Unique     :: <SQLUSMALLINT>;
   parameter Reserved   :: <SQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLStatistics", c-modifiers: "__stdcall";
+  c-name: "SQLStatistics";
 end;

 define c-func-with-err SQLTables
@@ -537,7 +537,7 @@
   parameter TableType  :: <LPSQLCHAR>;
   parameter NameLength4 :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLTables", c-modifiers: "__stdcall";
+  c-name: "SQLTables";
 end;

 define c-func-with-err SQLTransact
@@ -545,6 +545,6 @@
   parameter ConnectionHandle :: <SQLHDBC>;
   parameter CompletionType :: <SQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLTransact", c-modifiers: "__stdcall";
+  c-name: "SQLTransact";
 end;

Copied: trunk/fundev/sources/databases/odbc-ffi/sqlext-unix.dylan (from r11774, trunk/fundev/sources/databases/odbc-ffi/sqlext.dylan)
==============================================================================
--- trunk/fundev/sources/databases/odbc-ffi/sqlext.dylan	(original)
+++ trunk/fundev/sources/databases/odbc-ffi/sqlext-unix.dylan	Sat Apr 26 12:05:14 2008
@@ -21,7 +21,7 @@
   output parameter pcbConnStrOut :: <LPSQLSMALLINT>;
   parameter fDriverCompletion :: <SQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLDriverConnect", c-modifiers: "__stdcall";
+  c-name: "SQLDriverConnect";
 end;

 define c-func-with-err SQLBrowseConnect
@@ -32,14 +32,14 @@
   parameter cbConnStrOutMax :: <SQLSMALLINT>;
   output parameter pcbConnStrOut :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLBrowseConnect", c-modifiers: "__stdcall";
+  c-name: "SQLBrowseConnect";
 end;

 define c-func-with-err SQLBulkOperations
   parameter StatementHandle :: <SQLHSTMT>;
   parameter Operation  :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLBulkOperations", c-modifiers: "__stdcall";
+  c-name: "SQLBulkOperations";
 end;

 define c-func-with-err SQLColAttributes
@@ -51,7 +51,7 @@
   output parameter pcbDesc    :: <LPSQLSMALLINT>;
   output parameter pfDesc     :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLColAttributes", c-modifiers: "__stdcall";
+  c-name: "SQLColAttributes";
 end;

 define c-func-with-err SQLColumnPrivileges
@@ -65,7 +65,7 @@
   parameter szColumnName :: <LPSQLCHAR>;
   parameter cbColumnName :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLColumnPrivileges", c-modifiers: "__stdcall";
+  c-name: "SQLColumnPrivileges";
 end;

 define c-func-with-err SQLDescribeParam
@@ -76,7 +76,7 @@
   output parameter pibScale   :: <LPSQLSMALLINT>;
   output parameter pfNullable :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLDescribeParam", c-modifiers: "__stdcall";
+  c-name: "SQLDescribeParam";
 end;

 define c-func-with-err SQLExtendedFetch
@@ -86,7 +86,7 @@
   output parameter pcrow      :: <LPSQLUINTEGER>;
   output parameter rgfRowStatus :: <LPSQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLExtendedFetch", c-modifiers: "__stdcall";
+  c-name: "SQLExtendedFetch";
 end;

 define c-func-with-err SQLForeignKeys
@@ -104,13 +104,13 @@
   parameter szFkTableName :: <LPSQLCHAR>;
   parameter cbFkTableName :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLForeignKeys", c-modifiers: "__stdcall";
+  c-name: "SQLForeignKeys";
 end;

 define c-func-with-err SQLMoreResults
   parameter hstmt      :: <SQLHSTMT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLMoreResults", c-modifiers: "__stdcall";
+  c-name: "SQLMoreResults";
 end;

 define c-func-with-err SQLNativeSql
@@ -121,14 +121,14 @@
   parameter cbSqlStrMax :: <SQLINTEGER>;
   output parameter pcbSqlStr  :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLNativeSql", c-modifiers: "__stdcall";
+  c-name: "SQLNativeSql";
 end;

 define c-func-with-err SQLNumParams
   parameter hstmt      :: <SQLHSTMT>;
   output parameter pcpar      :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLNumParams", c-modifiers: "__stdcall";
+  c-name: "SQLNumParams";
 end;

 define c-func-with-err SQLParamOptions
@@ -136,7 +136,7 @@
   parameter crow       :: <SQLUINTEGER>;
   output parameter pirow      :: <LPSQLUINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLParamOptions", c-modifiers: "__stdcall";
+  c-name: "SQLParamOptions";
 end;

 define c-func-with-err SQLPrimaryKeys
@@ -148,7 +148,7 @@
   parameter szTableName :: <LPSQLCHAR>;
   parameter cbTableName :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLPrimaryKeys", c-modifiers: "__stdcall";
+  c-name: "SQLPrimaryKeys";
 end;

 define c-func-with-err SQLProcedureColumns
@@ -162,7 +162,7 @@
   parameter szColumnName :: <LPSQLCHAR>;
   parameter cbColumnName :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLProcedureColumns", c-modifiers: "__stdcall";
+  c-name: "SQLProcedureColumns";
 end;

 define c-func-with-err SQLProcedures
@@ -174,7 +174,7 @@
   parameter szProcName :: <LPSQLCHAR>;
   parameter cbProcName :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLProcedures", c-modifiers: "__stdcall";
+  c-name: "SQLProcedures";
 end;

 define c-func-with-err SQLSetPos
@@ -183,7 +183,7 @@
   parameter fOption    :: <SQLUSMALLINT>;
   parameter fLock      :: <SQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetPos", c-modifiers: "__stdcall";
+  c-name: "SQLSetPos";
 end;

 define c-func-with-err SQLTablePrivileges
@@ -195,7 +195,7 @@
   parameter szTableName :: <LPSQLCHAR>;
   parameter cbTableName :: <SQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLTablePrivileges", c-modifiers: "__stdcall";
+  c-name: "SQLTablePrivileges";
 end;

 define c-func-with-err SQLDrivers
@@ -208,7 +208,7 @@
   parameter cbDrvrAttrMax :: <SQLSMALLINT>;
   output parameter pcbDrvrAttr :: <LPSQLSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLDrivers", c-modifiers: "__stdcall";
+  c-name: "SQLDrivers";
 end;

 define c-func-with-err SQLBindParameter
@@ -223,7 +223,7 @@
   parameter cbValueMax :: <SQLINTEGER>;
   parameter pcbValue   :: <LPSQLINTEGER>;
   result value :: <SQLRETURN>;
-  c-name: "SQLBindParameter", c-modifiers: "__stdcall";
+  c-name: "SQLBindParameter";
 end;

 define c-func-with-err SQLAllocHandleStd
@@ -231,7 +231,7 @@
   parameter hInput     :: <SQLHANDLE>;
   output parameter phOutput   :: <LPSQLHANDLE>;
   result value :: <SQLRETURN>;
-  c-name: "SQLAllocHandleStd", c-modifiers: "__stdcall";
+  c-name: "SQLAllocHandleStd";
 end;

 define c-func-with-err SQLSetScrollOptions
@@ -240,7 +240,7 @@
   parameter crowKeyset :: <SQLINTEGER>;
   parameter crowRowset :: <SQLUSMALLINT>;
   result value :: <SQLRETURN>;
-  c-name: "SQLSetScrollOptions", c-modifiers: "__stdcall";
+  c-name: "SQLSetScrollOptions";
 end;

 /*  This junk is undocumented and uses types I don't know about.  I'm
@@ -251,23 +251,23 @@
   parameter lpwstr2    :: <LPWSTR>;
   parameter dword3     :: <DWORD>;
   result value :: <RETCODE>;
-  c-name: "TraceOpenLogFile", c-modifiers: "__stdcall";
+  c-name: "TraceOpenLogFile";
 end;

 define c-func-with-err TraceCloseLogFile
   result value :: <RETCODE>;
-  c-name: "TraceCloseLogFile", c-modifiers: "__stdcall";
+  c-name: "TraceCloseLogFile";
 end;

 define c-func-with-err TraceReturn
   parameter retcode1   :: <RETCODE>;
   parameter retcode2   :: <RETCODE>;
-  c-name: "TraceReturn", c-modifiers: "__stdcall";
+  c-name: "TraceReturn";
 end;

 define c-func-with-err TraceVersion
   result value :: <DWORD>;
-  c-name: "TraceVersion", c-modifiers: "__stdcall";
+  c-name: "TraceVersion";
 end;

 */
\ No newline at end of file

Modified: trunk/fundev/sources/databases/odbc-ffi/unix-odbc.lid
==============================================================================
--- trunk/fundev/sources/databases/odbc-ffi/unix-odbc.lid	(original)
+++ trunk/fundev/sources/databases/odbc-ffi/unix-odbc.lid	Sat Apr 26 12:05:14 2008
@@ -2,13 +2,13 @@
 Major-Version:  2
 Minor-Version:  1
 Library-Pack:   ODBC
-Linker-Options: -lodbc -liodbcinst
+Linker-Options: -lodbc -lodbcinst
 Files:  odbc-library
         macros
         constant
         sqltypes
-        sql
-        sqlext
+        sql-unix
+        sqlext-unix
 Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
               All rights reserved.
 License:      Functional Objects Library Public License Version 1.0

Modified: trunk/fundev/sources/databases/sql-odbc/binding.dylan
==============================================================================
--- trunk/fundev/sources/databases/sql-odbc/binding.dylan	(original)
+++ trunk/fundev/sources/databases/sql-odbc/binding.dylan	Sat Apr 26 12:05:14 2008
@@ -102,7 +102,7 @@
   signal(make(<simple-warning>, 
          format-string: "Binding to column whose datatype (%=) is not supported\n"
                         "Using instance of <sql-unsupported-type> instead.\n",
-         format-arguments: sql-data-type)); 
+         format-arguments: list(sql-data-type))); 
   values($sql-unsupported-type, null-pointer(<c-int*>), 0, 0);
 end method;

@@ -399,6 +399,26 @@
   values($sql-c-char, storage, storage-size, precision);
 end method;

+define method create-storage(sql-data-type == $sql-longvarchar,
+			     precision :: <integer>,
+			     scale :: <integer>,
+			     #key initial-value :: false-or(<string>))
+ => (c-data-type :: <object>,
+     storage :: <object>, 
+     storage-size :: <integer>,
+     data-size :: <integer>)
+  // string size includes the null termination byte which ODBC appends
+  let storage-size = precision + 1;
+  let storage = make(<C-string>, size: storage-size);
+  if (initial-value ~= #f)
+    for (ndx from 0 to min(initial-value.size, storage-size) - 1)
+      pointer-value(storage, index: ndx) := initial-value[ndx];
+    end for;
+  end if;
+
+  values($sql-c-char, storage, storage-size, precision);
+end method;
+

 
 define sealed concrete class <binding> (<object>)

Modified: trunk/fundev/sources/databases/sql-odbc/conditions.dylan
==============================================================================
--- trunk/fundev/sources/databases/sql-odbc/conditions.dylan	(original)
+++ trunk/fundev/sources/databases/sql-odbc/conditions.dylan	Sat Apr 26 12:05:14 2008
@@ -48,7 +48,7 @@
             if (return-code = $sql-invalid-handle)
               error("Assert-odbc-goodness: invalid ODBC handle.");
             else
-              error("Assert-odbc-goodness: error in acquiring sqlstate.");
+              error("Assert-odbc-goodness: error in acquiring sqlstate: %=", return-code);
             end if;
           end if;
         end method;

Added: trunk/fundev/sources/registry/generic/odbc-ffi
==============================================================================
--- (empty file)
+++ trunk/fundev/sources/registry/generic/odbc-ffi	Sat Apr 26 12:05:14 2008
@@ -0,0 +1,2 @@
+abstract://dylan/databases/odbc-ffi/unix-odbc.lid
+
_______________________________________________
chatter mailing list
chatter <at> lists.opendylan.org
https://www.opendylan.org/mailman/listinfo/chatter


Gmane