[project @ 2000-04-13 23:03:12 by sewardj]
[ghc-hetmet.git] / ghc / lib / std / Time.lhs
index e5cf47d..ff8556a 100644 (file)
@@ -38,17 +38,21 @@ module Time
 #ifdef __HUGS__
 import PreludeBuiltin
 #else
-import PrelBase
-import PrelShow
-import PrelIOBase
-import PrelHandle
-import PrelArr
-import PrelST
-import PrelAddr
-import PrelNum
-import PrelPack        ( unpackCString, new_ps_array,
-                         freeze_ps_array, unpackCStringBA
+import PrelGHC         ( RealWorld, (>#), (<#), (==#),
+                         newIntArray#, readIntArray#, 
+                         unsafeFreezeByteArray#,
+                         int2Integer#, negateInt# )
+import PrelBase                ( Int(..) )
+import PrelNum         ( Integer(..), fromInt )
+import PrelIOBase      ( IO(..), unsafePerformIO, stToIO, constructErrorAndFail )
+import PrelShow                ( showList__ )
+import PrelPack        ( unpackCString, unpackCStringBA,
+                         new_ps_array, freeze_ps_array
                        )
+import PrelByteArr     ( MutableByteArray(..) )
+import PrelHandle      ( Bytes )
+import PrelAddr                ( Addr )
+
 #endif
 
 import Ix
@@ -83,7 +87,10 @@ external calendar time @CalendarTime@.
 -- In fact, I think one of Int32 or Word32 would do. - ADR
 data ClockTime = TOD Int64 Int64 deriving (Eq, Ord)
 #else
-data ClockTime = TOD Integer Integer deriving (Eq, Ord)
+data ClockTime = TOD Integer           -- Seconds since 00:00:00 on 1 Jan 1970
+                    Integer            -- Picoseconds with the specified second
+              deriving (Eq, Ord)
+               
 #endif
 \end{code}
 
@@ -597,7 +604,7 @@ type MBytes = MutableByteArray RealWorld Int
 
 foreign import "libHS_cbits" "sizeof_time_t"    sizeof_time_t    :: Int
 
-foreign import "libHS_cbits" "prim_SETZONE" unsafe prim_SETZONE :: MBytes -> MBytes -> IO Int
+foreign import "libHS_cbits" "prim_SETZONE" unsafe prim_SETZONE :: MBytes -> MBytes -> IO ()
 #ifdef __HUGS__
 foreign import "libHS_cbits" "prim_toLocalTime"  unsafe prim_toLocalTime :: Int64 -> MBytes -> IO Int
 foreign import "libHS_cbits" "prim_toUTCTime"    unsafe prim_toUTCTime   :: Int64 -> MBytes -> IO Int