135 lines
4.2 KiB
Haskell
135 lines
4.2 KiB
Haskell
{-# LANGUAGE CApiFFI #-}
|
|
{-# LANGUAGE NoImplicitPrelude #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
{-# OPTIONS_HADDOCK prune #-}
|
|
|
|
module GarnetRs.FunPtr where
|
|
|
|
import qualified Foreign.C as FC
|
|
import qualified GHC.IO.Unsafe
|
|
import qualified GHC.Ptr as Ptr
|
|
import qualified HsBindgen.Runtime.Internal.CAPI
|
|
import qualified HsBindgen.Runtime.Internal.HasFFIType
|
|
import qualified HsBindgen.Runtime.LibC
|
|
import qualified HsBindgen.Runtime.PtrConst
|
|
import Data.Void (Void)
|
|
import GarnetRs
|
|
import Prelude (IO)
|
|
|
|
$(HsBindgen.Runtime.Internal.CAPI.addCSource (HsBindgen.Runtime.Internal.CAPI.unlines
|
|
[ "#include <garnet_rs.h>"
|
|
, "/* com_garnet_GarnetRs_get_hello */"
|
|
, "__attribute__ ((const))"
|
|
, "void (*hs_bindgen_faf62265b53521d3 (void)) ("
|
|
, " char const *arg1"
|
|
, ")"
|
|
, "{"
|
|
, " return &hello;"
|
|
, "}"
|
|
, "/* com_garnet_GarnetRs_get_hello_struct */"
|
|
, "__attribute__ ((const))"
|
|
, "void (*hs_bindgen_0f8c37ef19b17a6d (void)) ("
|
|
, " struct T arg1"
|
|
, ")"
|
|
, "{"
|
|
, " return &hello_struct;"
|
|
, "}"
|
|
, "/* com_garnet_GarnetRs_get_hello_shape */"
|
|
, "__attribute__ ((const))"
|
|
, "void (*hs_bindgen_287ff3ac660f333b (void)) ("
|
|
, " struct Shape arg1"
|
|
, ")"
|
|
, "{"
|
|
, " return &hello_shape;"
|
|
, "}"
|
|
, "/* com_garnet_GarnetRs_get_add */"
|
|
, "__attribute__ ((const))"
|
|
, "int64_t (*hs_bindgen_bbabdbe61cd1eeb2 (void)) ("
|
|
, " int64_t arg1,"
|
|
, " int64_t arg2"
|
|
, ")"
|
|
, "{"
|
|
, " return &add;"
|
|
, "}"
|
|
]))
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_hello@
|
|
foreign import ccall unsafe "hs_bindgen_faf62265b53521d3" hs_bindgen_faf62265b53521d3_base ::
|
|
IO (Ptr.FunPtr Void)
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_hello@
|
|
hs_bindgen_faf62265b53521d3 :: IO (Ptr.FunPtr ((HsBindgen.Runtime.PtrConst.PtrConst FC.CChar) -> IO ()))
|
|
hs_bindgen_faf62265b53521d3 =
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_faf62265b53521d3_base
|
|
|
|
{-# NOINLINE hello #-}
|
|
{-| __C declaration:__ @hello@
|
|
|
|
__defined at:__ @garnet_rs.h 32:6@
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
-}
|
|
hello :: Ptr.FunPtr ((HsBindgen.Runtime.PtrConst.PtrConst FC.CChar) -> IO ())
|
|
hello =
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_faf62265b53521d3
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_hello_struct@
|
|
foreign import ccall unsafe "hs_bindgen_0f8c37ef19b17a6d" hs_bindgen_0f8c37ef19b17a6d_base ::
|
|
IO (Ptr.FunPtr Void)
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_hello_struct@
|
|
hs_bindgen_0f8c37ef19b17a6d :: IO (Ptr.FunPtr (T -> IO ()))
|
|
hs_bindgen_0f8c37ef19b17a6d =
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_0f8c37ef19b17a6d_base
|
|
|
|
{-# NOINLINE hello_struct #-}
|
|
{-| __C declaration:__ @hello_struct@
|
|
|
|
__defined at:__ @garnet_rs.h 34:6@
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
-}
|
|
hello_struct :: Ptr.FunPtr (T -> IO ())
|
|
hello_struct =
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_0f8c37ef19b17a6d
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_hello_shape@
|
|
foreign import ccall unsafe "hs_bindgen_287ff3ac660f333b" hs_bindgen_287ff3ac660f333b_base ::
|
|
IO (Ptr.FunPtr Void)
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_hello_shape@
|
|
hs_bindgen_287ff3ac660f333b :: IO (Ptr.FunPtr (Shape -> IO ()))
|
|
hs_bindgen_287ff3ac660f333b =
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_287ff3ac660f333b_base
|
|
|
|
{-# NOINLINE hello_shape #-}
|
|
{-| __C declaration:__ @hello_shape@
|
|
|
|
__defined at:__ @garnet_rs.h 36:6@
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
-}
|
|
hello_shape :: Ptr.FunPtr (Shape -> IO ())
|
|
hello_shape =
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_287ff3ac660f333b
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_add@
|
|
foreign import ccall unsafe "hs_bindgen_bbabdbe61cd1eeb2" hs_bindgen_bbabdbe61cd1eeb2_base ::
|
|
IO (Ptr.FunPtr Void)
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_add@
|
|
hs_bindgen_bbabdbe61cd1eeb2 :: IO (Ptr.FunPtr (HsBindgen.Runtime.LibC.Int64 -> HsBindgen.Runtime.LibC.Int64 -> IO HsBindgen.Runtime.LibC.Int64))
|
|
hs_bindgen_bbabdbe61cd1eeb2 =
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_bbabdbe61cd1eeb2_base
|
|
|
|
{-# NOINLINE add #-}
|
|
{-| __C declaration:__ @add@
|
|
|
|
__defined at:__ @garnet_rs.h 38:32@
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
-}
|
|
add :: Ptr.FunPtr (HsBindgen.Runtime.LibC.Int64 -> HsBindgen.Runtime.LibC.Int64 -> IO HsBindgen.Runtime.LibC.Int64)
|
|
add =
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_bbabdbe61cd1eeb2
|