git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

scratch/print_c_sizes.c (2.4K)

 1 #define WLR_USE_UNSTABLE
 2 #include <wlr/types/wlr_output.h>
 3 #include <pixman.h>
 4 #include <stdio.h>
 5 #include <stddef.h>
 6 
 7 int main() {
 8     printf("C sizeof(struct wlr_output_state): %zu\n", sizeof(struct wlr_output_state));
 9     printf("C alignof(struct wlr_output_state): %zu\n", _Alignof(struct wlr_output_state));
10     printf("C sizeof(pixman_region32_t): %zu\n", sizeof(pixman_region32_t));
11     printf("C alignof(pixman_region32_t): %zu\n", _Alignof(pixman_region32_t));
12 
13     printf("committed: %zu\n", offsetof(struct wlr_output_state, committed));
14     printf("allow_reconfiguration: %zu\n", offsetof(struct wlr_output_state, allow_reconfiguration));
15     printf("damage: %zu\n", offsetof(struct wlr_output_state, damage));
16     printf("enabled: %zu\n", offsetof(struct wlr_output_state, enabled));
17     printf("scale: %zu\n", offsetof(struct wlr_output_state, scale));
18     printf("transform: %zu\n", offsetof(struct wlr_output_state, transform));
19     printf("adaptive_sync_enabled: %zu\n", offsetof(struct wlr_output_state, adaptive_sync_enabled));
20     printf("render_format: %zu\n", offsetof(struct wlr_output_state, render_format));
21     printf("subpixel: %zu\n", offsetof(struct wlr_output_state, subpixel));
22     printf("buffer: %zu\n", offsetof(struct wlr_output_state, buffer));
23     printf("buffer_src_box: %zu\n", offsetof(struct wlr_output_state, buffer_src_box));
24     printf("buffer_dst_box: %zu\n", offsetof(struct wlr_output_state, buffer_dst_box));
25     printf("tearing_page_flip: %zu\n", offsetof(struct wlr_output_state, tearing_page_flip));
26     printf("mode_type: %zu\n", offsetof(struct wlr_output_state, mode_type));
27     printf("mode: %zu\n", offsetof(struct wlr_output_state, mode));
28     printf("custom_mode: %zu\n", offsetof(struct wlr_output_state, custom_mode));
29     printf("gamma_lut: %zu\n", offsetof(struct wlr_output_state, gamma_lut));
30     printf("gamma_lut_size: %zu\n", offsetof(struct wlr_output_state, gamma_lut_size));
31     printf("layers: %zu\n", offsetof(struct wlr_output_state, layers));
32     printf("layers_len: %zu\n", offsetof(struct wlr_output_state, layers_len));
33     printf("wait_timeline: %zu\n", offsetof(struct wlr_output_state, wait_timeline));
34     printf("wait_point: %zu\n", offsetof(struct wlr_output_state, wait_point));
35     printf("signal_timeline: %zu\n", offsetof(struct wlr_output_state, signal_timeline));
36     printf("signal_point: %zu\n", offsetof(struct wlr_output_state, signal_point));
37     return 0;
38 }