packages feed

hs-bindgen-1.0.0.0: test-artefacts/fixtures/program-analysis/selection_matches_c_names.1.positive_case/Example/FunPtr.hs

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

module Example.FunPtr
    ( Example.FunPtr.functionWithAssignedHaskellNameByNameMangler
    )
  where

import qualified HsBindgen.Runtime.Support as BG
import qualified HsBindgen.Runtime.Support.CAPI
import Prelude (IO, fmap)

$(HsBindgen.Runtime.Support.CAPI.addCSource (HsBindgen.Runtime.Support.CAPI.unlines
  [ "#include <program-analysis/selection_matches_c_names.h>"
  , "/* test_programanalysisselection_mat_Example_get_FunctionWithAssignedHaskellNameByNameMangler */"
  , "__attribute__ ((const))"
  , "signed int (*hs_bindgen_1ccc97a484f823b2 (void)) (void)"
  , "{"
  , "  return &FunctionWithAssignedHaskellNameByNameMangler;"
  , "}"
  ]))

-- __unique:__ @test_programanalysisselection_mat_Example_get_FunctionWithAssignedHaskellNameByNameMangler@
foreign import ccall unsafe "hs_bindgen_1ccc97a484f823b2" hs_bindgen_1ccc97a484f823b2_base ::
     IO (BG.FunPtr BG.Void)

-- __unique:__ @test_programanalysisselection_mat_Example_get_FunctionWithAssignedHaskellNameByNameMangler@
hs_bindgen_1ccc97a484f823b2 :: IO (BG.FunPtr (IO BG.CInt))
hs_bindgen_1ccc97a484f823b2 =
  fmap BG.fromFFIType hs_bindgen_1ccc97a484f823b2_base

{-# NOINLINE functionWithAssignedHaskellNameByNameMangler #-}
{-| __C declaration:__ @FunctionWithAssignedHaskellNameByNameMangler@

    __defined at:__ @program-analysis\/selection_matches_c_names.h 5:5@

    __exported by:__ @program-analysis\/selection_matches_c_names.h@
-}
functionWithAssignedHaskellNameByNameMangler :: BG.FunPtr (IO BG.CInt)
functionWithAssignedHaskellNameByNameMangler =
  BG.unsafePerformIO hs_bindgen_1ccc97a484f823b2