Update of /cvsroot/htoolkit/HSQL/src/HSQL
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8632/src/HSQL
Modified Files:
MySQL.hsc
Added Files:
HsMySQL.h
Log Message:
Added support for MySQL under Windows
--- NEW FILE: HsMySQL.h ---
#ifndef HsMySQL
#define HsMySQL
#if defined(_WIN32_)
#include <windows.h>
#endif
#include <mysql.h>
#endif
Index: MySQL.hsc
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/src/HSQL/MySQL.hsc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MySQL.hsc 10 Feb 2004 11:30:52 -0000 1.4
--- MySQL.hsc 9 Apr 2004 20:24:05 -0000 1.5
***************
*** 31,35 ****
import Text.Read
! #include <mysql.h>
type MYSQL = Ptr ()
--- 31,36 ----
import Text.Read
! #include <windows.h>
! #include <HsMySQL.h>
type MYSQL = Ptr ()
***************
*** 39,58 ****
type MYSQL_LENGTHS = Ptr CULong
! foreign import ccall "mysql.h mysql_init" mysql_init :: MYSQL -> IO MYSQL
! foreign import ccall "mysql.h mysql_real_connect" mysql_real_connect :: MYSQL -> CString -> CString -> CString -> CString -> Int -> CString -> Int -> IO MYSQL
! foreign import ccall "mysql.h mysql_close" mysql_close :: MYSQL -> IO ()
! foreign import ccall "mysql.h mysql_errno" mysql_errno :: MYSQL -> IO Int
! foreign import ccall "mysql.h mysql_error" mysql_error :: MYSQL -> IO CString
! foreign import ccall "mysql.h mysql_query" mysql_query :: MYSQL -> CString -> IO Int
! foreign import ccall "mysql.h mysql_use_result" mysql_use_result :: MYSQL -> IO MYSQL_RES
! foreign import ccall "mysql.h mysql_fetch_field" mysql_fetch_field :: MYSQL_RES -> IO MYSQL_FIELD
! foreign import ccall "mysql.h mysql_free_result" mysql_free_result :: MYSQL_RES -> IO ()
! foreign import ccall "mysql.h mysql_fetch_row" mysql_fetch_row :: MYSQL_RES -> IO MYSQL_ROW
! foreign import ccall "mysql.h mysql_fetch_lengths" mysql_fetch_lengths :: MYSQL_RES -> IO MYSQL_LENGTHS
! foreign import ccall "mysql.h mysql_list_tables" mysql_list_tables :: MYSQL -> CString -> IO MYSQL_RES
! foreign import ccall "mysql.h mysql_list_fields" mysql_list_fields :: MYSQL -> CString -> CString -> IO MYSQL_RES
! foreign import ccall "stdlib.h atoi" c_atoi :: CString -> IO Int
! foreign import ccall "stdlib.h strtoll" c_strtoll :: CString -> Ptr CString -> Int -> IO Int64
-----------------------------------------------------------------------------------------
--- 40,62 ----
type MYSQL_LENGTHS = Ptr CULong
! #if defined(_WIN32_)
! #let CALLCONV = "stdcall"
! #else
! #let CALLCONV = "ccall"
! #endif
! foreign import #{CALLCONV} "HsMySQL.h mysql_init" mysql_init :: MYSQL -> IO MYSQL
! foreign import #{CALLCONV} "HsMySQL.h mysql_real_connect" mysql_real_connect :: MYSQL -> CString -> CString -> CString -> CString -> Int -> CString -> Int -> IO MYSQL
! foreign import #{CALLCONV} "HsMySQL.h mysql_close" mysql_close :: MYSQL -> IO ()
! foreign import #{CALLCONV} "HsMySQL.h mysql_errno" mysql_errno :: MYSQL -> IO Int
! foreign import #{CALLCONV} "HsMySQL.h mysql_error" mysql_error :: MYSQL -> IO CString
! foreign import #{CALLCONV} "HsMySQL.h mysql_query" mysql_query :: MYSQL -> CString -> IO Int
! foreign import #{CALLCONV} "HsMySQL.h mysql_use_result" mysql_use_result :: MYSQL -> IO MYSQL_RES
! foreign import #{CALLCONV} "HsMySQL.h mysql_fetch_field" mysql_fetch_field :: MYSQL_RES -> IO MYSQL_FIELD
! foreign import #{CALLCONV} "HsMySQL.h mysql_free_result" mysql_free_result :: MYSQL_RES -> IO ()
! foreign import #{CALLCONV} "HsMySQL.h mysql_fetch_row" mysql_fetch_row :: MYSQL_RES -> IO MYSQL_ROW
! foreign import #{CALLCONV} "HsMySQL.h mysql_fetch_lengths" mysql_fetch_lengths :: MYSQL_RES -> IO MYSQL_LENGTHS
! foreign import #{CALLCONV} "HsMySQL.h mysql_list_tables" mysql_list_tables :: MYSQL -> CString -> IO MYSQL_RES
! foreign import #{CALLCONV} "HsMySQL.h mysql_list_fields" mysql_list_fields :: MYSQL -> CString -> CString -> IO MYSQL_RES
-----------------------------------------------------------------------------------------
|