1 #include <stdarg.h> 2 #include <stdbool.h> 3 #include <stdint.h> 4 #include <stdlib.h> 5 6 enum FillRule 7 #ifdef __cplusplus 8 : uint8_t 9 #endif // __cplusplus 10 { 11 A, 12 B, 13 }; 14 #ifndef __cplusplus 15 typedef uint8_t FillRule; 16 #endif // __cplusplus 17 18 /** 19 * This will have a destructor manually implemented via variant_body, and 20 * similarly a Drop impl in Rust. 21 */ 22 struct OwnedSlice_u32 { 23 uintptr_t len; 24 uint32_t *ptr; 25 }; 26 27 struct Polygon_u32 { 28 FillRule fill; 29 struct OwnedSlice_u32 coordinates; 30 }; 31 32 /** 33 * This will have a destructor manually implemented via variant_body, and 34 * similarly a Drop impl in Rust. 35 */ 36 struct OwnedSlice_i32 { 37 uintptr_t len; 38 int32_t *ptr; 39 }; 40 41 enum Foo_u32_Tag 42 #ifdef __cplusplus 43 : uint8_t 44 #endif // __cplusplus 45 { 46 Bar_u32, 47 Polygon1_u32, 48 Slice1_u32, 49 Slice2_u32, 50 Slice3_u32, 51 Slice4_u32, 52 }; 53 #ifndef __cplusplus 54 typedef uint8_t Foo_u32_Tag; 55 #endif // __cplusplus 56 57 struct Polygon1_Body_u32 { 58 struct Polygon_u32 _0; 59 }; 60 61 struct Slice1_Body_u32 { 62 struct OwnedSlice_u32 _0; 63 }; 64 65 struct Slice2_Body_u32 { 66 struct OwnedSlice_i32 _0; 67 }; 68 69 struct Slice3_Body_u32 { 70 FillRule fill; 71 struct OwnedSlice_u32 coords; 72 }; 73 74 struct Slice4_Body_u32 { 75 FillRule fill; 76 struct OwnedSlice_i32 coords; 77 }; 78 79 struct Foo_u32 { 80 Foo_u32_Tag tag; 81 union { 82 struct Polygon1_Body_u32 polygon1; 83 struct Slice1_Body_u32 slice1; 84 struct Slice2_Body_u32 slice2; 85 struct Slice3_Body_u32 slice3; 86 struct Slice4_Body_u32 slice4; 87 }; 88 }; 89 90 struct Polygon_i32 { 91 FillRule fill; 92 struct OwnedSlice_i32 coordinates; 93 }; 94 95 enum Baz_i32_Tag 96 #ifdef __cplusplus 97 : uint8_t 98 #endif // __cplusplus 99 { 100 Bar2_i32, 101 Polygon21_i32, 102 Slice21_i32, 103 Slice22_i32, 104 Slice23_i32, 105 Slice24_i32, 106 }; 107 #ifndef __cplusplus 108 typedef uint8_t Baz_i32_Tag; 109 #endif // __cplusplus 110 111 struct Polygon21_Body_i32 { 112 Baz_i32_Tag tag; 113 struct Polygon_i32 _0; 114 }; 115 116 struct Slice21_Body_i32 { 117 Baz_i32_Tag tag; 118 struct OwnedSlice_i32 _0; 119 }; 120 121 struct Slice22_Body_i32 { 122 Baz_i32_Tag tag; 123 struct OwnedSlice_i32 _0; 124 }; 125 126 struct Slice23_Body_i32 { 127 Baz_i32_Tag tag; 128 FillRule fill; 129 struct OwnedSlice_i32 coords; 130 }; 131 132 struct Slice24_Body_i32 { 133 Baz_i32_Tag tag; 134 FillRule fill; 135 struct OwnedSlice_i32 coords; 136 }; 137 138 union Baz_i32 { 139 Baz_i32_Tag tag; 140 struct Polygon21_Body_i32 polygon21; 141 struct Slice21_Body_i32 slice21; 142 struct Slice22_Body_i32 slice22; 143 struct Slice23_Body_i32 slice23; 144 struct Slice24_Body_i32 slice24; 145 }; 146 147 enum Taz_Tag 148 #ifdef __cplusplus 149 : uint8_t 150 #endif // __cplusplus 151 { 152 Bar3, 153 Taz1, 154 Taz3, 155 }; 156 #ifndef __cplusplus 157 typedef uint8_t Taz_Tag; 158 #endif // __cplusplus 159 160 struct Taz1_Body { 161 Taz_Tag tag; 162 int32_t _0; 163 }; 164 165 struct Taz3_Body { 166 Taz_Tag tag; 167 struct OwnedSlice_i32 _0; 168 }; 169 170 union Taz { 171 Taz_Tag tag; 172 struct Taz1_Body taz1; 173 struct Taz3_Body taz3; 174 }; 175 176 enum Tazz_Tag 177 #ifdef __cplusplus 178 : uint8_t 179 #endif // __cplusplus 180 { 181 Bar4, 182 Taz2, 183 }; 184 #ifndef __cplusplus 185 typedef uint8_t Tazz_Tag; 186 #endif // __cplusplus 187 188 struct Taz2_Body { 189 Tazz_Tag tag; 190 int32_t _0; 191 }; 192 193 union Tazz { 194 Tazz_Tag tag; 195 struct Taz2_Body taz2; 196 }; 197 198 enum Tazzz_Tag 199 #ifdef __cplusplus 200 : uint8_t 201 #endif // __cplusplus 202 { 203 Bar5, 204 Taz5, 205 }; 206 #ifndef __cplusplus 207 typedef uint8_t Tazzz_Tag; 208 #endif // __cplusplus 209 210 struct Taz5_Body { 211 Tazzz_Tag tag; 212 int32_t _0; 213 }; 214 215 union Tazzz { 216 Tazzz_Tag tag; 217 struct Taz5_Body taz5; 218 }; 219 220 enum Tazzzz_Tag 221 #ifdef __cplusplus 222 : uint8_t 223 #endif // __cplusplus 224 { 225 Taz6, 226 Taz7, 227 }; 228 #ifndef __cplusplus 229 typedef uint8_t Tazzzz_Tag; 230 #endif // __cplusplus 231 232 struct Taz6_Body { 233 Tazzzz_Tag tag; 234 int32_t _0; 235 }; 236 237 struct Taz7_Body { 238 Tazzzz_Tag tag; 239 uint32_t _0; 240 }; 241 242 union Tazzzz { 243 Tazzzz_Tag tag; 244 struct Taz6_Body taz6; 245 struct Taz7_Body taz7; 246 }; 247 248 #ifdef __cplusplus 249 extern "C" { 250 #endif // __cplusplus 251 252 void root(const struct Foo_u32 *a, 253 const union Baz_i32 *b, 254 const union Taz *c, 255 union Tazz d, 256 const union Tazzz *e, 257 const union Tazzzz *f); 258 259 #ifdef __cplusplus 260 } // extern "C" 261 #endif // __cplusplus 262