{-# LANGUAGE CApiFFI #-}
module GHC.Eventlog.Socket (
startWait,
start,
wait,
) where
import Foreign.C
import Foreign.Ptr
startWait :: FilePath
-> IO ()
startWait :: FilePath -> IO ()
startWait = Bool -> FilePath -> IO ()
c_start' Bool
True
start :: FilePath
-> IO ()
start :: FilePath -> IO ()
start = Bool -> FilePath -> IO ()
c_start' Bool
False
wait :: IO ()
wait :: IO ()
wait = IO ()
c_wait
c_start' :: Bool -> FilePath -> IO ()
c_start' :: Bool -> FilePath -> IO ()
c_start' Bool
block FilePath
socketPath =
FilePath -> (CString -> IO ()) -> IO ()
forall a. FilePath -> (CString -> IO a) -> IO a
withCString FilePath
socketPath ((CString -> IO ()) -> IO ()) -> (CString -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CString
socketPathCString ->
CString -> Bool -> IO ()
c_start CString
socketPathCString Bool
block
foreign import capi safe "eventlog_socket.h eventlog_socket_start"
c_start :: CString -> Bool -> IO ()
foreign import capi safe "eventlog_socket.h eventlog_socket_wait"
c_wait :: IO ()