{-# LANGUAGE CApiFFI #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE TemplateHaskell #-} {-# OPTIONS_HADDOCK prune #-} module Example.Safe where import qualified GHC.Ptr as Ptr import qualified HsBindgen.Runtime.Internal.CAPI import qualified HsBindgen.Runtime.Internal.HasFFIType import Data.Void (Void) import Example import Prelude (IO) $(HsBindgen.Runtime.Internal.CAPI.addCSource (HsBindgen.Runtime.Internal.CAPI.unlines [ "#include " , "void hs_bindgen_40e15e86e5db36ce (" , " MyFunctionPointer arg1" , ")" , "{" , " foo(arg1);" , "}" , "void hs_bindgen_e13a57fd1d27f6e6 (" , " A arg1" , ")" , "{" , " fooA(arg1);" , "}" , "void hs_bindgen_fd490df5087893ae (" , " B arg1" , ")" , "{" , " fooB(arg1);" , "}" ])) -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_foo@ foreign import ccall safe "hs_bindgen_40e15e86e5db36ce" hs_bindgen_40e15e86e5db36ce_base :: Ptr.FunPtr Void -> IO () -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_foo@ hs_bindgen_40e15e86e5db36ce :: MyFunctionPointer -> IO () hs_bindgen_40e15e86e5db36ce = HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_40e15e86e5db36ce_base {-| __C declaration:__ @foo@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 5:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} foo :: MyFunctionPointer -- ^ __C declaration:__ @x@ -> IO () foo = hs_bindgen_40e15e86e5db36ce -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooA@ foreign import ccall safe "hs_bindgen_e13a57fd1d27f6e6" hs_bindgen_e13a57fd1d27f6e6_base :: Ptr.FunPtr Void -> IO () -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooA@ hs_bindgen_e13a57fd1d27f6e6 :: A -> IO () hs_bindgen_e13a57fd1d27f6e6 = HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_e13a57fd1d27f6e6_base {-| __C declaration:__ @fooA@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 10:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooA :: A -- ^ __C declaration:__ @x@ -> IO () fooA = hs_bindgen_e13a57fd1d27f6e6 -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooB@ foreign import ccall safe "hs_bindgen_fd490df5087893ae" hs_bindgen_fd490df5087893ae_base :: Ptr.FunPtr Void -> IO () -- __unique:__ @test_bindingspecsfun_argmacrofu_Example_Safe_fooB@ hs_bindgen_fd490df5087893ae :: B -> IO () hs_bindgen_fd490df5087893ae = HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_fd490df5087893ae_base {-| __C declaration:__ @fooB@ __defined at:__ @binding-specs\/fun_arg\/macro\/function_pointer.h 11:6@ __exported by:__ @binding-specs\/fun_arg\/macro\/function_pointer.h@ -} fooB :: B -- ^ __C declaration:__ @x@ -> IO () fooB = hs_bindgen_fd490df5087893ae