Debian Codegraph @

.cargo/vendor/cbindgen/tests/expectations/sentinel.c

raw
1 #include <stdarg.h>
2 #include <stdbool.h>
3 #include <stdint.h>
4 #include <stdlib.h>
5
6 enum A {
7 A_A1,
8 A_A2,
9 A_A3,
10 /**
11 * Must be last for serialization purposes
12 */
13 A_Sentinel,
14 };
15 typedef uint8_t A;
16
17 enum B {
18 B_B1,
19 B_B2,
20 B_B3,
21 /**
22 * Must be last for serialization purposes
23 */
24 B_Sentinel,
25 };
26 typedef uint8_t B;
27
28 enum C_Tag {
29 C_C1,
30 C_C2,
31 C_C3,
32 /**
33 * Must be last for serialization purposes
34 */
35 C_Sentinel,
36 };
37 typedef uint8_t C_Tag;
38
39 typedef struct {
40 C_Tag tag;
41 uint32_t a;
42 } C_C1_Body;
43
44 typedef struct {
45 C_Tag tag;
46 uint32_t b;
47 } C_C2_Body;
48
49 typedef union {
50 C_Tag tag;
51 C_C1_Body c1;
52 C_C2_Body c2;
53 } C;
54
55 void root(A a, B b, C c);