packages feed

hs-bindgen-1.0.0.0: test-artefacts/fixtures/functions/decls_in_signature/th.txt

-- addDependentFile test-artefacts/headers/golden/functions/decls_in_signature.h
-- #include <functions/decls_in_signature.h>
-- void hs_bindgen_920e5c20f770432b (
--   struct opaque *arg1,
--   struct outside *arg2,
--   struct outside *arg3
-- )
-- {
--   (normal)(arg1, arg2, *arg3);
-- }
-- void hs_bindgen_247ee31a29b7e5a8 (
--   struct opaque *arg1,
--   struct outside *arg2,
--   struct outside *arg3
-- )
-- {
--   (normal)(arg1, arg2, *arg3);
-- }
-- /* test_functionsdecls_in_signature_Example_get_normal */
-- __attribute__ ((const))
-- void (*hs_bindgen_f3036965ea57b87f (void)) (
--   struct opaque *arg1,
--   struct outside *arg2,
--   struct outside arg3
-- )
-- {
--   return &normal;
-- }
{-| __C declaration:__ @struct opaque@

    __defined at:__ @functions\/decls_in_signature.h 2:8@

    __exported by:__ @functions\/decls_in_signature.h@
-}
data Opaque
{-| __C declaration:__ @struct outside@

    __defined at:__ @functions\/decls_in_signature.h 3:8@

    __exported by:__ @functions\/decls_in_signature.h@
-}
data Outside
    = Outside {outside_x :: CInt
               {- ^ __C declaration:__ @x@

                    __defined at:__ @functions\/decls_in_signature.h 4:7@

                    __exported by:__ @functions\/decls_in_signature.h@
               -},
               outside_y :: CInt
               {- ^ __C declaration:__ @y@

                    __defined at:__ @functions\/decls_in_signature.h 5:7@

                    __exported by:__ @functions\/decls_in_signature.h@
               -}}
    deriving stock (Eq, Generic, Show)
instance StaticSize Outside
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Outside
    where readRaw = \ptr_0 -> (pure Outside <*> readRaw (Proxy @"outside_x") ptr_0) <*> readRaw (Proxy @"outside_y") ptr_0
instance WriteRaw Outside
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Outside outside_x_2
                                               outside_y_3 -> writeRaw (Proxy @"outside_x") ptr_0 outside_x_2 >> writeRaw (Proxy @"outside_y") ptr_0 outside_y_3
deriving via (EquivStorable Outside) instance Storable Outside
deriving via (IsStructViaReadRaw Outside) instance IsStruct Outside
instance (~) ty CInt => HasField "outside_x" Outside ty
    where hasField = \x_0 -> (\y_1 -> Outside{outside_x = y_1,
                                              outside_y = getField @"outside_y" x_0},
                              getField @"outside_x" x_0)
instance (~) ty CInt => HasField "outside_x" (Ptr Outside) (Ptr ty)
    where getField = fromPtr (Proxy @"outside_x")
instance HasCField Outside "outside_x"
    where type CFieldType Outside "outside_x" = CInt
          offset# = \_ -> \_ -> 0
instance (~) ty CInt => HasField "outside_y" Outside ty
    where hasField = \x_0 -> (\y_1 -> Outside{outside_y = y_1,
                                              outside_x = getField @"outside_x" x_0},
                              getField @"outside_y" x_0)
instance (~) ty CInt => HasField "outside_y" (Ptr Outside) (Ptr ty)
    where getField = fromPtr (Proxy @"outside_y")
instance HasCField Outside "outside_y"
    where type CFieldType Outside "outside_y" = CInt
          offset# = \_ -> \_ -> 4
-- __unique:__ @test_functionsdecls_in_signature_Example_Safe_normal@
foreign import ccall safe "hs_bindgen_920e5c20f770432b" hs_bindgen_920e5c20f770432b_base ::
    Ptr Void
 -> Ptr Void
 -> Ptr Void
 -> IO ()
-- __unique:__ @test_functionsdecls_in_signature_Example_Safe_normal@
hs_bindgen_920e5c20f770432b :: Ptr Opaque ->
                               Ptr Outside -> Ptr Outside -> IO ()
-- __unique:__ @test_functionsdecls_in_signature_Example_Safe_normal@
hs_bindgen_920e5c20f770432b = \x_0 -> \x_1 -> \x_2 -> hs_bindgen_920e5c20f770432b_base (toFFIType x_0) (toFFIType x_1) (toFFIType x_2)
{-| __C declaration:__ @normal@

    __defined at:__ @functions\/decls_in_signature.h 7:6@

    __exported by:__ @functions\/decls_in_signature.h@
-}
normal_safe :: Ptr Opaque -> Ptr Outside -> Outside -> IO ()
{-| __C declaration:__ @normal@

    __defined at:__ @functions\/decls_in_signature.h 7:6@

    __exported by:__ @functions\/decls_in_signature.h@
-}
normal_safe = \ptr_to_opaque_0 -> \ptr_to_defined_1 -> \by_value_2 -> with by_value_2 (\by_value_3 -> hs_bindgen_920e5c20f770432b ptr_to_opaque_0 ptr_to_defined_1 by_value_3)
-- __unique:__ @test_functionsdecls_in_signature_Example_Unsafe_normal@
foreign import ccall unsafe "hs_bindgen_247ee31a29b7e5a8" hs_bindgen_247ee31a29b7e5a8_base ::
    Ptr Void
 -> Ptr Void
 -> Ptr Void
 -> IO ()
-- __unique:__ @test_functionsdecls_in_signature_Example_Unsafe_normal@
hs_bindgen_247ee31a29b7e5a8 :: Ptr Opaque ->
                               Ptr Outside -> Ptr Outside -> IO ()
-- __unique:__ @test_functionsdecls_in_signature_Example_Unsafe_normal@
hs_bindgen_247ee31a29b7e5a8 = \x_0 -> \x_1 -> \x_2 -> hs_bindgen_247ee31a29b7e5a8_base (toFFIType x_0) (toFFIType x_1) (toFFIType x_2)
{-| __C declaration:__ @normal@

    __defined at:__ @functions\/decls_in_signature.h 7:6@

    __exported by:__ @functions\/decls_in_signature.h@
-}
normal_unsafe :: Ptr Opaque -> Ptr Outside -> Outside -> IO ()
{-| __C declaration:__ @normal@

    __defined at:__ @functions\/decls_in_signature.h 7:6@

    __exported by:__ @functions\/decls_in_signature.h@
-}
normal_unsafe = \ptr_to_opaque_0 -> \ptr_to_defined_1 -> \by_value_2 -> with by_value_2 (\by_value_3 -> hs_bindgen_247ee31a29b7e5a8 ptr_to_opaque_0 ptr_to_defined_1 by_value_3)
-- __unique:__ @test_functionsdecls_in_signature_Example_get_normal@
foreign import ccall unsafe "hs_bindgen_f3036965ea57b87f" hs_bindgen_f3036965ea57b87f_base ::
    IO (FunPtr Void)
-- __unique:__ @test_functionsdecls_in_signature_Example_get_normal@
hs_bindgen_f3036965ea57b87f :: IO (FunPtr (Ptr Opaque ->
                                           Ptr Outside -> Outside -> IO ()))
-- __unique:__ @test_functionsdecls_in_signature_Example_get_normal@
hs_bindgen_f3036965ea57b87f = fmap fromFFIType hs_bindgen_f3036965ea57b87f_base
{-# NOINLINE normal_funptr #-}
{-| __C declaration:__ @normal@

    __defined at:__ @functions\/decls_in_signature.h 7:6@

    __exported by:__ @functions\/decls_in_signature.h@
-}
normal_funptr :: FunPtr (Ptr Opaque ->
                         Ptr Outside -> Outside -> IO ())
{-| __C declaration:__ @normal@

    __defined at:__ @functions\/decls_in_signature.h 7:6@

    __exported by:__ @functions\/decls_in_signature.h@
-}
normal_funptr = unsafePerformIO hs_bindgen_f3036965ea57b87f