vq / vlib / v / tests / c_structs / cstruct.h
46 lines · 34 sloc · 520 bytes · caea2daece4cb5f435a61f77ce771496fc8c635a
Raw
1
2struct Abc {
3 int field;
4};
5
6typedef struct Test2 {
7 int a;
8} Test2;
9
10typedef struct Test1 {
11 Test2 a;
12} Test1;
13
14/////
15
16typedef struct MyCStruct {
17 char* data;
18} MyCStruct;
19
20/////
21
22typedef struct Foo {
23 int a;
24} Foo;
25
26typedef struct Bar {
27 int a;
28 float b;
29} Bar;
30
31///
32
33typedef struct TestAlias {
34 int a;
35};
36
37///
38
39typedef struct MyRefStruct MyRefStruct;
40struct MyRefStruct {
41 char* format;
42 char* name;
43 void** children;
44 void (*release)(struct MyRefStruct*);
45 void* private_data;
46};
47