hs-bindgen-1.0.0.0: test-artefacts/fixtures/edge-cases/distilled_lib_1/Example/Safe.hs
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_HADDOCK prune #-}
module Example.Safe
( Example.Safe.some_fun
)
where
import qualified HsBindgen.Runtime.IncompleteArray as IA
import qualified HsBindgen.Runtime.IsArray as IsA
import qualified HsBindgen.Runtime.LibC
import qualified HsBindgen.Runtime.Support as BG
import qualified HsBindgen.Runtime.Support.CAPI
import Example
import Prelude (IO, fmap)
$(HsBindgen.Runtime.Support.CAPI.addCSource (HsBindgen.Runtime.Support.CAPI.unlines
[ "#include <edge-cases/distilled_lib_1.h>"
, "int32_t hs_bindgen_57cb99ed92c001ad ("
, " a_type_t *arg1,"
, " uint32_t arg2,"
, " uint8_t *arg3"
, ")"
, "{"
, " return (some_fun)(arg1, arg2, arg3);"
, "}"
]))
-- __unique:__ @test_edgecasesdistilled_lib_1_Example_Safe_some_fun@
foreign import ccall safe "hs_bindgen_57cb99ed92c001ad" hs_bindgen_57cb99ed92c001ad_base ::
BG.Ptr BG.Void
-> HsBindgen.Runtime.LibC.Word32
-> BG.Ptr BG.Void
-> IO HsBindgen.Runtime.LibC.Int32
-- __unique:__ @test_edgecasesdistilled_lib_1_Example_Safe_some_fun@
hs_bindgen_57cb99ed92c001ad ::
BG.Ptr A_type_t
-> HsBindgen.Runtime.LibC.Word32
-> BG.Ptr (IsA.Elem (IA.IncompleteArray HsBindgen.Runtime.LibC.Word8))
-> IO HsBindgen.Runtime.LibC.Int32
hs_bindgen_57cb99ed92c001ad =
\x0 ->
\x1 ->
\x2 ->
fmap BG.fromFFIType (hs_bindgen_57cb99ed92c001ad_base (BG.toFFIType x0) (BG.toFFIType x1) (BG.toFFIType x2))
{-| __C declaration:__ @some_fun@
__defined at:__ @edge-cases\/distilled_lib_1.h 72:9@
__exported by:__ @edge-cases\/distilled_lib_1.h@
-}
some_fun ::
BG.Ptr A_type_t
-- ^ __C declaration:__ @i@
-> HsBindgen.Runtime.LibC.Word32
-- ^ __C declaration:__ @j@
-> BG.Ptr (IsA.Elem (IA.IncompleteArray HsBindgen.Runtime.LibC.Word8))
-- ^ __C declaration:__ @k@
-> IO HsBindgen.Runtime.LibC.Int32
some_fun = hs_bindgen_57cb99ed92c001ad