2026-02-19 11:08:20 +00:00
|
|
|
{-# 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
|
2026-02-19 15:26:27 +00:00
|
|
|
import qualified HsBindgen.Runtime.LibC
|
2026-02-19 11:08:20 +00:00
|
|
|
import qualified HsBindgen.Runtime.PtrConst
|
|
|
|
|
import Data.Void (Void)
|
2026-02-19 11:11:23 +00:00
|
|
|
import GarnetRs
|
2026-02-19 11:08:20 +00:00
|
|
|
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;"
|
|
|
|
|
, "}"
|
2026-02-19 11:11:23 +00:00
|
|
|
, "/* com_garnet_GarnetRs_get_hello_struct */"
|
|
|
|
|
, "__attribute__ ((const))"
|
|
|
|
|
, "void (*hs_bindgen_0f8c37ef19b17a6d (void)) ("
|
2026-02-19 11:15:38 +00:00
|
|
|
, " struct T arg1"
|
2026-02-19 11:11:23 +00:00
|
|
|
, ")"
|
|
|
|
|
, "{"
|
|
|
|
|
, " return &hello_struct;"
|
|
|
|
|
, "}"
|
|
|
|
|
, "/* com_garnet_GarnetRs_get_hello_shape */"
|
|
|
|
|
, "__attribute__ ((const))"
|
|
|
|
|
, "void (*hs_bindgen_287ff3ac660f333b (void)) ("
|
2026-02-19 11:15:38 +00:00
|
|
|
, " struct Shape arg1"
|
2026-02-19 11:11:23 +00:00
|
|
|
, ")"
|
|
|
|
|
, "{"
|
|
|
|
|
, " return &hello_shape;"
|
|
|
|
|
, "}"
|
2026-02-19 15:26:27 +00:00
|
|
|
, "/* com_garnet_GarnetRs_get_add */"
|
|
|
|
|
, "__attribute__ ((const))"
|
2026-02-19 15:47:55 +00:00
|
|
|
, "int64_t (*hs_bindgen_bbabdbe61cd1eeb2 (void)) ("
|
|
|
|
|
, " int64_t arg1,"
|
|
|
|
|
, " int64_t arg2"
|
2026-02-19 15:26:27 +00:00
|
|
|
, ")"
|
|
|
|
|
, "{"
|
|
|
|
|
, " return &add;"
|
|
|
|
|
, "}"
|
2026-02-19 20:44:04 +00:00
|
|
|
, "/* com_garnet_GarnetRs_get_sum_tree */"
|
|
|
|
|
, "__attribute__ ((const))"
|
|
|
|
|
, "int64_t (*hs_bindgen_473a3e791275b06d (void)) ("
|
|
|
|
|
, " struct BTree arg1"
|
|
|
|
|
, ")"
|
|
|
|
|
, "{"
|
|
|
|
|
, " return &sum_tree;"
|
|
|
|
|
, "}"
|
2026-02-19 11:08:20 +00:00
|
|
|
]))
|
|
|
|
|
|
|
|
|
|
-- __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@
|
|
|
|
|
|
2026-02-19 20:44:04 +00:00
|
|
|
__defined at:__ @garnet_rs.h 55:6@
|
2026-02-19 11:08:20 +00:00
|
|
|
|
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
|
|
|
-}
|
|
|
|
|
hello :: Ptr.FunPtr ((HsBindgen.Runtime.PtrConst.PtrConst FC.CChar) -> IO ())
|
|
|
|
|
hello =
|
|
|
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_faf62265b53521d3
|
2026-02-19 11:11:23 +00:00
|
|
|
|
|
|
|
|
-- __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@
|
2026-02-19 11:15:38 +00:00
|
|
|
hs_bindgen_0f8c37ef19b17a6d :: IO (Ptr.FunPtr (T -> IO ()))
|
2026-02-19 11:11:23 +00:00
|
|
|
hs_bindgen_0f8c37ef19b17a6d =
|
|
|
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_0f8c37ef19b17a6d_base
|
|
|
|
|
|
|
|
|
|
{-# NOINLINE hello_struct #-}
|
|
|
|
|
{-| __C declaration:__ @hello_struct@
|
|
|
|
|
|
2026-02-19 20:44:04 +00:00
|
|
|
__defined at:__ @garnet_rs.h 57:6@
|
2026-02-19 11:11:23 +00:00
|
|
|
|
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
|
|
|
-}
|
2026-02-19 11:15:38 +00:00
|
|
|
hello_struct :: Ptr.FunPtr (T -> IO ())
|
2026-02-19 11:11:23 +00:00
|
|
|
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@
|
2026-02-19 11:15:38 +00:00
|
|
|
hs_bindgen_287ff3ac660f333b :: IO (Ptr.FunPtr (Shape -> IO ()))
|
2026-02-19 11:11:23 +00:00
|
|
|
hs_bindgen_287ff3ac660f333b =
|
|
|
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_287ff3ac660f333b_base
|
|
|
|
|
|
|
|
|
|
{-# NOINLINE hello_shape #-}
|
|
|
|
|
{-| __C declaration:__ @hello_shape@
|
|
|
|
|
|
2026-02-19 20:44:04 +00:00
|
|
|
__defined at:__ @garnet_rs.h 59:6@
|
2026-02-19 11:11:23 +00:00
|
|
|
|
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
|
|
|
-}
|
2026-02-19 11:15:38 +00:00
|
|
|
hello_shape :: Ptr.FunPtr (Shape -> IO ())
|
2026-02-19 11:11:23 +00:00
|
|
|
hello_shape =
|
|
|
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_287ff3ac660f333b
|
2026-02-19 15:26:27 +00:00
|
|
|
|
|
|
|
|
-- __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@
|
2026-02-19 15:47:55 +00:00
|
|
|
hs_bindgen_bbabdbe61cd1eeb2 :: IO (Ptr.FunPtr (HsBindgen.Runtime.LibC.Int64 -> HsBindgen.Runtime.LibC.Int64 -> IO HsBindgen.Runtime.LibC.Int64))
|
2026-02-19 15:26:27 +00:00
|
|
|
hs_bindgen_bbabdbe61cd1eeb2 =
|
|
|
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_bbabdbe61cd1eeb2_base
|
|
|
|
|
|
|
|
|
|
{-# NOINLINE add #-}
|
|
|
|
|
{-| __C declaration:__ @add@
|
|
|
|
|
|
2026-02-19 20:44:04 +00:00
|
|
|
__defined at:__ @garnet_rs.h 61:32@
|
2026-02-19 15:26:27 +00:00
|
|
|
|
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
|
|
|
-}
|
2026-02-19 15:47:55 +00:00
|
|
|
add :: Ptr.FunPtr (HsBindgen.Runtime.LibC.Int64 -> HsBindgen.Runtime.LibC.Int64 -> IO HsBindgen.Runtime.LibC.Int64)
|
2026-02-19 15:26:27 +00:00
|
|
|
add =
|
|
|
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_bbabdbe61cd1eeb2
|
2026-02-19 20:44:04 +00:00
|
|
|
|
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_sum_tree@
|
|
|
|
|
foreign import ccall unsafe "hs_bindgen_473a3e791275b06d" hs_bindgen_473a3e791275b06d_base ::
|
|
|
|
|
IO (Ptr.FunPtr Void)
|
|
|
|
|
|
|
|
|
|
-- __unique:__ @com_garnet_GarnetRs_get_sum_tree@
|
|
|
|
|
hs_bindgen_473a3e791275b06d :: IO (Ptr.FunPtr (BTree -> IO HsBindgen.Runtime.LibC.Int64))
|
|
|
|
|
hs_bindgen_473a3e791275b06d =
|
|
|
|
|
HsBindgen.Runtime.Internal.HasFFIType.fromFFIType hs_bindgen_473a3e791275b06d_base
|
|
|
|
|
|
|
|
|
|
{-# NOINLINE sum_tree #-}
|
|
|
|
|
{-| __C declaration:__ @sum_tree@
|
|
|
|
|
|
|
|
|
|
__defined at:__ @garnet_rs.h 63:9@
|
|
|
|
|
|
|
|
|
|
__exported by:__ @garnet_rs.h@
|
|
|
|
|
-}
|
|
|
|
|
sum_tree :: Ptr.FunPtr (BTree -> IO HsBindgen.Runtime.LibC.Int64)
|
|
|
|
|
sum_tree =
|
|
|
|
|
GHC.IO.Unsafe.unsafePerformIO hs_bindgen_473a3e791275b06d
|