libffi-0.2.1: A binding to libffi
Safe HaskellNone
LanguageHaskell2010

Foreign.LibFFI.Types

Description

Arguments and return types

Synopsis

Arguments

Integral types

argCInt :: CInt -> Arg Source #

argCUInt :: CUInt -> Arg Source #

argCLong :: CLong -> Arg Source #

argCULong :: CULong -> Arg Source #

argInt8 :: Int8 -> Arg Source #

Note that on e.g. x86_64, Int /= CInt

argInt16 :: Int16 -> Arg Source #

argInt32 :: Int32 -> Arg Source #

argInt64 :: Int64 -> Arg Source #

argWord8 :: Word8 -> Arg Source #

argWord16 :: Word16 -> Arg Source #

argWord32 :: Word32 -> Arg Source #

argWord64 :: Word64 -> Arg Source #

Floating point types

argCFloat :: CFloat -> Arg Source #

argCDouble :: CDouble -> Arg Source #

Various other C types

argCSize :: CSize -> Arg Source #

argCTime :: CTime -> Arg Source #

argCChar :: CChar -> Arg Source #

argCUChar :: CUChar -> Arg Source #

argCWchar :: CWchar -> Arg Source #

argPtr :: Ptr a -> Arg Source #

argFunPtr :: FunPtr a -> Arg Source #

Strings

argString :: String -> Arg Source #

The string argument is passed to C as a char * pointer, which is freed afterwards. The argument should not contain zero-bytes.

argByteString :: ByteString -> Arg Source #

Like argString, but for ByteString's.

argConstByteString :: ByteString -> Arg Source #

Like argByteString, but changing the string from C breaks referential transparency.

Return types

Integral types

Floating point types

Various other C types

retPtr :: RetType a -> RetType (Ptr a) Source #

retFunPtr :: RetType a -> RetType (FunPtr a) Source #

Strings

retString :: RetType String Source #

Peek a String out of the returned char *. The char * is not freed.

retByteString :: RetType ByteString Source #

Like retString, but for ByteString's

retMallocByteString :: RetType ByteString Source #

Make a ByteString out of the returned char *. The char * will be free(3)ed when the ByteString is garbage collected.