c2hs-extra-0.1.0.0: Convenient marshallers for complicate C types.

Copyright(c) 2016 Tao He
LicenseMIT
Maintainersighingnow@gmail.com
Safe HaskellSafe
LanguageHaskell2010

C2HS.C.Extra.Marshal

Description

Convenient marshallers for complicate C types.

Synopsis

Documentation

peekIntegral :: (Integral a, Storable a, Integral b) => Ptr a -> IO b Source #

Peek from pointer then cast to another integral type.

peekString :: Ptr (Ptr CChar) -> IO String Source #

Peek string from a two-dimension pointer of CChar.

peekStringArray :: Integral n => n -> Ptr (Ptr CChar) -> IO [String] Source #

Peek an array of String and the result's length is given.

withStringArray :: [String] -> (Ptr (Ptr CChar) -> IO a) -> IO a Source #

Use an array of String as argument, usually used to pass multiple names to C functions.

withIntegralArray :: (Integral a, Integral b, Storable b) => [a] -> (Ptr b -> IO c) -> IO c Source #

Use an array of Integral as argument.