Portability | GHC |
---|---|
Stability | experimental |
Maintainer | hans@hanshoglund.se |
Safe Haskell | None |
Renders module descriptions as C header files.
- data GuardStyle
- data ImportStyle
- = SystemPath
- | LocalPath
- data CStyle = CStyle {
- guardStyle :: GuardStyle
- includeStyle :: ImportStyle
- includeDirective :: String
- guardMangler :: [String] -> String
- innerHeader :: [String] -> String -> String
- innerFooter :: [String] -> String
- typePrefixMangler :: [String] -> String
- valuePrefixMangler :: [String] -> String
- typeMangler :: [String] -> String
- structFieldMangler :: [String] -> String
- unionFieldMangler :: [String] -> String
- enumFieldMangler :: [String] -> String
- constMangler :: [String] -> String
- globalMangler :: [String] -> String
- funcMangler :: [String] -> String
- stdStyle :: CStyle
- cairoStyle :: CStyle
- gtkStyle :: CStyle
- appleStyle :: CStyle
- haskellStyle :: CStyle
- translType :: CStyle -> Name -> Name
- translFun :: CStyle -> Name -> Name
- translConst :: CStyle -> Name -> Name
- translGlobal :: CStyle -> Name -> Name
- translStructField :: CStyle -> Name -> Name
- translUnionField :: CStyle -> Name -> Name
- translEnumField :: CStyle -> Name -> Name
- printModule :: Module -> String
- renderModule :: Module -> (String, CTranslUnit, String)
- printModuleStyle :: CStyle -> Module -> String
- renderModuleStyle :: CStyle -> Module -> (String, CTranslUnit, String)
- printModuleComm :: Module -> String
Styles
data GuardStyle Source
data ImportStyle Source
SystemPath | Import external modules using system paths |
LocalPath | Import external modules using local paths |
CStyle | |
|
Style used in the C standard library.
- Types:
foo_bar_type_t
- Functions:
foo_bar_func
- Constants:
FOO_BAR_VAL
- Fields:
foo_bar
Style used in Cairo.
- Types:
p_foo_bar_t
- Opaques:
_p_foo_bar_t
- Functions:
p_foo_bar
- Constants:
P_FOO_BAR
- Fields:
foo_bar
Style used in GTK.
- Types:
PFooBar
- Opaques:
_PFooBar
- Functions:
p_foo_bar
- Constants:
P_FOO_BAR
- Fields:
foo_bar
Style used in Apple Frameworks.
- Types:
PFooBar
- Opaques:
PFooBarOpaque
- Functions:
PFooBar
- Constants:
kPFooBar
- Fields:
mFooBar
Style similar to Haskell conventions.
- Types:
PFooBar
- Opaques:
PFooBarOpaque
- Functions:
pfooBar
- Constants:
pfooBar
- Fields:
pfooBar
Conversion
translType :: CStyle -> Name -> NameSource
translConst :: CStyle -> Name -> NameSource
translGlobal :: CStyle -> Name -> NameSource
translStructField :: CStyle -> Name -> NameSource
translUnionField :: CStyle -> Name -> NameSource
translEnumField :: CStyle -> Name -> NameSource
Rendering
printModule :: Module -> StringSource
Print a module using the default style.
renderModule :: Module -> (String, CTranslUnit, String)Source
Render a module using the default style.
Returns a C header file, represented as a CTranslUnit
with enclosing header and footer strings.
printModuleStyle :: CStyle -> Module -> StringSource
Print a module using the specified style.
renderModuleStyle :: CStyle -> Module -> (String, CTranslUnit, String)Source
Render a module using the specified style.
Returns a C header file, represented as a CTranslUnit
with enclosing header and footer strings.
printModuleComm :: Module -> StringSource
Print a module using the default style.