flaw-ffi-0.1.0.0

LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Flaw.FFI

Description

 
Synopsis

Documentation

newtype EnumWrapper enumType Source #

Foreign-marshallable wrapper for enum types.

Constructors

EnumWrapper Int 

wrapEnum :: Enum a => a -> EnumWrapper a Source #

Wrap enum value into wrapper.

unwrapEnum :: Enum a => EnumWrapper a -> a Source #

Unwrap enum value from wrapper.

genEnum :: TypeQ -> String -> [(String, Int)] -> Q [Dec] Source #

Generate enum data type based on names and numbers.

genStruct :: String -> [(TypeQ, String)] -> Q [Dec] Source #

Generate struct data type.

genStructWithArrays :: String -> [(TypeQ, String, Int)] -> Q [Dec] Source #

Generate struct data type with support of array fields.

genStructWithEndUnion :: String -> [(TypeQ, String, Int)] -> Int -> [(String, TypeQ, String)] -> Q [Dec] Source #

Generate D3D11-style struct with union of types in the end, selected by one of the fields. Generates multiple constructors selected by selector.

forwardRef :: String -> TypeQ Source #

Make a reference to forward declaration for a type.