30 lines
1.3 KiB
C
30 lines
1.3 KiB
C
/* generate-offsets.c
|
||
* Генерирует offsets.inc с смещениями полей структур
|
||
*/
|
||
|
||
#include <stdio.h>
|
||
#include <stddef.h>
|
||
#include "window.h"
|
||
|
||
int main(void) {
|
||
printf("; offsets.inc — generated automatically\n");
|
||
|
||
// window_draw_info offsets
|
||
printf("WDI_DATA equ %zu\n", offsetof(struct window_draw_info, data));
|
||
printf("WDI_WIDTH equ %zu\n", offsetof(struct window_draw_info, width));
|
||
printf("WDI_HEIGHT equ %zu\n", offsetof(struct window_draw_info, height));
|
||
printf("WDI_FIGURE equ %zu\n", offsetof(struct window_draw_info, figure));
|
||
printf("WDI_FIGURE_MUTEX equ %zu\n", offsetof(struct window_draw_info, figure_mutex));
|
||
printf("\n");
|
||
|
||
// figure_animation_info offsets
|
||
printf("FIG_TYPE equ %zu\n", offsetof(struct figure_animation_info, type));
|
||
printf("FIG_POSITION equ %zu\n", offsetof(struct figure_animation_info, position));
|
||
printf("FIG_VELOCITY equ %zu\n", offsetof(struct figure_animation_info, velocity));
|
||
printf("FIG_ANGLE equ %zu\n", offsetof(struct figure_animation_info, angle));
|
||
printf("FIG_ANG_VEL equ %zu\n", offsetof(struct figure_animation_info, angular_velocity));
|
||
printf("FIG_SPEED equ %zu\n", offsetof(struct figure_animation_info, speed));
|
||
|
||
return 0;
|
||
}
|