libffi-0.2.1: A binding to libffi

Safe Haskell | Safe-Inferred
Language | Haskell2010

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

Constructors

Arg |

Fields

- unArg :: forall a. (Ptr CType -> Ptr CValue -> IO a) -> IO a

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

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

newtype RetType a Source #

Constructors

RetType |

Fields

- unRetType :: (Ptr CType -> Ptr CValue -> IO ()) -> IO a

#### Instances

Instances details

Functor RetType Source # |
Instance details Defined in Foreign.LibFFI.Base Methods fmap :: (a -> b) -> RetType a -> RetType b Source # (<$) :: a -> RetType b -> RetType a Source #

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

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

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

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

sizeAndAlignmentOfCType :: Ptr CType -> IO (Int, Int) Source #

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