hs-bindgen-1.0.0.0: test-artefacts/fixtures/program-analysis/program-slicing/macro_selected/th.txt
-- addDependentFile test-artefacts/headers/golden/program-analysis/program-slicing/macro_selected_t.h
-- addDependentFile test-artefacts/headers/golden/program-analysis/program-slicing/macro_selected.h
-- #include <program-analysis/program-slicing/macro_selected.h>
-- void hs_bindgen_27fdf7030b0bb40d (
-- T arg1
-- )
-- {
-- (foo)(arg1);
-- }
-- void hs_bindgen_ef8f97cf27661c20 (
-- U arg1
-- )
-- {
-- (bar)(arg1);
-- }
-- void hs_bindgen_72197c1a408e40ac (
-- T arg1
-- )
-- {
-- (foo)(arg1);
-- }
-- void hs_bindgen_401f15168ffec8ae (
-- U arg1
-- )
-- {
-- (bar)(arg1);
-- }
-- /* test_programanalysisprogramslici_Example_get_foo */
-- __attribute__ ((const))
-- void (*hs_bindgen_7fa7d51da57eb497 (void)) (
-- T arg1
-- )
-- {
-- return &foo;
-- }
-- /* test_programanalysisprogramslici_Example_get_bar */
-- __attribute__ ((const))
-- void (*hs_bindgen_e57577b970e09cca (void)) (
-- U arg1
-- )
-- {
-- return &bar;
-- }
{-| __C declaration:__ @macro T@
__defined at:__ @macro_selected_t.h 3:9@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
newtype T
= T {unwrapT :: CInt}
deriving stock (Eq, Generic, Ord, Read, Show)
deriving newtype (Bitfield,
Bits,
Bounded,
Enum,
FiniteBits,
HasFFIType,
Integral,
Ix,
Num,
Prim,
ReadRaw,
Real,
StaticSize,
Storable,
WriteRaw)
instance (~) ty CInt => HasField "unwrapT" T ty
where hasField = \x_0 -> (\y_1 -> T{unwrapT = y_1},
getField @"unwrapT" x_0)
instance (~) ty CInt => HasField "unwrapT" (Ptr T) (Ptr ty)
where getField = fromPtr (Proxy @"unwrapT")
instance HasCField T "unwrapT"
where type CFieldType T "unwrapT" = CInt
offset# = \_ -> \_ -> 0
{-| __C declaration:__ @macro U@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 9:9@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
newtype U
= U {unwrapU :: CInt}
deriving stock (Eq, Generic, Ord, Read, Show)
deriving newtype (Bitfield,
Bits,
Bounded,
Enum,
FiniteBits,
HasFFIType,
Integral,
Ix,
Num,
Prim,
ReadRaw,
Real,
StaticSize,
Storable,
WriteRaw)
instance (~) ty CInt => HasField "unwrapU" U ty
where hasField = \x_0 -> (\y_1 -> U{unwrapU = y_1},
getField @"unwrapU" x_0)
instance (~) ty CInt => HasField "unwrapU" (Ptr U) (Ptr ty)
where getField = fromPtr (Proxy @"unwrapU")
instance HasCField U "unwrapU"
where type CFieldType U "unwrapU" = CInt
offset# = \_ -> \_ -> 0
-- __unique:__ @test_programanalysisprogramslici_Example_Safe_foo@
foreign import ccall safe "hs_bindgen_27fdf7030b0bb40d" hs_bindgen_27fdf7030b0bb40d_base ::
CInt
-> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Safe_foo@
hs_bindgen_27fdf7030b0bb40d :: T -> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Safe_foo@
hs_bindgen_27fdf7030b0bb40d = \x_0 -> hs_bindgen_27fdf7030b0bb40d_base (toFFIType x_0)
{-| __C declaration:__ @foo@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 5:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
foo_safe :: T -> IO ()
{-| __C declaration:__ @foo@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 5:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
foo_safe = hs_bindgen_27fdf7030b0bb40d
-- __unique:__ @test_programanalysisprogramslici_Example_Safe_bar@
foreign import ccall safe "hs_bindgen_ef8f97cf27661c20" hs_bindgen_ef8f97cf27661c20_base ::
CInt
-> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Safe_bar@
hs_bindgen_ef8f97cf27661c20 :: U -> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Safe_bar@
hs_bindgen_ef8f97cf27661c20 = \x_0 -> hs_bindgen_ef8f97cf27661c20_base (toFFIType x_0)
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 10:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
bar_safe :: U -> IO ()
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 10:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
bar_safe = hs_bindgen_ef8f97cf27661c20
-- __unique:__ @test_programanalysisprogramslici_Example_Unsafe_foo@
foreign import ccall unsafe "hs_bindgen_72197c1a408e40ac" hs_bindgen_72197c1a408e40ac_base ::
CInt
-> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Unsafe_foo@
hs_bindgen_72197c1a408e40ac :: T -> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Unsafe_foo@
hs_bindgen_72197c1a408e40ac = \x_0 -> hs_bindgen_72197c1a408e40ac_base (toFFIType x_0)
{-| __C declaration:__ @foo@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 5:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
foo_unsafe :: T -> IO ()
{-| __C declaration:__ @foo@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 5:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
foo_unsafe = hs_bindgen_72197c1a408e40ac
-- __unique:__ @test_programanalysisprogramslici_Example_Unsafe_bar@
foreign import ccall unsafe "hs_bindgen_401f15168ffec8ae" hs_bindgen_401f15168ffec8ae_base ::
CInt
-> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Unsafe_bar@
hs_bindgen_401f15168ffec8ae :: U -> IO ()
-- __unique:__ @test_programanalysisprogramslici_Example_Unsafe_bar@
hs_bindgen_401f15168ffec8ae = \x_0 -> hs_bindgen_401f15168ffec8ae_base (toFFIType x_0)
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 10:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
bar_unsafe :: U -> IO ()
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 10:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
bar_unsafe = hs_bindgen_401f15168ffec8ae
-- __unique:__ @test_programanalysisprogramslici_Example_get_foo@
foreign import ccall unsafe "hs_bindgen_7fa7d51da57eb497" hs_bindgen_7fa7d51da57eb497_base ::
IO (FunPtr Void)
-- __unique:__ @test_programanalysisprogramslici_Example_get_foo@
hs_bindgen_7fa7d51da57eb497 :: IO (FunPtr (T -> IO ()))
-- __unique:__ @test_programanalysisprogramslici_Example_get_foo@
hs_bindgen_7fa7d51da57eb497 = fmap fromFFIType hs_bindgen_7fa7d51da57eb497_base
{-# NOINLINE foo_funptr #-}
{-| __C declaration:__ @foo@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 5:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
foo_funptr :: FunPtr (T -> IO ())
{-| __C declaration:__ @foo@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 5:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
foo_funptr = unsafePerformIO hs_bindgen_7fa7d51da57eb497
-- __unique:__ @test_programanalysisprogramslici_Example_get_bar@
foreign import ccall unsafe "hs_bindgen_e57577b970e09cca" hs_bindgen_e57577b970e09cca_base ::
IO (FunPtr Void)
-- __unique:__ @test_programanalysisprogramslici_Example_get_bar@
hs_bindgen_e57577b970e09cca :: IO (FunPtr (U -> IO ()))
-- __unique:__ @test_programanalysisprogramslici_Example_get_bar@
hs_bindgen_e57577b970e09cca = fmap fromFFIType hs_bindgen_e57577b970e09cca_base
{-# NOINLINE bar_funptr #-}
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 10:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
bar_funptr :: FunPtr (U -> IO ())
{-| __C declaration:__ @bar@
__defined at:__ @program-analysis\/program-slicing\/macro_selected.h 10:6@
__exported by:__ @program-analysis\/program-slicing\/macro_selected.h@
-}
bar_funptr = unsafePerformIO hs_bindgen_e57577b970e09cca