Debian Codegraph @

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

raw
1 #include <stdarg.h>
2 #include <stdbool.h>
3 #include <stdint.h>
4 #include <stdlib.h>
5
6 /**
7 * Constants shared by multiple CSS Box Alignment properties
8 *
9 * These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
10 */
11 typedef struct {
12 uint8_t bits;
13 } AlignFlags;
14 /**
15 * 'auto'
16 */
17 #define AlignFlags_AUTO (AlignFlags){ .bits = (uint8_t)0 }
18 /**
19 * 'normal'
20 */
21 #define AlignFlags_NORMAL (AlignFlags){ .bits = (uint8_t)1 }
22 /**
23 * 'start'
24 */
25 #define AlignFlags_START (AlignFlags){ .bits = (uint8_t)(1 << 1) }
26 /**
27 * 'end'
28 */
29 #define AlignFlags_END (AlignFlags){ .bits = (uint8_t)(1 << 2) }
30 #define AlignFlags_ALIAS (AlignFlags){ .bits = (uint8_t)(AlignFlags_END).bits }
31 /**
32 * 'flex-start'
33 */
34 #define AlignFlags_FLEX_START (AlignFlags){ .bits = (uint8_t)(1 << 3) }
35 #define AlignFlags_MIXED (AlignFlags){ .bits = (uint8_t)(((1 << 4) | (AlignFlags_FLEX_START).bits) | (AlignFlags_END).bits) }
36 #define AlignFlags_MIXED_SELF (AlignFlags){ .bits = (uint8_t)(((1 << 5) | (AlignFlags_FLEX_START).bits) | (AlignFlags_END).bits) }
37
38 typedef struct {
39 uint32_t bits;
40 } DebugFlags;
41 /**
42 * Flag with the topmost bit set of the u32
43 */
44 #define DebugFlags_BIGGEST_ALLOWED (DebugFlags){ .bits = (uint32_t)(1 << 31) }
45
46 typedef struct {
47 uint64_t bits;
48 } LargeFlags;
49 /**
50 * Flag with a very large shift that usually would be narrowed.
51 */
52 #define LargeFlags_LARGE_SHIFT (LargeFlags){ .bits = (uint64_t)(1ull << 44) }
53 #define LargeFlags_INVERTED (LargeFlags){ .bits = (uint64_t)~(LargeFlags_LARGE_SHIFT).bits }
54
55 void root(AlignFlags flags, DebugFlags bigger_flags, LargeFlags largest_flags);