[Gd-chatter] r11439 - in trunk/libraries/database: . odbc-ffi odbc-ffi/docs
agent at gwydiondylan.org
agent at gwydiondylan.org
Tue Sep 4 11:18:21 CEST 2007
Author: agent
Date: Tue Sep 4 11:18:21 2007
New Revision: 11439
Added:
trunk/libraries/database/
trunk/libraries/database/odbc-ffi/
trunk/libraries/database/odbc-ffi/Makefile (contents, props changed)
trunk/libraries/database/odbc-ffi/README (contents, props changed)
trunk/libraries/database/odbc-ffi/docs/
trunk/libraries/database/odbc-ffi/docs/html.zip (contents, props changed)
trunk/libraries/database/odbc-ffi/docs/html_source.zip (contents, props changed)
trunk/libraries/database/odbc-ffi/library.dylan (contents, props changed)
trunk/libraries/database/odbc-ffi/module-odbc-ffi.dylan (contents, props changed)
trunk/libraries/database/odbc-ffi/odbc-ffi-consts.dylan (contents, props changed)
trunk/libraries/database/odbc-ffi/odbc-ffi.intr (contents, props changed)
trunk/libraries/database/odbc-ffi/odbc-ffi.lid (contents, props changed)
Log:
Job: gd
Added Gwydion Dylan version of ODBC-FFI library.
Added: trunk/libraries/database/odbc-ffi/Makefile
==============================================================================
--- (empty file)
+++ trunk/libraries/database/odbc-ffi/Makefile Tue Sep 4 11:18:21 2007
@@ -0,0 +1,13 @@
+MODULES = module-odbc-ffi.dylan \
+ module-odbc-ffi-melange.dylan
+
+odbc-ffi.lib.du: odbc-ffi.lid $(MODULES)
+ d2c odbc-ffi.lid
+
+module-odbc-ffi-melange.dylan: odbc-ffi.intr
+ melange --d2c -m $@ $? odbc-ffi-melange.dylan
+
+clean:
+ -rm -f *.o *.s *.a *.c *.mak *.el *~ odbc-ffi.lib.du
+ -rm -rf .libs
+ -rm -f *-melange.dylan
Added: trunk/libraries/database/odbc-ffi/README
==============================================================================
--- (empty file)
+++ trunk/libraries/database/odbc-ffi/README Tue Sep 4 11:18:21 2007
@@ -0,0 +1,14 @@
+This is the Gwydion Dylan version of Open Dylan's ODBC-FFI library. It uses
+the following C libraries and header files:
+
+ - libodbc.a
+ - libiodbcinst.a
+ - sql.h
+ - sqlext.h
+ - sqltypes.h
+ - iodbcext.h
+
+Documentation is included in the docs/html.zip file. The html_source.zip file
+contains NaturalDocs files which comprised the HTML files.
+
+-- Dustin Voss, 2007.
Added: trunk/libraries/database/odbc-ffi/docs/html.zip
==============================================================================
Binary file. No diff available.
Added: trunk/libraries/database/odbc-ffi/docs/html_source.zip
==============================================================================
Binary file. No diff available.
Added: trunk/libraries/database/odbc-ffi/library.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/database/odbc-ffi/library.dylan Tue Sep 4 11:18:21 2007
@@ -0,0 +1,11 @@
+module: dylan-user
+author: Dustin Voss
+synopsis: The declaration for the ODBC library. The modules are declared in
+ the module*.dylan files.
+
+define library odbc-ffi
+ use dylan, import: { dylan, extensions };
+ use melange-support, export: all;
+
+ export odbc-ffi;
+end library;
Added: trunk/libraries/database/odbc-ffi/module-odbc-ffi.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/database/odbc-ffi/module-odbc-ffi.dylan Tue Sep 4 11:18:21 2007
@@ -0,0 +1,20 @@
+module: dylan-user
+author: Dustin Voss
+synopsis: The C-FFI interface to the ODBC library, created by Melange and by
+ hand. This interface is very similar to Open Dylan's.
+
+define module odbc-ffi
+ use dylan;
+ use melange-support;
+ use odbc-ffi-melange, export: all;
+
+ export
+ $SQL-NULL-HANDLE,
+ $SQL-NULL-HDBC,
+ $SQL-NULL-HDESC,
+ $SQL-NULL-HENV,
+ $SQL-NULL-HSTMT,
+ <intval>
+end module;
+
+
\ No newline at end of file
Added: trunk/libraries/database/odbc-ffi/odbc-ffi-consts.dylan
==============================================================================
--- (empty file)
+++ trunk/libraries/database/odbc-ffi/odbc-ffi-consts.dylan Tue Sep 4 11:18:21 2007
@@ -0,0 +1,11 @@
+module: odbc-ffi
+author: Dustin Voss
+synopsis: Melange doesn't handle these types properly, so I did them by hand.
+
+define constant $SQL-NULL-HENV = as(<SQLHANDLE>, 0);
+define constant $SQL-NULL-HDBC = as(<SQLHANDLE>, 0);
+define constant $SQL-NULL-HSTMT = as(<SQLHANDLE>, 0);
+define constant $SQL-NULL-HDESC = as(<SQLHANDLE>, 0);
+define constant $SQL-NULL-HANDLE = as(<SQLHANDLE>, 0);
+
+define constant <intval> = <anonymous-379>; /* SQL_INTERVAL_STRUCT.intval */
Added: trunk/libraries/database/odbc-ffi/odbc-ffi.intr
==============================================================================
--- (empty file)
+++ trunk/libraries/database/odbc-ffi/odbc-ffi.intr Tue Sep 4 11:18:21 2007
@@ -0,0 +1,102 @@
+module: odbc-ffi-melange
+author: Dustin Voss
+synopsis: The Melange interface declaration for the ODBC library.
+
+define interface
+ #include { "sql.h", "sqlext.h", "iodbcext.h", "sqltypes.h" },
+ define: { "STRICT_ODBC_TYPES" },
+
+ // See odbc-ffi-consts.dylan.
+ exclude: { "SQL_NULL_HENV", "SQL_NULL_HDBC", "SQL_NULL_HSTMT",
+ "SQL_NULL_HDESC", "SQL_NULL_HANDLE" },
+
+ // Melange tries to give these names like <SQL-INTERVAL$SQLINTERVAL>,
+ // so name them explicitly.
+ rename: { "SQLSMALLINT" => <SQLSMALLINT>,
+ "SQLINTERVAL" => <SQLINTERVAL> },
+
+ map: { "SQLCHAR *" => <c-string> },
+ seal-functions: sealed;
+
+ struct "struct tagDATE_STRUCT",
+ name-mapper: minimal-name-mapping,
+ rename: { "year" => year-value,
+ "month" => month-value,
+ "day" => day-value };
+
+ struct "struct tagTIME_STRUCT",
+ name-mapper: minimal-name-mapping,
+ rename: { "hour" => hour-value,
+ "minute" => minute-value,
+ "second" => second-value };
+
+ struct "struct tagTIMESTAMP_STRUCT",
+ name-mapper: minimal-name-mapping,
+ rename: { "year" => year-value,
+ "month" => month-value,
+ "day" => day-value,
+ "hour" => hour-value,
+ "minute" => minute-value,
+ "second" => second-value,
+ "fraction" => fraction-value };
+
+ struct "struct tagSQL_YEAR_MONTH",
+ name-mapper: minimal-name-mapping,
+ rename: { "year" => year-value,
+ "month" => month-value };
+
+ struct "struct tagSQL_DAY_SECOND",
+ name-mapper: minimal-name-mapping,
+ rename: { "day" => day-value,
+ "hour" => hour-value,
+ "minute" => minute-value,
+ "second" => second-value,
+ "fraction" => fraction-value };
+
+ struct "struct tagSQL_INTERVAL_STRUCT",
+ name-mapper: minimal-name-mapping,
+ rename: { "interval_type" => interval-type-value,
+ "interval_sign" => interval-sign-value,
+ "intval" => intval-value };
+
+ struct "struct tagSQL_NUMERIC_STRUCT",
+ name-mapper: minimal-name-mapping,
+ rename: { "precision" => precision-value,
+ "scale" => scale-value,
+ "sign" => sign-value,
+ "val" => val-array };
+
+ struct "struct tagSQLGUID",
+ name-mapper: minimal-name-mapping,
+ rename: { "Data1" => data1-value,
+ "Data2" => data2-value,
+ "Data3" => data3-value,
+ "Data4" => data4-array };
+
+ function "SQLAllocConnect", output-argument:2;
+ function "SQLAllocEnv", output-argument:1;
+ function "SQLAllocHandle", output-argument:3;
+ function "SQLAllocStmt", output-argument:2;
+ function "SQLColAttribute", output-argument:6;
+ function "SQLDataSources", output-argument:5, output-argument:8;
+ function "SQLDescribeCol",
+ output-argument:5, output-argument:6, output-argument:7,
+ output-argument:8, output-argument:9;
+ function "SQLError", output-argument:5, output-argument:8;
+ function "SQLGetConnectAttr", output-argument:5;
+ function "SQLGetCursorName", output-argument:4;
+ function "SQLGetData", output-argument:6;
+ function "SQLGetDescField", output-argument:6;
+ function "SQLGetDescRec",
+ output-argument:5, output-argument:6, output-argument:7,
+ output-argument:8, output-argument:9, output-argument:10,
+ output-argument:11;
+ function "SQLGetDiagField", output-argument:7;
+ function "SQLGetDiagRec", output-argument:5, output-argument:8;
+ function "SQLGetEnvAttr", output-argument:5;
+ function "SQLGetFunctions", output-argument:3;
+ function "SQLGetInfo", output-argument:5;
+ function "SQLGetStmtAttr", output-argument:5;
+ function "SQLNumResultCols", output-argument:2;
+ function "SQLRowCount", output-argument:2;
+end interface;
Added: trunk/libraries/database/odbc-ffi/odbc-ffi.lid
==============================================================================
--- (empty file)
+++ trunk/libraries/database/odbc-ffi/odbc-ffi.lid Tue Sep 4 11:18:21 2007
@@ -0,0 +1,8 @@
+library: odbc-ffi
+linker-options: -lodbc -liodbcinst
+files: library
+ module-odbc-ffi-melange
+ module-odbc-ffi
+ odbc-ffi-melange
+ odbc-ffi-consts
+
\ No newline at end of file
More information about the chatter
mailing list