1 #include <stdarg.h> 2 #include <stdbool.h> 3 #include <stdint.h> 4 #include <stdlib.h> 5 6 typedef enum MyCLikeEnum { 7 Foo1, 8 Bar1, 9 Baz1, 10 } MyCLikeEnum; 11 12 typedef enum MyCLikeEnum_Prepended { 13 Foo1_Prepended, 14 Bar1_Prepended, 15 Baz1_Prepended, 16 } MyCLikeEnum_Prepended; 17 18 typedef struct MyFancyStruct { 19 int32_t i; 20 #ifdef __cplusplus 21 inline void foo(); 22 #endif 23 } MyFancyStruct; 24 25 typedef enum MyFancyEnum_Tag { 26 Foo, 27 Bar, 28 Baz, 29 } MyFancyEnum_Tag; 30 31 typedef struct Bar_Body { 32 int32_t _0; 33 } Bar_Body; 34 35 typedef struct Baz_Body { 36 int32_t _0; 37 } Baz_Body; 38 39 typedef struct MyFancyEnum { 40 MyFancyEnum_Tag tag; 41 union { 42 Bar_Body bar; 43 Baz_Body baz; 44 }; 45 #ifdef __cplusplus 46 inline void wohoo(); 47 #endif 48 } MyFancyEnum; 49 50 typedef union MyUnion { 51 float f; 52 uint32_t u; 53 int32_t extra_member; // yolo 54 } MyUnion; 55 56 typedef struct MyFancyStruct_Prepended { 57 #ifdef __cplusplus 58 inline void prepended_wohoo(); 59 #endif 60 int32_t i; 61 } MyFancyStruct_Prepended; 62 63 typedef enum MyFancyEnum_Prepended_Tag { 64 Foo_Prepended, 65 Bar_Prepended, 66 Baz_Prepended, 67 } MyFancyEnum_Prepended_Tag; 68 69 typedef struct Bar_Prepended_Body { 70 int32_t _0; 71 } Bar_Prepended_Body; 72 73 typedef struct Baz_Prepended_Body { 74 int32_t _0; 75 } Baz_Prepended_Body; 76 77 typedef struct MyFancyEnum_Prepended { 78 #ifdef __cplusplus 79 inline void wohoo(); 80 #endif 81 MyFancyEnum_Prepended_Tag tag; 82 union { 83 Bar_Prepended_Body bar_prepended; 84 Baz_Prepended_Body baz_prepended; 85 }; 86 } MyFancyEnum_Prepended; 87 88 typedef union MyUnion_Prepended { 89 int32_t extra_member; // yolo 90 float f; 91 uint32_t u; 92 } MyUnion_Prepended; 93 94 #ifdef __cplusplus 95 extern "C" { 96 #endif // __cplusplus 97 98 void root(MyFancyStruct s, 99 MyFancyEnum e, 100 MyCLikeEnum c, 101 MyUnion u, 102 MyFancyStruct_Prepended sp, 103 MyFancyEnum_Prepended ep, 104 MyCLikeEnum_Prepended cp, 105 MyUnion_Prepended up); 106 107 #ifdef __cplusplus 108 } // extern "C" 109 #endif // __cplusplus 110