github.com/aykevl/tinygo@v0.5.0/testdata/cgo/main.h (about) 1 typedef short myint; 2 int add(int a, int b); 3 typedef int (*binop_t) (int, int); 4 int doCallback(int a, int b, binop_t cb); 5 typedef int * intPointer; 6 void store(int value, int *ptr); 7 8 typedef struct collection { 9 short s; 10 long l; 11 float f; 12 unsigned char c; 13 } collection_t; 14 15 // linked list 16 typedef struct list_t { 17 int n; 18 struct list_t *next; 19 } list_t; 20 21 typedef union joined { 22 myint s; 23 float f; 24 short data[3]; 25 } joined_t; 26 void unionSetShort(short s); 27 void unionSetFloat(float f); 28 void unionSetData(short f0, short f1, short f2); 29 30 // test globals 31 extern int global; 32 extern _Bool globalBool; 33 extern _Bool globalBool2; 34 extern float globalFloat; 35 extern double globalDouble; 36 extern _Complex float globalComplexFloat; 37 extern _Complex double globalComplexDouble; 38 extern _Complex double globalComplexLongDouble; 39 extern collection_t globalStruct; 40 extern int globalStructSize; 41 extern short globalArray[3]; 42 extern joined_t globalUnion; 43 extern int globalUnionSize; 44 45 // test duplicate definitions 46 int add(int a, int b); 47 extern int global;