-- addDependentFile examples/golden/attributes/type_attributes.h
{-| __C declaration:__ @struct S@

    __defined at:__ @attributes\/type_attributes.h 8:8@

    __exported by:__ @attributes\/type_attributes.h@
-}
data S
    = S {s_f :: (ConstantArray 3 CShort)
         {- ^ __C declaration:__ @f@

              __defined at:__ @attributes\/type_attributes.h 8:18@

              __exported by:__ @attributes\/type_attributes.h@
         -}}
      {- ^ __C declaration:__ @struct S@

           __defined at:__ @attributes\/type_attributes.h 8:8@

           __exported by:__ @attributes\/type_attributes.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize S
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 8 :: Int
instance ReadRaw S
    where readRaw = \ptr_0 -> pure S <*> readRaw (Proxy @"s_f") ptr_0
instance WriteRaw S
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       S s_f_2 -> writeRaw (Proxy @"s_f") ptr_0 s_f_2
deriving via (EquivStorable S) instance Storable S
instance HasCField S "s_f"
    where type CFieldType S "s_f" = ConstantArray 3 CShort
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType S "s_f") =>
         HasField "s_f" (Ptr S) (Ptr ty)
    where getField = fromPtr (Proxy @"s_f")
{-| __C declaration:__ @more_aligned_int@

    __defined at:__ @attributes\/type_attributes.h 9:13@

    __exported by:__ @attributes\/type_attributes.h@
-}
newtype More_aligned_int
    = More_aligned_int {unwrapMore_aligned_int :: CInt}
      {- ^ __C declaration:__ @more_aligned_int@

           __defined at:__ @attributes\/type_attributes.h 9:13@

           __exported by:__ @attributes\/type_attributes.h@
      -}
    deriving stock (Eq, Ord, Read, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType,
                      Prim,
                      Bitfield,
                      Bits,
                      Bounded,
                      Enum,
                      FiniteBits,
                      Integral,
                      Ix,
                      Num,
                      Real)
instance TyEq ty
              (CFieldType More_aligned_int "unwrapMore_aligned_int") =>
         HasField "unwrapMore_aligned_int" (Ptr More_aligned_int) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapMore_aligned_int")
instance HasCField More_aligned_int "unwrapMore_aligned_int"
    where type CFieldType More_aligned_int
                          "unwrapMore_aligned_int" = CInt
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @struct S2@

    __defined at:__ @attributes\/type_attributes.h 11:8@

    __exported by:__ @attributes\/type_attributes.h@
-}
data S2
    = S2 {s2_f :: (ConstantArray 3 CShort)
          {- ^ __C declaration:__ @f@

               __defined at:__ @attributes\/type_attributes.h 11:19@

               __exported by:__ @attributes\/type_attributes.h@
          -}}
      {- ^ __C declaration:__ @struct S2@

           __defined at:__ @attributes\/type_attributes.h 11:8@

           __exported by:__ @attributes\/type_attributes.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize S2
    where staticSizeOf = \_ -> 16 :: Int
          staticAlignment = \_ -> 16 :: Int
instance ReadRaw S2
    where readRaw = \ptr_0 -> pure S2 <*> readRaw (Proxy @"s2_f") ptr_0
instance WriteRaw S2
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       S2 s2_f_2 -> writeRaw (Proxy @"s2_f") ptr_0 s2_f_2
deriving via (EquivStorable S2) instance Storable S2
instance HasCField S2 "s2_f"
    where type CFieldType S2 "s2_f" = ConstantArray 3 CShort
          offset# = \_ -> \_ -> 0
instance TyEq ty (CFieldType S2 "s2_f") =>
         HasField "s2_f" (Ptr S2) (Ptr ty)
    where getField = fromPtr (Proxy @"s2_f")
{-| __C declaration:__ @struct my_unpacked_struct@

    __defined at:__ @attributes\/type_attributes.h 13:8@

    __exported by:__ @attributes\/type_attributes.h@
-}
data My_unpacked_struct
    = My_unpacked_struct {my_unpacked_struct_c :: CChar
                          {- ^ __C declaration:__ @c@

                               __defined at:__ @attributes\/type_attributes.h 15:8@

                               __exported by:__ @attributes\/type_attributes.h@
                          -},
                          my_unpacked_struct_i :: CInt
                          {- ^ __C declaration:__ @i@

                               __defined at:__ @attributes\/type_attributes.h 16:7@

                               __exported by:__ @attributes\/type_attributes.h@
                          -}}
      {- ^ __C declaration:__ @struct my_unpacked_struct@

           __defined at:__ @attributes\/type_attributes.h 13:8@

           __exported by:__ @attributes\/type_attributes.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize My_unpacked_struct
    where staticSizeOf = \_ -> 8 :: Int
          staticAlignment = \_ -> 4 :: Int
instance ReadRaw My_unpacked_struct
    where readRaw = \ptr_0 -> (pure My_unpacked_struct <*> readRaw (Proxy @"my_unpacked_struct_c") ptr_0) <*> readRaw (Proxy @"my_unpacked_struct_i") ptr_0
instance WriteRaw My_unpacked_struct
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       My_unpacked_struct my_unpacked_struct_c_2
                                                          my_unpacked_struct_i_3 -> writeRaw (Proxy @"my_unpacked_struct_c") ptr_0 my_unpacked_struct_c_2 >> writeRaw (Proxy @"my_unpacked_struct_i") ptr_0 my_unpacked_struct_i_3
deriving via (EquivStorable My_unpacked_struct) instance Storable My_unpacked_struct
instance HasCField My_unpacked_struct "my_unpacked_struct_c"
    where type CFieldType My_unpacked_struct
                          "my_unpacked_struct_c" = CChar
          offset# = \_ -> \_ -> 0
instance TyEq ty
              (CFieldType My_unpacked_struct "my_unpacked_struct_c") =>
         HasField "my_unpacked_struct_c" (Ptr My_unpacked_struct) (Ptr ty)
    where getField = fromPtr (Proxy @"my_unpacked_struct_c")
instance HasCField My_unpacked_struct "my_unpacked_struct_i"
    where type CFieldType My_unpacked_struct
                          "my_unpacked_struct_i" = CInt
          offset# = \_ -> \_ -> 4
instance TyEq ty
              (CFieldType My_unpacked_struct "my_unpacked_struct_i") =>
         HasField "my_unpacked_struct_i" (Ptr My_unpacked_struct) (Ptr ty)
    where getField = fromPtr (Proxy @"my_unpacked_struct_i")
{-| __C declaration:__ @struct my_packed_struct@

    __defined at:__ @attributes\/type_attributes.h 19:37@

    __exported by:__ @attributes\/type_attributes.h@
-}
data My_packed_struct
    = My_packed_struct {my_packed_struct_c :: CChar
                        {- ^ __C declaration:__ @c@

                             __defined at:__ @attributes\/type_attributes.h 21:9@

                             __exported by:__ @attributes\/type_attributes.h@
                        -},
                        my_packed_struct_i :: CInt
                        {- ^ __C declaration:__ @i@

                             __defined at:__ @attributes\/type_attributes.h 22:9@

                             __exported by:__ @attributes\/type_attributes.h@
                        -},
                        my_packed_struct_s :: My_unpacked_struct
                        {- ^ __C declaration:__ @s@

                             __defined at:__ @attributes\/type_attributes.h 23:30@

                             __exported by:__ @attributes\/type_attributes.h@
                        -}}
      {- ^ __C declaration:__ @struct my_packed_struct@

           __defined at:__ @attributes\/type_attributes.h 19:37@

           __exported by:__ @attributes\/type_attributes.h@
      -}
    deriving stock (Eq, Show)
instance StaticSize My_packed_struct
    where staticSizeOf = \_ -> 13 :: Int
          staticAlignment = \_ -> 1 :: Int
instance ReadRaw My_packed_struct
    where readRaw = \ptr_0 -> ((pure My_packed_struct <*> readRaw (Proxy @"my_packed_struct_c") ptr_0) <*> readRaw (Proxy @"my_packed_struct_i") ptr_0) <*> readRaw (Proxy @"my_packed_struct_s") ptr_0
instance WriteRaw My_packed_struct
    where writeRaw = \ptr_0 -> \s_1 -> case s_1 of
                                       My_packed_struct my_packed_struct_c_2
                                                        my_packed_struct_i_3
                                                        my_packed_struct_s_4 -> writeRaw (Proxy @"my_packed_struct_c") ptr_0 my_packed_struct_c_2 >> (writeRaw (Proxy @"my_packed_struct_i") ptr_0 my_packed_struct_i_3 >> writeRaw (Proxy @"my_packed_struct_s") ptr_0 my_packed_struct_s_4)
deriving via (EquivStorable My_packed_struct) instance Storable My_packed_struct
instance HasCField My_packed_struct "my_packed_struct_c"
    where type CFieldType My_packed_struct "my_packed_struct_c" = CChar
          offset# = \_ -> \_ -> 0
instance TyEq ty
              (CFieldType My_packed_struct "my_packed_struct_c") =>
         HasField "my_packed_struct_c" (Ptr My_packed_struct) (Ptr ty)
    where getField = fromPtr (Proxy @"my_packed_struct_c")
instance HasCField My_packed_struct "my_packed_struct_i"
    where type CFieldType My_packed_struct "my_packed_struct_i" = CInt
          offset# = \_ -> \_ -> 1
instance TyEq ty
              (CFieldType My_packed_struct "my_packed_struct_i") =>
         HasField "my_packed_struct_i" (Ptr My_packed_struct) (Ptr ty)
    where getField = fromPtr (Proxy @"my_packed_struct_i")
instance HasCField My_packed_struct "my_packed_struct_s"
    where type CFieldType My_packed_struct
                          "my_packed_struct_s" = My_unpacked_struct
          offset# = \_ -> \_ -> 5
instance TyEq ty
              (CFieldType My_packed_struct "my_packed_struct_s") =>
         HasField "my_packed_struct_s" (Ptr My_packed_struct) (Ptr ty)
    where getField = fromPtr (Proxy @"my_packed_struct_s")
{-| __C declaration:__ @union wait_status_ptr_t@

    __defined at:__ @attributes\/type_attributes.h 26:9@

    __exported by:__ @attributes\/type_attributes.h@
-}
newtype Wait_status_ptr_t
    = Wait_status_ptr_t {unwrapWait_status_ptr_t :: ByteArray}
      {- ^ __C declaration:__ @union wait_status_ptr_t@

           __defined at:__ @attributes\/type_attributes.h 26:9@

           __exported by:__ @attributes\/type_attributes.h@
      -}
deriving via (SizedByteArray 8
                             8) instance StaticSize Wait_status_ptr_t
deriving via (SizedByteArray 8
                             8) instance ReadRaw Wait_status_ptr_t
deriving via (SizedByteArray 8
                             8) instance WriteRaw Wait_status_ptr_t
deriving via (EquivStorable Wait_status_ptr_t) instance Storable Wait_status_ptr_t
{-|

  __See:__ 'set_wait_status_ptr_t___ip'

__C declaration:__ @__ip@

__defined at:__ @attributes\/type_attributes.h 28:8@

__exported by:__ @attributes\/type_attributes.h@
-}
get_wait_status_ptr_t___ip :: Wait_status_ptr_t -> Ptr CInt
{-|

  __See:__ 'set_wait_status_ptr_t___ip'

__C declaration:__ @__ip@

__defined at:__ @attributes\/type_attributes.h 28:8@

__exported by:__ @attributes\/type_attributes.h@
-}
get_wait_status_ptr_t___ip = getUnionPayload
{-|

  __See:__ 'get_wait_status_ptr_t___ip'

-}
set_wait_status_ptr_t___ip :: Ptr CInt -> Wait_status_ptr_t
{-|

  __See:__ 'get_wait_status_ptr_t___ip'

-}
set_wait_status_ptr_t___ip = setUnionPayload
{-|

  __See:__ 'set_wait_status_ptr_t___up'

__C declaration:__ @__up@

__defined at:__ @attributes\/type_attributes.h 29:15@

__exported by:__ @attributes\/type_attributes.h@
-}
get_wait_status_ptr_t___up :: Wait_status_ptr_t -> Ptr Wait
{-|

  __See:__ 'set_wait_status_ptr_t___up'

__C declaration:__ @__up@

__defined at:__ @attributes\/type_attributes.h 29:15@

__exported by:__ @attributes\/type_attributes.h@
-}
get_wait_status_ptr_t___up = getUnionPayload
{-|

  __See:__ 'get_wait_status_ptr_t___up'

-}
set_wait_status_ptr_t___up :: Ptr Wait -> Wait_status_ptr_t
{-|

  __See:__ 'get_wait_status_ptr_t___up'

-}
set_wait_status_ptr_t___up = setUnionPayload
instance HasCField Wait_status_ptr_t "wait_status_ptr_t___ip"
    where type CFieldType Wait_status_ptr_t
                          "wait_status_ptr_t___ip" = Ptr CInt
          offset# = \_ -> \_ -> 0
instance TyEq ty
              (CFieldType Wait_status_ptr_t "wait_status_ptr_t___ip") =>
         HasField "wait_status_ptr_t___ip" (Ptr Wait_status_ptr_t) (Ptr ty)
    where getField = fromPtr (Proxy @"wait_status_ptr_t___ip")
instance HasCField Wait_status_ptr_t "wait_status_ptr_t___up"
    where type CFieldType Wait_status_ptr_t
                          "wait_status_ptr_t___up" = Ptr Wait
          offset# = \_ -> \_ -> 0
instance TyEq ty
              (CFieldType Wait_status_ptr_t "wait_status_ptr_t___up") =>
         HasField "wait_status_ptr_t___up" (Ptr Wait_status_ptr_t) (Ptr ty)
    where getField = fromPtr (Proxy @"wait_status_ptr_t___up")
{-| __C declaration:__ @union wait@

    __defined at:__ @attributes\/type_attributes.h 29:9@

    __exported by:__ @attributes\/type_attributes.h@
-}
data Wait
{-| __C declaration:__ @T1@

    __defined at:__ @attributes\/type_attributes.h 32:13@

    __exported by:__ @attributes\/type_attributes.h@
-}
newtype T1
    = T1 {unwrapT1 :: CInt}
      {- ^ __C declaration:__ @T1@

           __defined at:__ @attributes\/type_attributes.h 32:13@

           __exported by:__ @attributes\/type_attributes.h@
      -}
    deriving stock (Eq, Ord, Read, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType,
                      Prim,
                      Bitfield,
                      Bits,
                      Bounded,
                      Enum,
                      FiniteBits,
                      Integral,
                      Ix,
                      Num,
                      Real)
instance TyEq ty (CFieldType T1 "unwrapT1") =>
         HasField "unwrapT1" (Ptr T1) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapT1")
instance HasCField T1 "unwrapT1"
    where type CFieldType T1 "unwrapT1" = CInt
          offset# = \_ -> \_ -> 0
{-| __C declaration:__ @short_a@

    __defined at:__ @attributes\/type_attributes.h 34:46@

    __exported by:__ @attributes\/type_attributes.h@
-}
newtype Short_a
    = Short_a {unwrapShort_a :: CShort}
      {- ^ __C declaration:__ @short_a@

           __defined at:__ @attributes\/type_attributes.h 34:46@

           __exported by:__ @attributes\/type_attributes.h@
      -}
    deriving stock (Eq, Ord, Read, Show)
    deriving newtype (StaticSize,
                      ReadRaw,
                      WriteRaw,
                      Storable,
                      HasFFIType,
                      Prim,
                      Bitfield,
                      Bits,
                      Bounded,
                      Enum,
                      FiniteBits,
                      Integral,
                      Ix,
                      Num,
                      Real)
instance TyEq ty (CFieldType Short_a "unwrapShort_a") =>
         HasField "unwrapShort_a" (Ptr Short_a) (Ptr ty)
    where getField = fromPtr (Proxy @"unwrapShort_a")
instance HasCField Short_a "unwrapShort_a"
    where type CFieldType Short_a "unwrapShort_a" = CShort
          offset# = \_ -> \_ -> 0
