| 
      
      
      From: <kr_...@us...> - 2003-09-05 11:38:00
      
     | 
| Update of /cvsroot/htoolkit/HSQL/src/ODBC In directory sc8-pr-cvs1:/tmp/cvs-serv12029/src/ODBC Modified Files: HSQL.hsc Log Message: Basic build system for HSQL Index: HSQL.hsc =================================================================== RCS file: /cvsroot/htoolkit/HSQL/src/ODBC/HSQL.hsc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HSQL.hsc 24 Jan 2003 00:08:58 -0000 1.1 --- HSQL.hsc 5 Sep 2003 11:37:56 -0000 1.2 *************** *** 21,27 **** , forEachRow' -- :: (Statement -> IO ()) -> Statement -> IO () , collectRows -- :: (Statement -> IO s) -> Statement -> IO [s] - #ifdef ENABLED_GUI - , fillitems -- :: HasItems w => Connection -> String -> Config (w Int) - #endif ) where --- 21,24 ---- *************** *** 36,43 **** import System.IO.Unsafe import System.Time - #ifdef ENABLED_GUI - import Graphics.UI.HGUI.BasicTypes - import Graphics.UI.HGUI.BasicClasses - #endif #include <time.h> --- 33,36 ---- *************** *** 59,63 **** foreign import stdcall "sqlext.h SQLAllocEnv" sqlAllocEnv :: Ptr HENV -> IO SQLRETURN ! foreign import stdcall "sqlext.h SQLFreeEnv" sqlFreeEnv :: HENV -> IO SQLRETURN foreign import stdcall "sqlext.h SQLAllocConnect" sqlAllocConnect :: HENV -> Ptr HDBC -> IO SQLRETURN foreign import stdcall "sqlext.h SQLFreeConnect" sqlFreeConnect:: HDBC -> IO SQLRETURN --- 52,56 ---- foreign import stdcall "sqlext.h SQLAllocEnv" sqlAllocEnv :: Ptr HENV -> IO SQLRETURN ! foreign import stdcall "sqlext.h &SQLFreeEnv" sqlFreeEnv :: FunPtr (HENV -> IO ()) foreign import stdcall "sqlext.h SQLAllocConnect" sqlAllocConnect :: HENV -> Ptr HDBC -> IO SQLRETURN foreign import stdcall "sqlext.h SQLFreeConnect" sqlFreeConnect:: HDBC -> IO SQLRETURN *************** *** 183,190 **** free phEnv handleSqlResult 0 nullPtr res ! newForeignPtr hEnv (closeEnvironment hEnv) ! where ! closeEnvironment :: HENV -> IO () ! closeEnvironment hEnv = sqlFreeEnv hEnv >>= handleSqlResult (#const SQL_HANDLE_ENV) hEnv ----------------------------------------------------------------------------------------- --- 176,180 ---- free phEnv handleSqlResult 0 nullPtr res ! newForeignPtr hEnv sqlFreeEnv ----------------------------------------------------------------------------------------- *************** *** 474,489 **** return (x:xs) else closeStatement stmt >> return [] - - ----------------------------------------------------------------------------------------- - -- fillitems - ----------------------------------------------------------------------------------------- - - #ifdef ENABLED_GUI - fillitems :: HasItems w => Connection -> String -> Config (w Int) - fillitems conn sqlExpr widget = query conn sqlExpr >>= forEachRow' addItemToWidget - where - addItemToWidget stmt = do - (id :: Int) <- getFieldValue stmt "id" - (title :: Title) <- getFieldValue stmt "Name" - addItem id title widget - #endif \ No newline at end of file --- 464,465 ---- |