-- addDependentFile examples/golden/binding-specs/name/squash_typedef.h
{-| __C declaration:__ @struct foo@

    __defined at:__ @binding-specs\/name\/squash_typedef.h 1:16@

    __exported by:__ @binding-specs\/name\/squash_typedef.h@
-}
data Piyo
    = Piyo {piyo_x :: CInt
            {- ^ __C declaration:__ @x@

                 __defined at:__ @binding-specs\/name\/squash_typedef.h 1:26@

                 __exported by:__ @binding-specs\/name\/squash_typedef.h@
            -},
            piyo_y :: CInt
            {- ^ __C declaration:__ @y@

                 __defined at:__ @binding-specs\/name\/squash_typedef.h 1:29@

                 __exported by:__ @binding-specs\/name\/squash_typedef.h@
            -}}
      {- ^ __C declaration:__ @struct foo@

           __defined at:__ @binding-specs\/name\/squash_typedef.h 1:16@

           __exported by:__ @binding-specs\/name\/squash_typedef.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize Piyo
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw Piyo
    where readRaw = \ptr_0 -> (pure Piyo <*> readRaw (Proxy @"piyo_x") ptr_0) <*> readRaw (Proxy @"piyo_y") ptr_0
instance WriteRaw Piyo
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       Piyo piyo_x_2
                                            piyo_y_3 -> writeRaw (Proxy @"piyo_x") ptr_0 piyo_x_2 >> writeRaw (Proxy @"piyo_y") ptr_0 piyo_y_3
deriving via (EquivStorable Piyo) instance Storable Piyo
instance HasCField Piyo "piyo_x"
    where type CFieldType Piyo "piyo_x" = CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType Piyo "piyo_x") =>
         HasField "piyo_x" (Ptr Piyo) (Ptr ty)
    where getField = fromPtr (Proxy @"piyo_x")
instance HasCField Piyo "piyo_y"
    where type CFieldType Piyo "piyo_y" = CInt
          offset# = \_ -> \_ -> 4
instance TyEq ty (CFieldType Piyo "piyo_y") =>
         HasField "piyo_y" (Ptr Piyo) (Ptr ty)
    where getField = fromPtr (Proxy @"piyo_y")
