-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdl2.c
3124 lines (2758 loc) · 107 KB
/
sdl2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// SPDX-FileCopyrightText: 2024 KUSANAGI Mitsuhisa <mikkun@mbg.nifty.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include <gawkapi.h>
#define _(msgid) msgid
#include "sdl2.h"
#define RETURN_NOK return make_number(-1, result)
#define RETURN_OK return make_number(0, result)
#define make_string_malloc(str, len, result) \
r_make_string(api, ext_id, str, len, 1, result)
static const gawk_api_t *api;
static awk_ext_id_t ext_id;
static awk_bool_t init_sdl2(void);
static awk_bool_t (*init_func)(void) = init_sdl2;
static const char *ext_version = "SDL2 extension: version (untracked)";
awk_bool_t gawk_api_varinit_constant(const gawk_api_t *,
awk_ext_id_t,
const char *,
awk_value_t *,
awk_scalar_t *);
int plugin_is_GPL_compatible;
/* Initialization and Shutdown */
static awk_scalar_t SDL_INIT_TIMER_node;
static awk_scalar_t SDL_INIT_AUDIO_node;
static awk_scalar_t SDL_INIT_VIDEO_node;
static awk_scalar_t SDL_INIT_JOYSTICK_node;
static awk_scalar_t SDL_INIT_HAPTIC_node;
static awk_scalar_t SDL_INIT_GAMECONTROLLER_node;
static awk_scalar_t SDL_INIT_EVENTS_node;
static awk_scalar_t SDL_INIT_SENSOR_node;
static awk_scalar_t SDL_INIT_NOPARACHUTE_node;
static awk_scalar_t SDL_INIT_EVERYTHING_node;
/* Querying SDL Version */
static awk_scalar_t SDL_MAJOR_VERSION_node;
static awk_scalar_t SDL_MINOR_VERSION_node;
static awk_scalar_t SDL_PATCHLEVEL_node;
static awk_scalar_t SDL_COMPILEDVERSION_node;
/* Display and Window Management */
static awk_scalar_t SDL_WINDOW_FULLSCREEN_node;
static awk_scalar_t SDL_WINDOW_OPENGL_node;
static awk_scalar_t SDL_WINDOW_SHOWN_node;
static awk_scalar_t SDL_WINDOW_HIDDEN_node;
static awk_scalar_t SDL_WINDOW_BORDERLESS_node;
static awk_scalar_t SDL_WINDOW_RESIZABLE_node;
static awk_scalar_t SDL_WINDOW_MINIMIZED_node;
static awk_scalar_t SDL_WINDOW_MAXIMIZED_node;
static awk_scalar_t SDL_WINDOW_MOUSE_GRABBED_node;
static awk_scalar_t SDL_WINDOW_INPUT_FOCUS_node;
static awk_scalar_t SDL_WINDOW_MOUSE_FOCUS_node;
static awk_scalar_t SDL_WINDOW_FULLSCREEN_DESKTOP_node;
static awk_scalar_t SDL_WINDOW_FOREIGN_node;
static awk_scalar_t SDL_WINDOW_ALLOW_HIGHDPI_node;
static awk_scalar_t SDL_WINDOW_MOUSE_CAPTURE_node;
static awk_scalar_t SDL_WINDOW_ALWAYS_ON_TOP_node;
static awk_scalar_t SDL_WINDOW_SKIP_TASKBAR_node;
static awk_scalar_t SDL_WINDOW_UTILITY_node;
static awk_scalar_t SDL_WINDOW_TOOLTIP_node;
static awk_scalar_t SDL_WINDOW_POPUP_MENU_node;
static awk_scalar_t SDL_WINDOW_KEYBOARD_GRABBED_node;
static awk_scalar_t SDL_WINDOW_VULKAN_node;
static awk_scalar_t SDL_WINDOW_METAL_node;
static awk_scalar_t SDL_WINDOW_INPUT_GRABBED_node;
static awk_scalar_t SDL_WINDOWPOS_UNDEFINED_node;
static awk_scalar_t SDL_WINDOWPOS_CENTERED_node;
static awk_scalar_t SDL_WINDOWEVENT_NONE_node;
static awk_scalar_t SDL_WINDOWEVENT_SHOWN_node;
static awk_scalar_t SDL_WINDOWEVENT_HIDDEN_node;
static awk_scalar_t SDL_WINDOWEVENT_EXPOSED_node;
static awk_scalar_t SDL_WINDOWEVENT_MOVED_node;
static awk_scalar_t SDL_WINDOWEVENT_RESIZED_node;
static awk_scalar_t SDL_WINDOWEVENT_SIZE_CHANGED_node;
static awk_scalar_t SDL_WINDOWEVENT_MINIMIZED_node;
static awk_scalar_t SDL_WINDOWEVENT_MAXIMIZED_node;
static awk_scalar_t SDL_WINDOWEVENT_RESTORED_node;
static awk_scalar_t SDL_WINDOWEVENT_ENTER_node;
static awk_scalar_t SDL_WINDOWEVENT_LEAVE_node;
static awk_scalar_t SDL_WINDOWEVENT_FOCUS_GAINED_node;
static awk_scalar_t SDL_WINDOWEVENT_FOCUS_LOST_node;
static awk_scalar_t SDL_WINDOWEVENT_CLOSE_node;
static awk_scalar_t SDL_WINDOWEVENT_TAKE_FOCUS_node;
static awk_scalar_t SDL_WINDOWEVENT_HIT_TEST_node;
static awk_scalar_t SDL_WINDOWEVENT_ICCPROF_CHANGED_node;
static awk_scalar_t SDL_WINDOWEVENT_DISPLAY_CHANGED_node;
/* 2D Accelerated Rendering */
static awk_scalar_t SDL_RENDERER_SOFTWARE_node;
static awk_scalar_t SDL_RENDERER_ACCELERATED_node;
static awk_scalar_t SDL_RENDERER_PRESENTVSYNC_node;
static awk_scalar_t SDL_RENDERER_TARGETTEXTURE_node;
static awk_scalar_t SDL_TEXTUREACCESS_STATIC_node;
static awk_scalar_t SDL_TEXTUREACCESS_STREAMING_node;
static awk_scalar_t SDL_TEXTUREACCESS_TARGET_node;
/* Pixel Formats and Conversion Routines */
static awk_scalar_t SDL_PIXELFORMAT_UNKNOWN_node;
static awk_scalar_t SDL_PIXELFORMAT_INDEX1LSB_node;
static awk_scalar_t SDL_PIXELFORMAT_INDEX1MSB_node;
static awk_scalar_t SDL_PIXELFORMAT_INDEX4LSB_node;
static awk_scalar_t SDL_PIXELFORMAT_INDEX4MSB_node;
static awk_scalar_t SDL_PIXELFORMAT_INDEX8_node;
static awk_scalar_t SDL_PIXELFORMAT_RGB332_node;
static awk_scalar_t SDL_PIXELFORMAT_XRGB4444_node;
static awk_scalar_t SDL_PIXELFORMAT_RGB444_node;
static awk_scalar_t SDL_PIXELFORMAT_XBGR4444_node;
static awk_scalar_t SDL_PIXELFORMAT_BGR444_node;
static awk_scalar_t SDL_PIXELFORMAT_XRGB1555_node;
static awk_scalar_t SDL_PIXELFORMAT_RGB555_node;
static awk_scalar_t SDL_PIXELFORMAT_XBGR1555_node;
static awk_scalar_t SDL_PIXELFORMAT_BGR555_node;
static awk_scalar_t SDL_PIXELFORMAT_ARGB4444_node;
static awk_scalar_t SDL_PIXELFORMAT_RGBA4444_node;
static awk_scalar_t SDL_PIXELFORMAT_ABGR4444_node;
static awk_scalar_t SDL_PIXELFORMAT_BGRA4444_node;
static awk_scalar_t SDL_PIXELFORMAT_ARGB1555_node;
static awk_scalar_t SDL_PIXELFORMAT_RGBA5551_node;
static awk_scalar_t SDL_PIXELFORMAT_ABGR1555_node;
static awk_scalar_t SDL_PIXELFORMAT_BGRA5551_node;
static awk_scalar_t SDL_PIXELFORMAT_RGB565_node;
static awk_scalar_t SDL_PIXELFORMAT_BGR565_node;
static awk_scalar_t SDL_PIXELFORMAT_RGB24_node;
static awk_scalar_t SDL_PIXELFORMAT_BGR24_node;
static awk_scalar_t SDL_PIXELFORMAT_XRGB8888_node;
static awk_scalar_t SDL_PIXELFORMAT_RGB888_node;
static awk_scalar_t SDL_PIXELFORMAT_RGBX8888_node;
static awk_scalar_t SDL_PIXELFORMAT_XBGR8888_node;
static awk_scalar_t SDL_PIXELFORMAT_BGR888_node;
static awk_scalar_t SDL_PIXELFORMAT_BGRX8888_node;
static awk_scalar_t SDL_PIXELFORMAT_ARGB8888_node;
static awk_scalar_t SDL_PIXELFORMAT_RGBA8888_node;
static awk_scalar_t SDL_PIXELFORMAT_ABGR8888_node;
static awk_scalar_t SDL_PIXELFORMAT_BGRA8888_node;
static awk_scalar_t SDL_PIXELFORMAT_ARGB2101010_node;
static awk_scalar_t SDL_PIXELFORMAT_RGBA32_node;
static awk_scalar_t SDL_PIXELFORMAT_ARGB32_node;
static awk_scalar_t SDL_PIXELFORMAT_BGRA32_node;
static awk_scalar_t SDL_PIXELFORMAT_ABGR32_node;
static awk_scalar_t SDL_PIXELFORMAT_YV12_node;
static awk_scalar_t SDL_PIXELFORMAT_IYUV_node;
static awk_scalar_t SDL_PIXELFORMAT_YUY2_node;
static awk_scalar_t SDL_PIXELFORMAT_UYVY_node;
static awk_scalar_t SDL_PIXELFORMAT_YVYU_node;
static awk_scalar_t SDL_PIXELFORMAT_NV12_node;
static awk_scalar_t SDL_PIXELFORMAT_NV21_node;
static awk_scalar_t SDL_PIXELFORMAT_EXTERNAL_OES_node;
/* Event Handling */
static awk_scalar_t SDL_RELEASED_node;
static awk_scalar_t SDL_PRESSED_node;
static awk_scalar_t SDL_FIRSTEVENT_node;
static awk_scalar_t SDL_QUIT_node;
static awk_scalar_t SDL_APP_TERMINATING_node;
static awk_scalar_t SDL_APP_LOWMEMORY_node;
static awk_scalar_t SDL_APP_WILLENTERBACKGROUND_node;
static awk_scalar_t SDL_APP_DIDENTERBACKGROUND_node;
static awk_scalar_t SDL_APP_WILLENTERFOREGROUND_node;
static awk_scalar_t SDL_APP_DIDENTERFOREGROUND_node;
static awk_scalar_t SDL_LOCALECHANGED_node;
static awk_scalar_t SDL_DISPLAYEVENT_node;
static awk_scalar_t SDL_WINDOWEVENT_node;
static awk_scalar_t SDL_SYSWMEVENT_node;
static awk_scalar_t SDL_KEYDOWN_node;
static awk_scalar_t SDL_KEYUP_node;
static awk_scalar_t SDL_TEXTEDITING_node;
static awk_scalar_t SDL_TEXTINPUT_node;
static awk_scalar_t SDL_KEYMAPCHANGED_node;
static awk_scalar_t SDL_TEXTEDITING_EXT_node;
static awk_scalar_t SDL_MOUSEMOTION_node;
static awk_scalar_t SDL_MOUSEBUTTONDOWN_node;
static awk_scalar_t SDL_MOUSEBUTTONUP_node;
static awk_scalar_t SDL_MOUSEWHEEL_node;
static awk_scalar_t SDL_JOYAXISMOTION_node;
static awk_scalar_t SDL_JOYBALLMOTION_node;
static awk_scalar_t SDL_JOYHATMOTION_node;
static awk_scalar_t SDL_JOYBUTTONDOWN_node;
static awk_scalar_t SDL_JOYBUTTONUP_node;
static awk_scalar_t SDL_JOYDEVICEADDED_node;
static awk_scalar_t SDL_JOYDEVICEREMOVED_node;
static awk_scalar_t SDL_JOYBATTERYUPDATED_node;
static awk_scalar_t SDL_CONTROLLERAXISMOTION_node;
static awk_scalar_t SDL_CONTROLLERBUTTONDOWN_node;
static awk_scalar_t SDL_CONTROLLERBUTTONUP_node;
static awk_scalar_t SDL_CONTROLLERDEVICEADDED_node;
static awk_scalar_t SDL_CONTROLLERDEVICEREMOVED_node;
static awk_scalar_t SDL_CONTROLLERDEVICEREMAPPED_node;
static awk_scalar_t SDL_CONTROLLERTOUCHPADDOWN_node;
static awk_scalar_t SDL_CONTROLLERTOUCHPADMOTION_node;
static awk_scalar_t SDL_CONTROLLERTOUCHPADUP_node;
static awk_scalar_t SDL_CONTROLLERSENSORUPDATE_node;
static awk_scalar_t SDL_FINGERDOWN_node;
static awk_scalar_t SDL_FINGERUP_node;
static awk_scalar_t SDL_FINGERMOTION_node;
static awk_scalar_t SDL_DOLLARGESTURE_node;
static awk_scalar_t SDL_DOLLARRECORD_node;
static awk_scalar_t SDL_MULTIGESTURE_node;
static awk_scalar_t SDL_CLIPBOARDUPDATE_node;
static awk_scalar_t SDL_DROPFILE_node;
static awk_scalar_t SDL_DROPTEXT_node;
static awk_scalar_t SDL_DROPBEGIN_node;
static awk_scalar_t SDL_DROPCOMPLETE_node;
static awk_scalar_t SDL_AUDIODEVICEADDED_node;
static awk_scalar_t SDL_AUDIODEVICEREMOVED_node;
static awk_scalar_t SDL_SENSORUPDATE_node;
static awk_scalar_t SDL_RENDER_TARGETS_RESET_node;
static awk_scalar_t SDL_RENDER_DEVICE_RESET_node;
static awk_scalar_t SDL_POLLSENTINEL_node;
static awk_scalar_t SDL_USEREVENT_node;
static awk_scalar_t SDL_LASTEVENT_node;
/* Keyboard Support */
static awk_scalar_t SDL_SCANCODE_UNKNOWN_node;
static awk_scalar_t SDL_SCANCODE_A_node;
static awk_scalar_t SDL_SCANCODE_B_node;
static awk_scalar_t SDL_SCANCODE_C_node;
static awk_scalar_t SDL_SCANCODE_D_node;
static awk_scalar_t SDL_SCANCODE_E_node;
static awk_scalar_t SDL_SCANCODE_F_node;
static awk_scalar_t SDL_SCANCODE_G_node;
static awk_scalar_t SDL_SCANCODE_H_node;
static awk_scalar_t SDL_SCANCODE_I_node;
static awk_scalar_t SDL_SCANCODE_J_node;
static awk_scalar_t SDL_SCANCODE_K_node;
static awk_scalar_t SDL_SCANCODE_L_node;
static awk_scalar_t SDL_SCANCODE_M_node;
static awk_scalar_t SDL_SCANCODE_N_node;
static awk_scalar_t SDL_SCANCODE_O_node;
static awk_scalar_t SDL_SCANCODE_P_node;
static awk_scalar_t SDL_SCANCODE_Q_node;
static awk_scalar_t SDL_SCANCODE_R_node;
static awk_scalar_t SDL_SCANCODE_S_node;
static awk_scalar_t SDL_SCANCODE_T_node;
static awk_scalar_t SDL_SCANCODE_U_node;
static awk_scalar_t SDL_SCANCODE_V_node;
static awk_scalar_t SDL_SCANCODE_W_node;
static awk_scalar_t SDL_SCANCODE_X_node;
static awk_scalar_t SDL_SCANCODE_Y_node;
static awk_scalar_t SDL_SCANCODE_Z_node;
static awk_scalar_t SDL_SCANCODE_1_node;
static awk_scalar_t SDL_SCANCODE_2_node;
static awk_scalar_t SDL_SCANCODE_3_node;
static awk_scalar_t SDL_SCANCODE_4_node;
static awk_scalar_t SDL_SCANCODE_5_node;
static awk_scalar_t SDL_SCANCODE_6_node;
static awk_scalar_t SDL_SCANCODE_7_node;
static awk_scalar_t SDL_SCANCODE_8_node;
static awk_scalar_t SDL_SCANCODE_9_node;
static awk_scalar_t SDL_SCANCODE_0_node;
static awk_scalar_t SDL_SCANCODE_RETURN_node;
static awk_scalar_t SDL_SCANCODE_ESCAPE_node;
static awk_scalar_t SDL_SCANCODE_BACKSPACE_node;
static awk_scalar_t SDL_SCANCODE_TAB_node;
static awk_scalar_t SDL_SCANCODE_SPACE_node;
static awk_scalar_t SDL_SCANCODE_MINUS_node;
static awk_scalar_t SDL_SCANCODE_EQUALS_node;
static awk_scalar_t SDL_SCANCODE_LEFTBRACKET_node;
static awk_scalar_t SDL_SCANCODE_RIGHTBRACKET_node;
static awk_scalar_t SDL_SCANCODE_BACKSLASH_node;
static awk_scalar_t SDL_SCANCODE_NONUSHASH_node;
static awk_scalar_t SDL_SCANCODE_SEMICOLON_node;
static awk_scalar_t SDL_SCANCODE_APOSTROPHE_node;
static awk_scalar_t SDL_SCANCODE_GRAVE_node;
static awk_scalar_t SDL_SCANCODE_COMMA_node;
static awk_scalar_t SDL_SCANCODE_PERIOD_node;
static awk_scalar_t SDL_SCANCODE_SLASH_node;
static awk_scalar_t SDL_SCANCODE_CAPSLOCK_node;
static awk_scalar_t SDL_SCANCODE_F1_node;
static awk_scalar_t SDL_SCANCODE_F2_node;
static awk_scalar_t SDL_SCANCODE_F3_node;
static awk_scalar_t SDL_SCANCODE_F4_node;
static awk_scalar_t SDL_SCANCODE_F5_node;
static awk_scalar_t SDL_SCANCODE_F6_node;
static awk_scalar_t SDL_SCANCODE_F7_node;
static awk_scalar_t SDL_SCANCODE_F8_node;
static awk_scalar_t SDL_SCANCODE_F9_node;
static awk_scalar_t SDL_SCANCODE_F10_node;
static awk_scalar_t SDL_SCANCODE_F11_node;
static awk_scalar_t SDL_SCANCODE_F12_node;
static awk_scalar_t SDL_SCANCODE_PRINTSCREEN_node;
static awk_scalar_t SDL_SCANCODE_SCROLLLOCK_node;
static awk_scalar_t SDL_SCANCODE_PAUSE_node;
static awk_scalar_t SDL_SCANCODE_INSERT_node;
static awk_scalar_t SDL_SCANCODE_HOME_node;
static awk_scalar_t SDL_SCANCODE_PAGEUP_node;
static awk_scalar_t SDL_SCANCODE_DELETE_node;
static awk_scalar_t SDL_SCANCODE_END_node;
static awk_scalar_t SDL_SCANCODE_PAGEDOWN_node;
static awk_scalar_t SDL_SCANCODE_RIGHT_node;
static awk_scalar_t SDL_SCANCODE_LEFT_node;
static awk_scalar_t SDL_SCANCODE_DOWN_node;
static awk_scalar_t SDL_SCANCODE_UP_node;
static awk_scalar_t SDL_SCANCODE_NUMLOCKCLEAR_node;
static awk_scalar_t SDL_SCANCODE_KP_DIVIDE_node;
static awk_scalar_t SDL_SCANCODE_KP_MULTIPLY_node;
static awk_scalar_t SDL_SCANCODE_KP_MINUS_node;
static awk_scalar_t SDL_SCANCODE_KP_PLUS_node;
static awk_scalar_t SDL_SCANCODE_KP_ENTER_node;
static awk_scalar_t SDL_SCANCODE_KP_1_node;
static awk_scalar_t SDL_SCANCODE_KP_2_node;
static awk_scalar_t SDL_SCANCODE_KP_3_node;
static awk_scalar_t SDL_SCANCODE_KP_4_node;
static awk_scalar_t SDL_SCANCODE_KP_5_node;
static awk_scalar_t SDL_SCANCODE_KP_6_node;
static awk_scalar_t SDL_SCANCODE_KP_7_node;
static awk_scalar_t SDL_SCANCODE_KP_8_node;
static awk_scalar_t SDL_SCANCODE_KP_9_node;
static awk_scalar_t SDL_SCANCODE_KP_0_node;
static awk_scalar_t SDL_SCANCODE_KP_PERIOD_node;
static awk_scalar_t SDL_SCANCODE_NONUSBACKSLASH_node;
static awk_scalar_t SDL_SCANCODE_APPLICATION_node;
static awk_scalar_t SDL_SCANCODE_POWER_node;
static awk_scalar_t SDL_SCANCODE_KP_EQUALS_node;
static awk_scalar_t SDL_SCANCODE_F13_node;
static awk_scalar_t SDL_SCANCODE_F14_node;
static awk_scalar_t SDL_SCANCODE_F15_node;
static awk_scalar_t SDL_SCANCODE_F16_node;
static awk_scalar_t SDL_SCANCODE_F17_node;
static awk_scalar_t SDL_SCANCODE_F18_node;
static awk_scalar_t SDL_SCANCODE_F19_node;
static awk_scalar_t SDL_SCANCODE_F20_node;
static awk_scalar_t SDL_SCANCODE_F21_node;
static awk_scalar_t SDL_SCANCODE_F22_node;
static awk_scalar_t SDL_SCANCODE_F23_node;
static awk_scalar_t SDL_SCANCODE_F24_node;
static awk_scalar_t SDL_SCANCODE_EXECUTE_node;
static awk_scalar_t SDL_SCANCODE_HELP_node;
static awk_scalar_t SDL_SCANCODE_MENU_node;
static awk_scalar_t SDL_SCANCODE_SELECT_node;
static awk_scalar_t SDL_SCANCODE_STOP_node;
static awk_scalar_t SDL_SCANCODE_AGAIN_node;
static awk_scalar_t SDL_SCANCODE_UNDO_node;
static awk_scalar_t SDL_SCANCODE_CUT_node;
static awk_scalar_t SDL_SCANCODE_COPY_node;
static awk_scalar_t SDL_SCANCODE_PASTE_node;
static awk_scalar_t SDL_SCANCODE_FIND_node;
static awk_scalar_t SDL_SCANCODE_MUTE_node;
static awk_scalar_t SDL_SCANCODE_VOLUMEUP_node;
static awk_scalar_t SDL_SCANCODE_VOLUMEDOWN_node;
static awk_scalar_t SDL_SCANCODE_KP_COMMA_node;
static awk_scalar_t SDL_SCANCODE_KP_EQUALSAS400_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL1_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL2_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL3_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL4_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL5_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL6_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL7_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL8_node;
static awk_scalar_t SDL_SCANCODE_INTERNATIONAL9_node;
static awk_scalar_t SDL_SCANCODE_LANG1_node;
static awk_scalar_t SDL_SCANCODE_LANG2_node;
static awk_scalar_t SDL_SCANCODE_LANG3_node;
static awk_scalar_t SDL_SCANCODE_LANG4_node;
static awk_scalar_t SDL_SCANCODE_LANG5_node;
static awk_scalar_t SDL_SCANCODE_LANG6_node;
static awk_scalar_t SDL_SCANCODE_LANG7_node;
static awk_scalar_t SDL_SCANCODE_LANG8_node;
static awk_scalar_t SDL_SCANCODE_LANG9_node;
static awk_scalar_t SDL_SCANCODE_ALTERASE_node;
static awk_scalar_t SDL_SCANCODE_SYSREQ_node;
static awk_scalar_t SDL_SCANCODE_CANCEL_node;
static awk_scalar_t SDL_SCANCODE_CLEAR_node;
static awk_scalar_t SDL_SCANCODE_PRIOR_node;
static awk_scalar_t SDL_SCANCODE_RETURN2_node;
static awk_scalar_t SDL_SCANCODE_SEPARATOR_node;
static awk_scalar_t SDL_SCANCODE_OUT_node;
static awk_scalar_t SDL_SCANCODE_OPER_node;
static awk_scalar_t SDL_SCANCODE_CLEARAGAIN_node;
static awk_scalar_t SDL_SCANCODE_CRSEL_node;
static awk_scalar_t SDL_SCANCODE_EXSEL_node;
static awk_scalar_t SDL_SCANCODE_KP_00_node;
static awk_scalar_t SDL_SCANCODE_KP_000_node;
static awk_scalar_t SDL_SCANCODE_THOUSANDSSEPARATOR_node;
static awk_scalar_t SDL_SCANCODE_DECIMALSEPARATOR_node;
static awk_scalar_t SDL_SCANCODE_CURRENCYUNIT_node;
static awk_scalar_t SDL_SCANCODE_CURRENCYSUBUNIT_node;
static awk_scalar_t SDL_SCANCODE_KP_LEFTPAREN_node;
static awk_scalar_t SDL_SCANCODE_KP_RIGHTPAREN_node;
static awk_scalar_t SDL_SCANCODE_KP_LEFTBRACE_node;
static awk_scalar_t SDL_SCANCODE_KP_RIGHTBRACE_node;
static awk_scalar_t SDL_SCANCODE_KP_TAB_node;
static awk_scalar_t SDL_SCANCODE_KP_BACKSPACE_node;
static awk_scalar_t SDL_SCANCODE_KP_A_node;
static awk_scalar_t SDL_SCANCODE_KP_B_node;
static awk_scalar_t SDL_SCANCODE_KP_C_node;
static awk_scalar_t SDL_SCANCODE_KP_D_node;
static awk_scalar_t SDL_SCANCODE_KP_E_node;
static awk_scalar_t SDL_SCANCODE_KP_F_node;
static awk_scalar_t SDL_SCANCODE_KP_XOR_node;
static awk_scalar_t SDL_SCANCODE_KP_POWER_node;
static awk_scalar_t SDL_SCANCODE_KP_PERCENT_node;
static awk_scalar_t SDL_SCANCODE_KP_LESS_node;
static awk_scalar_t SDL_SCANCODE_KP_GREATER_node;
static awk_scalar_t SDL_SCANCODE_KP_AMPERSAND_node;
static awk_scalar_t SDL_SCANCODE_KP_DBLAMPERSAND_node;
static awk_scalar_t SDL_SCANCODE_KP_VERTICALBAR_node;
static awk_scalar_t SDL_SCANCODE_KP_DBLVERTICALBAR_node;
static awk_scalar_t SDL_SCANCODE_KP_COLON_node;
static awk_scalar_t SDL_SCANCODE_KP_HASH_node;
static awk_scalar_t SDL_SCANCODE_KP_SPACE_node;
static awk_scalar_t SDL_SCANCODE_KP_AT_node;
static awk_scalar_t SDL_SCANCODE_KP_EXCLAM_node;
static awk_scalar_t SDL_SCANCODE_KP_MEMSTORE_node;
static awk_scalar_t SDL_SCANCODE_KP_MEMRECALL_node;
static awk_scalar_t SDL_SCANCODE_KP_MEMCLEAR_node;
static awk_scalar_t SDL_SCANCODE_KP_MEMADD_node;
static awk_scalar_t SDL_SCANCODE_KP_MEMSUBTRACT_node;
static awk_scalar_t SDL_SCANCODE_KP_MEMMULTIPLY_node;
static awk_scalar_t SDL_SCANCODE_KP_MEMDIVIDE_node;
static awk_scalar_t SDL_SCANCODE_KP_PLUSMINUS_node;
static awk_scalar_t SDL_SCANCODE_KP_CLEAR_node;
static awk_scalar_t SDL_SCANCODE_KP_CLEARENTRY_node;
static awk_scalar_t SDL_SCANCODE_KP_BINARY_node;
static awk_scalar_t SDL_SCANCODE_KP_OCTAL_node;
static awk_scalar_t SDL_SCANCODE_KP_DECIMAL_node;
static awk_scalar_t SDL_SCANCODE_KP_HEXADECIMAL_node;
static awk_scalar_t SDL_SCANCODE_LCTRL_node;
static awk_scalar_t SDL_SCANCODE_LSHIFT_node;
static awk_scalar_t SDL_SCANCODE_LALT_node;
static awk_scalar_t SDL_SCANCODE_LGUI_node;
static awk_scalar_t SDL_SCANCODE_RCTRL_node;
static awk_scalar_t SDL_SCANCODE_RSHIFT_node;
static awk_scalar_t SDL_SCANCODE_RALT_node;
static awk_scalar_t SDL_SCANCODE_RGUI_node;
static awk_scalar_t SDL_SCANCODE_MODE_node;
static awk_scalar_t SDL_SCANCODE_AUDIONEXT_node;
static awk_scalar_t SDL_SCANCODE_AUDIOPREV_node;
static awk_scalar_t SDL_SCANCODE_AUDIOSTOP_node;
static awk_scalar_t SDL_SCANCODE_AUDIOPLAY_node;
static awk_scalar_t SDL_SCANCODE_AUDIOMUTE_node;
static awk_scalar_t SDL_SCANCODE_MEDIASELECT_node;
static awk_scalar_t SDL_SCANCODE_WWW_node;
static awk_scalar_t SDL_SCANCODE_MAIL_node;
static awk_scalar_t SDL_SCANCODE_CALCULATOR_node;
static awk_scalar_t SDL_SCANCODE_COMPUTER_node;
static awk_scalar_t SDL_SCANCODE_AC_SEARCH_node;
static awk_scalar_t SDL_SCANCODE_AC_HOME_node;
static awk_scalar_t SDL_SCANCODE_AC_BACK_node;
static awk_scalar_t SDL_SCANCODE_AC_FORWARD_node;
static awk_scalar_t SDL_SCANCODE_AC_STOP_node;
static awk_scalar_t SDL_SCANCODE_AC_REFRESH_node;
static awk_scalar_t SDL_SCANCODE_AC_BOOKMARKS_node;
static awk_scalar_t SDL_SCANCODE_BRIGHTNESSDOWN_node;
static awk_scalar_t SDL_SCANCODE_BRIGHTNESSUP_node;
static awk_scalar_t SDL_SCANCODE_DISPLAYSWITCH_node;
static awk_scalar_t SDL_SCANCODE_KBDILLUMTOGGLE_node;
static awk_scalar_t SDL_SCANCODE_KBDILLUMDOWN_node;
static awk_scalar_t SDL_SCANCODE_KBDILLUMUP_node;
static awk_scalar_t SDL_SCANCODE_EJECT_node;
static awk_scalar_t SDL_SCANCODE_SLEEP_node;
static awk_scalar_t SDL_SCANCODE_APP1_node;
static awk_scalar_t SDL_SCANCODE_APP2_node;
static awk_scalar_t SDL_SCANCODE_AUDIOREWIND_node;
static awk_scalar_t SDL_SCANCODE_AUDIOFASTFORWARD_node;
static awk_scalar_t SDL_SCANCODE_SOFTLEFT_node;
static awk_scalar_t SDL_SCANCODE_SOFTRIGHT_node;
static awk_scalar_t SDL_SCANCODE_CALL_node;
static awk_scalar_t SDL_SCANCODE_ENDCALL_node;
/* Message boxes */
static awk_scalar_t SDL_MESSAGEBOX_ERROR_node;
static awk_scalar_t SDL_MESSAGEBOX_WARNING_node;
static awk_scalar_t SDL_MESSAGEBOX_INFORMATION_node;
static awk_scalar_t SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT_node;
static awk_scalar_t SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT_node;
/* Standard Library Functionality */
static awk_scalar_t SDL_FALSE_node;
static awk_scalar_t SDL_TRUE_node;
struct varinit {
awk_scalar_t *spec;
const char *name;
int dfltval;
int read_only;
};
static const struct varinit varinit[] = {
ENTRY(SDL_INIT_TIMER, 1),
ENTRY(SDL_INIT_AUDIO, 1),
ENTRY(SDL_INIT_VIDEO, 1),
ENTRY(SDL_INIT_JOYSTICK, 1),
ENTRY(SDL_INIT_HAPTIC, 1),
ENTRY(SDL_INIT_GAMECONTROLLER, 1),
ENTRY(SDL_INIT_EVENTS, 1),
ENTRY(SDL_INIT_SENSOR, 1),
ENTRY(SDL_INIT_NOPARACHUTE, 1),
ENTRY(SDL_INIT_EVERYTHING, 1),
ENTRY(SDL_MAJOR_VERSION, 1),
ENTRY(SDL_MINOR_VERSION, 1),
ENTRY(SDL_PATCHLEVEL, 1),
ENTRY(SDL_COMPILEDVERSION, 1),
ENTRY(SDL_WINDOW_FULLSCREEN, 1),
ENTRY(SDL_WINDOW_OPENGL, 1),
ENTRY(SDL_WINDOW_SHOWN, 1),
ENTRY(SDL_WINDOW_HIDDEN, 1),
ENTRY(SDL_WINDOW_BORDERLESS, 1),
ENTRY(SDL_WINDOW_RESIZABLE, 1),
ENTRY(SDL_WINDOW_MINIMIZED, 1),
ENTRY(SDL_WINDOW_MAXIMIZED, 1),
ENTRY(SDL_WINDOW_MOUSE_GRABBED, 1),
ENTRY(SDL_WINDOW_INPUT_FOCUS, 1),
ENTRY(SDL_WINDOW_MOUSE_FOCUS, 1),
ENTRY(SDL_WINDOW_FULLSCREEN_DESKTOP, 1),
ENTRY(SDL_WINDOW_FOREIGN, 1),
ENTRY(SDL_WINDOW_ALLOW_HIGHDPI, 1),
ENTRY(SDL_WINDOW_MOUSE_CAPTURE, 1),
ENTRY(SDL_WINDOW_ALWAYS_ON_TOP, 1),
ENTRY(SDL_WINDOW_SKIP_TASKBAR, 1),
ENTRY(SDL_WINDOW_UTILITY, 1),
ENTRY(SDL_WINDOW_TOOLTIP, 1),
ENTRY(SDL_WINDOW_POPUP_MENU, 1),
ENTRY(SDL_WINDOW_KEYBOARD_GRABBED, 1),
ENTRY(SDL_WINDOW_VULKAN, 1),
ENTRY(SDL_WINDOW_METAL, 1),
ENTRY(SDL_WINDOW_INPUT_GRABBED, 1),
ENTRY(SDL_WINDOWPOS_UNDEFINED, 1),
ENTRY(SDL_WINDOWPOS_CENTERED, 1),
ENTRY(SDL_WINDOWEVENT_NONE, 1),
ENTRY(SDL_WINDOWEVENT_SHOWN, 1),
ENTRY(SDL_WINDOWEVENT_HIDDEN, 1),
ENTRY(SDL_WINDOWEVENT_EXPOSED, 1),
ENTRY(SDL_WINDOWEVENT_MOVED, 1),
ENTRY(SDL_WINDOWEVENT_RESIZED, 1),
ENTRY(SDL_WINDOWEVENT_SIZE_CHANGED, 1),
ENTRY(SDL_WINDOWEVENT_MINIMIZED, 1),
ENTRY(SDL_WINDOWEVENT_MAXIMIZED, 1),
ENTRY(SDL_WINDOWEVENT_RESTORED, 1),
ENTRY(SDL_WINDOWEVENT_ENTER, 1),
ENTRY(SDL_WINDOWEVENT_LEAVE, 1),
ENTRY(SDL_WINDOWEVENT_FOCUS_GAINED, 1),
ENTRY(SDL_WINDOWEVENT_FOCUS_LOST, 1),
ENTRY(SDL_WINDOWEVENT_CLOSE, 1),
ENTRY(SDL_WINDOWEVENT_TAKE_FOCUS, 1),
ENTRY(SDL_WINDOWEVENT_HIT_TEST, 1),
ENTRY(SDL_WINDOWEVENT_ICCPROF_CHANGED, 1),
ENTRY(SDL_WINDOWEVENT_DISPLAY_CHANGED, 1),
ENTRY(SDL_RENDERER_SOFTWARE, 1),
ENTRY(SDL_RENDERER_ACCELERATED, 1),
ENTRY(SDL_RENDERER_PRESENTVSYNC, 1),
ENTRY(SDL_RENDERER_TARGETTEXTURE, 1),
ENTRY(SDL_TEXTUREACCESS_STATIC, 1),
ENTRY(SDL_TEXTUREACCESS_STREAMING, 1),
ENTRY(SDL_TEXTUREACCESS_TARGET, 1),
ENTRY(SDL_PIXELFORMAT_UNKNOWN, 1),
ENTRY(SDL_PIXELFORMAT_INDEX1LSB, 1),
ENTRY(SDL_PIXELFORMAT_INDEX1MSB, 1),
ENTRY(SDL_PIXELFORMAT_INDEX4LSB, 1),
ENTRY(SDL_PIXELFORMAT_INDEX4MSB, 1),
ENTRY(SDL_PIXELFORMAT_INDEX8, 1),
ENTRY(SDL_PIXELFORMAT_RGB332, 1),
ENTRY(SDL_PIXELFORMAT_XRGB4444, 1),
ENTRY(SDL_PIXELFORMAT_RGB444, 1),
ENTRY(SDL_PIXELFORMAT_XBGR4444, 1),
ENTRY(SDL_PIXELFORMAT_BGR444, 1),
ENTRY(SDL_PIXELFORMAT_XRGB1555, 1),
ENTRY(SDL_PIXELFORMAT_RGB555, 1),
ENTRY(SDL_PIXELFORMAT_XBGR1555, 1),
ENTRY(SDL_PIXELFORMAT_BGR555, 1),
ENTRY(SDL_PIXELFORMAT_ARGB4444, 1),
ENTRY(SDL_PIXELFORMAT_RGBA4444, 1),
ENTRY(SDL_PIXELFORMAT_ABGR4444, 1),
ENTRY(SDL_PIXELFORMAT_BGRA4444, 1),
ENTRY(SDL_PIXELFORMAT_ARGB1555, 1),
ENTRY(SDL_PIXELFORMAT_RGBA5551, 1),
ENTRY(SDL_PIXELFORMAT_ABGR1555, 1),
ENTRY(SDL_PIXELFORMAT_BGRA5551, 1),
ENTRY(SDL_PIXELFORMAT_RGB565, 1),
ENTRY(SDL_PIXELFORMAT_BGR565, 1),
ENTRY(SDL_PIXELFORMAT_RGB24, 1),
ENTRY(SDL_PIXELFORMAT_BGR24, 1),
ENTRY(SDL_PIXELFORMAT_XRGB8888, 1),
ENTRY(SDL_PIXELFORMAT_RGB888, 1),
ENTRY(SDL_PIXELFORMAT_RGBX8888, 1),
ENTRY(SDL_PIXELFORMAT_XBGR8888, 1),
ENTRY(SDL_PIXELFORMAT_BGR888, 1),
ENTRY(SDL_PIXELFORMAT_BGRX8888, 1),
ENTRY(SDL_PIXELFORMAT_ARGB8888, 1),
ENTRY(SDL_PIXELFORMAT_RGBA8888, 1),
ENTRY(SDL_PIXELFORMAT_ABGR8888, 1),
ENTRY(SDL_PIXELFORMAT_BGRA8888, 1),
ENTRY(SDL_PIXELFORMAT_ARGB2101010, 1),
ENTRY(SDL_PIXELFORMAT_RGBA32, 1),
ENTRY(SDL_PIXELFORMAT_ARGB32, 1),
ENTRY(SDL_PIXELFORMAT_BGRA32, 1),
ENTRY(SDL_PIXELFORMAT_ABGR32, 1),
ENTRY(SDL_PIXELFORMAT_YV12, 1),
ENTRY(SDL_PIXELFORMAT_IYUV, 1),
ENTRY(SDL_PIXELFORMAT_YUY2, 1),
ENTRY(SDL_PIXELFORMAT_UYVY, 1),
ENTRY(SDL_PIXELFORMAT_YVYU, 1),
ENTRY(SDL_PIXELFORMAT_NV12, 1),
ENTRY(SDL_PIXELFORMAT_NV21, 1),
ENTRY(SDL_PIXELFORMAT_EXTERNAL_OES, 1),
ENTRY(SDL_RELEASED, 1),
ENTRY(SDL_PRESSED, 1),
ENTRY(SDL_FIRSTEVENT, 1),
ENTRY(SDL_QUIT, 1),
ENTRY(SDL_APP_TERMINATING, 1),
ENTRY(SDL_APP_LOWMEMORY, 1),
ENTRY(SDL_APP_WILLENTERBACKGROUND, 1),
ENTRY(SDL_APP_DIDENTERBACKGROUND, 1),
ENTRY(SDL_APP_WILLENTERFOREGROUND, 1),
ENTRY(SDL_APP_DIDENTERFOREGROUND, 1),
ENTRY(SDL_LOCALECHANGED, 1),
ENTRY(SDL_DISPLAYEVENT, 1),
ENTRY(SDL_WINDOWEVENT, 1),
ENTRY(SDL_SYSWMEVENT, 1),
ENTRY(SDL_KEYDOWN, 1),
ENTRY(SDL_KEYUP, 1),
ENTRY(SDL_TEXTEDITING, 1),
ENTRY(SDL_TEXTINPUT, 1),
ENTRY(SDL_KEYMAPCHANGED, 1),
ENTRY(SDL_TEXTEDITING_EXT, 1),
ENTRY(SDL_MOUSEMOTION, 1),
ENTRY(SDL_MOUSEBUTTONDOWN, 1),
ENTRY(SDL_MOUSEBUTTONUP, 1),
ENTRY(SDL_MOUSEWHEEL, 1),
ENTRY(SDL_JOYAXISMOTION, 1),
ENTRY(SDL_JOYBALLMOTION, 1),
ENTRY(SDL_JOYHATMOTION, 1),
ENTRY(SDL_JOYBUTTONDOWN, 1),
ENTRY(SDL_JOYBUTTONUP, 1),
ENTRY(SDL_JOYDEVICEADDED, 1),
ENTRY(SDL_JOYDEVICEREMOVED, 1),
ENTRY(SDL_JOYBATTERYUPDATED, 1),
ENTRY(SDL_CONTROLLERAXISMOTION, 1),
ENTRY(SDL_CONTROLLERBUTTONDOWN, 1),
ENTRY(SDL_CONTROLLERBUTTONUP, 1),
ENTRY(SDL_CONTROLLERDEVICEADDED, 1),
ENTRY(SDL_CONTROLLERDEVICEREMOVED, 1),
ENTRY(SDL_CONTROLLERDEVICEREMAPPED, 1),
ENTRY(SDL_CONTROLLERTOUCHPADDOWN, 1),
ENTRY(SDL_CONTROLLERTOUCHPADMOTION, 1),
ENTRY(SDL_CONTROLLERTOUCHPADUP, 1),
ENTRY(SDL_CONTROLLERSENSORUPDATE, 1),
ENTRY(SDL_FINGERDOWN, 1),
ENTRY(SDL_FINGERUP, 1),
ENTRY(SDL_FINGERMOTION, 1),
ENTRY(SDL_DOLLARGESTURE, 1),
ENTRY(SDL_DOLLARRECORD, 1),
ENTRY(SDL_MULTIGESTURE, 1),
ENTRY(SDL_CLIPBOARDUPDATE, 1),
ENTRY(SDL_DROPFILE, 1),
ENTRY(SDL_DROPTEXT, 1),
ENTRY(SDL_DROPBEGIN, 1),
ENTRY(SDL_DROPCOMPLETE, 1),
ENTRY(SDL_AUDIODEVICEADDED, 1),
ENTRY(SDL_AUDIODEVICEREMOVED, 1),
ENTRY(SDL_SENSORUPDATE, 1),
ENTRY(SDL_RENDER_TARGETS_RESET, 1),
ENTRY(SDL_RENDER_DEVICE_RESET, 1),
ENTRY(SDL_POLLSENTINEL, 1),
ENTRY(SDL_USEREVENT, 1),
ENTRY(SDL_LASTEVENT, 1),
ENTRY(SDL_SCANCODE_UNKNOWN, 1),
ENTRY(SDL_SCANCODE_A, 1),
ENTRY(SDL_SCANCODE_B, 1),
ENTRY(SDL_SCANCODE_C, 1),
ENTRY(SDL_SCANCODE_D, 1),
ENTRY(SDL_SCANCODE_E, 1),
ENTRY(SDL_SCANCODE_F, 1),
ENTRY(SDL_SCANCODE_G, 1),
ENTRY(SDL_SCANCODE_H, 1),
ENTRY(SDL_SCANCODE_I, 1),
ENTRY(SDL_SCANCODE_J, 1),
ENTRY(SDL_SCANCODE_K, 1),
ENTRY(SDL_SCANCODE_L, 1),
ENTRY(SDL_SCANCODE_M, 1),
ENTRY(SDL_SCANCODE_N, 1),
ENTRY(SDL_SCANCODE_O, 1),
ENTRY(SDL_SCANCODE_P, 1),
ENTRY(SDL_SCANCODE_Q, 1),
ENTRY(SDL_SCANCODE_R, 1),
ENTRY(SDL_SCANCODE_S, 1),
ENTRY(SDL_SCANCODE_T, 1),
ENTRY(SDL_SCANCODE_U, 1),
ENTRY(SDL_SCANCODE_V, 1),
ENTRY(SDL_SCANCODE_W, 1),
ENTRY(SDL_SCANCODE_X, 1),
ENTRY(SDL_SCANCODE_Y, 1),
ENTRY(SDL_SCANCODE_Z, 1),
ENTRY(SDL_SCANCODE_1, 1),
ENTRY(SDL_SCANCODE_2, 1),
ENTRY(SDL_SCANCODE_3, 1),
ENTRY(SDL_SCANCODE_4, 1),
ENTRY(SDL_SCANCODE_5, 1),
ENTRY(SDL_SCANCODE_6, 1),
ENTRY(SDL_SCANCODE_7, 1),
ENTRY(SDL_SCANCODE_8, 1),
ENTRY(SDL_SCANCODE_9, 1),
ENTRY(SDL_SCANCODE_0, 1),
ENTRY(SDL_SCANCODE_RETURN, 1),
ENTRY(SDL_SCANCODE_ESCAPE, 1),
ENTRY(SDL_SCANCODE_BACKSPACE, 1),
ENTRY(SDL_SCANCODE_TAB, 1),
ENTRY(SDL_SCANCODE_SPACE, 1),
ENTRY(SDL_SCANCODE_MINUS, 1),
ENTRY(SDL_SCANCODE_EQUALS, 1),
ENTRY(SDL_SCANCODE_LEFTBRACKET, 1),
ENTRY(SDL_SCANCODE_RIGHTBRACKET, 1),
ENTRY(SDL_SCANCODE_BACKSLASH, 1),
ENTRY(SDL_SCANCODE_NONUSHASH, 1),
ENTRY(SDL_SCANCODE_SEMICOLON, 1),
ENTRY(SDL_SCANCODE_APOSTROPHE, 1),
ENTRY(SDL_SCANCODE_GRAVE, 1),
ENTRY(SDL_SCANCODE_COMMA, 1),
ENTRY(SDL_SCANCODE_PERIOD, 1),
ENTRY(SDL_SCANCODE_SLASH, 1),
ENTRY(SDL_SCANCODE_CAPSLOCK, 1),
ENTRY(SDL_SCANCODE_F1, 1),
ENTRY(SDL_SCANCODE_F2, 1),
ENTRY(SDL_SCANCODE_F3, 1),
ENTRY(SDL_SCANCODE_F4, 1),
ENTRY(SDL_SCANCODE_F5, 1),
ENTRY(SDL_SCANCODE_F6, 1),
ENTRY(SDL_SCANCODE_F7, 1),
ENTRY(SDL_SCANCODE_F8, 1),
ENTRY(SDL_SCANCODE_F9, 1),
ENTRY(SDL_SCANCODE_F10, 1),
ENTRY(SDL_SCANCODE_F11, 1),
ENTRY(SDL_SCANCODE_F12, 1),
ENTRY(SDL_SCANCODE_PRINTSCREEN, 1),
ENTRY(SDL_SCANCODE_SCROLLLOCK, 1),
ENTRY(SDL_SCANCODE_PAUSE, 1),
ENTRY(SDL_SCANCODE_INSERT, 1),
ENTRY(SDL_SCANCODE_HOME, 1),
ENTRY(SDL_SCANCODE_PAGEUP, 1),
ENTRY(SDL_SCANCODE_DELETE, 1),
ENTRY(SDL_SCANCODE_END, 1),
ENTRY(SDL_SCANCODE_PAGEDOWN, 1),
ENTRY(SDL_SCANCODE_RIGHT, 1),
ENTRY(SDL_SCANCODE_LEFT, 1),
ENTRY(SDL_SCANCODE_DOWN, 1),
ENTRY(SDL_SCANCODE_UP, 1),
ENTRY(SDL_SCANCODE_NUMLOCKCLEAR, 1),
ENTRY(SDL_SCANCODE_KP_DIVIDE, 1),
ENTRY(SDL_SCANCODE_KP_MULTIPLY, 1),
ENTRY(SDL_SCANCODE_KP_MINUS, 1),
ENTRY(SDL_SCANCODE_KP_PLUS, 1),
ENTRY(SDL_SCANCODE_KP_ENTER, 1),
ENTRY(SDL_SCANCODE_KP_1, 1),
ENTRY(SDL_SCANCODE_KP_2, 1),
ENTRY(SDL_SCANCODE_KP_3, 1),
ENTRY(SDL_SCANCODE_KP_4, 1),
ENTRY(SDL_SCANCODE_KP_5, 1),
ENTRY(SDL_SCANCODE_KP_6, 1),
ENTRY(SDL_SCANCODE_KP_7, 1),
ENTRY(SDL_SCANCODE_KP_8, 1),
ENTRY(SDL_SCANCODE_KP_9, 1),
ENTRY(SDL_SCANCODE_KP_0, 1),
ENTRY(SDL_SCANCODE_KP_PERIOD, 1),
ENTRY(SDL_SCANCODE_NONUSBACKSLASH, 1),
ENTRY(SDL_SCANCODE_APPLICATION, 1),
ENTRY(SDL_SCANCODE_POWER, 1),
ENTRY(SDL_SCANCODE_KP_EQUALS, 1),
ENTRY(SDL_SCANCODE_F13, 1),
ENTRY(SDL_SCANCODE_F14, 1),
ENTRY(SDL_SCANCODE_F15, 1),
ENTRY(SDL_SCANCODE_F16, 1),
ENTRY(SDL_SCANCODE_F17, 1),
ENTRY(SDL_SCANCODE_F18, 1),
ENTRY(SDL_SCANCODE_F19, 1),
ENTRY(SDL_SCANCODE_F20, 1),
ENTRY(SDL_SCANCODE_F21, 1),
ENTRY(SDL_SCANCODE_F22, 1),
ENTRY(SDL_SCANCODE_F23, 1),
ENTRY(SDL_SCANCODE_F24, 1),
ENTRY(SDL_SCANCODE_EXECUTE, 1),
ENTRY(SDL_SCANCODE_HELP, 1),
ENTRY(SDL_SCANCODE_MENU, 1),
ENTRY(SDL_SCANCODE_SELECT, 1),
ENTRY(SDL_SCANCODE_STOP, 1),
ENTRY(SDL_SCANCODE_AGAIN, 1),
ENTRY(SDL_SCANCODE_UNDO, 1),
ENTRY(SDL_SCANCODE_CUT, 1),
ENTRY(SDL_SCANCODE_COPY, 1),
ENTRY(SDL_SCANCODE_PASTE, 1),
ENTRY(SDL_SCANCODE_FIND, 1),
ENTRY(SDL_SCANCODE_MUTE, 1),
ENTRY(SDL_SCANCODE_VOLUMEUP, 1),
ENTRY(SDL_SCANCODE_VOLUMEDOWN, 1),
ENTRY(SDL_SCANCODE_KP_COMMA, 1),
ENTRY(SDL_SCANCODE_KP_EQUALSAS400, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL1, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL2, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL3, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL4, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL5, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL6, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL7, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL8, 1),
ENTRY(SDL_SCANCODE_INTERNATIONAL9, 1),
ENTRY(SDL_SCANCODE_LANG1, 1),
ENTRY(SDL_SCANCODE_LANG2, 1),
ENTRY(SDL_SCANCODE_LANG3, 1),
ENTRY(SDL_SCANCODE_LANG4, 1),
ENTRY(SDL_SCANCODE_LANG5, 1),
ENTRY(SDL_SCANCODE_LANG6, 1),
ENTRY(SDL_SCANCODE_LANG7, 1),
ENTRY(SDL_SCANCODE_LANG8, 1),
ENTRY(SDL_SCANCODE_LANG9, 1),
ENTRY(SDL_SCANCODE_ALTERASE, 1),
ENTRY(SDL_SCANCODE_SYSREQ, 1),
ENTRY(SDL_SCANCODE_CANCEL, 1),
ENTRY(SDL_SCANCODE_CLEAR, 1),
ENTRY(SDL_SCANCODE_PRIOR, 1),
ENTRY(SDL_SCANCODE_RETURN2, 1),
ENTRY(SDL_SCANCODE_SEPARATOR, 1),
ENTRY(SDL_SCANCODE_OUT, 1),
ENTRY(SDL_SCANCODE_OPER, 1),
ENTRY(SDL_SCANCODE_CLEARAGAIN, 1),
ENTRY(SDL_SCANCODE_CRSEL, 1),
ENTRY(SDL_SCANCODE_EXSEL, 1),
ENTRY(SDL_SCANCODE_KP_00, 1),
ENTRY(SDL_SCANCODE_KP_000, 1),
ENTRY(SDL_SCANCODE_THOUSANDSSEPARATOR, 1),
ENTRY(SDL_SCANCODE_DECIMALSEPARATOR, 1),
ENTRY(SDL_SCANCODE_CURRENCYUNIT, 1),
ENTRY(SDL_SCANCODE_CURRENCYSUBUNIT, 1),
ENTRY(SDL_SCANCODE_KP_LEFTPAREN, 1),
ENTRY(SDL_SCANCODE_KP_RIGHTPAREN, 1),
ENTRY(SDL_SCANCODE_KP_LEFTBRACE, 1),
ENTRY(SDL_SCANCODE_KP_RIGHTBRACE, 1),
ENTRY(SDL_SCANCODE_KP_TAB, 1),
ENTRY(SDL_SCANCODE_KP_BACKSPACE, 1),
ENTRY(SDL_SCANCODE_KP_A, 1),
ENTRY(SDL_SCANCODE_KP_B, 1),
ENTRY(SDL_SCANCODE_KP_C, 1),
ENTRY(SDL_SCANCODE_KP_D, 1),
ENTRY(SDL_SCANCODE_KP_E, 1),
ENTRY(SDL_SCANCODE_KP_F, 1),
ENTRY(SDL_SCANCODE_KP_XOR, 1),
ENTRY(SDL_SCANCODE_KP_POWER, 1),
ENTRY(SDL_SCANCODE_KP_PERCENT, 1),
ENTRY(SDL_SCANCODE_KP_LESS, 1),
ENTRY(SDL_SCANCODE_KP_GREATER, 1),
ENTRY(SDL_SCANCODE_KP_AMPERSAND, 1),
ENTRY(SDL_SCANCODE_KP_DBLAMPERSAND, 1),
ENTRY(SDL_SCANCODE_KP_VERTICALBAR, 1),
ENTRY(SDL_SCANCODE_KP_DBLVERTICALBAR, 1),
ENTRY(SDL_SCANCODE_KP_COLON, 1),
ENTRY(SDL_SCANCODE_KP_HASH, 1),
ENTRY(SDL_SCANCODE_KP_SPACE, 1),
ENTRY(SDL_SCANCODE_KP_AT, 1),
ENTRY(SDL_SCANCODE_KP_EXCLAM, 1),
ENTRY(SDL_SCANCODE_KP_MEMSTORE, 1),
ENTRY(SDL_SCANCODE_KP_MEMRECALL, 1),
ENTRY(SDL_SCANCODE_KP_MEMCLEAR, 1),
ENTRY(SDL_SCANCODE_KP_MEMADD, 1),
ENTRY(SDL_SCANCODE_KP_MEMSUBTRACT, 1),
ENTRY(SDL_SCANCODE_KP_MEMMULTIPLY, 1),
ENTRY(SDL_SCANCODE_KP_MEMDIVIDE, 1),
ENTRY(SDL_SCANCODE_KP_PLUSMINUS, 1),
ENTRY(SDL_SCANCODE_KP_CLEAR, 1),
ENTRY(SDL_SCANCODE_KP_CLEARENTRY, 1),
ENTRY(SDL_SCANCODE_KP_BINARY, 1),
ENTRY(SDL_SCANCODE_KP_OCTAL, 1),
ENTRY(SDL_SCANCODE_KP_DECIMAL, 1),
ENTRY(SDL_SCANCODE_KP_HEXADECIMAL, 1),
ENTRY(SDL_SCANCODE_LCTRL, 1),
ENTRY(SDL_SCANCODE_LSHIFT, 1),
ENTRY(SDL_SCANCODE_LALT, 1),
ENTRY(SDL_SCANCODE_LGUI, 1),
ENTRY(SDL_SCANCODE_RCTRL, 1),
ENTRY(SDL_SCANCODE_RSHIFT, 1),
ENTRY(SDL_SCANCODE_RALT, 1),
ENTRY(SDL_SCANCODE_RGUI, 1),
ENTRY(SDL_SCANCODE_MODE, 1),
ENTRY(SDL_SCANCODE_AUDIONEXT, 1),
ENTRY(SDL_SCANCODE_AUDIOPREV, 1),
ENTRY(SDL_SCANCODE_AUDIOSTOP, 1),
ENTRY(SDL_SCANCODE_AUDIOPLAY, 1),
ENTRY(SDL_SCANCODE_AUDIOMUTE, 1),
ENTRY(SDL_SCANCODE_MEDIASELECT, 1),
ENTRY(SDL_SCANCODE_WWW, 1),
ENTRY(SDL_SCANCODE_MAIL, 1),
ENTRY(SDL_SCANCODE_CALCULATOR, 1),
ENTRY(SDL_SCANCODE_COMPUTER, 1),
ENTRY(SDL_SCANCODE_AC_SEARCH, 1),
ENTRY(SDL_SCANCODE_AC_HOME, 1),
ENTRY(SDL_SCANCODE_AC_BACK, 1),
ENTRY(SDL_SCANCODE_AC_FORWARD, 1),
ENTRY(SDL_SCANCODE_AC_STOP, 1),
ENTRY(SDL_SCANCODE_AC_REFRESH, 1),
ENTRY(SDL_SCANCODE_AC_BOOKMARKS, 1),
ENTRY(SDL_SCANCODE_BRIGHTNESSDOWN, 1),
ENTRY(SDL_SCANCODE_BRIGHTNESSUP, 1),
ENTRY(SDL_SCANCODE_DISPLAYSWITCH, 1),
ENTRY(SDL_SCANCODE_KBDILLUMTOGGLE, 1),
ENTRY(SDL_SCANCODE_KBDILLUMDOWN, 1),
ENTRY(SDL_SCANCODE_KBDILLUMUP, 1),
ENTRY(SDL_SCANCODE_EJECT, 1),
ENTRY(SDL_SCANCODE_SLEEP, 1),
ENTRY(SDL_SCANCODE_APP1, 1),
ENTRY(SDL_SCANCODE_APP2, 1),
ENTRY(SDL_SCANCODE_AUDIOREWIND, 1),
ENTRY(SDL_SCANCODE_AUDIOFASTFORWARD, 1),
ENTRY(SDL_SCANCODE_SOFTLEFT, 1),
ENTRY(SDL_SCANCODE_SOFTRIGHT, 1),
ENTRY(SDL_SCANCODE_CALL, 1),
ENTRY(SDL_SCANCODE_ENDCALL, 1),
ENTRY(SDL_MESSAGEBOX_ERROR, 1),
ENTRY(SDL_MESSAGEBOX_WARNING, 1),
ENTRY(SDL_MESSAGEBOX_INFORMATION, 1),
ENTRY(SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT, 1),
ENTRY(SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT, 1),
ENTRY(SDL_FALSE, 1),
ENTRY(SDL_TRUE, 1),
};
/* load_vars --- load constant variables */
static void
load_vars(void)
{
const struct varinit *vp;
size_t i;
for (vp = varinit, i = 0; i < NUM_SCALARS; i++, vp++) {
awk_value_t val;
if (! gawk_api_varinit_constant(api,
ext_id,
vp->name,
make_number(vp->dfltval, &val),
vp->spec))
fatal(ext_id, _("sdl2: unable to initialize %s"), vp->name);
}
}
/*----- Initialization and Shutdown ----------------------------------------*/
/* int SDL_Init(Uint32 flags); */
/* do_SDL_Init --- provide a SDL_Init() function for gawk */
static awk_value_t *
do_SDL_Init(int nargs, awk_value_t *result, struct awk_ext_func *finfo)
{
awk_value_t flags_param;
uint32_t flags;
int ret;
if (! get_argument(0, AWK_NUMBER, &flags_param)) {
warning(ext_id, _("SDL_Init: bad parameter(s)"));
RETURN_NOK;
}
flags = flags_param.num_value;
ret = SDL_Init(flags);
if (ret < 0)
update_ERRNO_string(_("SDL_Init failed"));
return make_number(ret, result);
}
/* void SDL_Quit(void); */
/* do_SDL_Quit --- provide a SDL_Quit() function for gawk */
static awk_value_t *
do_SDL_Quit(int nargs, awk_value_t *result, struct awk_ext_func *finfo)
{
SDL_Quit();
RETURN_OK;
}
/* void SDL_QuitSubSystem(Uint32 flags); */
/* do_SDL_QuitSubSystem --- provide a SDL_QuitSubSystem() function for gawk */
static awk_value_t *
do_SDL_QuitSubSystem(int nargs,
awk_value_t *result,
struct awk_ext_func *finfo)
{
awk_value_t flags_param;
uint32_t flags;
if (! get_argument(0, AWK_NUMBER, &flags_param)) {
warning(ext_id, _("SDL_QuitSubSystem: bad parameter(s)"));
RETURN_NOK;