1 #include <stdarg.h> 2 #include <stdbool.h> 3 #include <stdint.h> 4 #include <stdlib.h> 5 6 typedef struct { 7 int32_t x; 8 int32_t y; 9 } StylePoint_i32; 10 11 typedef struct { 12 float x; 13 float y; 14 } StylePoint_f32; 15 16 enum StyleFoo_i32_Tag 17 #ifdef __cplusplus 18 : uint8_t 19 #endif // __cplusplus 20 { 21 Foo_i32, 22 Bar_i32, 23 Baz_i32, 24 Bazz_i32, 25 }; 26 #ifndef __cplusplus 27 typedef uint8_t StyleFoo_i32_Tag; 28 #endif // __cplusplus 29 30 typedef struct { 31 StyleFoo_i32_Tag tag; 32 int32_t x; 33 StylePoint_i32 y; 34 StylePoint_f32 z; 35 } StyleFoo_Body_i32; 36 37 typedef union { 38 StyleFoo_i32_Tag tag; 39 StyleFoo_Body_i32 foo; 40 struct { 41 StyleFoo_i32_Tag bar_tag; 42 int32_t bar; 43 }; 44 struct { 45 StyleFoo_i32_Tag baz_tag; 46 StylePoint_i32 baz; 47 }; 48 } StyleFoo_i32; 49 50 typedef enum { 51 Bar1_i32, 52 Bar2_i32, 53 Bar3_i32, 54 Bar4_i32, 55 } StyleBar_i32_Tag; 56 57 typedef struct { 58 int32_t x; 59 StylePoint_i32 y; 60 StylePoint_f32 z; 61 int32_t (*u)(int32_t); 62 } StyleBar1_Body_i32; 63 64 typedef struct { 65 StyleBar_i32_Tag tag; 66 union { 67 StyleBar1_Body_i32 bar1; 68 struct { 69 int32_t bar2; 70 }; 71 struct { 72 StylePoint_i32 bar3; 73 }; 74 }; 75 } StyleBar_i32; 76 77 typedef struct { 78 uint32_t x; 79 uint32_t y; 80 } StylePoint_u32; 81 82 typedef enum { 83 Bar1_u32, 84 Bar2_u32, 85 Bar3_u32, 86 Bar4_u32, 87 } StyleBar_u32_Tag; 88 89 typedef struct { 90 int32_t x; 91 StylePoint_u32 y; 92 StylePoint_f32 z; 93 int32_t (*u)(int32_t); 94 } StyleBar1_Body_u32; 95 96 typedef struct { 97 StyleBar_u32_Tag tag; 98 union { 99 StyleBar1_Body_u32 bar1; 100 struct { 101 uint32_t bar2; 102 }; 103 struct { 104 StylePoint_u32 bar3; 105 }; 106 }; 107 } StyleBar_u32; 108 109 enum StyleBaz_Tag 110 #ifdef __cplusplus 111 : uint8_t 112 #endif // __cplusplus 113 { 114 Baz1, 115 Baz2, 116 Baz3, 117 }; 118 #ifndef __cplusplus 119 typedef uint8_t StyleBaz_Tag; 120 #endif // __cplusplus 121 122 typedef union { 123 StyleBaz_Tag tag; 124 struct { 125 StyleBaz_Tag baz1_tag; 126 StyleBar_u32 baz1; 127 }; 128 struct { 129 StyleBaz_Tag baz2_tag; 130 StylePoint_i32 baz2; 131 }; 132 } StyleBaz; 133 134 enum StyleTaz_Tag 135 #ifdef __cplusplus 136 : uint8_t 137 #endif // __cplusplus 138 { 139 Taz1, 140 Taz2, 141 Taz3, 142 }; 143 #ifndef __cplusplus 144 typedef uint8_t StyleTaz_Tag; 145 #endif // __cplusplus 146 147 typedef struct { 148 StyleTaz_Tag tag; 149 union { 150 struct { 151 StyleBar_u32 taz1; 152 }; 153 struct { 154 StyleBaz taz2; 155 }; 156 }; 157 } StyleTaz; 158 159 #ifdef __cplusplus 160 extern "C" { 161 #endif // __cplusplus 162 163 void foo(const StyleFoo_i32 *foo, 164 const StyleBar_i32 *bar, 165 const StyleBaz *baz, 166 const StyleTaz *taz); 167 168 #ifdef __cplusplus 169 } // extern "C" 170 #endif // __cplusplus 171