module Bindings.C.Time where
import Foreign
import Foreign.C
type C'clock_t = Int32
type C'time_t = Int32
data C'tm = C'tm {tm'tm_sec :: CInt , tm'tm_min :: CInt , tm'tm_hour :: CInt , tm'tm_mday :: CInt , tm'tm_mon :: CInt , tm'tm_year :: CInt , tm'tm_wday :: CInt , tm'tm_yday :: CInt , tm'tm_isdst :: CInt}
instance Storable C'tm where
sizeOf _ = 44
alignment = sizeOf
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
v3 <- peekByteOff p 12
v4 <- peekByteOff p 16
v5 <- peekByteOff p 20
v6 <- peekByteOff p 24
v7 <- peekByteOff p 28
v8 <- peekByteOff p 32
return $ C'tm v0 v1 v2 v3 v4 v5 v6 v7 v8
poke p (C'tm v0 v1 v2 v3 v4 v5 v6 v7 v8 ) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
pokeByteOff p 12 v3
pokeByteOff p 16 v4
pokeByteOff p 20 v5
pokeByteOff p 24 v6
pokeByteOff p 28 v7
pokeByteOff p 32 v8
return ()
c'CLOCKS_PER_SEC = 1000000 ; c'CLOCKS_PER_SEC :: (Num a) => a
c'TIMER_ABSTIME = 1 ; c'TIMER_ABSTIME :: (Num a) => a
foreign import ccall "clock" c'clock :: IO C'clock_t
foreign import ccall "&clock" p'clock :: FunPtr (IO C'clock_t )
foreign import ccall "difftime" c'difftime :: C'time_t -> C'time_t -> IO CDouble
foreign import ccall "&difftime" p'difftime :: FunPtr ( C'time_t -> C'time_t -> IO CDouble)
foreign import ccall "gmtime" c'gmtime :: Ptr C'time_t -> IO (Ptr C'tm )
foreign import ccall "&gmtime" p'gmtime :: FunPtr (Ptr C'time_t -> IO (Ptr C'tm ))
foreign import ccall "localtime" c'localtime :: Ptr C'time_t -> IO (Ptr C'tm )
foreign import ccall "&localtime" p'localtime :: FunPtr (Ptr C'time_t -> IO (Ptr C'tm ))
foreign import ccall "mktime" c'mktime :: Ptr C'tm -> IO C'time_t
foreign import ccall "&mktime" p'mktime :: FunPtr (Ptr C'tm -> IO C'time_t )
foreign import ccall "strftime" c'strftime :: CString -> CSize -> CString -> Ptr C'tm -> IO CSize
foreign import ccall "&strftime" p'strftime :: FunPtr (CString -> CSize -> CString -> Ptr C'tm -> IO CSize)
foreign import ccall "time" c'time :: Ptr C'time_t -> IO C'time_t
foreign import ccall "&time" p'time :: FunPtr (Ptr C'time_t -> IO C'time_t )