Foreign.LibFFI.Base

libffi-0.1: A binding to libffi

Safe Haskell | None
Language | Haskell98

Foreign.LibFFI.Base

Description

This module defines the basic libffi machinery. You will need this to create support for new ffi types.

# Documentation

newtype Arg

Constructors

Arg |
Fields unArg :: IO (Ptr CType, Ptr CValue, IO ())

customPointerArg :: (a -> IO (Ptr b)) -> (Ptr b -> IO ()) -> a -> Arg

mkStorableArg :: Storable a => Ptr CType -> a -> Arg

data RetType a

Constructors

RetType (Ptr CType) ((Ptr CValue -> IO ()) -> IO a) |

Instances

Functor RetType |

withRetType :: (a -> IO b) -> RetType a -> RetType b

mkStorableRetType :: Storable a => Ptr CType -> RetType a

newStorableStructArgRet :: Storable a => [Ptr CType] -> IO (a -> Arg, RetType a, IO ())

newStructCType :: [Ptr CType] -> IO (Ptr CType, IO ())

callFFI :: FunPtr a -> RetType b -> [Arg] -> IO b