From: <kr_...@us...> - 2003-09-06 22:48:49
|
Update of /cvsroot/htoolkit/HSQL/PostgreSQL In directory sc8-pr-cvs1:/tmp/cvs-serv11308/PostgreSQL Modified Files: HSQL.hsc Log Message: formatting Index: HSQL.hsc =================================================================== RCS file: /cvsroot/htoolkit/HSQL/PostgreSQL/HSQL.hsc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HSQL.hsc 6 Sep 2003 21:50:28 -0000 1.2 --- HSQL.hsc 6 Sep 2003 22:48:00 -0000 1.3 *************** *** 286,303 **** class SqlBind a where fromSqlValue :: SqlType -> String -> Maybe a ! toSqlValue :: a -> String instance SqlBind Int where ! fromSqlValue SqlInteger s = Just (read s) fromSqlValue SqlSmallInt s = Just (read s) ! fromSqlValue _ _ = Nothing toSqlValue s = show s instance SqlBind Integer where ! fromSqlValue SqlInteger s = Just (read s) fromSqlValue SqlSmallInt s = Just (read s) ! fromSqlValue SqlBigInt s = Just (read s) ! fromSqlValue _ _ = Nothing toSqlValue s = show s --- 286,303 ---- class SqlBind a where fromSqlValue :: SqlType -> String -> Maybe a ! toSqlValue :: a -> String instance SqlBind Int where ! fromSqlValue SqlInteger s = Just (read s) fromSqlValue SqlSmallInt s = Just (read s) ! fromSqlValue _ _ = Nothing toSqlValue s = show s instance SqlBind Integer where ! fromSqlValue SqlInteger s = Just (read s) fromSqlValue SqlSmallInt s = Just (read s) ! fromSqlValue SqlBigInt s = Just (read s) ! fromSqlValue _ _ = Nothing toSqlValue s = show s *************** *** 332,340 **** unsafePerformIO $ do allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do ! (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) ! (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) ! (#poke struct tm,tm_mday) p_tm (fromIntegral mday :: CInt) ! (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) --- 332,340 ---- unsafePerformIO $ do allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do ! (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) ! (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) ! (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) ! (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) *************** *** 358,362 **** getTime :: ReadP ClockTime getTime = do ! hour <- readS_to_P reads char ':' minutes <- readS_to_P reads --- 358,362 ---- getTime :: ReadP ClockTime getTime = do ! hour <- readS_to_P reads char ':' minutes <- readS_to_P reads *************** *** 370,374 **** getTime :: ReadP ClockTime getTime = do ! hour <- readS_to_P reads char ':' minutes <- readS_to_P reads --- 370,374 ---- getTime :: ReadP ClockTime getTime = do ! hour <- readS_to_P reads char ':' minutes <- readS_to_P reads *************** *** 381,389 **** getDate :: ReadP ClockTime getDate = do ! year <- readS_to_P reads satisfy (=='-') month <- readS_to_P reads ! satisfy (=='-') ! day <- readS_to_P reads return (mkClockTime year month day 0 0 0 currTZ) --- 381,389 ---- getDate :: ReadP ClockTime getDate = do ! year <- readS_to_P reads satisfy (=='-') month <- readS_to_P reads ! satisfy (=='-') ! day <- readS_to_P reads return (mkClockTime year month day 0 0 0 currTZ) *************** *** 392,407 **** getTimeStamp :: ReadP ClockTime getTimeStamp = do ! year <- readS_to_P reads satisfy (=='-') month <- readS_to_P reads ! satisfy (=='-') ! day <- readS_to_P reads skipSpaces ! hour <- readS_to_P reads ! satisfy (==':') minutes <- readS_to_P reads satisfy (==':') seconds <- readS_to_P reads ! tz <- parseTZ return (mkClockTime year month day hour minutes seconds (tz*3600)) --- 392,407 ---- getTimeStamp :: ReadP ClockTime getTimeStamp = do ! year <- readS_to_P reads satisfy (=='-') month <- readS_to_P reads ! satisfy (=='-') ! day <- readS_to_P reads skipSpaces ! hour <- readS_to_P reads ! satisfy (==':') minutes <- readS_to_P reads satisfy (==':') seconds <- readS_to_P reads ! tz <- parseTZ return (mkClockTime year month day hour minutes seconds (tz*3600)) *************** *** 581,585 **** findFieldInfo name (fieldDef@(name',sqlType):fields) colNumber | name == name' = (sqlType,colNumber) ! | otherwise = findFieldInfo name fields (colNumber+1) --- 581,585 ---- findFieldInfo name (fieldDef@(name',sqlType):fields) colNumber | name == name' = (sqlType,colNumber) ! | otherwise = findFieldInfo name fields (colNumber+1) |