packages feed

hs-bindgen-1.0.0.0: test-artefacts/fixtures/edge-cases/distilled_lib_1/Example/Unsafe.hs

{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_HADDOCK prune #-}

module Example.Unsafe
    ( Example.Unsafe.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_2a91c367a9380a63 ("
  , "  a_type_t *arg1,"
  , "  uint32_t arg2,"
  , "  uint8_t *arg3"
  , ")"
  , "{"
  , "  return (some_fun)(arg1, arg2, arg3);"
  , "}"
  ]))

-- __unique:__ @test_edgecasesdistilled_lib_1_Example_Unsafe_some_fun@
foreign import ccall unsafe "hs_bindgen_2a91c367a9380a63" hs_bindgen_2a91c367a9380a63_base ::
     BG.Ptr BG.Void
  -> HsBindgen.Runtime.LibC.Word32
  -> BG.Ptr BG.Void
  -> IO HsBindgen.Runtime.LibC.Int32

-- __unique:__ @test_edgecasesdistilled_lib_1_Example_Unsafe_some_fun@
hs_bindgen_2a91c367a9380a63 ::
     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_2a91c367a9380a63 =
  \x0 ->
    \x1 ->
      \x2 ->
        fmap BG.fromFFIType (hs_bindgen_2a91c367a9380a63_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_2a91c367a9380a63