Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Graphics.Text.Font.Choose.Internal.FFI
Description
Utilities for writing language bindings transferring complex parameters. Encoding & decoding parameters via MessagePack.
Synopsis
- unpackWithErr :: MessagePack a => ByteString -> Maybe a
- withMessageIO :: MessagePack a => (CString -> Int -> IO b) -> a -> IO b
- withMessage :: MessagePack a => (CString -> Int -> b) -> a -> b
- fromMessage :: MessagePack a => (Ptr Int -> CString) -> Maybe a
- fromMessage0 :: MessagePack a => (Ptr Int -> CString) -> a
- fromMessageIO0 :: MessagePack a => (Ptr Int -> IO CString) -> IO a
- withCString' :: (CString -> a) -> String -> a
- peekCString' :: CString -> String
- withForeignPtr' :: (Ptr a -> b) -> ForeignPtr a -> b
Documentation
unpackWithErr :: MessagePack a => ByteString -> Maybe a Source #
Decode a MessagePack packet whilst throwing textually-specified exceptions.
withMessageIO :: MessagePack a => (CString -> Int -> IO b) -> a -> IO b Source #
Encode data via MessagePack to pass to an impure C function.
withMessage :: MessagePack a => (CString -> Int -> b) -> a -> b Source #
Encode data via MessagePack to pass to a pure C function.
fromMessage :: MessagePack a => (Ptr Int -> CString) -> Maybe a Source #
Decode data via MessagePack returned from a pure C function.
fromMessage0 :: MessagePack a => (Ptr Int -> CString) -> a Source #
Decode data via MessagePack returned from a pure C function, throwing exceptions upon failed decodes.
fromMessageIO0 :: MessagePack a => (Ptr Int -> IO CString) -> IO a Source #
Decode data via MessagePack returned from an impure C function, throwing exceptions upon failed decodes.
withCString' :: (CString -> a) -> String -> a Source #
Pass a string to a pure C function.
peekCString' :: CString -> String Source #
Return a string from a pure C function
withForeignPtr' :: (Ptr a -> b) -> ForeignPtr a -> b Source #
Unwrap a foreign pointer to pass to a pure C function.