{-# LINE 1 "Std/IO/UV/FFI.hsc" #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE UnliftedFFITypes #-}
module Std.IO.UV.FFI where
import Data.Bits
import Data.Int
import Data.Word
import Foreign.C.String
import Foreign.C.Types
import Foreign.Ptr
import Foreign.Storable
import GHC.Prim
import Std.Foreign.PrimArray
import Std.IO.Exception
import Std.IO.SockAddr (SockAddr, SocketFamily (..))
import System.Posix.Types (CSsize (..))
import GHC.Generics
{-# LINE 40 "Std/IO/UV/FFI.hsc" #-}
{-# LINE 42 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe uv_version :: IO CUInt
foreign import ccall unsafe uv_version_string :: IO CString
type UVSlot = Int
newtype UVSlotUnSafe = UVSlotUnSafe { unsafeGetSlot :: UVSlot }
type UVFD = Int32
pattern ACCEPT_BUFFER_SIZE :: Int
pattern ACCEPT_BUFFER_SIZE = 1020
{-# LINE 61 "Std/IO/UV/FFI.hsc" #-}
pattern SO_REUSEPORT_LOAD_BALANCE :: Int
pattern SO_REUSEPORT_LOAD_BALANCE = 0
{-# LINE 63 "Std/IO/UV/FFI.hsc" #-}
pattern INIT_LOOP_SIZE :: Int
pattern INIT_LOOP_SIZE = 128
{-# LINE 65 "Std/IO/UV/FFI.hsc" #-}
data UVLoop
data UVLoopData
peekUVEventQueue :: Ptr UVLoopData -> IO (Int, Ptr Int)
peekUVEventQueue p = (,)
<$> ((\hsc_ptr -> peekByteOff hsc_ptr 0) p)
{-# LINE 74 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 8) p)
{-# LINE 75 "Std/IO/UV/FFI.hsc" #-}
clearUVEventCounter :: Ptr UVLoopData -> IO ()
clearUVEventCounter p = do
(\hsc_ptr -> pokeByteOff hsc_ptr 0) p $ (0 :: Int)
{-# LINE 79 "Std/IO/UV/FFI.hsc" #-}
peekUVBufferTable :: Ptr UVLoopData -> IO (Ptr (Ptr Word8), Ptr CSsize)
peekUVBufferTable p = (,)
<$> ((\hsc_ptr -> peekByteOff hsc_ptr 16) p)
{-# LINE 83 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 24) p)
{-# LINE 84 "Std/IO/UV/FFI.hsc" #-}
newtype UVRunMode = UVRunMode CInt
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
pattern UV_RUN_DEFAULT :: UVRunMode
pattern UV_RUN_DEFAULT = UVRunMode 0
{-# LINE 90 "Std/IO/UV/FFI.hsc" #-}
pattern UV_RUN_ONCE :: UVRunMode
pattern UV_RUN_ONCE = UVRunMode 1
{-# LINE 92 "Std/IO/UV/FFI.hsc" #-}
pattern UV_RUN_NOWAIT :: UVRunMode
pattern UV_RUN_NOWAIT = UVRunMode 2
{-# LINE 94 "Std/IO/UV/FFI.hsc" #-}
peekUVLoopData :: Ptr UVLoop -> IO (Ptr UVLoopData)
peekUVLoopData p = (\hsc_ptr -> peekByteOff hsc_ptr 0) p
{-# LINE 98 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe hs_uv_loop_init :: Int -> IO (Ptr UVLoop)
foreign import ccall unsafe hs_uv_loop_close :: Ptr UVLoop -> IO ()
foreign import ccall unsafe "hs_uv_run" uv_run :: Ptr UVLoop -> UVRunMode -> IO CInt
foreign import ccall safe "hs_uv_run" uv_run_safe :: Ptr UVLoop -> UVRunMode -> IO CInt
foreign import ccall unsafe uv_loop_alive :: Ptr UVLoop -> IO CInt
foreign import ccall unsafe hs_uv_wake_up_timer :: Ptr UVLoopData -> IO CInt
foreign import ccall unsafe hs_uv_wake_up_async :: Ptr UVLoopData -> IO CInt
data UVHandle
peekUVHandleData :: Ptr UVHandle -> IO UVSlotUnSafe
peekUVHandleData p = UVSlotUnSafe <$> ((\hsc_ptr -> peekByteOff hsc_ptr 0) p :: IO Int)
{-# LINE 122 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe hs_uv_fileno :: Ptr UVHandle -> IO UVFD
foreign import ccall unsafe hs_uv_handle_alloc :: Ptr UVLoop -> IO (Ptr UVHandle)
foreign import ccall unsafe hs_uv_handle_free :: Ptr UVHandle -> IO ()
foreign import ccall unsafe hs_uv_handle_close :: Ptr UVHandle -> IO ()
foreign import ccall unsafe hs_uv_cancel :: Ptr UVLoop -> UVSlot -> IO ()
foreign import ccall unsafe hs_uv_listen :: Ptr UVHandle -> CInt -> IO CInt
foreign import ccall unsafe hs_uv_listen_resume :: Ptr UVHandle -> IO ()
foreign import ccall unsafe hs_uv_read_start :: Ptr UVHandle -> IO CInt
foreign import ccall unsafe uv_read_stop :: Ptr UVHandle -> IO CInt
foreign import ccall unsafe hs_uv_write :: Ptr UVHandle -> Ptr Word8 -> Int -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_accept_check_alloc :: Ptr UVHandle -> IO (Ptr UVHandle)
foreign import ccall unsafe hs_uv_accept_check_init :: Ptr UVHandle -> IO CInt
foreign import ccall unsafe hs_uv_accept_check_close :: Ptr UVHandle -> IO ()
foreign import ccall unsafe hs_uv_tcp_open :: Ptr UVHandle -> UVFD -> IO CInt
foreign import ccall unsafe uv_tcp_init :: Ptr UVLoop -> Ptr UVHandle -> IO CInt
foreign import ccall unsafe uv_tcp_init_ex :: Ptr UVLoop -> Ptr UVHandle -> CUInt -> IO CInt
foreign import ccall unsafe uv_tcp_nodelay :: Ptr UVHandle -> CInt -> IO CInt
foreign import ccall unsafe uv_tcp_keepalive :: Ptr UVHandle -> CInt -> CUInt -> IO CInt
uV_TCP_IPV6ONLY :: CUInt
uV_TCP_IPV6ONLY = 1
{-# LINE 157 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe uv_tcp_bind :: Ptr UVHandle -> Ptr SockAddr -> CUInt -> IO CInt
foreign import ccall unsafe hs_uv_tcp_connect :: Ptr UVHandle -> Ptr SockAddr -> IO UVSlotUnSafe
foreign import ccall unsafe hs_set_socket_reuse :: Ptr UVHandle -> IO CInt
foreign import ccall unsafe uv_udp_init :: Ptr UVLoop -> Ptr UVHandle -> IO CInt
foreign import ccall unsafe uv_udp_init_ex :: Ptr UVLoop -> Ptr UVHandle -> CUInt -> IO CInt
foreign import ccall unsafe uv_udp_open :: Ptr UVHandle -> UVFD -> IO CInt
foreign import ccall unsafe uv_udp_bind :: Ptr UVHandle -> Ptr SockAddr -> UVUDPFlag -> IO CInt
newtype UVMembership = UVMembership CInt deriving (Show, Eq, Ord)
pattern UV_LEAVE_GROUP = UVMembership 0
{-# LINE 170 "Std/IO/UV/FFI.hsc" #-}
pattern UV_JOIN_GROUP = UVMembership 1
{-# LINE 171 "Std/IO/UV/FFI.hsc" #-}
newtype UVUDPFlag = UVUDPFlag CInt deriving (Show, Eq, Ord, Storable, Bits, FiniteBits, Num)
pattern UV_UDP_DEFAULT = UVUDPFlag 0
pattern UV_UDP_IPV6ONLY = UVUDPFlag 1
{-# LINE 175 "Std/IO/UV/FFI.hsc" #-}
pattern UV_UDP_REUSEADDR = UVUDPFlag 4
{-# LINE 176 "Std/IO/UV/FFI.hsc" #-}
pattern UV_UDP_PARTIAL :: Int32
pattern UV_UDP_PARTIAL = 2
{-# LINE 179 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe uv_udp_set_membership ::
Ptr UVHandle -> CString -> CString -> UVMembership -> IO CInt
foreign import ccall unsafe uv_udp_set_multicast_loop :: Ptr UVHandle -> CInt -> IO CInt
foreign import ccall unsafe uv_udp_set_multicast_ttl :: Ptr UVHandle -> CInt -> IO CInt
foreign import ccall unsafe uv_udp_set_multicast_interface :: Ptr UVHandle -> CString -> IO CInt
foreign import ccall unsafe uv_udp_set_broadcast :: Ptr UVHandle -> CInt -> IO CInt
foreign import ccall unsafe uv_udp_set_ttl :: Ptr UVHandle -> CInt -> IO CInt
foreign import ccall unsafe hs_uv_udp_recv_start :: Ptr UVHandle -> IO CInt
foreign import ccall unsafe uv_udp_recv_stop :: Ptr UVHandle -> IO CInt
foreign import ccall unsafe hs_uv_udp_send
:: Ptr UVHandle -> Ptr SockAddr -> Ptr Word8 -> Int -> IO UVSlotUnSafe
foreign import ccall unsafe uv_udp_getsockname
:: Ptr UVHandle -> Ptr SockAddr -> Ptr CInt -> IO CInt
foreign import ccall unsafe uv_pipe_init :: Ptr UVLoop -> Ptr UVHandle -> CInt -> IO CInt
newtype UVTTYMode = UVTTYMode CInt
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
pattern UV_TTY_MODE_NORMAL :: UVTTYMode
pattern UV_TTY_MODE_NORMAL = UVTTYMode 0
{-# LINE 213 "Std/IO/UV/FFI.hsc" #-}
pattern UV_TTY_MODE_RAW :: UVTTYMode
pattern UV_TTY_MODE_RAW = UVTTYMode 1
{-# LINE 215 "Std/IO/UV/FFI.hsc" #-}
pattern UV_TTY_MODE_IO :: UVTTYMode
pattern UV_TTY_MODE_IO = UVTTYMode 2
{-# LINE 217 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe uv_tty_init :: Ptr UVLoop -> Ptr UVHandle -> CInt -> IO CInt
foreign import ccall unsafe uv_tty_set_mode :: Ptr UVHandle -> UVTTYMode -> IO CInt
newtype UVFileMode = UVFileMode CInt
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
pattern S_IRWXU :: UVFileMode
pattern S_IRWXU = UVFileMode 448
{-# LINE 230 "Std/IO/UV/FFI.hsc" #-}
pattern S_IRUSR :: UVFileMode
pattern S_IRUSR = UVFileMode 256
{-# LINE 234 "Std/IO/UV/FFI.hsc" #-}
pattern S_IWUSR :: UVFileMode
pattern S_IWUSR = UVFileMode 128
{-# LINE 238 "Std/IO/UV/FFI.hsc" #-}
pattern S_IXUSR :: UVFileMode
pattern S_IXUSR = UVFileMode 64
{-# LINE 242 "Std/IO/UV/FFI.hsc" #-}
pattern S_IRWXG :: UVFileMode
pattern S_IRWXG = UVFileMode 56
{-# LINE 246 "Std/IO/UV/FFI.hsc" #-}
pattern S_IRGRP :: UVFileMode
pattern S_IRGRP = UVFileMode 32
{-# LINE 250 "Std/IO/UV/FFI.hsc" #-}
pattern S_IWGRP :: UVFileMode
pattern S_IWGRP = UVFileMode 16
{-# LINE 254 "Std/IO/UV/FFI.hsc" #-}
pattern S_IXGRP :: UVFileMode
pattern S_IXGRP = UVFileMode 8
{-# LINE 258 "Std/IO/UV/FFI.hsc" #-}
pattern S_IRWXO :: UVFileMode
pattern S_IRWXO = UVFileMode 7
{-# LINE 262 "Std/IO/UV/FFI.hsc" #-}
pattern S_IROTH :: UVFileMode
pattern S_IROTH = UVFileMode 4
{-# LINE 266 "Std/IO/UV/FFI.hsc" #-}
pattern S_IWOTH :: UVFileMode
pattern S_IWOTH = UVFileMode 2
{-# LINE 270 "Std/IO/UV/FFI.hsc" #-}
pattern S_IXOTH :: UVFileMode
pattern S_IXOTH = UVFileMode 1
{-# LINE 274 "Std/IO/UV/FFI.hsc" #-}
pattern DEFAULT_MODE :: UVFileMode
pattern DEFAULT_MODE = UVFileMode 0o666
foreign import ccall unsafe hs_uv_fs_open :: CString -> UVFileFlag -> UVFileMode -> IO UVFD
foreign import ccall unsafe hs_uv_fs_close :: UVFD -> IO Int
foreign import ccall unsafe hs_uv_fs_read :: UVFD -> Ptr Word8 -> Int -> Int64 -> IO Int
foreign import ccall unsafe hs_uv_fs_write :: UVFD -> Ptr Word8 -> Int -> Int64 -> IO Int
foreign import ccall unsafe hs_uv_fs_unlink :: CString -> IO Int
foreign import ccall unsafe hs_uv_fs_mkdir :: CString -> UVFileMode -> IO Int
foreign import ccall unsafe hs_uv_fs_rmdir :: CString -> IO Int
foreign import ccall unsafe hs_uv_fs_mkdtemp :: CString -> Int -> CString -> IO Int
foreign import ccall unsafe hs_uv_fs_open_threaded
:: CString -> UVFileFlag -> UVFileMode -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_close_threaded
:: UVFD -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_read_threaded
:: UVFD -> Ptr Word8 -> Int -> Int64 -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_write_threaded
:: UVFD -> Ptr Word8 -> Int -> Int64 -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_unlink_threaded
:: CString -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_mkdir_threaded
:: CString -> UVFileMode -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_rmdir_threaded
:: CString -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_mkdtemp_threaded
:: CString -> Int -> CString -> Ptr UVLoop -> IO UVSlotUnSafe
newtype UVFileFlag = UVFileFlag CInt
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
pattern O_APPEND :: UVFileFlag
pattern O_APPEND = UVFileFlag 8
{-# LINE 313 "Std/IO/UV/FFI.hsc" #-}
pattern O_CREAT :: UVFileFlag
pattern O_CREAT = UVFileFlag 512
{-# LINE 317 "Std/IO/UV/FFI.hsc" #-}
pattern O_DIRECT :: UVFileFlag
pattern O_DIRECT = UVFileFlag 0
{-# LINE 321 "Std/IO/UV/FFI.hsc" #-}
pattern O_DIRECTORY :: UVFileFlag
pattern O_DIRECTORY = UVFileFlag 1048576
{-# LINE 327 "Std/IO/UV/FFI.hsc" #-}
pattern O_DSYNC :: UVFileFlag
pattern O_DSYNC = UVFileFlag 4194304
{-# LINE 333 "Std/IO/UV/FFI.hsc" #-}
pattern O_EXCL :: UVFileFlag
pattern O_EXCL = UVFileFlag 2048
{-# LINE 341 "Std/IO/UV/FFI.hsc" #-}
pattern O_EXLOCK :: UVFileFlag
pattern O_EXLOCK = UVFileFlag 32
{-# LINE 348 "Std/IO/UV/FFI.hsc" #-}
pattern O_NOATIME :: UVFileFlag
pattern O_NOATIME = UVFileFlag 0
{-# LINE 354 "Std/IO/UV/FFI.hsc" #-}
pattern O_NOCTTY :: UVFileFlag
pattern O_NOCTTY = UVFileFlag 131072
{-# LINE 360 "Std/IO/UV/FFI.hsc" #-}
pattern O_NOFOLLOW :: UVFileFlag
pattern O_NOFOLLOW = UVFileFlag 256
{-# LINE 366 "Std/IO/UV/FFI.hsc" #-}
pattern O_NONBLOCK :: UVFileFlag
pattern O_NONBLOCK = UVFileFlag 4
{-# LINE 372 "Std/IO/UV/FFI.hsc" #-}
pattern O_RANDOM :: UVFileFlag
pattern O_RANDOM = UVFileFlag 0
{-# LINE 378 "Std/IO/UV/FFI.hsc" #-}
pattern O_RDONLY :: UVFileFlag
pattern O_RDONLY = UVFileFlag 0
{-# LINE 382 "Std/IO/UV/FFI.hsc" #-}
pattern O_RDWR :: UVFileFlag
pattern O_RDWR = UVFileFlag 2
{-# LINE 386 "Std/IO/UV/FFI.hsc" #-}
pattern O_SEQUENTIAL :: UVFileFlag
pattern O_SEQUENTIAL = UVFileFlag 0
{-# LINE 393 "Std/IO/UV/FFI.hsc" #-}
pattern O_SHORT_LIVED :: UVFileFlag
pattern O_SHORT_LIVED = UVFileFlag 0
{-# LINE 399 "Std/IO/UV/FFI.hsc" #-}
pattern O_SYMLINK :: UVFileFlag
pattern O_SYMLINK = UVFileFlag 2097152
{-# LINE 403 "Std/IO/UV/FFI.hsc" #-}
pattern O_SYNC :: UVFileFlag
pattern O_SYNC = UVFileFlag 128
{-# LINE 409 "Std/IO/UV/FFI.hsc" #-}
pattern O_TEMPORARY :: UVFileFlag
pattern O_TEMPORARY = UVFileFlag 0
{-# LINE 415 "Std/IO/UV/FFI.hsc" #-}
pattern O_TRUNC :: UVFileFlag
pattern O_TRUNC = UVFileFlag 1024
{-# LINE 419 "Std/IO/UV/FFI.hsc" #-}
pattern O_WRONLY :: UVFileFlag
pattern O_WRONLY = UVFileFlag 1
{-# LINE 423 "Std/IO/UV/FFI.hsc" #-}
{-# LINE 427 "Std/IO/UV/FFI.hsc" #-}
newtype UVDirEntType = UVDirEntType CChar
{-# LINE 429 "Std/IO/UV/FFI.hsc" #-}
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
data DirEntType
= DirEntUnknown
| DirEntFile
| DirEntDir
| DirEntLink
| DirEntFIFO
| DirEntSocket
| DirEntChar
| DirEntBlock
deriving (Read, Show, Eq, Ord, Generic)
fromUVDirEntType :: UVDirEntType -> DirEntType
fromUVDirEntType t
| t == uV__DT_FILE = DirEntFile
| t == uV__DT_DIR = DirEntDir
| t == uV__DT_LINK = DirEntLink
| t == uV__DT_FIFO = DirEntFIFO
| t == uV__DT_SOCKET = DirEntSocket
| t == uV__DT_CHAR = DirEntChar
| t == uV__DT_BLOCK = DirEntBlock
| otherwise = DirEntUnknown
uV__DT_FILE :: UVDirEntType
uV__DT_FILE = UVDirEntType 8
uV__DT_DIR :: UVDirEntType
uV__DT_DIR = UVDirEntType 4
uV__DT_LINK :: UVDirEntType
uV__DT_LINK = UVDirEntType 10
uV__DT_FIFO :: UVDirEntType
uV__DT_FIFO = UVDirEntType 1
uV__DT_SOCKET :: UVDirEntType
uV__DT_SOCKET = UVDirEntType 12
uV__DT_CHAR :: UVDirEntType
uV__DT_CHAR = UVDirEntType 2
uV__DT_BLOCK :: UVDirEntType
uV__DT_BLOCK = UVDirEntType 6
{-# LINE 461 "Std/IO/UV/FFI.hsc" #-}
data UVDirEnt
peekUVDirEnt :: Ptr UVDirEnt -> IO (CString, UVDirEntType)
{-# LINE 466 "Std/IO/UV/FFI.hsc" #-}
peekUVDirEnt p = (,) ((\hsc_ptr -> hsc_ptr `plusPtr` 21) p) <$> ((\hsc_ptr -> peekByteOff hsc_ptr 20) p)
{-# LINE 467 "Std/IO/UV/FFI.hsc" #-}
{-# LINE 470 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe hs_uv_fs_scandir_cleanup
:: Ptr (Ptr UVDirEnt) -> Int -> IO ()
foreign import ccall unsafe hs_uv_fs_scandir
:: CString -> MBA# (Ptr UVDirEnt) -> IO Int
foreign import ccall unsafe hs_uv_fs_scandir_extra_cleanup
:: Ptr (Ptr (Ptr UVDirEnt)) -> Int -> IO ()
foreign import ccall unsafe hs_uv_fs_scandir_threaded
:: CString -> Ptr (Ptr (Ptr UVDirEnt)) -> Ptr UVLoop -> IO UVSlotUnSafe
data UVTimeSpec = UVTimeSpec
{ uvtSecond :: {-# UNPACK #-} !CLong
, uvtNanoSecond :: {-# UNPACK #-} !CLong
} deriving (Show, Read, Eq, Ord, Generic)
instance Storable UVTimeSpec where
sizeOf _ = (16)
{-# LINE 487 "Std/IO/UV/FFI.hsc" #-}
alignment _ = 8
{-# LINE 488 "Std/IO/UV/FFI.hsc" #-}
peek p = UVTimeSpec <$> ((\hsc_ptr -> peekByteOff hsc_ptr 0) p)
{-# LINE 489 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 8) p)
{-# LINE 490 "Std/IO/UV/FFI.hsc" #-}
poke p (UVTimeSpec sec nsec) = do
((\hsc_ptr -> pokeByteOff hsc_ptr 0) p sec)
{-# LINE 492 "Std/IO/UV/FFI.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8) p nsec)
{-# LINE 493 "Std/IO/UV/FFI.hsc" #-}
data UVStat = UVStat
{ stDev :: {-# UNPACK #-} !Word64
, stMode :: {-# UNPACK #-} !Word64
, stNlink :: {-# UNPACK #-} !Word64
, stUid :: {-# UNPACK #-} !Word64
, stGid :: {-# UNPACK #-} !Word64
, stRdev :: {-# UNPACK #-} !Word64
, stIno :: {-# UNPACK #-} !Word64
, stSize :: {-# UNPACK #-} !Word64
, stBlksize :: {-# UNPACK #-} !Word64
, stBlocks :: {-# UNPACK #-} !Word64
, stFlags :: {-# UNPACK #-} !Word64
, stGen :: {-# UNPACK #-} !Word64
, stAtim :: {-# UNPACK #-} !UVTimeSpec
, stMtim :: {-# UNPACK #-} !UVTimeSpec
, stCtim :: {-# UNPACK #-} !UVTimeSpec
, stBirthtim :: {-# UNPACK #-} !UVTimeSpec
} deriving (Show, Read, Eq, Ord, Generic)
uvStatSize :: Int
uvStatSize = (160)
{-# LINE 515 "Std/IO/UV/FFI.hsc" #-}
peekUVStat :: Ptr UVStat -> IO UVStat
peekUVStat p = UVStat
<$> ((\hsc_ptr -> peekByteOff hsc_ptr 0) p)
{-# LINE 519 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 8) p)
{-# LINE 520 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 16) p)
{-# LINE 521 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 24) p)
{-# LINE 522 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 32) p)
{-# LINE 523 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 40) p)
{-# LINE 524 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 48) p)
{-# LINE 525 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 56) p)
{-# LINE 526 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 64) p)
{-# LINE 527 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 72) p)
{-# LINE 528 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 80) p)
{-# LINE 529 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 88) p)
{-# LINE 530 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 96) p)
{-# LINE 531 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 112) p)
{-# LINE 532 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 128) p)
{-# LINE 533 "Std/IO/UV/FFI.hsc" #-}
<*> ((\hsc_ptr -> peekByteOff hsc_ptr 144) p)
{-# LINE 534 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe hs_uv_fs_stat :: CString -> Ptr UVStat -> IO Int
foreign import ccall unsafe hs_uv_fs_fstat :: UVFD -> Ptr UVStat -> IO Int
foreign import ccall unsafe hs_uv_fs_lstat :: CString -> Ptr UVStat -> IO Int
foreign import ccall unsafe hs_uv_fs_rename :: CString -> CString -> IO Int
foreign import ccall unsafe hs_uv_fs_fsync :: UVFD -> IO Int
foreign import ccall unsafe hs_uv_fs_fdatasync :: UVFD -> IO Int
foreign import ccall unsafe hs_uv_fs_ftruncate :: UVFD -> Int64 -> IO Int
foreign import ccall unsafe hs_uv_fs_stat_threaded
:: CString -> Ptr UVStat -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_fstat_threaded
:: UVFD -> Ptr UVStat -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_lstat_threaded
:: CString -> Ptr UVStat -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_rename_threaded
:: CString -> CString -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_fsync_threaded
:: UVFD -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_fdatasync_threaded
:: UVFD -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_ftruncate_threaded
:: UVFD -> Int64 -> Ptr UVLoop -> IO UVSlotUnSafe
newtype UVCopyFileFlag = UVCopyFileFlag CInt
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
pattern COPYFILE_DEFAULT :: UVCopyFileFlag
pattern COPYFILE_DEFAULT = UVCopyFileFlag 0
pattern COPYFILE_EXCL :: UVCopyFileFlag
pattern COPYFILE_EXCL = UVCopyFileFlag 1
{-# LINE 571 "Std/IO/UV/FFI.hsc" #-}
pattern COPYFILE_FICLONE :: UVCopyFileFlag
{-# LINE 576 "Std/IO/UV/FFI.hsc" #-}
pattern COPYFILE_FICLONE = UVCopyFileFlag 0
{-# LINE 578 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe hs_uv_fs_copyfile :: CString -> CString -> UVCopyFileFlag -> IO Int
foreign import ccall unsafe hs_uv_fs_copyfile_threaded
:: CString -> CString -> UVCopyFileFlag -> Ptr UVLoop -> IO UVSlotUnSafe
newtype UVAccessMode = UVAccessMode CInt
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
pattern F_OK :: UVAccessMode
pattern F_OK = UVAccessMode 0
{-# LINE 588 "Std/IO/UV/FFI.hsc" #-}
pattern R_OK :: UVAccessMode
pattern R_OK = UVAccessMode 4
{-# LINE 590 "Std/IO/UV/FFI.hsc" #-}
pattern W_OK :: UVAccessMode
pattern W_OK = UVAccessMode 2
{-# LINE 592 "Std/IO/UV/FFI.hsc" #-}
pattern X_OK :: UVAccessMode
pattern X_OK = UVAccessMode 1
{-# LINE 594 "Std/IO/UV/FFI.hsc" #-}
data AccessResult = NoExistence | NoPermission | AccessOK deriving (Show, Eq, Ord)
foreign import ccall unsafe hs_uv_fs_access :: CString -> UVAccessMode -> IO Int
foreign import ccall unsafe hs_uv_fs_access_threaded
:: CString -> UVAccessMode -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_chmod :: CString -> UVFileMode -> IO Int
foreign import ccall unsafe hs_uv_fs_chmod_threaded
:: CString -> UVFileMode -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_fchmod :: UVFD -> UVFileMode -> IO Int
foreign import ccall unsafe hs_uv_fs_fchmod_threaded
:: UVFD -> UVFileMode -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_utime :: CString -> Double -> Double -> IO Int
foreign import ccall unsafe hs_uv_fs_utime_threaded
:: CString -> Double -> Double -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_futime :: UVFD -> Double -> Double -> IO Int
foreign import ccall unsafe hs_uv_fs_futime_threaded
:: UVFD -> Double -> Double -> Ptr UVLoop -> IO UVSlotUnSafe
newtype UVSymlinkFlag = UVSymlinkFlag CInt
deriving (Eq, Ord, Read, Show, FiniteBits, Bits, Storable, Num)
pattern SYMLINK_DEFAULT :: UVSymlinkFlag
pattern SYMLINK_DEFAULT = UVSymlinkFlag 0
pattern SYMLINK_DIR :: UVSymlinkFlag
pattern SYMLINK_DIR = UVSymlinkFlag 1
{-# LINE 625 "Std/IO/UV/FFI.hsc" #-}
pattern SYMLINK_JUNCTION :: UVSymlinkFlag
pattern SYMLINK_JUNCTION = UVSymlinkFlag 2
{-# LINE 628 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe hs_uv_fs_link :: CString -> CString -> IO Int
foreign import ccall unsafe hs_uv_fs_link_threaded
:: CString -> CString -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_symlink :: CString -> CString -> UVSymlinkFlag -> IO Int
foreign import ccall unsafe hs_uv_fs_symlink_threaded
:: CString -> CString -> UVSymlinkFlag -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_readlink_cleanup
:: CString -> IO ()
foreign import ccall unsafe hs_uv_fs_readlink
:: CString -> MBA# CString -> IO Int
foreign import ccall unsafe hs_uv_fs_realpath
:: CString -> MBA# CString -> IO Int
foreign import ccall unsafe hs_uv_fs_readlink_extra_cleanup
:: Ptr CString -> IO ()
foreign import ccall unsafe hs_uv_fs_readlink_threaded
:: CString -> Ptr CString -> Ptr UVLoop -> IO UVSlotUnSafe
foreign import ccall unsafe hs_uv_fs_realpath_threaded
:: CString -> Ptr CString -> Ptr UVLoop -> IO UVSlotUnSafe
newtype UVHandleType = UVHandleType CInt deriving (Eq, Ord, Read, Show, Storable)
pattern UV_UNKNOWN_HANDLE :: UVHandleType
pattern UV_UNKNOWN_HANDLE = UVHandleType 0
{-# LINE 658 "Std/IO/UV/FFI.hsc" #-}
pattern UV_ASYNC :: UVHandleType
pattern UV_ASYNC = UVHandleType 1
{-# LINE 660 "Std/IO/UV/FFI.hsc" #-}
pattern UV_CHECK :: UVHandleType
pattern UV_CHECK = UVHandleType 2
{-# LINE 662 "Std/IO/UV/FFI.hsc" #-}
pattern UV_FS_EVENT :: UVHandleType
pattern UV_FS_EVENT = UVHandleType 3
{-# LINE 664 "Std/IO/UV/FFI.hsc" #-}
pattern UV_FS_POLL :: UVHandleType
pattern UV_FS_POLL = UVHandleType 4
{-# LINE 666 "Std/IO/UV/FFI.hsc" #-}
pattern UV_HANDLE :: UVHandleType
pattern UV_HANDLE = UVHandleType 5
{-# LINE 668 "Std/IO/UV/FFI.hsc" #-}
pattern UV_IDLE :: UVHandleType
pattern UV_IDLE = UVHandleType 6
{-# LINE 670 "Std/IO/UV/FFI.hsc" #-}
pattern UV_NAMED_PIPE :: UVHandleType
pattern UV_NAMED_PIPE = UVHandleType 7
{-# LINE 672 "Std/IO/UV/FFI.hsc" #-}
pattern UV_POLL :: UVHandleType
pattern UV_POLL = UVHandleType 8
{-# LINE 674 "Std/IO/UV/FFI.hsc" #-}
pattern UV_PREPARE :: UVHandleType
pattern UV_PREPARE = UVHandleType 9
{-# LINE 676 "Std/IO/UV/FFI.hsc" #-}
pattern UV_PROCESS :: UVHandleType
pattern UV_PROCESS = UVHandleType 10
{-# LINE 678 "Std/IO/UV/FFI.hsc" #-}
pattern UV_STREAM :: UVHandleType
pattern UV_STREAM = UVHandleType 11
{-# LINE 680 "Std/IO/UV/FFI.hsc" #-}
pattern UV_TCP :: UVHandleType
pattern UV_TCP = UVHandleType 12
{-# LINE 682 "Std/IO/UV/FFI.hsc" #-}
pattern UV_TIMER :: UVHandleType
pattern UV_TIMER = UVHandleType 13
{-# LINE 684 "Std/IO/UV/FFI.hsc" #-}
pattern UV_TTY :: UVHandleType
pattern UV_TTY = UVHandleType 14
{-# LINE 686 "Std/IO/UV/FFI.hsc" #-}
pattern UV_UDP :: UVHandleType
pattern UV_UDP = UVHandleType 15
{-# LINE 688 "Std/IO/UV/FFI.hsc" #-}
pattern UV_SIGNAL :: UVHandleType
pattern UV_SIGNAL = UVHandleType 16
{-# LINE 690 "Std/IO/UV/FFI.hsc" #-}
pattern UV_FILE :: UVHandleType
pattern UV_FILE = UVHandleType 17
{-# LINE 692 "Std/IO/UV/FFI.hsc" #-}
foreign import ccall unsafe uv_guess_handle :: UVFD -> IO UVHandleType