libffi-0.1: A binding to libffi

Safe HaskellNone
LanguageHaskell98

Foreign.LibFFI.Types

Contents

Description

Arguments and return types

Synopsis

Arguments

Integral types

argInt :: Int -> Arg #

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

Floating point types

Various other C types

argPtr :: Ptr a -> Arg #

Strings

argString :: String -> Arg #

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 #

Like argString, but for ByteString's.

argConstByteString :: ByteString -> Arg #

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) #

Strings

retString :: RetType String #

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

retByteString :: RetType ByteString #

Like retString, but for ByteString's

retMallocByteString :: RetType ByteString #

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