Safe Haskell | None |
---|---|
Language | GHC2021 |
Foreign export stubs
Synopsis
- data ForeignStubs
- newtype CHeader = CHeader {
- getCHeader :: SDoc
- data CStub = CStub {
- getCStub :: SDoc
- getInitializers :: [CLabel]
- getFinalizers :: [CLabel]
- initializerCStub :: Platform -> CLabel -> SDoc -> SDoc -> CStub
- finalizerCStub :: Platform -> CLabel -> SDoc -> SDoc -> CStub
- appendStubC :: ForeignStubs -> CStub -> ForeignStubs
Documentation
data ForeignStubs Source #
Foreign export stubs
NoStubs | We don't have any stubs |
ForeignStubs CHeader CStub | There are some stubs. Parameters: 1) Header file prototypes for "foreign exported" functions 2) C stubs to use when calling "foreign exported" functions |
CStub | |
|
initializerCStub :: Platform -> CLabel -> SDoc -> SDoc -> CStub Source #
initializerCStub fn_nm decls body
is a CStub
containing C initializer
function (e.g. an entry of the .init_array
section) named
fn_nm
with the given body and the given set of declarations.
finalizerCStub :: Platform -> CLabel -> SDoc -> SDoc -> CStub Source #
finalizerCStub fn_nm decls body
is a CStub
containing C finalizer
function (e.g. an entry of the .fini_array
section) named
fn_nm
with the given body and the given set of declarations.
appendStubC :: ForeignStubs -> CStub -> ForeignStubs Source #