hs-bindgen-1.0.0.0: test-artefacts/fixtures/declarations/opaque_declaration/th.txt
-- addDependentFile test-artefacts/headers/golden/declarations/opaque_declaration.h
{-| __C declaration:__ @struct foo@
__defined at:__ @declarations\/opaque_declaration.h 1:8@
__exported by:__ @declarations\/opaque_declaration.h@
-}
data Foo
{-| __C declaration:__ @struct bar@
__defined at:__ @declarations\/opaque_declaration.h 4:8@
__exported by:__ @declarations\/opaque_declaration.h@
-}
data Bar
= Bar {bar_ptrA :: (Ptr Foo)
{- ^ __C declaration:__ @ptrA@
__defined at:__ @declarations\/opaque_declaration.h 5:17@
__exported by:__ @declarations\/opaque_declaration.h@
-},
bar_ptrB :: (Ptr Bar)
{- ^ __C declaration:__ @ptrB@
__defined at:__ @declarations\/opaque_declaration.h 6:17@
__exported by:__ @declarations\/opaque_declaration.h@
-}}
deriving stock (Eq, Generic, Show)
instance StaticSize Bar
where staticSizeOf = \_ -> 16 :: Int
staticAlignment = \_ -> 8 :: Int
instance ReadRaw Bar
where readRaw = \ptr_0 -> (pure Bar <*> readRaw (Proxy @"bar_ptrA") ptr_0) <*> readRaw (Proxy @"bar_ptrB") ptr_0
instance WriteRaw Bar
where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
Bar bar_ptrA_2
bar_ptrB_3 -> writeRaw (Proxy @"bar_ptrA") ptr_0 bar_ptrA_2 >> writeRaw (Proxy @"bar_ptrB") ptr_0 bar_ptrB_3
deriving via (EquivStorable Bar) instance Storable Bar
deriving via (IsStructViaReadRaw Bar) instance IsStruct Bar
instance (~) ty (Ptr Foo) => HasField "bar_ptrA" Bar ty
where hasField = \x_0 -> (\y_1 -> Bar{bar_ptrA = y_1,
bar_ptrB = getField @"bar_ptrB" x_0},
getField @"bar_ptrA" x_0)
instance (~) ty (Ptr Foo) => HasField "bar_ptrA" (Ptr Bar) (Ptr ty)
where getField = fromPtr (Proxy @"bar_ptrA")
instance HasCField Bar "bar_ptrA"
where type CFieldType Bar "bar_ptrA" = Ptr Foo
offset# = \_ -> \_ -> 0
instance (~) ty (Ptr Bar) => HasField "bar_ptrB" Bar ty
where hasField = \x_0 -> (\y_1 -> Bar{bar_ptrB = y_1,
bar_ptrA = getField @"bar_ptrA" x_0},
getField @"bar_ptrB" x_0)
instance (~) ty (Ptr Bar) => HasField "bar_ptrB" (Ptr Bar) (Ptr ty)
where getField = fromPtr (Proxy @"bar_ptrB")
instance HasCField Bar "bar_ptrB"
where type CFieldType Bar "bar_ptrB" = Ptr Bar
offset# = \_ -> \_ -> 8
{-| __C declaration:__ @struct baz@
__defined at:__ @declarations\/opaque_declaration.h 9:8@
__exported by:__ @declarations\/opaque_declaration.h@
-}
data Baz = Baz {} deriving stock (Eq, Generic, Show)
instance StaticSize Baz
where staticSizeOf = \_ -> 0 :: Int
staticAlignment = \_ -> 1 :: Int
instance ReadRaw Baz
where readRaw = \ptr_0 -> pure Baz
instance WriteRaw Baz
where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
Baz -> pure ()
deriving via (EquivStorable Baz) instance Storable Baz
deriving via (IsStructViaReadRaw Baz) instance IsStruct Baz
{-| __C declaration:__ @enum quu@
__defined at:__ @declarations\/opaque_declaration.h 11:6@
__exported by:__ @declarations\/opaque_declaration.h@
-}
data Quu
{-| __C declaration:__ @union opaque_union@
__defined at:__ @declarations\/opaque_declaration.h 13:7@
__exported by:__ @declarations\/opaque_declaration.h@
-}
data Opaque_union