1#[repr(C)]
4#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
5pub struct __BindgenBitfieldUnit<Storage> {
6 storage: Storage,
7}
8impl<Storage> __BindgenBitfieldUnit<Storage> {
9 #[inline]
10 pub const fn new(storage: Storage) -> Self {
11 Self { storage }
12 }
13}
14impl<Storage> __BindgenBitfieldUnit<Storage>
15where
16 Storage: AsRef<[u8]> + AsMut<[u8]>,
17{
18 #[inline]
19 pub fn get_bit(&self, index: usize) -> bool {
20 debug_assert!(index / 8 < self.storage.as_ref().len());
21 let byte_index = index / 8;
22 let byte = self.storage.as_ref()[byte_index];
23 let bit_index = if cfg!(target_endian = "big") {
24 7 - (index % 8)
25 } else {
26 index % 8
27 };
28 let mask = 1 << bit_index;
29 byte & mask == mask
30 }
31 #[inline]
32 pub fn set_bit(&mut self, index: usize, val: bool) {
33 debug_assert!(index / 8 < self.storage.as_ref().len());
34 let byte_index = index / 8;
35 let byte = &mut self.storage.as_mut()[byte_index];
36 let bit_index = if cfg!(target_endian = "big") {
37 7 - (index % 8)
38 } else {
39 index % 8
40 };
41 let mask = 1 << bit_index;
42 if val {
43 *byte |= mask;
44 } else {
45 *byte &= !mask;
46 }
47 }
48 #[inline]
49 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
50 debug_assert!(bit_width <= 64);
51 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
52 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
53 let mut val = 0;
54 for i in 0..(bit_width as usize) {
55 if self.get_bit(i + bit_offset) {
56 let index = if cfg!(target_endian = "big") {
57 bit_width as usize - 1 - i
58 } else {
59 i
60 };
61 val |= 1 << index;
62 }
63 }
64 val
65 }
66 #[inline]
67 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
68 debug_assert!(bit_width <= 64);
69 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
70 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
71 for i in 0..(bit_width as usize) {
72 let mask = 1 << i;
73 let val_bit_is_set = val & mask == mask;
74 let index = if cfg!(target_endian = "big") {
75 bit_width as usize - 1 - i
76 } else {
77 i
78 };
79 self.set_bit(index + bit_offset, val_bit_is_set);
80 }
81 }
82}
83pub const LCD_COLUMNS: u32 = 400;
84pub const LCD_ROWS: u32 = 240;
85pub const LCD_ROWSIZE: u32 = 52;
86pub const SEEK_SET: u32 = 0;
87pub const SEEK_CUR: u32 = 1;
88pub const SEEK_END: u32 = 2;
89#[repr(C)]
90#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
91pub struct LCDRect {
92 pub left: ctypes::c_int,
93 pub right: ctypes::c_int,
94 pub top: ctypes::c_int,
95 pub bottom: ctypes::c_int,
96}
97#[test]
98fn bindgen_test_layout_LCDRect() {
99 const UNINIT: ::core::mem::MaybeUninit<LCDRect> = ::core::mem::MaybeUninit::uninit();
100 let ptr = UNINIT.as_ptr();
101 assert_eq!(
102 ::core::mem::size_of::<LCDRect>(),
103 16usize,
104 concat!("Size of: ", stringify!(LCDRect))
105 );
106 assert_eq!(
107 ::core::mem::align_of::<LCDRect>(),
108 4usize,
109 concat!("Alignment of ", stringify!(LCDRect))
110 );
111 assert_eq!(
112 unsafe { ::core::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
113 0usize,
114 concat!(
115 "Offset of field: ",
116 stringify!(LCDRect),
117 "::",
118 stringify!(left)
119 )
120 );
121 assert_eq!(
122 unsafe { ::core::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
123 4usize,
124 concat!(
125 "Offset of field: ",
126 stringify!(LCDRect),
127 "::",
128 stringify!(right)
129 )
130 );
131 assert_eq!(
132 unsafe { ::core::ptr::addr_of!((*ptr).top) as usize - ptr as usize },
133 8usize,
134 concat!(
135 "Offset of field: ",
136 stringify!(LCDRect),
137 "::",
138 stringify!(top)
139 )
140 );
141 assert_eq!(
142 unsafe { ::core::ptr::addr_of!((*ptr).bottom) as usize - ptr as usize },
143 12usize,
144 concat!(
145 "Offset of field: ",
146 stringify!(LCDRect),
147 "::",
148 stringify!(bottom)
149 )
150 );
151}
152#[repr(u32)]
153#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
154pub enum LCDBitmapDrawMode {
155 kDrawModeCopy = 0,
156 kDrawModeWhiteTransparent = 1,
157 kDrawModeBlackTransparent = 2,
158 kDrawModeFillWhite = 3,
159 kDrawModeFillBlack = 4,
160 kDrawModeXOR = 5,
161 kDrawModeNXOR = 6,
162 kDrawModeInverted = 7,
163}
164#[repr(u32)]
165#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
166pub enum LCDBitmapFlip {
167 kBitmapUnflipped = 0,
168 kBitmapFlippedX = 1,
169 kBitmapFlippedY = 2,
170 kBitmapFlippedXY = 3,
171}
172#[repr(u32)]
173#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
174pub enum LCDSolidColor {
175 kColorBlack = 0,
176 kColorWhite = 1,
177 kColorClear = 2,
178 kColorXOR = 3,
179}
180#[repr(u32)]
181#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
182pub enum LCDLineCapStyle {
183 kLineCapStyleButt = 0,
184 kLineCapStyleSquare = 1,
185 kLineCapStyleRound = 2,
186}
187#[repr(u32)]
188#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
189pub enum PDStringEncoding {
190 kASCIIEncoding = 0,
191 kUTF8Encoding = 1,
192 k16BitLEEncoding = 2,
193}
194pub type LCDPattern = [u8; 16usize];
195pub type LCDColor = usize;
196#[repr(u32)]
197#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
198pub enum LCDPolygonFillRule {
199 kPolygonFillNonZero = 0,
200 kPolygonFillEvenOdd = 1,
201}
202#[repr(C)]
203#[derive(Debug, Copy, Clone)]
204pub struct LCDBitmap {
205 _unused: [u8; 0],
206}
207#[repr(C)]
208#[derive(Debug, Copy, Clone)]
209pub struct LCDBitmapTable {
210 _unused: [u8; 0],
211}
212#[repr(C)]
213#[derive(Debug, Copy, Clone)]
214pub struct LCDFont {
215 _unused: [u8; 0],
216}
217#[repr(C)]
218#[derive(Debug, Copy, Clone)]
219pub struct LCDFontData {
220 _unused: [u8; 0],
221}
222#[repr(C)]
223#[derive(Debug, Copy, Clone)]
224pub struct LCDFontPage {
225 _unused: [u8; 0],
226}
227#[repr(C)]
228#[derive(Debug, Copy, Clone)]
229pub struct LCDFontGlyph {
230 _unused: [u8; 0],
231}
232#[repr(C)]
233#[derive(Debug, Copy, Clone)]
234pub struct LCDVideoPlayer {
235 _unused: [u8; 0],
236}
237#[repr(C)]
238#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
239pub struct playdate_video {
240 pub loadVideo: ::core::option::Option<
241 unsafe extern "C" fn(path: *const ctypes::c_char) -> *mut LCDVideoPlayer,
242 >,
243 pub freePlayer: ::core::option::Option<unsafe extern "C" fn(p: *mut LCDVideoPlayer)>,
244 pub setContext: ::core::option::Option<
245 unsafe extern "C" fn(p: *mut LCDVideoPlayer, context: *mut LCDBitmap) -> ctypes::c_int,
246 >,
247 pub useScreenContext: ::core::option::Option<unsafe extern "C" fn(p: *mut LCDVideoPlayer)>,
248 pub renderFrame: ::core::option::Option<
249 unsafe extern "C" fn(p: *mut LCDVideoPlayer, n: ctypes::c_int) -> ctypes::c_int,
250 >,
251 pub getError: ::core::option::Option<
252 unsafe extern "C" fn(p: *mut LCDVideoPlayer) -> *const ctypes::c_char,
253 >,
254 pub getInfo: ::core::option::Option<
255 unsafe extern "C" fn(
256 p: *mut LCDVideoPlayer,
257 outWidth: *mut ctypes::c_int,
258 outHeight: *mut ctypes::c_int,
259 outFrameRate: *mut f32,
260 outFrameCount: *mut ctypes::c_int,
261 outCurrentFrame: *mut ctypes::c_int,
262 ),
263 >,
264 pub getContext:
265 ::core::option::Option<unsafe extern "C" fn(p: *mut LCDVideoPlayer) -> *mut LCDBitmap>,
266}
267#[test]
268fn bindgen_test_layout_playdate_video() {
269 const UNINIT: ::core::mem::MaybeUninit<playdate_video> = ::core::mem::MaybeUninit::uninit();
270 let ptr = UNINIT.as_ptr();
271 assert_eq!(
272 ::core::mem::size_of::<playdate_video>(),
273 64usize,
274 concat!("Size of: ", stringify!(playdate_video))
275 );
276 assert_eq!(
277 ::core::mem::align_of::<playdate_video>(),
278 8usize,
279 concat!("Alignment of ", stringify!(playdate_video))
280 );
281 assert_eq!(
282 unsafe { ::core::ptr::addr_of!((*ptr).loadVideo) as usize - ptr as usize },
283 0usize,
284 concat!(
285 "Offset of field: ",
286 stringify!(playdate_video),
287 "::",
288 stringify!(loadVideo)
289 )
290 );
291 assert_eq!(
292 unsafe { ::core::ptr::addr_of!((*ptr).freePlayer) as usize - ptr as usize },
293 8usize,
294 concat!(
295 "Offset of field: ",
296 stringify!(playdate_video),
297 "::",
298 stringify!(freePlayer)
299 )
300 );
301 assert_eq!(
302 unsafe { ::core::ptr::addr_of!((*ptr).setContext) as usize - ptr as usize },
303 16usize,
304 concat!(
305 "Offset of field: ",
306 stringify!(playdate_video),
307 "::",
308 stringify!(setContext)
309 )
310 );
311 assert_eq!(
312 unsafe { ::core::ptr::addr_of!((*ptr).useScreenContext) as usize - ptr as usize },
313 24usize,
314 concat!(
315 "Offset of field: ",
316 stringify!(playdate_video),
317 "::",
318 stringify!(useScreenContext)
319 )
320 );
321 assert_eq!(
322 unsafe { ::core::ptr::addr_of!((*ptr).renderFrame) as usize - ptr as usize },
323 32usize,
324 concat!(
325 "Offset of field: ",
326 stringify!(playdate_video),
327 "::",
328 stringify!(renderFrame)
329 )
330 );
331 assert_eq!(
332 unsafe { ::core::ptr::addr_of!((*ptr).getError) as usize - ptr as usize },
333 40usize,
334 concat!(
335 "Offset of field: ",
336 stringify!(playdate_video),
337 "::",
338 stringify!(getError)
339 )
340 );
341 assert_eq!(
342 unsafe { ::core::ptr::addr_of!((*ptr).getInfo) as usize - ptr as usize },
343 48usize,
344 concat!(
345 "Offset of field: ",
346 stringify!(playdate_video),
347 "::",
348 stringify!(getInfo)
349 )
350 );
351 assert_eq!(
352 unsafe { ::core::ptr::addr_of!((*ptr).getContext) as usize - ptr as usize },
353 56usize,
354 concat!(
355 "Offset of field: ",
356 stringify!(playdate_video),
357 "::",
358 stringify!(getContext)
359 )
360 );
361}
362#[repr(C)]
363#[derive(Debug, Copy, Clone, PartialEq, Eq)]
364pub struct playdate_graphics {
365 pub video: *const playdate_video,
366 pub clear: ::core::option::Option<unsafe extern "C" fn(color: LCDColor)>,
367 pub setBackgroundColor: ::core::option::Option<unsafe extern "C" fn(color: LCDSolidColor)>,
368 pub setStencil: ::core::option::Option<unsafe extern "C" fn(stencil: *mut LCDBitmap)>,
369 pub setDrawMode: ::core::option::Option<unsafe extern "C" fn(mode: LCDBitmapDrawMode)>,
370 pub setDrawOffset:
371 ::core::option::Option<unsafe extern "C" fn(dx: ctypes::c_int, dy: ctypes::c_int)>,
372 pub setClipRect: ::core::option::Option<
373 unsafe extern "C" fn(
374 x: ctypes::c_int,
375 y: ctypes::c_int,
376 width: ctypes::c_int,
377 height: ctypes::c_int,
378 ),
379 >,
380 pub clearClipRect: ::core::option::Option<unsafe extern "C" fn()>,
381 pub setLineCapStyle: ::core::option::Option<unsafe extern "C" fn(endCapStyle: LCDLineCapStyle)>,
382 pub setFont: ::core::option::Option<unsafe extern "C" fn(font: *mut LCDFont)>,
383 pub setTextTracking: ::core::option::Option<unsafe extern "C" fn(tracking: ctypes::c_int)>,
384 pub pushContext: ::core::option::Option<unsafe extern "C" fn(target: *mut LCDBitmap)>,
385 pub popContext: ::core::option::Option<unsafe extern "C" fn()>,
386 pub drawBitmap: ::core::option::Option<
387 unsafe extern "C" fn(
388 bitmap: *mut LCDBitmap,
389 x: ctypes::c_int,
390 y: ctypes::c_int,
391 flip: LCDBitmapFlip,
392 ),
393 >,
394 pub tileBitmap: ::core::option::Option<
395 unsafe extern "C" fn(
396 bitmap: *mut LCDBitmap,
397 x: ctypes::c_int,
398 y: ctypes::c_int,
399 width: ctypes::c_int,
400 height: ctypes::c_int,
401 flip: LCDBitmapFlip,
402 ),
403 >,
404 pub drawLine: ::core::option::Option<
405 unsafe extern "C" fn(
406 x1: ctypes::c_int,
407 y1: ctypes::c_int,
408 x2: ctypes::c_int,
409 y2: ctypes::c_int,
410 width: ctypes::c_int,
411 color: LCDColor,
412 ),
413 >,
414 pub fillTriangle: ::core::option::Option<
415 unsafe extern "C" fn(
416 x1: ctypes::c_int,
417 y1: ctypes::c_int,
418 x2: ctypes::c_int,
419 y2: ctypes::c_int,
420 x3: ctypes::c_int,
421 y3: ctypes::c_int,
422 color: LCDColor,
423 ),
424 >,
425 pub drawRect: ::core::option::Option<
426 unsafe extern "C" fn(
427 x: ctypes::c_int,
428 y: ctypes::c_int,
429 width: ctypes::c_int,
430 height: ctypes::c_int,
431 color: LCDColor,
432 ),
433 >,
434 pub fillRect: ::core::option::Option<
435 unsafe extern "C" fn(
436 x: ctypes::c_int,
437 y: ctypes::c_int,
438 width: ctypes::c_int,
439 height: ctypes::c_int,
440 color: LCDColor,
441 ),
442 >,
443 pub drawEllipse: ::core::option::Option<
444 unsafe extern "C" fn(
445 x: ctypes::c_int,
446 y: ctypes::c_int,
447 width: ctypes::c_int,
448 height: ctypes::c_int,
449 lineWidth: ctypes::c_int,
450 startAngle: f32,
451 endAngle: f32,
452 color: LCDColor,
453 ),
454 >,
455 pub fillEllipse: ::core::option::Option<
456 unsafe extern "C" fn(
457 x: ctypes::c_int,
458 y: ctypes::c_int,
459 width: ctypes::c_int,
460 height: ctypes::c_int,
461 startAngle: f32,
462 endAngle: f32,
463 color: LCDColor,
464 ),
465 >,
466 pub drawScaledBitmap: ::core::option::Option<
467 unsafe extern "C" fn(
468 bitmap: *mut LCDBitmap,
469 x: ctypes::c_int,
470 y: ctypes::c_int,
471 xscale: f32,
472 yscale: f32,
473 ),
474 >,
475 pub drawText: ::core::option::Option<
476 unsafe extern "C" fn(
477 text: *const ctypes::c_void,
478 len: usize,
479 encoding: PDStringEncoding,
480 x: ctypes::c_int,
481 y: ctypes::c_int,
482 ) -> ctypes::c_int,
483 >,
484 pub newBitmap: ::core::option::Option<
485 unsafe extern "C" fn(
486 width: ctypes::c_int,
487 height: ctypes::c_int,
488 bgcolor: LCDColor,
489 ) -> *mut LCDBitmap,
490 >,
491 pub freeBitmap: ::core::option::Option<unsafe extern "C" fn(arg1: *mut LCDBitmap)>,
492 pub loadBitmap: ::core::option::Option<
493 unsafe extern "C" fn(
494 path: *const ctypes::c_char,
495 outerr: *mut *const ctypes::c_char,
496 ) -> *mut LCDBitmap,
497 >,
498 pub copyBitmap:
499 ::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap) -> *mut LCDBitmap>,
500 pub loadIntoBitmap: ::core::option::Option<
501 unsafe extern "C" fn(
502 path: *const ctypes::c_char,
503 bitmap: *mut LCDBitmap,
504 outerr: *mut *const ctypes::c_char,
505 ),
506 >,
507 pub getBitmapData: ::core::option::Option<
508 unsafe extern "C" fn(
509 bitmap: *mut LCDBitmap,
510 width: *mut ctypes::c_int,
511 height: *mut ctypes::c_int,
512 rowbytes: *mut ctypes::c_int,
513 mask: *mut *mut u8,
514 data: *mut *mut u8,
515 ),
516 >,
517 pub clearBitmap:
518 ::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap, bgcolor: LCDColor)>,
519 pub rotatedBitmap: ::core::option::Option<
520 unsafe extern "C" fn(
521 bitmap: *mut LCDBitmap,
522 rotation: f32,
523 xscale: f32,
524 yscale: f32,
525 allocedSize: *mut ctypes::c_int,
526 ) -> *mut LCDBitmap,
527 >,
528 pub newBitmapTable: ::core::option::Option<
529 unsafe extern "C" fn(
530 count: ctypes::c_int,
531 width: ctypes::c_int,
532 height: ctypes::c_int,
533 ) -> *mut LCDBitmapTable,
534 >,
535 pub freeBitmapTable: ::core::option::Option<unsafe extern "C" fn(table: *mut LCDBitmapTable)>,
536 pub loadBitmapTable: ::core::option::Option<
537 unsafe extern "C" fn(
538 path: *const ctypes::c_char,
539 outerr: *mut *const ctypes::c_char,
540 ) -> *mut LCDBitmapTable,
541 >,
542 pub loadIntoBitmapTable: ::core::option::Option<
543 unsafe extern "C" fn(
544 path: *const ctypes::c_char,
545 table: *mut LCDBitmapTable,
546 outerr: *mut *const ctypes::c_char,
547 ),
548 >,
549 pub getTableBitmap: ::core::option::Option<
550 unsafe extern "C" fn(table: *mut LCDBitmapTable, idx: ctypes::c_int) -> *mut LCDBitmap,
551 >,
552 pub loadFont: ::core::option::Option<
553 unsafe extern "C" fn(
554 path: *const ctypes::c_char,
555 outErr: *mut *const ctypes::c_char,
556 ) -> *mut LCDFont,
557 >,
558 pub getFontPage: ::core::option::Option<
559 unsafe extern "C" fn(font: *mut LCDFont, c: u32) -> *mut LCDFontPage,
560 >,
561 pub getPageGlyph: ::core::option::Option<
562 unsafe extern "C" fn(
563 page: *mut LCDFontPage,
564 c: u32,
565 bitmap: *mut *mut LCDBitmap,
566 advance: *mut ctypes::c_int,
567 ) -> *mut LCDFontGlyph,
568 >,
569 pub getGlyphKerning: ::core::option::Option<
570 unsafe extern "C" fn(
571 glyph: *mut LCDFontGlyph,
572 glyphcode: u32,
573 nextcode: u32,
574 ) -> ctypes::c_int,
575 >,
576 pub getTextWidth: ::core::option::Option<
577 unsafe extern "C" fn(
578 font: *mut LCDFont,
579 text: *const ctypes::c_void,
580 len: usize,
581 encoding: PDStringEncoding,
582 tracking: ctypes::c_int,
583 ) -> ctypes::c_int,
584 >,
585 pub getFrame: ::core::option::Option<unsafe extern "C" fn() -> *mut u8>,
586 pub getDisplayFrame: ::core::option::Option<unsafe extern "C" fn() -> *mut u8>,
587 pub getDebugBitmap: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDBitmap>,
588 pub copyFrameBufferBitmap: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDBitmap>,
589 pub markUpdatedRows:
590 ::core::option::Option<unsafe extern "C" fn(start: ctypes::c_int, end: ctypes::c_int)>,
591 pub display: ::core::option::Option<unsafe extern "C" fn()>,
592 pub setColorToPattern: ::core::option::Option<
593 unsafe extern "C" fn(
594 color: *mut LCDColor,
595 bitmap: *mut LCDBitmap,
596 x: ctypes::c_int,
597 y: ctypes::c_int,
598 ),
599 >,
600 pub checkMaskCollision: ::core::option::Option<
601 unsafe extern "C" fn(
602 bitmap1: *mut LCDBitmap,
603 x1: ctypes::c_int,
604 y1: ctypes::c_int,
605 flip1: LCDBitmapFlip,
606 bitmap2: *mut LCDBitmap,
607 x2: ctypes::c_int,
608 y2: ctypes::c_int,
609 flip2: LCDBitmapFlip,
610 rect: LCDRect,
611 ) -> ctypes::c_int,
612 >,
613 pub setScreenClipRect: ::core::option::Option<
614 unsafe extern "C" fn(
615 x: ctypes::c_int,
616 y: ctypes::c_int,
617 width: ctypes::c_int,
618 height: ctypes::c_int,
619 ),
620 >,
621 pub fillPolygon: ::core::option::Option<
622 unsafe extern "C" fn(
623 nPoints: ctypes::c_int,
624 coords: *mut ctypes::c_int,
625 color: LCDColor,
626 fillrule: LCDPolygonFillRule,
627 ),
628 >,
629 pub getFontHeight: ::core::option::Option<unsafe extern "C" fn(font: *mut LCDFont) -> u8>,
630 pub getDisplayBufferBitmap: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDBitmap>,
631 pub drawRotatedBitmap: ::core::option::Option<
632 unsafe extern "C" fn(
633 bitmap: *mut LCDBitmap,
634 x: ctypes::c_int,
635 y: ctypes::c_int,
636 rotation: f32,
637 centerx: f32,
638 centery: f32,
639 xscale: f32,
640 yscale: f32,
641 ),
642 >,
643 pub setTextLeading:
644 ::core::option::Option<unsafe extern "C" fn(lineHeightAdustment: ctypes::c_int)>,
645 pub setBitmapMask: ::core::option::Option<
646 unsafe extern "C" fn(bitmap: *mut LCDBitmap, mask: *mut LCDBitmap) -> ctypes::c_int,
647 >,
648 pub getBitmapMask:
649 ::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap) -> *mut LCDBitmap>,
650 pub setStencilImage:
651 ::core::option::Option<unsafe extern "C" fn(stencil: *mut LCDBitmap, tile: ctypes::c_int)>,
652 pub makeFontFromData: ::core::option::Option<
653 unsafe extern "C" fn(data: *mut LCDFontData, wide: ctypes::c_int) -> *mut LCDFont,
654 >,
655}
656#[test]
657fn bindgen_test_layout_playdate_graphics() {
658 const UNINIT: ::core::mem::MaybeUninit<playdate_graphics> = ::core::mem::MaybeUninit::uninit();
659 let ptr = UNINIT.as_ptr();
660 assert_eq!(
661 ::core::mem::size_of::<playdate_graphics>(),
662 472usize,
663 concat!("Size of: ", stringify!(playdate_graphics))
664 );
665 assert_eq!(
666 ::core::mem::align_of::<playdate_graphics>(),
667 8usize,
668 concat!("Alignment of ", stringify!(playdate_graphics))
669 );
670 assert_eq!(
671 unsafe { ::core::ptr::addr_of!((*ptr).video) as usize - ptr as usize },
672 0usize,
673 concat!(
674 "Offset of field: ",
675 stringify!(playdate_graphics),
676 "::",
677 stringify!(video)
678 )
679 );
680 assert_eq!(
681 unsafe { ::core::ptr::addr_of!((*ptr).clear) as usize - ptr as usize },
682 8usize,
683 concat!(
684 "Offset of field: ",
685 stringify!(playdate_graphics),
686 "::",
687 stringify!(clear)
688 )
689 );
690 assert_eq!(
691 unsafe { ::core::ptr::addr_of!((*ptr).setBackgroundColor) as usize - ptr as usize },
692 16usize,
693 concat!(
694 "Offset of field: ",
695 stringify!(playdate_graphics),
696 "::",
697 stringify!(setBackgroundColor)
698 )
699 );
700 assert_eq!(
701 unsafe { ::core::ptr::addr_of!((*ptr).setStencil) as usize - ptr as usize },
702 24usize,
703 concat!(
704 "Offset of field: ",
705 stringify!(playdate_graphics),
706 "::",
707 stringify!(setStencil)
708 )
709 );
710 assert_eq!(
711 unsafe { ::core::ptr::addr_of!((*ptr).setDrawMode) as usize - ptr as usize },
712 32usize,
713 concat!(
714 "Offset of field: ",
715 stringify!(playdate_graphics),
716 "::",
717 stringify!(setDrawMode)
718 )
719 );
720 assert_eq!(
721 unsafe { ::core::ptr::addr_of!((*ptr).setDrawOffset) as usize - ptr as usize },
722 40usize,
723 concat!(
724 "Offset of field: ",
725 stringify!(playdate_graphics),
726 "::",
727 stringify!(setDrawOffset)
728 )
729 );
730 assert_eq!(
731 unsafe { ::core::ptr::addr_of!((*ptr).setClipRect) as usize - ptr as usize },
732 48usize,
733 concat!(
734 "Offset of field: ",
735 stringify!(playdate_graphics),
736 "::",
737 stringify!(setClipRect)
738 )
739 );
740 assert_eq!(
741 unsafe { ::core::ptr::addr_of!((*ptr).clearClipRect) as usize - ptr as usize },
742 56usize,
743 concat!(
744 "Offset of field: ",
745 stringify!(playdate_graphics),
746 "::",
747 stringify!(clearClipRect)
748 )
749 );
750 assert_eq!(
751 unsafe { ::core::ptr::addr_of!((*ptr).setLineCapStyle) as usize - ptr as usize },
752 64usize,
753 concat!(
754 "Offset of field: ",
755 stringify!(playdate_graphics),
756 "::",
757 stringify!(setLineCapStyle)
758 )
759 );
760 assert_eq!(
761 unsafe { ::core::ptr::addr_of!((*ptr).setFont) as usize - ptr as usize },
762 72usize,
763 concat!(
764 "Offset of field: ",
765 stringify!(playdate_graphics),
766 "::",
767 stringify!(setFont)
768 )
769 );
770 assert_eq!(
771 unsafe { ::core::ptr::addr_of!((*ptr).setTextTracking) as usize - ptr as usize },
772 80usize,
773 concat!(
774 "Offset of field: ",
775 stringify!(playdate_graphics),
776 "::",
777 stringify!(setTextTracking)
778 )
779 );
780 assert_eq!(
781 unsafe { ::core::ptr::addr_of!((*ptr).pushContext) as usize - ptr as usize },
782 88usize,
783 concat!(
784 "Offset of field: ",
785 stringify!(playdate_graphics),
786 "::",
787 stringify!(pushContext)
788 )
789 );
790 assert_eq!(
791 unsafe { ::core::ptr::addr_of!((*ptr).popContext) as usize - ptr as usize },
792 96usize,
793 concat!(
794 "Offset of field: ",
795 stringify!(playdate_graphics),
796 "::",
797 stringify!(popContext)
798 )
799 );
800 assert_eq!(
801 unsafe { ::core::ptr::addr_of!((*ptr).drawBitmap) as usize - ptr as usize },
802 104usize,
803 concat!(
804 "Offset of field: ",
805 stringify!(playdate_graphics),
806 "::",
807 stringify!(drawBitmap)
808 )
809 );
810 assert_eq!(
811 unsafe { ::core::ptr::addr_of!((*ptr).tileBitmap) as usize - ptr as usize },
812 112usize,
813 concat!(
814 "Offset of field: ",
815 stringify!(playdate_graphics),
816 "::",
817 stringify!(tileBitmap)
818 )
819 );
820 assert_eq!(
821 unsafe { ::core::ptr::addr_of!((*ptr).drawLine) as usize - ptr as usize },
822 120usize,
823 concat!(
824 "Offset of field: ",
825 stringify!(playdate_graphics),
826 "::",
827 stringify!(drawLine)
828 )
829 );
830 assert_eq!(
831 unsafe { ::core::ptr::addr_of!((*ptr).fillTriangle) as usize - ptr as usize },
832 128usize,
833 concat!(
834 "Offset of field: ",
835 stringify!(playdate_graphics),
836 "::",
837 stringify!(fillTriangle)
838 )
839 );
840 assert_eq!(
841 unsafe { ::core::ptr::addr_of!((*ptr).drawRect) as usize - ptr as usize },
842 136usize,
843 concat!(
844 "Offset of field: ",
845 stringify!(playdate_graphics),
846 "::",
847 stringify!(drawRect)
848 )
849 );
850 assert_eq!(
851 unsafe { ::core::ptr::addr_of!((*ptr).fillRect) as usize - ptr as usize },
852 144usize,
853 concat!(
854 "Offset of field: ",
855 stringify!(playdate_graphics),
856 "::",
857 stringify!(fillRect)
858 )
859 );
860 assert_eq!(
861 unsafe { ::core::ptr::addr_of!((*ptr).drawEllipse) as usize - ptr as usize },
862 152usize,
863 concat!(
864 "Offset of field: ",
865 stringify!(playdate_graphics),
866 "::",
867 stringify!(drawEllipse)
868 )
869 );
870 assert_eq!(
871 unsafe { ::core::ptr::addr_of!((*ptr).fillEllipse) as usize - ptr as usize },
872 160usize,
873 concat!(
874 "Offset of field: ",
875 stringify!(playdate_graphics),
876 "::",
877 stringify!(fillEllipse)
878 )
879 );
880 assert_eq!(
881 unsafe { ::core::ptr::addr_of!((*ptr).drawScaledBitmap) as usize - ptr as usize },
882 168usize,
883 concat!(
884 "Offset of field: ",
885 stringify!(playdate_graphics),
886 "::",
887 stringify!(drawScaledBitmap)
888 )
889 );
890 assert_eq!(
891 unsafe { ::core::ptr::addr_of!((*ptr).drawText) as usize - ptr as usize },
892 176usize,
893 concat!(
894 "Offset of field: ",
895 stringify!(playdate_graphics),
896 "::",
897 stringify!(drawText)
898 )
899 );
900 assert_eq!(
901 unsafe { ::core::ptr::addr_of!((*ptr).newBitmap) as usize - ptr as usize },
902 184usize,
903 concat!(
904 "Offset of field: ",
905 stringify!(playdate_graphics),
906 "::",
907 stringify!(newBitmap)
908 )
909 );
910 assert_eq!(
911 unsafe { ::core::ptr::addr_of!((*ptr).freeBitmap) as usize - ptr as usize },
912 192usize,
913 concat!(
914 "Offset of field: ",
915 stringify!(playdate_graphics),
916 "::",
917 stringify!(freeBitmap)
918 )
919 );
920 assert_eq!(
921 unsafe { ::core::ptr::addr_of!((*ptr).loadBitmap) as usize - ptr as usize },
922 200usize,
923 concat!(
924 "Offset of field: ",
925 stringify!(playdate_graphics),
926 "::",
927 stringify!(loadBitmap)
928 )
929 );
930 assert_eq!(
931 unsafe { ::core::ptr::addr_of!((*ptr).copyBitmap) as usize - ptr as usize },
932 208usize,
933 concat!(
934 "Offset of field: ",
935 stringify!(playdate_graphics),
936 "::",
937 stringify!(copyBitmap)
938 )
939 );
940 assert_eq!(
941 unsafe { ::core::ptr::addr_of!((*ptr).loadIntoBitmap) as usize - ptr as usize },
942 216usize,
943 concat!(
944 "Offset of field: ",
945 stringify!(playdate_graphics),
946 "::",
947 stringify!(loadIntoBitmap)
948 )
949 );
950 assert_eq!(
951 unsafe { ::core::ptr::addr_of!((*ptr).getBitmapData) as usize - ptr as usize },
952 224usize,
953 concat!(
954 "Offset of field: ",
955 stringify!(playdate_graphics),
956 "::",
957 stringify!(getBitmapData)
958 )
959 );
960 assert_eq!(
961 unsafe { ::core::ptr::addr_of!((*ptr).clearBitmap) as usize - ptr as usize },
962 232usize,
963 concat!(
964 "Offset of field: ",
965 stringify!(playdate_graphics),
966 "::",
967 stringify!(clearBitmap)
968 )
969 );
970 assert_eq!(
971 unsafe { ::core::ptr::addr_of!((*ptr).rotatedBitmap) as usize - ptr as usize },
972 240usize,
973 concat!(
974 "Offset of field: ",
975 stringify!(playdate_graphics),
976 "::",
977 stringify!(rotatedBitmap)
978 )
979 );
980 assert_eq!(
981 unsafe { ::core::ptr::addr_of!((*ptr).newBitmapTable) as usize - ptr as usize },
982 248usize,
983 concat!(
984 "Offset of field: ",
985 stringify!(playdate_graphics),
986 "::",
987 stringify!(newBitmapTable)
988 )
989 );
990 assert_eq!(
991 unsafe { ::core::ptr::addr_of!((*ptr).freeBitmapTable) as usize - ptr as usize },
992 256usize,
993 concat!(
994 "Offset of field: ",
995 stringify!(playdate_graphics),
996 "::",
997 stringify!(freeBitmapTable)
998 )
999 );
1000 assert_eq!(
1001 unsafe { ::core::ptr::addr_of!((*ptr).loadBitmapTable) as usize - ptr as usize },
1002 264usize,
1003 concat!(
1004 "Offset of field: ",
1005 stringify!(playdate_graphics),
1006 "::",
1007 stringify!(loadBitmapTable)
1008 )
1009 );
1010 assert_eq!(
1011 unsafe { ::core::ptr::addr_of!((*ptr).loadIntoBitmapTable) as usize - ptr as usize },
1012 272usize,
1013 concat!(
1014 "Offset of field: ",
1015 stringify!(playdate_graphics),
1016 "::",
1017 stringify!(loadIntoBitmapTable)
1018 )
1019 );
1020 assert_eq!(
1021 unsafe { ::core::ptr::addr_of!((*ptr).getTableBitmap) as usize - ptr as usize },
1022 280usize,
1023 concat!(
1024 "Offset of field: ",
1025 stringify!(playdate_graphics),
1026 "::",
1027 stringify!(getTableBitmap)
1028 )
1029 );
1030 assert_eq!(
1031 unsafe { ::core::ptr::addr_of!((*ptr).loadFont) as usize - ptr as usize },
1032 288usize,
1033 concat!(
1034 "Offset of field: ",
1035 stringify!(playdate_graphics),
1036 "::",
1037 stringify!(loadFont)
1038 )
1039 );
1040 assert_eq!(
1041 unsafe { ::core::ptr::addr_of!((*ptr).getFontPage) as usize - ptr as usize },
1042 296usize,
1043 concat!(
1044 "Offset of field: ",
1045 stringify!(playdate_graphics),
1046 "::",
1047 stringify!(getFontPage)
1048 )
1049 );
1050 assert_eq!(
1051 unsafe { ::core::ptr::addr_of!((*ptr).getPageGlyph) as usize - ptr as usize },
1052 304usize,
1053 concat!(
1054 "Offset of field: ",
1055 stringify!(playdate_graphics),
1056 "::",
1057 stringify!(getPageGlyph)
1058 )
1059 );
1060 assert_eq!(
1061 unsafe { ::core::ptr::addr_of!((*ptr).getGlyphKerning) as usize - ptr as usize },
1062 312usize,
1063 concat!(
1064 "Offset of field: ",
1065 stringify!(playdate_graphics),
1066 "::",
1067 stringify!(getGlyphKerning)
1068 )
1069 );
1070 assert_eq!(
1071 unsafe { ::core::ptr::addr_of!((*ptr).getTextWidth) as usize - ptr as usize },
1072 320usize,
1073 concat!(
1074 "Offset of field: ",
1075 stringify!(playdate_graphics),
1076 "::",
1077 stringify!(getTextWidth)
1078 )
1079 );
1080 assert_eq!(
1081 unsafe { ::core::ptr::addr_of!((*ptr).getFrame) as usize - ptr as usize },
1082 328usize,
1083 concat!(
1084 "Offset of field: ",
1085 stringify!(playdate_graphics),
1086 "::",
1087 stringify!(getFrame)
1088 )
1089 );
1090 assert_eq!(
1091 unsafe { ::core::ptr::addr_of!((*ptr).getDisplayFrame) as usize - ptr as usize },
1092 336usize,
1093 concat!(
1094 "Offset of field: ",
1095 stringify!(playdate_graphics),
1096 "::",
1097 stringify!(getDisplayFrame)
1098 )
1099 );
1100 assert_eq!(
1101 unsafe { ::core::ptr::addr_of!((*ptr).getDebugBitmap) as usize - ptr as usize },
1102 344usize,
1103 concat!(
1104 "Offset of field: ",
1105 stringify!(playdate_graphics),
1106 "::",
1107 stringify!(getDebugBitmap)
1108 )
1109 );
1110 assert_eq!(
1111 unsafe { ::core::ptr::addr_of!((*ptr).copyFrameBufferBitmap) as usize - ptr as usize },
1112 352usize,
1113 concat!(
1114 "Offset of field: ",
1115 stringify!(playdate_graphics),
1116 "::",
1117 stringify!(copyFrameBufferBitmap)
1118 )
1119 );
1120 assert_eq!(
1121 unsafe { ::core::ptr::addr_of!((*ptr).markUpdatedRows) as usize - ptr as usize },
1122 360usize,
1123 concat!(
1124 "Offset of field: ",
1125 stringify!(playdate_graphics),
1126 "::",
1127 stringify!(markUpdatedRows)
1128 )
1129 );
1130 assert_eq!(
1131 unsafe { ::core::ptr::addr_of!((*ptr).display) as usize - ptr as usize },
1132 368usize,
1133 concat!(
1134 "Offset of field: ",
1135 stringify!(playdate_graphics),
1136 "::",
1137 stringify!(display)
1138 )
1139 );
1140 assert_eq!(
1141 unsafe { ::core::ptr::addr_of!((*ptr).setColorToPattern) as usize - ptr as usize },
1142 376usize,
1143 concat!(
1144 "Offset of field: ",
1145 stringify!(playdate_graphics),
1146 "::",
1147 stringify!(setColorToPattern)
1148 )
1149 );
1150 assert_eq!(
1151 unsafe { ::core::ptr::addr_of!((*ptr).checkMaskCollision) as usize - ptr as usize },
1152 384usize,
1153 concat!(
1154 "Offset of field: ",
1155 stringify!(playdate_graphics),
1156 "::",
1157 stringify!(checkMaskCollision)
1158 )
1159 );
1160 assert_eq!(
1161 unsafe { ::core::ptr::addr_of!((*ptr).setScreenClipRect) as usize - ptr as usize },
1162 392usize,
1163 concat!(
1164 "Offset of field: ",
1165 stringify!(playdate_graphics),
1166 "::",
1167 stringify!(setScreenClipRect)
1168 )
1169 );
1170 assert_eq!(
1171 unsafe { ::core::ptr::addr_of!((*ptr).fillPolygon) as usize - ptr as usize },
1172 400usize,
1173 concat!(
1174 "Offset of field: ",
1175 stringify!(playdate_graphics),
1176 "::",
1177 stringify!(fillPolygon)
1178 )
1179 );
1180 assert_eq!(
1181 unsafe { ::core::ptr::addr_of!((*ptr).getFontHeight) as usize - ptr as usize },
1182 408usize,
1183 concat!(
1184 "Offset of field: ",
1185 stringify!(playdate_graphics),
1186 "::",
1187 stringify!(getFontHeight)
1188 )
1189 );
1190 assert_eq!(
1191 unsafe { ::core::ptr::addr_of!((*ptr).getDisplayBufferBitmap) as usize - ptr as usize },
1192 416usize,
1193 concat!(
1194 "Offset of field: ",
1195 stringify!(playdate_graphics),
1196 "::",
1197 stringify!(getDisplayBufferBitmap)
1198 )
1199 );
1200 assert_eq!(
1201 unsafe { ::core::ptr::addr_of!((*ptr).drawRotatedBitmap) as usize - ptr as usize },
1202 424usize,
1203 concat!(
1204 "Offset of field: ",
1205 stringify!(playdate_graphics),
1206 "::",
1207 stringify!(drawRotatedBitmap)
1208 )
1209 );
1210 assert_eq!(
1211 unsafe { ::core::ptr::addr_of!((*ptr).setTextLeading) as usize - ptr as usize },
1212 432usize,
1213 concat!(
1214 "Offset of field: ",
1215 stringify!(playdate_graphics),
1216 "::",
1217 stringify!(setTextLeading)
1218 )
1219 );
1220 assert_eq!(
1221 unsafe { ::core::ptr::addr_of!((*ptr).setBitmapMask) as usize - ptr as usize },
1222 440usize,
1223 concat!(
1224 "Offset of field: ",
1225 stringify!(playdate_graphics),
1226 "::",
1227 stringify!(setBitmapMask)
1228 )
1229 );
1230 assert_eq!(
1231 unsafe { ::core::ptr::addr_of!((*ptr).getBitmapMask) as usize - ptr as usize },
1232 448usize,
1233 concat!(
1234 "Offset of field: ",
1235 stringify!(playdate_graphics),
1236 "::",
1237 stringify!(getBitmapMask)
1238 )
1239 );
1240 assert_eq!(
1241 unsafe { ::core::ptr::addr_of!((*ptr).setStencilImage) as usize - ptr as usize },
1242 456usize,
1243 concat!(
1244 "Offset of field: ",
1245 stringify!(playdate_graphics),
1246 "::",
1247 stringify!(setStencilImage)
1248 )
1249 );
1250 assert_eq!(
1251 unsafe { ::core::ptr::addr_of!((*ptr).makeFontFromData) as usize - ptr as usize },
1252 464usize,
1253 concat!(
1254 "Offset of field: ",
1255 stringify!(playdate_graphics),
1256 "::",
1257 stringify!(makeFontFromData)
1258 )
1259 );
1260}
1261impl Default for playdate_graphics {
1262 fn default() -> Self {
1263 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
1264 unsafe {
1265 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1266 s.assume_init()
1267 }
1268 }
1269}
1270impl PDButtons {
1271 pub const kButtonLeft: PDButtons = PDButtons(1);
1272}
1273impl PDButtons {
1274 pub const kButtonRight: PDButtons = PDButtons(2);
1275}
1276impl PDButtons {
1277 pub const kButtonUp: PDButtons = PDButtons(4);
1278}
1279impl PDButtons {
1280 pub const kButtonDown: PDButtons = PDButtons(8);
1281}
1282impl PDButtons {
1283 pub const kButtonB: PDButtons = PDButtons(16);
1284}
1285impl PDButtons {
1286 pub const kButtonA: PDButtons = PDButtons(32);
1287}
1288impl ::core::ops::BitOr<PDButtons> for PDButtons {
1289 type Output = Self;
1290 #[inline]
1291 fn bitor(self, other: Self) -> Self {
1292 PDButtons(self.0 | other.0)
1293 }
1294}
1295impl ::core::ops::BitOrAssign for PDButtons {
1296 #[inline]
1297 fn bitor_assign(&mut self, rhs: PDButtons) {
1298 self.0 |= rhs.0;
1299 }
1300}
1301impl ::core::ops::BitAnd<PDButtons> for PDButtons {
1302 type Output = Self;
1303 #[inline]
1304 fn bitand(self, other: Self) -> Self {
1305 PDButtons(self.0 & other.0)
1306 }
1307}
1308impl ::core::ops::BitAndAssign for PDButtons {
1309 #[inline]
1310 fn bitand_assign(&mut self, rhs: PDButtons) {
1311 self.0 &= rhs.0;
1312 }
1313}
1314#[repr(transparent)]
1315#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1316pub struct PDButtons(pub ctypes::c_uint);
1317#[repr(u32)]
1318#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1319pub enum PDLanguage {
1320 kPDLanguageEnglish = 0,
1321 kPDLanguageJapanese = 1,
1322 kPDLanguageUnknown = 2,
1323}
1324#[repr(C)]
1325#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
1326pub struct PDDateTime {
1327 pub year: u16,
1328 pub month: u8,
1329 pub day: u8,
1330 pub weekday: u8,
1331 pub hour: u8,
1332 pub minute: u8,
1333 pub second: u8,
1334}
1335#[test]
1336fn bindgen_test_layout_PDDateTime() {
1337 const UNINIT: ::core::mem::MaybeUninit<PDDateTime> = ::core::mem::MaybeUninit::uninit();
1338 let ptr = UNINIT.as_ptr();
1339 assert_eq!(
1340 ::core::mem::size_of::<PDDateTime>(),
1341 8usize,
1342 concat!("Size of: ", stringify!(PDDateTime))
1343 );
1344 assert_eq!(
1345 ::core::mem::align_of::<PDDateTime>(),
1346 2usize,
1347 concat!("Alignment of ", stringify!(PDDateTime))
1348 );
1349 assert_eq!(
1350 unsafe { ::core::ptr::addr_of!((*ptr).year) as usize - ptr as usize },
1351 0usize,
1352 concat!(
1353 "Offset of field: ",
1354 stringify!(PDDateTime),
1355 "::",
1356 stringify!(year)
1357 )
1358 );
1359 assert_eq!(
1360 unsafe { ::core::ptr::addr_of!((*ptr).month) as usize - ptr as usize },
1361 2usize,
1362 concat!(
1363 "Offset of field: ",
1364 stringify!(PDDateTime),
1365 "::",
1366 stringify!(month)
1367 )
1368 );
1369 assert_eq!(
1370 unsafe { ::core::ptr::addr_of!((*ptr).day) as usize - ptr as usize },
1371 3usize,
1372 concat!(
1373 "Offset of field: ",
1374 stringify!(PDDateTime),
1375 "::",
1376 stringify!(day)
1377 )
1378 );
1379 assert_eq!(
1380 unsafe { ::core::ptr::addr_of!((*ptr).weekday) as usize - ptr as usize },
1381 4usize,
1382 concat!(
1383 "Offset of field: ",
1384 stringify!(PDDateTime),
1385 "::",
1386 stringify!(weekday)
1387 )
1388 );
1389 assert_eq!(
1390 unsafe { ::core::ptr::addr_of!((*ptr).hour) as usize - ptr as usize },
1391 5usize,
1392 concat!(
1393 "Offset of field: ",
1394 stringify!(PDDateTime),
1395 "::",
1396 stringify!(hour)
1397 )
1398 );
1399 assert_eq!(
1400 unsafe { ::core::ptr::addr_of!((*ptr).minute) as usize - ptr as usize },
1401 6usize,
1402 concat!(
1403 "Offset of field: ",
1404 stringify!(PDDateTime),
1405 "::",
1406 stringify!(minute)
1407 )
1408 );
1409 assert_eq!(
1410 unsafe { ::core::ptr::addr_of!((*ptr).second) as usize - ptr as usize },
1411 7usize,
1412 concat!(
1413 "Offset of field: ",
1414 stringify!(PDDateTime),
1415 "::",
1416 stringify!(second)
1417 )
1418 );
1419}
1420#[repr(C)]
1421#[derive(Debug, Copy, Clone)]
1422pub struct PDMenuItem {
1423 _unused: [u8; 0],
1424}
1425#[repr(u32)]
1426#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1427pub enum PDPeripherals {
1428 kNone = 0,
1429 kAccelerometer = 1,
1430 kAllPeripherals = 65535,
1431}
1432pub type PDCallbackFunction =
1433 ::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void) -> ctypes::c_int>;
1434pub type PDMenuItemCallbackFunction =
1435 ::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void)>;
1436#[repr(C)]
1437#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
1438pub struct playdate_sys {
1439 pub realloc: ::core::option::Option<
1440 unsafe extern "C" fn(ptr: *mut ctypes::c_void, size: usize) -> *mut ctypes::c_void,
1441 >,
1442 pub formatString: ::core::option::Option<
1443 unsafe extern "C" fn(
1444 ret: *mut *mut ctypes::c_char,
1445 fmt: *const ctypes::c_char,
1446 ...
1447 ) -> ctypes::c_int,
1448 >,
1449 pub logToConsole: ::core::option::Option<unsafe extern "C" fn(fmt: *const ctypes::c_char, ...)>,
1450 pub error: ::core::option::Option<unsafe extern "C" fn(fmt: *const ctypes::c_char, ...)>,
1451 pub getLanguage: ::core::option::Option<unsafe extern "C" fn() -> PDLanguage>,
1452 pub getCurrentTimeMilliseconds:
1453 ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_uint>,
1454 pub getSecondsSinceEpoch: ::core::option::Option<
1455 unsafe extern "C" fn(milliseconds: *mut ctypes::c_uint) -> ctypes::c_uint,
1456 >,
1457 pub drawFPS: ::core::option::Option<unsafe extern "C" fn(x: ctypes::c_int, y: ctypes::c_int)>,
1458 pub setUpdateCallback: ::core::option::Option<
1459 unsafe extern "C" fn(update: PDCallbackFunction, userdata: *mut ctypes::c_void),
1460 >,
1461 pub getButtonState: ::core::option::Option<
1462 unsafe extern "C" fn(
1463 current: *mut PDButtons,
1464 pushed: *mut PDButtons,
1465 released: *mut PDButtons,
1466 ),
1467 >,
1468 pub setPeripheralsEnabled: ::core::option::Option<unsafe extern "C" fn(mask: PDPeripherals)>,
1469 pub getAccelerometer: ::core::option::Option<
1470 unsafe extern "C" fn(outx: *mut f32, outy: *mut f32, outz: *mut f32),
1471 >,
1472 pub getCrankChange: ::core::option::Option<unsafe extern "C" fn() -> f32>,
1473 pub getCrankAngle: ::core::option::Option<unsafe extern "C" fn() -> f32>,
1474 pub isCrankDocked: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
1475 pub setCrankSoundsDisabled:
1476 ::core::option::Option<unsafe extern "C" fn(flag: ctypes::c_int) -> ctypes::c_int>,
1477 pub getFlipped: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
1478 pub setAutoLockDisabled: ::core::option::Option<unsafe extern "C" fn(disable: ctypes::c_int)>,
1479 pub setMenuImage: ::core::option::Option<
1480 unsafe extern "C" fn(bitmap: *mut LCDBitmap, xOffset: ctypes::c_int),
1481 >,
1482 pub addMenuItem: ::core::option::Option<
1483 unsafe extern "C" fn(
1484 title: *const ctypes::c_char,
1485 callback: PDMenuItemCallbackFunction,
1486 userdata: *mut ctypes::c_void,
1487 ) -> *mut PDMenuItem,
1488 >,
1489 pub addCheckmarkMenuItem: ::core::option::Option<
1490 unsafe extern "C" fn(
1491 title: *const ctypes::c_char,
1492 value: ctypes::c_int,
1493 callback: PDMenuItemCallbackFunction,
1494 userdata: *mut ctypes::c_void,
1495 ) -> *mut PDMenuItem,
1496 >,
1497 pub addOptionsMenuItem: ::core::option::Option<
1498 unsafe extern "C" fn(
1499 title: *const ctypes::c_char,
1500 optionTitles: *mut *const ctypes::c_char,
1501 optionsCount: ctypes::c_int,
1502 f: PDMenuItemCallbackFunction,
1503 userdata: *mut ctypes::c_void,
1504 ) -> *mut PDMenuItem,
1505 >,
1506 pub removeAllMenuItems: ::core::option::Option<unsafe extern "C" fn()>,
1507 pub removeMenuItem: ::core::option::Option<unsafe extern "C" fn(menuItem: *mut PDMenuItem)>,
1508 pub getMenuItemValue:
1509 ::core::option::Option<unsafe extern "C" fn(menuItem: *mut PDMenuItem) -> ctypes::c_int>,
1510 pub setMenuItemValue: ::core::option::Option<
1511 unsafe extern "C" fn(menuItem: *mut PDMenuItem, value: ctypes::c_int),
1512 >,
1513 pub getMenuItemTitle: ::core::option::Option<
1514 unsafe extern "C" fn(menuItem: *mut PDMenuItem) -> *const ctypes::c_char,
1515 >,
1516 pub setMenuItemTitle: ::core::option::Option<
1517 unsafe extern "C" fn(menuItem: *mut PDMenuItem, title: *const ctypes::c_char),
1518 >,
1519 pub getMenuItemUserdata: ::core::option::Option<
1520 unsafe extern "C" fn(menuItem: *mut PDMenuItem) -> *mut ctypes::c_void,
1521 >,
1522 pub setMenuItemUserdata: ::core::option::Option<
1523 unsafe extern "C" fn(menuItem: *mut PDMenuItem, ud: *mut ctypes::c_void),
1524 >,
1525 pub getReduceFlashing: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
1526 pub getElapsedTime: ::core::option::Option<unsafe extern "C" fn() -> f32>,
1527 pub resetElapsedTime: ::core::option::Option<unsafe extern "C" fn()>,
1528 pub getBatteryPercentage: ::core::option::Option<unsafe extern "C" fn() -> f32>,
1529 pub getBatteryVoltage: ::core::option::Option<unsafe extern "C" fn() -> f32>,
1530 pub getTimezoneOffset: ::core::option::Option<unsafe extern "C" fn() -> i32>,
1531 pub shouldDisplay24HourTime: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
1532 pub convertEpochToDateTime:
1533 ::core::option::Option<unsafe extern "C" fn(epoch: u32, datetime: *mut PDDateTime)>,
1534 pub convertDateTimeToEpoch:
1535 ::core::option::Option<unsafe extern "C" fn(datetime: *mut PDDateTime) -> u32>,
1536 pub clearICache: ::core::option::Option<unsafe extern "C" fn()>,
1537}
1538#[test]
1539fn bindgen_test_layout_playdate_sys() {
1540 const UNINIT: ::core::mem::MaybeUninit<playdate_sys> = ::core::mem::MaybeUninit::uninit();
1541 let ptr = UNINIT.as_ptr();
1542 assert_eq!(
1543 ::core::mem::size_of::<playdate_sys>(),
1544 320usize,
1545 concat!("Size of: ", stringify!(playdate_sys))
1546 );
1547 assert_eq!(
1548 ::core::mem::align_of::<playdate_sys>(),
1549 8usize,
1550 concat!("Alignment of ", stringify!(playdate_sys))
1551 );
1552 assert_eq!(
1553 unsafe { ::core::ptr::addr_of!((*ptr).realloc) as usize - ptr as usize },
1554 0usize,
1555 concat!(
1556 "Offset of field: ",
1557 stringify!(playdate_sys),
1558 "::",
1559 stringify!(realloc)
1560 )
1561 );
1562 assert_eq!(
1563 unsafe { ::core::ptr::addr_of!((*ptr).formatString) as usize - ptr as usize },
1564 8usize,
1565 concat!(
1566 "Offset of field: ",
1567 stringify!(playdate_sys),
1568 "::",
1569 stringify!(formatString)
1570 )
1571 );
1572 assert_eq!(
1573 unsafe { ::core::ptr::addr_of!((*ptr).logToConsole) as usize - ptr as usize },
1574 16usize,
1575 concat!(
1576 "Offset of field: ",
1577 stringify!(playdate_sys),
1578 "::",
1579 stringify!(logToConsole)
1580 )
1581 );
1582 assert_eq!(
1583 unsafe { ::core::ptr::addr_of!((*ptr).error) as usize - ptr as usize },
1584 24usize,
1585 concat!(
1586 "Offset of field: ",
1587 stringify!(playdate_sys),
1588 "::",
1589 stringify!(error)
1590 )
1591 );
1592 assert_eq!(
1593 unsafe { ::core::ptr::addr_of!((*ptr).getLanguage) as usize - ptr as usize },
1594 32usize,
1595 concat!(
1596 "Offset of field: ",
1597 stringify!(playdate_sys),
1598 "::",
1599 stringify!(getLanguage)
1600 )
1601 );
1602 assert_eq!(
1603 unsafe { ::core::ptr::addr_of!((*ptr).getCurrentTimeMilliseconds) as usize - ptr as usize },
1604 40usize,
1605 concat!(
1606 "Offset of field: ",
1607 stringify!(playdate_sys),
1608 "::",
1609 stringify!(getCurrentTimeMilliseconds)
1610 )
1611 );
1612 assert_eq!(
1613 unsafe { ::core::ptr::addr_of!((*ptr).getSecondsSinceEpoch) as usize - ptr as usize },
1614 48usize,
1615 concat!(
1616 "Offset of field: ",
1617 stringify!(playdate_sys),
1618 "::",
1619 stringify!(getSecondsSinceEpoch)
1620 )
1621 );
1622 assert_eq!(
1623 unsafe { ::core::ptr::addr_of!((*ptr).drawFPS) as usize - ptr as usize },
1624 56usize,
1625 concat!(
1626 "Offset of field: ",
1627 stringify!(playdate_sys),
1628 "::",
1629 stringify!(drawFPS)
1630 )
1631 );
1632 assert_eq!(
1633 unsafe { ::core::ptr::addr_of!((*ptr).setUpdateCallback) as usize - ptr as usize },
1634 64usize,
1635 concat!(
1636 "Offset of field: ",
1637 stringify!(playdate_sys),
1638 "::",
1639 stringify!(setUpdateCallback)
1640 )
1641 );
1642 assert_eq!(
1643 unsafe { ::core::ptr::addr_of!((*ptr).getButtonState) as usize - ptr as usize },
1644 72usize,
1645 concat!(
1646 "Offset of field: ",
1647 stringify!(playdate_sys),
1648 "::",
1649 stringify!(getButtonState)
1650 )
1651 );
1652 assert_eq!(
1653 unsafe { ::core::ptr::addr_of!((*ptr).setPeripheralsEnabled) as usize - ptr as usize },
1654 80usize,
1655 concat!(
1656 "Offset of field: ",
1657 stringify!(playdate_sys),
1658 "::",
1659 stringify!(setPeripheralsEnabled)
1660 )
1661 );
1662 assert_eq!(
1663 unsafe { ::core::ptr::addr_of!((*ptr).getAccelerometer) as usize - ptr as usize },
1664 88usize,
1665 concat!(
1666 "Offset of field: ",
1667 stringify!(playdate_sys),
1668 "::",
1669 stringify!(getAccelerometer)
1670 )
1671 );
1672 assert_eq!(
1673 unsafe { ::core::ptr::addr_of!((*ptr).getCrankChange) as usize - ptr as usize },
1674 96usize,
1675 concat!(
1676 "Offset of field: ",
1677 stringify!(playdate_sys),
1678 "::",
1679 stringify!(getCrankChange)
1680 )
1681 );
1682 assert_eq!(
1683 unsafe { ::core::ptr::addr_of!((*ptr).getCrankAngle) as usize - ptr as usize },
1684 104usize,
1685 concat!(
1686 "Offset of field: ",
1687 stringify!(playdate_sys),
1688 "::",
1689 stringify!(getCrankAngle)
1690 )
1691 );
1692 assert_eq!(
1693 unsafe { ::core::ptr::addr_of!((*ptr).isCrankDocked) as usize - ptr as usize },
1694 112usize,
1695 concat!(
1696 "Offset of field: ",
1697 stringify!(playdate_sys),
1698 "::",
1699 stringify!(isCrankDocked)
1700 )
1701 );
1702 assert_eq!(
1703 unsafe { ::core::ptr::addr_of!((*ptr).setCrankSoundsDisabled) as usize - ptr as usize },
1704 120usize,
1705 concat!(
1706 "Offset of field: ",
1707 stringify!(playdate_sys),
1708 "::",
1709 stringify!(setCrankSoundsDisabled)
1710 )
1711 );
1712 assert_eq!(
1713 unsafe { ::core::ptr::addr_of!((*ptr).getFlipped) as usize - ptr as usize },
1714 128usize,
1715 concat!(
1716 "Offset of field: ",
1717 stringify!(playdate_sys),
1718 "::",
1719 stringify!(getFlipped)
1720 )
1721 );
1722 assert_eq!(
1723 unsafe { ::core::ptr::addr_of!((*ptr).setAutoLockDisabled) as usize - ptr as usize },
1724 136usize,
1725 concat!(
1726 "Offset of field: ",
1727 stringify!(playdate_sys),
1728 "::",
1729 stringify!(setAutoLockDisabled)
1730 )
1731 );
1732 assert_eq!(
1733 unsafe { ::core::ptr::addr_of!((*ptr).setMenuImage) as usize - ptr as usize },
1734 144usize,
1735 concat!(
1736 "Offset of field: ",
1737 stringify!(playdate_sys),
1738 "::",
1739 stringify!(setMenuImage)
1740 )
1741 );
1742 assert_eq!(
1743 unsafe { ::core::ptr::addr_of!((*ptr).addMenuItem) as usize - ptr as usize },
1744 152usize,
1745 concat!(
1746 "Offset of field: ",
1747 stringify!(playdate_sys),
1748 "::",
1749 stringify!(addMenuItem)
1750 )
1751 );
1752 assert_eq!(
1753 unsafe { ::core::ptr::addr_of!((*ptr).addCheckmarkMenuItem) as usize - ptr as usize },
1754 160usize,
1755 concat!(
1756 "Offset of field: ",
1757 stringify!(playdate_sys),
1758 "::",
1759 stringify!(addCheckmarkMenuItem)
1760 )
1761 );
1762 assert_eq!(
1763 unsafe { ::core::ptr::addr_of!((*ptr).addOptionsMenuItem) as usize - ptr as usize },
1764 168usize,
1765 concat!(
1766 "Offset of field: ",
1767 stringify!(playdate_sys),
1768 "::",
1769 stringify!(addOptionsMenuItem)
1770 )
1771 );
1772 assert_eq!(
1773 unsafe { ::core::ptr::addr_of!((*ptr).removeAllMenuItems) as usize - ptr as usize },
1774 176usize,
1775 concat!(
1776 "Offset of field: ",
1777 stringify!(playdate_sys),
1778 "::",
1779 stringify!(removeAllMenuItems)
1780 )
1781 );
1782 assert_eq!(
1783 unsafe { ::core::ptr::addr_of!((*ptr).removeMenuItem) as usize - ptr as usize },
1784 184usize,
1785 concat!(
1786 "Offset of field: ",
1787 stringify!(playdate_sys),
1788 "::",
1789 stringify!(removeMenuItem)
1790 )
1791 );
1792 assert_eq!(
1793 unsafe { ::core::ptr::addr_of!((*ptr).getMenuItemValue) as usize - ptr as usize },
1794 192usize,
1795 concat!(
1796 "Offset of field: ",
1797 stringify!(playdate_sys),
1798 "::",
1799 stringify!(getMenuItemValue)
1800 )
1801 );
1802 assert_eq!(
1803 unsafe { ::core::ptr::addr_of!((*ptr).setMenuItemValue) as usize - ptr as usize },
1804 200usize,
1805 concat!(
1806 "Offset of field: ",
1807 stringify!(playdate_sys),
1808 "::",
1809 stringify!(setMenuItemValue)
1810 )
1811 );
1812 assert_eq!(
1813 unsafe { ::core::ptr::addr_of!((*ptr).getMenuItemTitle) as usize - ptr as usize },
1814 208usize,
1815 concat!(
1816 "Offset of field: ",
1817 stringify!(playdate_sys),
1818 "::",
1819 stringify!(getMenuItemTitle)
1820 )
1821 );
1822 assert_eq!(
1823 unsafe { ::core::ptr::addr_of!((*ptr).setMenuItemTitle) as usize - ptr as usize },
1824 216usize,
1825 concat!(
1826 "Offset of field: ",
1827 stringify!(playdate_sys),
1828 "::",
1829 stringify!(setMenuItemTitle)
1830 )
1831 );
1832 assert_eq!(
1833 unsafe { ::core::ptr::addr_of!((*ptr).getMenuItemUserdata) as usize - ptr as usize },
1834 224usize,
1835 concat!(
1836 "Offset of field: ",
1837 stringify!(playdate_sys),
1838 "::",
1839 stringify!(getMenuItemUserdata)
1840 )
1841 );
1842 assert_eq!(
1843 unsafe { ::core::ptr::addr_of!((*ptr).setMenuItemUserdata) as usize - ptr as usize },
1844 232usize,
1845 concat!(
1846 "Offset of field: ",
1847 stringify!(playdate_sys),
1848 "::",
1849 stringify!(setMenuItemUserdata)
1850 )
1851 );
1852 assert_eq!(
1853 unsafe { ::core::ptr::addr_of!((*ptr).getReduceFlashing) as usize - ptr as usize },
1854 240usize,
1855 concat!(
1856 "Offset of field: ",
1857 stringify!(playdate_sys),
1858 "::",
1859 stringify!(getReduceFlashing)
1860 )
1861 );
1862 assert_eq!(
1863 unsafe { ::core::ptr::addr_of!((*ptr).getElapsedTime) as usize - ptr as usize },
1864 248usize,
1865 concat!(
1866 "Offset of field: ",
1867 stringify!(playdate_sys),
1868 "::",
1869 stringify!(getElapsedTime)
1870 )
1871 );
1872 assert_eq!(
1873 unsafe { ::core::ptr::addr_of!((*ptr).resetElapsedTime) as usize - ptr as usize },
1874 256usize,
1875 concat!(
1876 "Offset of field: ",
1877 stringify!(playdate_sys),
1878 "::",
1879 stringify!(resetElapsedTime)
1880 )
1881 );
1882 assert_eq!(
1883 unsafe { ::core::ptr::addr_of!((*ptr).getBatteryPercentage) as usize - ptr as usize },
1884 264usize,
1885 concat!(
1886 "Offset of field: ",
1887 stringify!(playdate_sys),
1888 "::",
1889 stringify!(getBatteryPercentage)
1890 )
1891 );
1892 assert_eq!(
1893 unsafe { ::core::ptr::addr_of!((*ptr).getBatteryVoltage) as usize - ptr as usize },
1894 272usize,
1895 concat!(
1896 "Offset of field: ",
1897 stringify!(playdate_sys),
1898 "::",
1899 stringify!(getBatteryVoltage)
1900 )
1901 );
1902 assert_eq!(
1903 unsafe { ::core::ptr::addr_of!((*ptr).getTimezoneOffset) as usize - ptr as usize },
1904 280usize,
1905 concat!(
1906 "Offset of field: ",
1907 stringify!(playdate_sys),
1908 "::",
1909 stringify!(getTimezoneOffset)
1910 )
1911 );
1912 assert_eq!(
1913 unsafe { ::core::ptr::addr_of!((*ptr).shouldDisplay24HourTime) as usize - ptr as usize },
1914 288usize,
1915 concat!(
1916 "Offset of field: ",
1917 stringify!(playdate_sys),
1918 "::",
1919 stringify!(shouldDisplay24HourTime)
1920 )
1921 );
1922 assert_eq!(
1923 unsafe { ::core::ptr::addr_of!((*ptr).convertEpochToDateTime) as usize - ptr as usize },
1924 296usize,
1925 concat!(
1926 "Offset of field: ",
1927 stringify!(playdate_sys),
1928 "::",
1929 stringify!(convertEpochToDateTime)
1930 )
1931 );
1932 assert_eq!(
1933 unsafe { ::core::ptr::addr_of!((*ptr).convertDateTimeToEpoch) as usize - ptr as usize },
1934 304usize,
1935 concat!(
1936 "Offset of field: ",
1937 stringify!(playdate_sys),
1938 "::",
1939 stringify!(convertDateTimeToEpoch)
1940 )
1941 );
1942 assert_eq!(
1943 unsafe { ::core::ptr::addr_of!((*ptr).clearICache) as usize - ptr as usize },
1944 312usize,
1945 concat!(
1946 "Offset of field: ",
1947 stringify!(playdate_sys),
1948 "::",
1949 stringify!(clearICache)
1950 )
1951 );
1952}
1953pub type lua_State = *mut ctypes::c_void;
1954pub type lua_CFunction =
1955 ::core::option::Option<unsafe extern "C" fn(L: *mut lua_State) -> ctypes::c_int>;
1956#[repr(C)]
1957#[derive(Debug, Copy, Clone)]
1958pub struct LuaUDObject {
1959 _unused: [u8; 0],
1960}
1961#[repr(C)]
1962#[derive(Debug, Copy, Clone)]
1963pub struct LCDSprite {
1964 _unused: [u8; 0],
1965}
1966#[repr(u32)]
1967#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1968pub enum l_valtype {
1969 kInt = 0,
1970 kFloat = 1,
1971 kStr = 2,
1972}
1973#[repr(C)]
1974#[derive(Debug, Copy, Clone, PartialEq, Eq)]
1975pub struct lua_reg {
1976 pub name: *const ctypes::c_char,
1977 pub func: lua_CFunction,
1978}
1979#[test]
1980fn bindgen_test_layout_lua_reg() {
1981 const UNINIT: ::core::mem::MaybeUninit<lua_reg> = ::core::mem::MaybeUninit::uninit();
1982 let ptr = UNINIT.as_ptr();
1983 assert_eq!(
1984 ::core::mem::size_of::<lua_reg>(),
1985 16usize,
1986 concat!("Size of: ", stringify!(lua_reg))
1987 );
1988 assert_eq!(
1989 ::core::mem::align_of::<lua_reg>(),
1990 8usize,
1991 concat!("Alignment of ", stringify!(lua_reg))
1992 );
1993 assert_eq!(
1994 unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
1995 0usize,
1996 concat!(
1997 "Offset of field: ",
1998 stringify!(lua_reg),
1999 "::",
2000 stringify!(name)
2001 )
2002 );
2003 assert_eq!(
2004 unsafe { ::core::ptr::addr_of!((*ptr).func) as usize - ptr as usize },
2005 8usize,
2006 concat!(
2007 "Offset of field: ",
2008 stringify!(lua_reg),
2009 "::",
2010 stringify!(func)
2011 )
2012 );
2013}
2014impl Default for lua_reg {
2015 fn default() -> Self {
2016 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2017 unsafe {
2018 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2019 s.assume_init()
2020 }
2021 }
2022}
2023#[repr(u32)]
2024#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2025pub enum LuaType {
2026 kTypeNil = 0,
2027 kTypeBool = 1,
2028 kTypeInt = 2,
2029 kTypeFloat = 3,
2030 kTypeString = 4,
2031 kTypeTable = 5,
2032 kTypeFunction = 6,
2033 kTypeThread = 7,
2034 kTypeObject = 8,
2035}
2036#[repr(C)]
2037#[derive(Copy, Clone)]
2038pub struct lua_val {
2039 pub name: *const ctypes::c_char,
2040 pub type_: l_valtype,
2041 pub v: lua_val__bindgen_ty_1,
2042}
2043#[repr(C)]
2044#[derive(Copy, Clone)]
2045pub union lua_val__bindgen_ty_1 {
2046 pub intval: ctypes::c_uint,
2047 pub floatval: f32,
2048 pub strval: *const ctypes::c_char,
2049}
2050#[test]
2051fn bindgen_test_layout_lua_val__bindgen_ty_1() {
2052 const UNINIT: ::core::mem::MaybeUninit<lua_val__bindgen_ty_1> =
2053 ::core::mem::MaybeUninit::uninit();
2054 let ptr = UNINIT.as_ptr();
2055 assert_eq!(
2056 ::core::mem::size_of::<lua_val__bindgen_ty_1>(),
2057 8usize,
2058 concat!("Size of: ", stringify!(lua_val__bindgen_ty_1))
2059 );
2060 assert_eq!(
2061 ::core::mem::align_of::<lua_val__bindgen_ty_1>(),
2062 8usize,
2063 concat!("Alignment of ", stringify!(lua_val__bindgen_ty_1))
2064 );
2065 assert_eq!(
2066 unsafe { ::core::ptr::addr_of!((*ptr).intval) as usize - ptr as usize },
2067 0usize,
2068 concat!(
2069 "Offset of field: ",
2070 stringify!(lua_val__bindgen_ty_1),
2071 "::",
2072 stringify!(intval)
2073 )
2074 );
2075 assert_eq!(
2076 unsafe { ::core::ptr::addr_of!((*ptr).floatval) as usize - ptr as usize },
2077 0usize,
2078 concat!(
2079 "Offset of field: ",
2080 stringify!(lua_val__bindgen_ty_1),
2081 "::",
2082 stringify!(floatval)
2083 )
2084 );
2085 assert_eq!(
2086 unsafe { ::core::ptr::addr_of!((*ptr).strval) as usize - ptr as usize },
2087 0usize,
2088 concat!(
2089 "Offset of field: ",
2090 stringify!(lua_val__bindgen_ty_1),
2091 "::",
2092 stringify!(strval)
2093 )
2094 );
2095}
2096impl Default for lua_val__bindgen_ty_1 {
2097 fn default() -> Self {
2098 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2099 unsafe {
2100 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2101 s.assume_init()
2102 }
2103 }
2104}
2105#[test]
2106fn bindgen_test_layout_lua_val() {
2107 const UNINIT: ::core::mem::MaybeUninit<lua_val> = ::core::mem::MaybeUninit::uninit();
2108 let ptr = UNINIT.as_ptr();
2109 assert_eq!(
2110 ::core::mem::size_of::<lua_val>(),
2111 24usize,
2112 concat!("Size of: ", stringify!(lua_val))
2113 );
2114 assert_eq!(
2115 ::core::mem::align_of::<lua_val>(),
2116 8usize,
2117 concat!("Alignment of ", stringify!(lua_val))
2118 );
2119 assert_eq!(
2120 unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
2121 0usize,
2122 concat!(
2123 "Offset of field: ",
2124 stringify!(lua_val),
2125 "::",
2126 stringify!(name)
2127 )
2128 );
2129 assert_eq!(
2130 unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
2131 8usize,
2132 concat!(
2133 "Offset of field: ",
2134 stringify!(lua_val),
2135 "::",
2136 stringify!(type_)
2137 )
2138 );
2139 assert_eq!(
2140 unsafe { ::core::ptr::addr_of!((*ptr).v) as usize - ptr as usize },
2141 16usize,
2142 concat!(
2143 "Offset of field: ",
2144 stringify!(lua_val),
2145 "::",
2146 stringify!(v)
2147 )
2148 );
2149}
2150impl Default for lua_val {
2151 fn default() -> Self {
2152 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2153 unsafe {
2154 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2155 s.assume_init()
2156 }
2157 }
2158}
2159#[repr(C)]
2160#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
2161pub struct playdate_lua {
2162 pub addFunction: ::core::option::Option<
2163 unsafe extern "C" fn(
2164 f: lua_CFunction,
2165 name: *const ctypes::c_char,
2166 outErr: *mut *const ctypes::c_char,
2167 ) -> ctypes::c_int,
2168 >,
2169 pub registerClass: ::core::option::Option<
2170 unsafe extern "C" fn(
2171 name: *const ctypes::c_char,
2172 reg: *const lua_reg,
2173 vals: *const lua_val,
2174 isstatic: ctypes::c_int,
2175 outErr: *mut *const ctypes::c_char,
2176 ) -> ctypes::c_int,
2177 >,
2178 pub pushFunction: ::core::option::Option<unsafe extern "C" fn(f: lua_CFunction)>,
2179 pub indexMetatable: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
2180 pub stop: ::core::option::Option<unsafe extern "C" fn()>,
2181 pub start: ::core::option::Option<unsafe extern "C" fn()>,
2182 pub getArgCount: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
2183 pub getArgType: ::core::option::Option<
2184 unsafe extern "C" fn(pos: ctypes::c_int, outClass: *mut *const ctypes::c_char) -> LuaType,
2185 >,
2186 pub argIsNil: ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> ctypes::c_int>,
2187 pub getArgBool:
2188 ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> ctypes::c_int>,
2189 pub getArgInt:
2190 ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> ctypes::c_int>,
2191 pub getArgFloat: ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> f32>,
2192 pub getArgString:
2193 ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> *const ctypes::c_char>,
2194 pub getArgBytes: ::core::option::Option<
2195 unsafe extern "C" fn(pos: ctypes::c_int, outlen: *mut usize) -> *const ctypes::c_char,
2196 >,
2197 pub getArgObject: ::core::option::Option<
2198 unsafe extern "C" fn(
2199 pos: ctypes::c_int,
2200 type_: *mut ctypes::c_char,
2201 outud: *mut *mut LuaUDObject,
2202 ) -> *mut ctypes::c_void,
2203 >,
2204 pub getBitmap:
2205 ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> *mut LCDBitmap>,
2206 pub getSprite:
2207 ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> *mut LCDSprite>,
2208 pub pushNil: ::core::option::Option<unsafe extern "C" fn()>,
2209 pub pushBool: ::core::option::Option<unsafe extern "C" fn(val: ctypes::c_int)>,
2210 pub pushInt: ::core::option::Option<unsafe extern "C" fn(val: ctypes::c_int)>,
2211 pub pushFloat: ::core::option::Option<unsafe extern "C" fn(val: f32)>,
2212 pub pushString: ::core::option::Option<unsafe extern "C" fn(str_: *const ctypes::c_char)>,
2213 pub pushBytes:
2214 ::core::option::Option<unsafe extern "C" fn(str_: *const ctypes::c_char, len: usize)>,
2215 pub pushBitmap: ::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap)>,
2216 pub pushSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
2217 pub pushObject: ::core::option::Option<
2218 unsafe extern "C" fn(
2219 obj: *mut ctypes::c_void,
2220 type_: *mut ctypes::c_char,
2221 nValues: ctypes::c_int,
2222 ) -> *mut LuaUDObject,
2223 >,
2224 pub retainObject:
2225 ::core::option::Option<unsafe extern "C" fn(obj: *mut LuaUDObject) -> *mut LuaUDObject>,
2226 pub releaseObject: ::core::option::Option<unsafe extern "C" fn(obj: *mut LuaUDObject)>,
2227 pub setUserValue:
2228 ::core::option::Option<unsafe extern "C" fn(obj: *mut LuaUDObject, slot: ctypes::c_uint)>,
2229 pub getUserValue: ::core::option::Option<
2230 unsafe extern "C" fn(obj: *mut LuaUDObject, slot: ctypes::c_uint) -> ctypes::c_int,
2231 >,
2232 pub callFunction_deprecated: ::core::option::Option<
2233 unsafe extern "C" fn(name: *const ctypes::c_char, nargs: ctypes::c_int),
2234 >,
2235 pub callFunction: ::core::option::Option<
2236 unsafe extern "C" fn(
2237 name: *const ctypes::c_char,
2238 nargs: ctypes::c_int,
2239 outerr: *mut *const ctypes::c_char,
2240 ) -> ctypes::c_int,
2241 >,
2242}
2243#[test]
2244fn bindgen_test_layout_playdate_lua() {
2245 const UNINIT: ::core::mem::MaybeUninit<playdate_lua> = ::core::mem::MaybeUninit::uninit();
2246 let ptr = UNINIT.as_ptr();
2247 assert_eq!(
2248 ::core::mem::size_of::<playdate_lua>(),
2249 256usize,
2250 concat!("Size of: ", stringify!(playdate_lua))
2251 );
2252 assert_eq!(
2253 ::core::mem::align_of::<playdate_lua>(),
2254 8usize,
2255 concat!("Alignment of ", stringify!(playdate_lua))
2256 );
2257 assert_eq!(
2258 unsafe { ::core::ptr::addr_of!((*ptr).addFunction) as usize - ptr as usize },
2259 0usize,
2260 concat!(
2261 "Offset of field: ",
2262 stringify!(playdate_lua),
2263 "::",
2264 stringify!(addFunction)
2265 )
2266 );
2267 assert_eq!(
2268 unsafe { ::core::ptr::addr_of!((*ptr).registerClass) as usize - ptr as usize },
2269 8usize,
2270 concat!(
2271 "Offset of field: ",
2272 stringify!(playdate_lua),
2273 "::",
2274 stringify!(registerClass)
2275 )
2276 );
2277 assert_eq!(
2278 unsafe { ::core::ptr::addr_of!((*ptr).pushFunction) as usize - ptr as usize },
2279 16usize,
2280 concat!(
2281 "Offset of field: ",
2282 stringify!(playdate_lua),
2283 "::",
2284 stringify!(pushFunction)
2285 )
2286 );
2287 assert_eq!(
2288 unsafe { ::core::ptr::addr_of!((*ptr).indexMetatable) as usize - ptr as usize },
2289 24usize,
2290 concat!(
2291 "Offset of field: ",
2292 stringify!(playdate_lua),
2293 "::",
2294 stringify!(indexMetatable)
2295 )
2296 );
2297 assert_eq!(
2298 unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
2299 32usize,
2300 concat!(
2301 "Offset of field: ",
2302 stringify!(playdate_lua),
2303 "::",
2304 stringify!(stop)
2305 )
2306 );
2307 assert_eq!(
2308 unsafe { ::core::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
2309 40usize,
2310 concat!(
2311 "Offset of field: ",
2312 stringify!(playdate_lua),
2313 "::",
2314 stringify!(start)
2315 )
2316 );
2317 assert_eq!(
2318 unsafe { ::core::ptr::addr_of!((*ptr).getArgCount) as usize - ptr as usize },
2319 48usize,
2320 concat!(
2321 "Offset of field: ",
2322 stringify!(playdate_lua),
2323 "::",
2324 stringify!(getArgCount)
2325 )
2326 );
2327 assert_eq!(
2328 unsafe { ::core::ptr::addr_of!((*ptr).getArgType) as usize - ptr as usize },
2329 56usize,
2330 concat!(
2331 "Offset of field: ",
2332 stringify!(playdate_lua),
2333 "::",
2334 stringify!(getArgType)
2335 )
2336 );
2337 assert_eq!(
2338 unsafe { ::core::ptr::addr_of!((*ptr).argIsNil) as usize - ptr as usize },
2339 64usize,
2340 concat!(
2341 "Offset of field: ",
2342 stringify!(playdate_lua),
2343 "::",
2344 stringify!(argIsNil)
2345 )
2346 );
2347 assert_eq!(
2348 unsafe { ::core::ptr::addr_of!((*ptr).getArgBool) as usize - ptr as usize },
2349 72usize,
2350 concat!(
2351 "Offset of field: ",
2352 stringify!(playdate_lua),
2353 "::",
2354 stringify!(getArgBool)
2355 )
2356 );
2357 assert_eq!(
2358 unsafe { ::core::ptr::addr_of!((*ptr).getArgInt) as usize - ptr as usize },
2359 80usize,
2360 concat!(
2361 "Offset of field: ",
2362 stringify!(playdate_lua),
2363 "::",
2364 stringify!(getArgInt)
2365 )
2366 );
2367 assert_eq!(
2368 unsafe { ::core::ptr::addr_of!((*ptr).getArgFloat) as usize - ptr as usize },
2369 88usize,
2370 concat!(
2371 "Offset of field: ",
2372 stringify!(playdate_lua),
2373 "::",
2374 stringify!(getArgFloat)
2375 )
2376 );
2377 assert_eq!(
2378 unsafe { ::core::ptr::addr_of!((*ptr).getArgString) as usize - ptr as usize },
2379 96usize,
2380 concat!(
2381 "Offset of field: ",
2382 stringify!(playdate_lua),
2383 "::",
2384 stringify!(getArgString)
2385 )
2386 );
2387 assert_eq!(
2388 unsafe { ::core::ptr::addr_of!((*ptr).getArgBytes) as usize - ptr as usize },
2389 104usize,
2390 concat!(
2391 "Offset of field: ",
2392 stringify!(playdate_lua),
2393 "::",
2394 stringify!(getArgBytes)
2395 )
2396 );
2397 assert_eq!(
2398 unsafe { ::core::ptr::addr_of!((*ptr).getArgObject) as usize - ptr as usize },
2399 112usize,
2400 concat!(
2401 "Offset of field: ",
2402 stringify!(playdate_lua),
2403 "::",
2404 stringify!(getArgObject)
2405 )
2406 );
2407 assert_eq!(
2408 unsafe { ::core::ptr::addr_of!((*ptr).getBitmap) as usize - ptr as usize },
2409 120usize,
2410 concat!(
2411 "Offset of field: ",
2412 stringify!(playdate_lua),
2413 "::",
2414 stringify!(getBitmap)
2415 )
2416 );
2417 assert_eq!(
2418 unsafe { ::core::ptr::addr_of!((*ptr).getSprite) as usize - ptr as usize },
2419 128usize,
2420 concat!(
2421 "Offset of field: ",
2422 stringify!(playdate_lua),
2423 "::",
2424 stringify!(getSprite)
2425 )
2426 );
2427 assert_eq!(
2428 unsafe { ::core::ptr::addr_of!((*ptr).pushNil) as usize - ptr as usize },
2429 136usize,
2430 concat!(
2431 "Offset of field: ",
2432 stringify!(playdate_lua),
2433 "::",
2434 stringify!(pushNil)
2435 )
2436 );
2437 assert_eq!(
2438 unsafe { ::core::ptr::addr_of!((*ptr).pushBool) as usize - ptr as usize },
2439 144usize,
2440 concat!(
2441 "Offset of field: ",
2442 stringify!(playdate_lua),
2443 "::",
2444 stringify!(pushBool)
2445 )
2446 );
2447 assert_eq!(
2448 unsafe { ::core::ptr::addr_of!((*ptr).pushInt) as usize - ptr as usize },
2449 152usize,
2450 concat!(
2451 "Offset of field: ",
2452 stringify!(playdate_lua),
2453 "::",
2454 stringify!(pushInt)
2455 )
2456 );
2457 assert_eq!(
2458 unsafe { ::core::ptr::addr_of!((*ptr).pushFloat) as usize - ptr as usize },
2459 160usize,
2460 concat!(
2461 "Offset of field: ",
2462 stringify!(playdate_lua),
2463 "::",
2464 stringify!(pushFloat)
2465 )
2466 );
2467 assert_eq!(
2468 unsafe { ::core::ptr::addr_of!((*ptr).pushString) as usize - ptr as usize },
2469 168usize,
2470 concat!(
2471 "Offset of field: ",
2472 stringify!(playdate_lua),
2473 "::",
2474 stringify!(pushString)
2475 )
2476 );
2477 assert_eq!(
2478 unsafe { ::core::ptr::addr_of!((*ptr).pushBytes) as usize - ptr as usize },
2479 176usize,
2480 concat!(
2481 "Offset of field: ",
2482 stringify!(playdate_lua),
2483 "::",
2484 stringify!(pushBytes)
2485 )
2486 );
2487 assert_eq!(
2488 unsafe { ::core::ptr::addr_of!((*ptr).pushBitmap) as usize - ptr as usize },
2489 184usize,
2490 concat!(
2491 "Offset of field: ",
2492 stringify!(playdate_lua),
2493 "::",
2494 stringify!(pushBitmap)
2495 )
2496 );
2497 assert_eq!(
2498 unsafe { ::core::ptr::addr_of!((*ptr).pushSprite) as usize - ptr as usize },
2499 192usize,
2500 concat!(
2501 "Offset of field: ",
2502 stringify!(playdate_lua),
2503 "::",
2504 stringify!(pushSprite)
2505 )
2506 );
2507 assert_eq!(
2508 unsafe { ::core::ptr::addr_of!((*ptr).pushObject) as usize - ptr as usize },
2509 200usize,
2510 concat!(
2511 "Offset of field: ",
2512 stringify!(playdate_lua),
2513 "::",
2514 stringify!(pushObject)
2515 )
2516 );
2517 assert_eq!(
2518 unsafe { ::core::ptr::addr_of!((*ptr).retainObject) as usize - ptr as usize },
2519 208usize,
2520 concat!(
2521 "Offset of field: ",
2522 stringify!(playdate_lua),
2523 "::",
2524 stringify!(retainObject)
2525 )
2526 );
2527 assert_eq!(
2528 unsafe { ::core::ptr::addr_of!((*ptr).releaseObject) as usize - ptr as usize },
2529 216usize,
2530 concat!(
2531 "Offset of field: ",
2532 stringify!(playdate_lua),
2533 "::",
2534 stringify!(releaseObject)
2535 )
2536 );
2537 assert_eq!(
2538 unsafe { ::core::ptr::addr_of!((*ptr).setUserValue) as usize - ptr as usize },
2539 224usize,
2540 concat!(
2541 "Offset of field: ",
2542 stringify!(playdate_lua),
2543 "::",
2544 stringify!(setUserValue)
2545 )
2546 );
2547 assert_eq!(
2548 unsafe { ::core::ptr::addr_of!((*ptr).getUserValue) as usize - ptr as usize },
2549 232usize,
2550 concat!(
2551 "Offset of field: ",
2552 stringify!(playdate_lua),
2553 "::",
2554 stringify!(getUserValue)
2555 )
2556 );
2557 assert_eq!(
2558 unsafe { ::core::ptr::addr_of!((*ptr).callFunction_deprecated) as usize - ptr as usize },
2559 240usize,
2560 concat!(
2561 "Offset of field: ",
2562 stringify!(playdate_lua),
2563 "::",
2564 stringify!(callFunction_deprecated)
2565 )
2566 );
2567 assert_eq!(
2568 unsafe { ::core::ptr::addr_of!((*ptr).callFunction) as usize - ptr as usize },
2569 248usize,
2570 concat!(
2571 "Offset of field: ",
2572 stringify!(playdate_lua),
2573 "::",
2574 stringify!(callFunction)
2575 )
2576 );
2577}
2578#[repr(u32)]
2579#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2580pub enum json_value_type {
2581 kJSONNull = 0,
2582 kJSONTrue = 1,
2583 kJSONFalse = 2,
2584 kJSONInteger = 3,
2585 kJSONFloat = 4,
2586 kJSONString = 5,
2587 kJSONArray = 6,
2588 kJSONTable = 7,
2589}
2590#[repr(C)]
2591#[derive(Copy, Clone)]
2592pub struct json_value {
2593 pub type_: ctypes::c_char,
2594 pub data: json_value__bindgen_ty_1,
2595}
2596#[repr(C)]
2597#[derive(Copy, Clone)]
2598pub union json_value__bindgen_ty_1 {
2599 pub intval: ctypes::c_int,
2600 pub floatval: f32,
2601 pub stringval: *mut ctypes::c_char,
2602 pub arrayval: *mut ctypes::c_void,
2603 pub tableval: *mut ctypes::c_void,
2604}
2605#[test]
2606fn bindgen_test_layout_json_value__bindgen_ty_1() {
2607 const UNINIT: ::core::mem::MaybeUninit<json_value__bindgen_ty_1> =
2608 ::core::mem::MaybeUninit::uninit();
2609 let ptr = UNINIT.as_ptr();
2610 assert_eq!(
2611 ::core::mem::size_of::<json_value__bindgen_ty_1>(),
2612 8usize,
2613 concat!("Size of: ", stringify!(json_value__bindgen_ty_1))
2614 );
2615 assert_eq!(
2616 ::core::mem::align_of::<json_value__bindgen_ty_1>(),
2617 8usize,
2618 concat!("Alignment of ", stringify!(json_value__bindgen_ty_1))
2619 );
2620 assert_eq!(
2621 unsafe { ::core::ptr::addr_of!((*ptr).intval) as usize - ptr as usize },
2622 0usize,
2623 concat!(
2624 "Offset of field: ",
2625 stringify!(json_value__bindgen_ty_1),
2626 "::",
2627 stringify!(intval)
2628 )
2629 );
2630 assert_eq!(
2631 unsafe { ::core::ptr::addr_of!((*ptr).floatval) as usize - ptr as usize },
2632 0usize,
2633 concat!(
2634 "Offset of field: ",
2635 stringify!(json_value__bindgen_ty_1),
2636 "::",
2637 stringify!(floatval)
2638 )
2639 );
2640 assert_eq!(
2641 unsafe { ::core::ptr::addr_of!((*ptr).stringval) as usize - ptr as usize },
2642 0usize,
2643 concat!(
2644 "Offset of field: ",
2645 stringify!(json_value__bindgen_ty_1),
2646 "::",
2647 stringify!(stringval)
2648 )
2649 );
2650 assert_eq!(
2651 unsafe { ::core::ptr::addr_of!((*ptr).arrayval) as usize - ptr as usize },
2652 0usize,
2653 concat!(
2654 "Offset of field: ",
2655 stringify!(json_value__bindgen_ty_1),
2656 "::",
2657 stringify!(arrayval)
2658 )
2659 );
2660 assert_eq!(
2661 unsafe { ::core::ptr::addr_of!((*ptr).tableval) as usize - ptr as usize },
2662 0usize,
2663 concat!(
2664 "Offset of field: ",
2665 stringify!(json_value__bindgen_ty_1),
2666 "::",
2667 stringify!(tableval)
2668 )
2669 );
2670}
2671impl Default for json_value__bindgen_ty_1 {
2672 fn default() -> Self {
2673 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2674 unsafe {
2675 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2676 s.assume_init()
2677 }
2678 }
2679}
2680#[test]
2681fn bindgen_test_layout_json_value() {
2682 const UNINIT: ::core::mem::MaybeUninit<json_value> = ::core::mem::MaybeUninit::uninit();
2683 let ptr = UNINIT.as_ptr();
2684 assert_eq!(
2685 ::core::mem::size_of::<json_value>(),
2686 16usize,
2687 concat!("Size of: ", stringify!(json_value))
2688 );
2689 assert_eq!(
2690 ::core::mem::align_of::<json_value>(),
2691 8usize,
2692 concat!("Alignment of ", stringify!(json_value))
2693 );
2694 assert_eq!(
2695 unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
2696 0usize,
2697 concat!(
2698 "Offset of field: ",
2699 stringify!(json_value),
2700 "::",
2701 stringify!(type_)
2702 )
2703 );
2704 assert_eq!(
2705 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
2706 8usize,
2707 concat!(
2708 "Offset of field: ",
2709 stringify!(json_value),
2710 "::",
2711 stringify!(data)
2712 )
2713 );
2714}
2715impl Default for json_value {
2716 fn default() -> Self {
2717 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2718 unsafe {
2719 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2720 s.assume_init()
2721 }
2722 }
2723}
2724#[repr(C)]
2725#[derive(Debug, Copy, Clone, PartialEq, Eq)]
2726pub struct json_decoder {
2727 pub decodeError: ::core::option::Option<
2728 unsafe extern "C" fn(
2729 decoder: *mut json_decoder,
2730 error: *const ctypes::c_char,
2731 linenum: ctypes::c_int,
2732 ),
2733 >,
2734 pub willDecodeSublist: ::core::option::Option<
2735 unsafe extern "C" fn(
2736 decoder: *mut json_decoder,
2737 name: *const ctypes::c_char,
2738 type_: json_value_type,
2739 ),
2740 >,
2741 pub shouldDecodeTableValueForKey: ::core::option::Option<
2742 unsafe extern "C" fn(
2743 decoder: *mut json_decoder,
2744 key: *const ctypes::c_char,
2745 ) -> ctypes::c_int,
2746 >,
2747 pub didDecodeTableValue: ::core::option::Option<
2748 unsafe extern "C" fn(
2749 decoder: *mut json_decoder,
2750 key: *const ctypes::c_char,
2751 value: json_value,
2752 ),
2753 >,
2754 pub shouldDecodeArrayValueAtIndex: ::core::option::Option<
2755 unsafe extern "C" fn(decoder: *mut json_decoder, pos: ctypes::c_int) -> ctypes::c_int,
2756 >,
2757 pub didDecodeArrayValue: ::core::option::Option<
2758 unsafe extern "C" fn(decoder: *mut json_decoder, pos: ctypes::c_int, value: json_value),
2759 >,
2760 pub didDecodeSublist: ::core::option::Option<
2761 unsafe extern "C" fn(
2762 decoder: *mut json_decoder,
2763 name: *const ctypes::c_char,
2764 type_: json_value_type,
2765 ) -> *mut ctypes::c_void,
2766 >,
2767 pub userdata: *mut ctypes::c_void,
2768 pub returnString: ctypes::c_int,
2769 pub path: *const ctypes::c_char,
2770}
2771#[test]
2772fn bindgen_test_layout_json_decoder() {
2773 const UNINIT: ::core::mem::MaybeUninit<json_decoder> = ::core::mem::MaybeUninit::uninit();
2774 let ptr = UNINIT.as_ptr();
2775 assert_eq!(
2776 ::core::mem::size_of::<json_decoder>(),
2777 80usize,
2778 concat!("Size of: ", stringify!(json_decoder))
2779 );
2780 assert_eq!(
2781 ::core::mem::align_of::<json_decoder>(),
2782 8usize,
2783 concat!("Alignment of ", stringify!(json_decoder))
2784 );
2785 assert_eq!(
2786 unsafe { ::core::ptr::addr_of!((*ptr).decodeError) as usize - ptr as usize },
2787 0usize,
2788 concat!(
2789 "Offset of field: ",
2790 stringify!(json_decoder),
2791 "::",
2792 stringify!(decodeError)
2793 )
2794 );
2795 assert_eq!(
2796 unsafe { ::core::ptr::addr_of!((*ptr).willDecodeSublist) as usize - ptr as usize },
2797 8usize,
2798 concat!(
2799 "Offset of field: ",
2800 stringify!(json_decoder),
2801 "::",
2802 stringify!(willDecodeSublist)
2803 )
2804 );
2805 assert_eq!(
2806 unsafe {
2807 ::core::ptr::addr_of!((*ptr).shouldDecodeTableValueForKey) as usize - ptr as usize
2808 },
2809 16usize,
2810 concat!(
2811 "Offset of field: ",
2812 stringify!(json_decoder),
2813 "::",
2814 stringify!(shouldDecodeTableValueForKey)
2815 )
2816 );
2817 assert_eq!(
2818 unsafe { ::core::ptr::addr_of!((*ptr).didDecodeTableValue) as usize - ptr as usize },
2819 24usize,
2820 concat!(
2821 "Offset of field: ",
2822 stringify!(json_decoder),
2823 "::",
2824 stringify!(didDecodeTableValue)
2825 )
2826 );
2827 assert_eq!(
2828 unsafe {
2829 ::core::ptr::addr_of!((*ptr).shouldDecodeArrayValueAtIndex) as usize - ptr as usize
2830 },
2831 32usize,
2832 concat!(
2833 "Offset of field: ",
2834 stringify!(json_decoder),
2835 "::",
2836 stringify!(shouldDecodeArrayValueAtIndex)
2837 )
2838 );
2839 assert_eq!(
2840 unsafe { ::core::ptr::addr_of!((*ptr).didDecodeArrayValue) as usize - ptr as usize },
2841 40usize,
2842 concat!(
2843 "Offset of field: ",
2844 stringify!(json_decoder),
2845 "::",
2846 stringify!(didDecodeArrayValue)
2847 )
2848 );
2849 assert_eq!(
2850 unsafe { ::core::ptr::addr_of!((*ptr).didDecodeSublist) as usize - ptr as usize },
2851 48usize,
2852 concat!(
2853 "Offset of field: ",
2854 stringify!(json_decoder),
2855 "::",
2856 stringify!(didDecodeSublist)
2857 )
2858 );
2859 assert_eq!(
2860 unsafe { ::core::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize },
2861 56usize,
2862 concat!(
2863 "Offset of field: ",
2864 stringify!(json_decoder),
2865 "::",
2866 stringify!(userdata)
2867 )
2868 );
2869 assert_eq!(
2870 unsafe { ::core::ptr::addr_of!((*ptr).returnString) as usize - ptr as usize },
2871 64usize,
2872 concat!(
2873 "Offset of field: ",
2874 stringify!(json_decoder),
2875 "::",
2876 stringify!(returnString)
2877 )
2878 );
2879 assert_eq!(
2880 unsafe { ::core::ptr::addr_of!((*ptr).path) as usize - ptr as usize },
2881 72usize,
2882 concat!(
2883 "Offset of field: ",
2884 stringify!(json_decoder),
2885 "::",
2886 stringify!(path)
2887 )
2888 );
2889}
2890impl Default for json_decoder {
2891 fn default() -> Self {
2892 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2893 unsafe {
2894 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2895 s.assume_init()
2896 }
2897 }
2898}
2899#[repr(C)]
2900#[derive(Debug, Copy, Clone, PartialEq, Eq)]
2901pub struct json_reader {
2902 pub read: ::core::option::Option<
2903 unsafe extern "C" fn(
2904 userdata: *mut ctypes::c_void,
2905 buf: *mut u8,
2906 bufsize: ctypes::c_int,
2907 ) -> ctypes::c_int,
2908 >,
2909 pub userdata: *mut ctypes::c_void,
2910}
2911#[test]
2912fn bindgen_test_layout_json_reader() {
2913 const UNINIT: ::core::mem::MaybeUninit<json_reader> = ::core::mem::MaybeUninit::uninit();
2914 let ptr = UNINIT.as_ptr();
2915 assert_eq!(
2916 ::core::mem::size_of::<json_reader>(),
2917 16usize,
2918 concat!("Size of: ", stringify!(json_reader))
2919 );
2920 assert_eq!(
2921 ::core::mem::align_of::<json_reader>(),
2922 8usize,
2923 concat!("Alignment of ", stringify!(json_reader))
2924 );
2925 assert_eq!(
2926 unsafe { ::core::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
2927 0usize,
2928 concat!(
2929 "Offset of field: ",
2930 stringify!(json_reader),
2931 "::",
2932 stringify!(read)
2933 )
2934 );
2935 assert_eq!(
2936 unsafe { ::core::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize },
2937 8usize,
2938 concat!(
2939 "Offset of field: ",
2940 stringify!(json_reader),
2941 "::",
2942 stringify!(userdata)
2943 )
2944 );
2945}
2946impl Default for json_reader {
2947 fn default() -> Self {
2948 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
2949 unsafe {
2950 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
2951 s.assume_init()
2952 }
2953 }
2954}
2955pub type writeFunc = ::core::option::Option<
2956 unsafe extern "C" fn(
2957 userdata: *mut ctypes::c_void,
2958 str_: *const ctypes::c_char,
2959 len: ctypes::c_int,
2960 ),
2961>;
2962#[repr(C)]
2963#[derive(Debug, Copy, Clone, PartialEq, Eq)]
2964pub struct json_encoder {
2965 pub writeStringFunc: writeFunc,
2966 pub userdata: *mut ctypes::c_void,
2967 pub _bitfield_align_1: [u32; 0],
2968 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
2969 pub startArray: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2970 pub addArrayMember: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2971 pub endArray: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2972 pub startTable: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2973 pub addTableMember: ::core::option::Option<
2974 unsafe extern "C" fn(
2975 encoder: *mut json_encoder,
2976 name: *const ctypes::c_char,
2977 len: ctypes::c_int,
2978 ),
2979 >,
2980 pub endTable: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2981 pub writeNull: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2982 pub writeFalse: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2983 pub writeTrue: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
2984 pub writeInt: ::core::option::Option<
2985 unsafe extern "C" fn(encoder: *mut json_encoder, num: ctypes::c_int),
2986 >,
2987 pub writeDouble:
2988 ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder, num: f64)>,
2989 pub writeString: ::core::option::Option<
2990 unsafe extern "C" fn(
2991 encoder: *mut json_encoder,
2992 str_: *const ctypes::c_char,
2993 len: ctypes::c_int,
2994 ),
2995 >,
2996}
2997#[test]
2998fn bindgen_test_layout_json_encoder() {
2999 const UNINIT: ::core::mem::MaybeUninit<json_encoder> = ::core::mem::MaybeUninit::uninit();
3000 let ptr = UNINIT.as_ptr();
3001 assert_eq!(
3002 ::core::mem::size_of::<json_encoder>(),
3003 120usize,
3004 concat!("Size of: ", stringify!(json_encoder))
3005 );
3006 assert_eq!(
3007 ::core::mem::align_of::<json_encoder>(),
3008 8usize,
3009 concat!("Alignment of ", stringify!(json_encoder))
3010 );
3011 assert_eq!(
3012 unsafe { ::core::ptr::addr_of!((*ptr).writeStringFunc) as usize - ptr as usize },
3013 0usize,
3014 concat!(
3015 "Offset of field: ",
3016 stringify!(json_encoder),
3017 "::",
3018 stringify!(writeStringFunc)
3019 )
3020 );
3021 assert_eq!(
3022 unsafe { ::core::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize },
3023 8usize,
3024 concat!(
3025 "Offset of field: ",
3026 stringify!(json_encoder),
3027 "::",
3028 stringify!(userdata)
3029 )
3030 );
3031 assert_eq!(
3032 unsafe { ::core::ptr::addr_of!((*ptr).startArray) as usize - ptr as usize },
3033 24usize,
3034 concat!(
3035 "Offset of field: ",
3036 stringify!(json_encoder),
3037 "::",
3038 stringify!(startArray)
3039 )
3040 );
3041 assert_eq!(
3042 unsafe { ::core::ptr::addr_of!((*ptr).addArrayMember) as usize - ptr as usize },
3043 32usize,
3044 concat!(
3045 "Offset of field: ",
3046 stringify!(json_encoder),
3047 "::",
3048 stringify!(addArrayMember)
3049 )
3050 );
3051 assert_eq!(
3052 unsafe { ::core::ptr::addr_of!((*ptr).endArray) as usize - ptr as usize },
3053 40usize,
3054 concat!(
3055 "Offset of field: ",
3056 stringify!(json_encoder),
3057 "::",
3058 stringify!(endArray)
3059 )
3060 );
3061 assert_eq!(
3062 unsafe { ::core::ptr::addr_of!((*ptr).startTable) as usize - ptr as usize },
3063 48usize,
3064 concat!(
3065 "Offset of field: ",
3066 stringify!(json_encoder),
3067 "::",
3068 stringify!(startTable)
3069 )
3070 );
3071 assert_eq!(
3072 unsafe { ::core::ptr::addr_of!((*ptr).addTableMember) as usize - ptr as usize },
3073 56usize,
3074 concat!(
3075 "Offset of field: ",
3076 stringify!(json_encoder),
3077 "::",
3078 stringify!(addTableMember)
3079 )
3080 );
3081 assert_eq!(
3082 unsafe { ::core::ptr::addr_of!((*ptr).endTable) as usize - ptr as usize },
3083 64usize,
3084 concat!(
3085 "Offset of field: ",
3086 stringify!(json_encoder),
3087 "::",
3088 stringify!(endTable)
3089 )
3090 );
3091 assert_eq!(
3092 unsafe { ::core::ptr::addr_of!((*ptr).writeNull) as usize - ptr as usize },
3093 72usize,
3094 concat!(
3095 "Offset of field: ",
3096 stringify!(json_encoder),
3097 "::",
3098 stringify!(writeNull)
3099 )
3100 );
3101 assert_eq!(
3102 unsafe { ::core::ptr::addr_of!((*ptr).writeFalse) as usize - ptr as usize },
3103 80usize,
3104 concat!(
3105 "Offset of field: ",
3106 stringify!(json_encoder),
3107 "::",
3108 stringify!(writeFalse)
3109 )
3110 );
3111 assert_eq!(
3112 unsafe { ::core::ptr::addr_of!((*ptr).writeTrue) as usize - ptr as usize },
3113 88usize,
3114 concat!(
3115 "Offset of field: ",
3116 stringify!(json_encoder),
3117 "::",
3118 stringify!(writeTrue)
3119 )
3120 );
3121 assert_eq!(
3122 unsafe { ::core::ptr::addr_of!((*ptr).writeInt) as usize - ptr as usize },
3123 96usize,
3124 concat!(
3125 "Offset of field: ",
3126 stringify!(json_encoder),
3127 "::",
3128 stringify!(writeInt)
3129 )
3130 );
3131 assert_eq!(
3132 unsafe { ::core::ptr::addr_of!((*ptr).writeDouble) as usize - ptr as usize },
3133 104usize,
3134 concat!(
3135 "Offset of field: ",
3136 stringify!(json_encoder),
3137 "::",
3138 stringify!(writeDouble)
3139 )
3140 );
3141 assert_eq!(
3142 unsafe { ::core::ptr::addr_of!((*ptr).writeString) as usize - ptr as usize },
3143 112usize,
3144 concat!(
3145 "Offset of field: ",
3146 stringify!(json_encoder),
3147 "::",
3148 stringify!(writeString)
3149 )
3150 );
3151}
3152impl Default for json_encoder {
3153 fn default() -> Self {
3154 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3155 unsafe {
3156 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3157 s.assume_init()
3158 }
3159 }
3160}
3161impl json_encoder {
3162 #[inline]
3163 pub fn pretty(&self) -> ctypes::c_int {
3164 unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
3165 }
3166 #[inline]
3167 pub fn set_pretty(&mut self, val: ctypes::c_int) {
3168 unsafe {
3169 let val: u32 = ::core::mem::transmute(val);
3170 self._bitfield_1.set(0usize, 1u8, val as u64)
3171 }
3172 }
3173 #[inline]
3174 pub fn startedTable(&self) -> ctypes::c_int {
3175 unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
3176 }
3177 #[inline]
3178 pub fn set_startedTable(&mut self, val: ctypes::c_int) {
3179 unsafe {
3180 let val: u32 = ::core::mem::transmute(val);
3181 self._bitfield_1.set(1usize, 1u8, val as u64)
3182 }
3183 }
3184 #[inline]
3185 pub fn startedArray(&self) -> ctypes::c_int {
3186 unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
3187 }
3188 #[inline]
3189 pub fn set_startedArray(&mut self, val: ctypes::c_int) {
3190 unsafe {
3191 let val: u32 = ::core::mem::transmute(val);
3192 self._bitfield_1.set(2usize, 1u8, val as u64)
3193 }
3194 }
3195 #[inline]
3196 pub fn depth(&self) -> ctypes::c_int {
3197 unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 29u8) as u32) }
3198 }
3199 #[inline]
3200 pub fn set_depth(&mut self, val: ctypes::c_int) {
3201 unsafe {
3202 let val: u32 = ::core::mem::transmute(val);
3203 self._bitfield_1.set(3usize, 29u8, val as u64)
3204 }
3205 }
3206 #[inline]
3207 pub fn new_bitfield_1(
3208 pretty: ctypes::c_int,
3209 startedTable: ctypes::c_int,
3210 startedArray: ctypes::c_int,
3211 depth: ctypes::c_int,
3212 ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
3213 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
3214 __bindgen_bitfield_unit.set(0usize, 1u8, {
3215 let pretty: u32 = unsafe { ::core::mem::transmute(pretty) };
3216 pretty as u64
3217 });
3218 __bindgen_bitfield_unit.set(1usize, 1u8, {
3219 let startedTable: u32 = unsafe { ::core::mem::transmute(startedTable) };
3220 startedTable as u64
3221 });
3222 __bindgen_bitfield_unit.set(2usize, 1u8, {
3223 let startedArray: u32 = unsafe { ::core::mem::transmute(startedArray) };
3224 startedArray as u64
3225 });
3226 __bindgen_bitfield_unit.set(3usize, 29u8, {
3227 let depth: u32 = unsafe { ::core::mem::transmute(depth) };
3228 depth as u64
3229 });
3230 __bindgen_bitfield_unit
3231 }
3232}
3233#[repr(C)]
3234#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
3235pub struct playdate_json {
3236 pub initEncoder: ::core::option::Option<
3237 unsafe extern "C" fn(
3238 encoder: *mut json_encoder,
3239 write: writeFunc,
3240 userdata: *mut ctypes::c_void,
3241 pretty: ctypes::c_int,
3242 ),
3243 >,
3244 pub decode: ::core::option::Option<
3245 unsafe extern "C" fn(
3246 functions: *mut json_decoder,
3247 reader: json_reader,
3248 outval: *mut json_value,
3249 ) -> ctypes::c_int,
3250 >,
3251 pub decodeString: ::core::option::Option<
3252 unsafe extern "C" fn(
3253 functions: *mut json_decoder,
3254 jsonString: *const ctypes::c_char,
3255 outval: *mut json_value,
3256 ) -> ctypes::c_int,
3257 >,
3258}
3259#[test]
3260fn bindgen_test_layout_playdate_json() {
3261 const UNINIT: ::core::mem::MaybeUninit<playdate_json> = ::core::mem::MaybeUninit::uninit();
3262 let ptr = UNINIT.as_ptr();
3263 assert_eq!(
3264 ::core::mem::size_of::<playdate_json>(),
3265 24usize,
3266 concat!("Size of: ", stringify!(playdate_json))
3267 );
3268 assert_eq!(
3269 ::core::mem::align_of::<playdate_json>(),
3270 8usize,
3271 concat!("Alignment of ", stringify!(playdate_json))
3272 );
3273 assert_eq!(
3274 unsafe { ::core::ptr::addr_of!((*ptr).initEncoder) as usize - ptr as usize },
3275 0usize,
3276 concat!(
3277 "Offset of field: ",
3278 stringify!(playdate_json),
3279 "::",
3280 stringify!(initEncoder)
3281 )
3282 );
3283 assert_eq!(
3284 unsafe { ::core::ptr::addr_of!((*ptr).decode) as usize - ptr as usize },
3285 8usize,
3286 concat!(
3287 "Offset of field: ",
3288 stringify!(playdate_json),
3289 "::",
3290 stringify!(decode)
3291 )
3292 );
3293 assert_eq!(
3294 unsafe { ::core::ptr::addr_of!((*ptr).decodeString) as usize - ptr as usize },
3295 16usize,
3296 concat!(
3297 "Offset of field: ",
3298 stringify!(playdate_json),
3299 "::",
3300 stringify!(decodeString)
3301 )
3302 );
3303}
3304pub type SDFile = ctypes::c_void;
3305impl FileOptions {
3306 pub const kFileRead: FileOptions = FileOptions(1);
3307}
3308impl FileOptions {
3309 pub const kFileReadData: FileOptions = FileOptions(2);
3310}
3311impl FileOptions {
3312 pub const kFileWrite: FileOptions = FileOptions(4);
3313}
3314impl FileOptions {
3315 pub const kFileAppend: FileOptions = FileOptions(8);
3316}
3317impl ::core::ops::BitOr<FileOptions> for FileOptions {
3318 type Output = Self;
3319 #[inline]
3320 fn bitor(self, other: Self) -> Self {
3321 FileOptions(self.0 | other.0)
3322 }
3323}
3324impl ::core::ops::BitOrAssign for FileOptions {
3325 #[inline]
3326 fn bitor_assign(&mut self, rhs: FileOptions) {
3327 self.0 |= rhs.0;
3328 }
3329}
3330impl ::core::ops::BitAnd<FileOptions> for FileOptions {
3331 type Output = Self;
3332 #[inline]
3333 fn bitand(self, other: Self) -> Self {
3334 FileOptions(self.0 & other.0)
3335 }
3336}
3337impl ::core::ops::BitAndAssign for FileOptions {
3338 #[inline]
3339 fn bitand_assign(&mut self, rhs: FileOptions) {
3340 self.0 &= rhs.0;
3341 }
3342}
3343#[repr(transparent)]
3344#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3345pub struct FileOptions(pub ctypes::c_uint);
3346#[repr(C)]
3347#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
3348pub struct FileStat {
3349 pub isdir: ctypes::c_int,
3350 pub size: ctypes::c_uint,
3351 pub m_year: ctypes::c_int,
3352 pub m_month: ctypes::c_int,
3353 pub m_day: ctypes::c_int,
3354 pub m_hour: ctypes::c_int,
3355 pub m_minute: ctypes::c_int,
3356 pub m_second: ctypes::c_int,
3357}
3358#[test]
3359fn bindgen_test_layout_FileStat() {
3360 const UNINIT: ::core::mem::MaybeUninit<FileStat> = ::core::mem::MaybeUninit::uninit();
3361 let ptr = UNINIT.as_ptr();
3362 assert_eq!(
3363 ::core::mem::size_of::<FileStat>(),
3364 32usize,
3365 concat!("Size of: ", stringify!(FileStat))
3366 );
3367 assert_eq!(
3368 ::core::mem::align_of::<FileStat>(),
3369 4usize,
3370 concat!("Alignment of ", stringify!(FileStat))
3371 );
3372 assert_eq!(
3373 unsafe { ::core::ptr::addr_of!((*ptr).isdir) as usize - ptr as usize },
3374 0usize,
3375 concat!(
3376 "Offset of field: ",
3377 stringify!(FileStat),
3378 "::",
3379 stringify!(isdir)
3380 )
3381 );
3382 assert_eq!(
3383 unsafe { ::core::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
3384 4usize,
3385 concat!(
3386 "Offset of field: ",
3387 stringify!(FileStat),
3388 "::",
3389 stringify!(size)
3390 )
3391 );
3392 assert_eq!(
3393 unsafe { ::core::ptr::addr_of!((*ptr).m_year) as usize - ptr as usize },
3394 8usize,
3395 concat!(
3396 "Offset of field: ",
3397 stringify!(FileStat),
3398 "::",
3399 stringify!(m_year)
3400 )
3401 );
3402 assert_eq!(
3403 unsafe { ::core::ptr::addr_of!((*ptr).m_month) as usize - ptr as usize },
3404 12usize,
3405 concat!(
3406 "Offset of field: ",
3407 stringify!(FileStat),
3408 "::",
3409 stringify!(m_month)
3410 )
3411 );
3412 assert_eq!(
3413 unsafe { ::core::ptr::addr_of!((*ptr).m_day) as usize - ptr as usize },
3414 16usize,
3415 concat!(
3416 "Offset of field: ",
3417 stringify!(FileStat),
3418 "::",
3419 stringify!(m_day)
3420 )
3421 );
3422 assert_eq!(
3423 unsafe { ::core::ptr::addr_of!((*ptr).m_hour) as usize - ptr as usize },
3424 20usize,
3425 concat!(
3426 "Offset of field: ",
3427 stringify!(FileStat),
3428 "::",
3429 stringify!(m_hour)
3430 )
3431 );
3432 assert_eq!(
3433 unsafe { ::core::ptr::addr_of!((*ptr).m_minute) as usize - ptr as usize },
3434 24usize,
3435 concat!(
3436 "Offset of field: ",
3437 stringify!(FileStat),
3438 "::",
3439 stringify!(m_minute)
3440 )
3441 );
3442 assert_eq!(
3443 unsafe { ::core::ptr::addr_of!((*ptr).m_second) as usize - ptr as usize },
3444 28usize,
3445 concat!(
3446 "Offset of field: ",
3447 stringify!(FileStat),
3448 "::",
3449 stringify!(m_second)
3450 )
3451 );
3452}
3453#[repr(C)]
3454#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
3455pub struct playdate_file {
3456 pub geterr: ::core::option::Option<unsafe extern "C" fn() -> *const ctypes::c_char>,
3457 pub listfiles: ::core::option::Option<
3458 unsafe extern "C" fn(
3459 path: *const ctypes::c_char,
3460 callback: ::core::option::Option<
3461 unsafe extern "C" fn(path: *const ctypes::c_char, userdata: *mut ctypes::c_void),
3462 >,
3463 userdata: *mut ctypes::c_void,
3464 showhidden: ctypes::c_int,
3465 ) -> ctypes::c_int,
3466 >,
3467 pub stat: ::core::option::Option<
3468 unsafe extern "C" fn(path: *const ctypes::c_char, stat: *mut FileStat) -> ctypes::c_int,
3469 >,
3470 pub mkdir:
3471 ::core::option::Option<unsafe extern "C" fn(path: *const ctypes::c_char) -> ctypes::c_int>,
3472 pub unlink: ::core::option::Option<
3473 unsafe extern "C" fn(
3474 name: *const ctypes::c_char,
3475 recursive: ctypes::c_int,
3476 ) -> ctypes::c_int,
3477 >,
3478 pub rename: ::core::option::Option<
3479 unsafe extern "C" fn(
3480 from: *const ctypes::c_char,
3481 to: *const ctypes::c_char,
3482 ) -> ctypes::c_int,
3483 >,
3484 pub open: ::core::option::Option<
3485 unsafe extern "C" fn(name: *const ctypes::c_char, mode: FileOptions) -> *mut SDFile,
3486 >,
3487 pub close: ::core::option::Option<unsafe extern "C" fn(file: *mut SDFile) -> ctypes::c_int>,
3488 pub read: ::core::option::Option<
3489 unsafe extern "C" fn(
3490 file: *mut SDFile,
3491 buf: *mut ctypes::c_void,
3492 len: ctypes::c_uint,
3493 ) -> ctypes::c_int,
3494 >,
3495 pub write: ::core::option::Option<
3496 unsafe extern "C" fn(
3497 file: *mut SDFile,
3498 buf: *const ctypes::c_void,
3499 len: ctypes::c_uint,
3500 ) -> ctypes::c_int,
3501 >,
3502 pub flush: ::core::option::Option<unsafe extern "C" fn(file: *mut SDFile) -> ctypes::c_int>,
3503 pub tell: ::core::option::Option<unsafe extern "C" fn(file: *mut SDFile) -> ctypes::c_int>,
3504 pub seek: ::core::option::Option<
3505 unsafe extern "C" fn(
3506 file: *mut SDFile,
3507 pos: ctypes::c_int,
3508 whence: ctypes::c_int,
3509 ) -> ctypes::c_int,
3510 >,
3511}
3512#[test]
3513fn bindgen_test_layout_playdate_file() {
3514 const UNINIT: ::core::mem::MaybeUninit<playdate_file> = ::core::mem::MaybeUninit::uninit();
3515 let ptr = UNINIT.as_ptr();
3516 assert_eq!(
3517 ::core::mem::size_of::<playdate_file>(),
3518 104usize,
3519 concat!("Size of: ", stringify!(playdate_file))
3520 );
3521 assert_eq!(
3522 ::core::mem::align_of::<playdate_file>(),
3523 8usize,
3524 concat!("Alignment of ", stringify!(playdate_file))
3525 );
3526 assert_eq!(
3527 unsafe { ::core::ptr::addr_of!((*ptr).geterr) as usize - ptr as usize },
3528 0usize,
3529 concat!(
3530 "Offset of field: ",
3531 stringify!(playdate_file),
3532 "::",
3533 stringify!(geterr)
3534 )
3535 );
3536 assert_eq!(
3537 unsafe { ::core::ptr::addr_of!((*ptr).listfiles) as usize - ptr as usize },
3538 8usize,
3539 concat!(
3540 "Offset of field: ",
3541 stringify!(playdate_file),
3542 "::",
3543 stringify!(listfiles)
3544 )
3545 );
3546 assert_eq!(
3547 unsafe { ::core::ptr::addr_of!((*ptr).stat) as usize - ptr as usize },
3548 16usize,
3549 concat!(
3550 "Offset of field: ",
3551 stringify!(playdate_file),
3552 "::",
3553 stringify!(stat)
3554 )
3555 );
3556 assert_eq!(
3557 unsafe { ::core::ptr::addr_of!((*ptr).mkdir) as usize - ptr as usize },
3558 24usize,
3559 concat!(
3560 "Offset of field: ",
3561 stringify!(playdate_file),
3562 "::",
3563 stringify!(mkdir)
3564 )
3565 );
3566 assert_eq!(
3567 unsafe { ::core::ptr::addr_of!((*ptr).unlink) as usize - ptr as usize },
3568 32usize,
3569 concat!(
3570 "Offset of field: ",
3571 stringify!(playdate_file),
3572 "::",
3573 stringify!(unlink)
3574 )
3575 );
3576 assert_eq!(
3577 unsafe { ::core::ptr::addr_of!((*ptr).rename) as usize - ptr as usize },
3578 40usize,
3579 concat!(
3580 "Offset of field: ",
3581 stringify!(playdate_file),
3582 "::",
3583 stringify!(rename)
3584 )
3585 );
3586 assert_eq!(
3587 unsafe { ::core::ptr::addr_of!((*ptr).open) as usize - ptr as usize },
3588 48usize,
3589 concat!(
3590 "Offset of field: ",
3591 stringify!(playdate_file),
3592 "::",
3593 stringify!(open)
3594 )
3595 );
3596 assert_eq!(
3597 unsafe { ::core::ptr::addr_of!((*ptr).close) as usize - ptr as usize },
3598 56usize,
3599 concat!(
3600 "Offset of field: ",
3601 stringify!(playdate_file),
3602 "::",
3603 stringify!(close)
3604 )
3605 );
3606 assert_eq!(
3607 unsafe { ::core::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
3608 64usize,
3609 concat!(
3610 "Offset of field: ",
3611 stringify!(playdate_file),
3612 "::",
3613 stringify!(read)
3614 )
3615 );
3616 assert_eq!(
3617 unsafe { ::core::ptr::addr_of!((*ptr).write) as usize - ptr as usize },
3618 72usize,
3619 concat!(
3620 "Offset of field: ",
3621 stringify!(playdate_file),
3622 "::",
3623 stringify!(write)
3624 )
3625 );
3626 assert_eq!(
3627 unsafe { ::core::ptr::addr_of!((*ptr).flush) as usize - ptr as usize },
3628 80usize,
3629 concat!(
3630 "Offset of field: ",
3631 stringify!(playdate_file),
3632 "::",
3633 stringify!(flush)
3634 )
3635 );
3636 assert_eq!(
3637 unsafe { ::core::ptr::addr_of!((*ptr).tell) as usize - ptr as usize },
3638 88usize,
3639 concat!(
3640 "Offset of field: ",
3641 stringify!(playdate_file),
3642 "::",
3643 stringify!(tell)
3644 )
3645 );
3646 assert_eq!(
3647 unsafe { ::core::ptr::addr_of!((*ptr).seek) as usize - ptr as usize },
3648 96usize,
3649 concat!(
3650 "Offset of field: ",
3651 stringify!(playdate_file),
3652 "::",
3653 stringify!(seek)
3654 )
3655 );
3656}
3657#[repr(u32)]
3658#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3659pub enum SpriteCollisionResponseType {
3660 kCollisionTypeSlide = 0,
3661 kCollisionTypeFreeze = 1,
3662 kCollisionTypeOverlap = 2,
3663 kCollisionTypeBounce = 3,
3664}
3665#[repr(C)]
3666#[derive(Debug, Default, Copy, Clone, PartialEq)]
3667pub struct PDRect {
3668 pub x: f32,
3669 pub y: f32,
3670 pub width: f32,
3671 pub height: f32,
3672}
3673#[test]
3674fn bindgen_test_layout_PDRect() {
3675 const UNINIT: ::core::mem::MaybeUninit<PDRect> = ::core::mem::MaybeUninit::uninit();
3676 let ptr = UNINIT.as_ptr();
3677 assert_eq!(
3678 ::core::mem::size_of::<PDRect>(),
3679 16usize,
3680 concat!("Size of: ", stringify!(PDRect))
3681 );
3682 assert_eq!(
3683 ::core::mem::align_of::<PDRect>(),
3684 4usize,
3685 concat!("Alignment of ", stringify!(PDRect))
3686 );
3687 assert_eq!(
3688 unsafe { ::core::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
3689 0usize,
3690 concat!("Offset of field: ", stringify!(PDRect), "::", stringify!(x))
3691 );
3692 assert_eq!(
3693 unsafe { ::core::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
3694 4usize,
3695 concat!("Offset of field: ", stringify!(PDRect), "::", stringify!(y))
3696 );
3697 assert_eq!(
3698 unsafe { ::core::ptr::addr_of!((*ptr).width) as usize - ptr as usize },
3699 8usize,
3700 concat!(
3701 "Offset of field: ",
3702 stringify!(PDRect),
3703 "::",
3704 stringify!(width)
3705 )
3706 );
3707 assert_eq!(
3708 unsafe { ::core::ptr::addr_of!((*ptr).height) as usize - ptr as usize },
3709 12usize,
3710 concat!(
3711 "Offset of field: ",
3712 stringify!(PDRect),
3713 "::",
3714 stringify!(height)
3715 )
3716 );
3717}
3718#[repr(C)]
3719#[derive(Debug, Default, Copy, Clone, PartialEq)]
3720pub struct CollisionPoint {
3721 pub x: f32,
3722 pub y: f32,
3723}
3724#[test]
3725fn bindgen_test_layout_CollisionPoint() {
3726 const UNINIT: ::core::mem::MaybeUninit<CollisionPoint> = ::core::mem::MaybeUninit::uninit();
3727 let ptr = UNINIT.as_ptr();
3728 assert_eq!(
3729 ::core::mem::size_of::<CollisionPoint>(),
3730 8usize,
3731 concat!("Size of: ", stringify!(CollisionPoint))
3732 );
3733 assert_eq!(
3734 ::core::mem::align_of::<CollisionPoint>(),
3735 4usize,
3736 concat!("Alignment of ", stringify!(CollisionPoint))
3737 );
3738 assert_eq!(
3739 unsafe { ::core::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
3740 0usize,
3741 concat!(
3742 "Offset of field: ",
3743 stringify!(CollisionPoint),
3744 "::",
3745 stringify!(x)
3746 )
3747 );
3748 assert_eq!(
3749 unsafe { ::core::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
3750 4usize,
3751 concat!(
3752 "Offset of field: ",
3753 stringify!(CollisionPoint),
3754 "::",
3755 stringify!(y)
3756 )
3757 );
3758}
3759#[repr(C)]
3760#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
3761pub struct CollisionVector {
3762 pub x: ctypes::c_int,
3763 pub y: ctypes::c_int,
3764}
3765#[test]
3766fn bindgen_test_layout_CollisionVector() {
3767 const UNINIT: ::core::mem::MaybeUninit<CollisionVector> = ::core::mem::MaybeUninit::uninit();
3768 let ptr = UNINIT.as_ptr();
3769 assert_eq!(
3770 ::core::mem::size_of::<CollisionVector>(),
3771 8usize,
3772 concat!("Size of: ", stringify!(CollisionVector))
3773 );
3774 assert_eq!(
3775 ::core::mem::align_of::<CollisionVector>(),
3776 4usize,
3777 concat!("Alignment of ", stringify!(CollisionVector))
3778 );
3779 assert_eq!(
3780 unsafe { ::core::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
3781 0usize,
3782 concat!(
3783 "Offset of field: ",
3784 stringify!(CollisionVector),
3785 "::",
3786 stringify!(x)
3787 )
3788 );
3789 assert_eq!(
3790 unsafe { ::core::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
3791 4usize,
3792 concat!(
3793 "Offset of field: ",
3794 stringify!(CollisionVector),
3795 "::",
3796 stringify!(y)
3797 )
3798 );
3799}
3800#[repr(C)]
3801#[derive(Debug, Copy, Clone, PartialEq)]
3802pub struct SpriteCollisionInfo {
3803 pub sprite: *mut LCDSprite,
3804 pub other: *mut LCDSprite,
3805 pub responseType: SpriteCollisionResponseType,
3806 pub overlaps: u8,
3807 pub ti: f32,
3808 pub move_: CollisionPoint,
3809 pub normal: CollisionVector,
3810 pub touch: CollisionPoint,
3811 pub spriteRect: PDRect,
3812 pub otherRect: PDRect,
3813}
3814#[test]
3815fn bindgen_test_layout_SpriteCollisionInfo() {
3816 const UNINIT: ::core::mem::MaybeUninit<SpriteCollisionInfo> =
3817 ::core::mem::MaybeUninit::uninit();
3818 let ptr = UNINIT.as_ptr();
3819 assert_eq!(
3820 ::core::mem::size_of::<SpriteCollisionInfo>(),
3821 88usize,
3822 concat!("Size of: ", stringify!(SpriteCollisionInfo))
3823 );
3824 assert_eq!(
3825 ::core::mem::align_of::<SpriteCollisionInfo>(),
3826 8usize,
3827 concat!("Alignment of ", stringify!(SpriteCollisionInfo))
3828 );
3829 assert_eq!(
3830 unsafe { ::core::ptr::addr_of!((*ptr).sprite) as usize - ptr as usize },
3831 0usize,
3832 concat!(
3833 "Offset of field: ",
3834 stringify!(SpriteCollisionInfo),
3835 "::",
3836 stringify!(sprite)
3837 )
3838 );
3839 assert_eq!(
3840 unsafe { ::core::ptr::addr_of!((*ptr).other) as usize - ptr as usize },
3841 8usize,
3842 concat!(
3843 "Offset of field: ",
3844 stringify!(SpriteCollisionInfo),
3845 "::",
3846 stringify!(other)
3847 )
3848 );
3849 assert_eq!(
3850 unsafe { ::core::ptr::addr_of!((*ptr).responseType) as usize - ptr as usize },
3851 16usize,
3852 concat!(
3853 "Offset of field: ",
3854 stringify!(SpriteCollisionInfo),
3855 "::",
3856 stringify!(responseType)
3857 )
3858 );
3859 assert_eq!(
3860 unsafe { ::core::ptr::addr_of!((*ptr).overlaps) as usize - ptr as usize },
3861 20usize,
3862 concat!(
3863 "Offset of field: ",
3864 stringify!(SpriteCollisionInfo),
3865 "::",
3866 stringify!(overlaps)
3867 )
3868 );
3869 assert_eq!(
3870 unsafe { ::core::ptr::addr_of!((*ptr).ti) as usize - ptr as usize },
3871 24usize,
3872 concat!(
3873 "Offset of field: ",
3874 stringify!(SpriteCollisionInfo),
3875 "::",
3876 stringify!(ti)
3877 )
3878 );
3879 assert_eq!(
3880 unsafe { ::core::ptr::addr_of!((*ptr).move_) as usize - ptr as usize },
3881 28usize,
3882 concat!(
3883 "Offset of field: ",
3884 stringify!(SpriteCollisionInfo),
3885 "::",
3886 stringify!(move_)
3887 )
3888 );
3889 assert_eq!(
3890 unsafe { ::core::ptr::addr_of!((*ptr).normal) as usize - ptr as usize },
3891 36usize,
3892 concat!(
3893 "Offset of field: ",
3894 stringify!(SpriteCollisionInfo),
3895 "::",
3896 stringify!(normal)
3897 )
3898 );
3899 assert_eq!(
3900 unsafe { ::core::ptr::addr_of!((*ptr).touch) as usize - ptr as usize },
3901 44usize,
3902 concat!(
3903 "Offset of field: ",
3904 stringify!(SpriteCollisionInfo),
3905 "::",
3906 stringify!(touch)
3907 )
3908 );
3909 assert_eq!(
3910 unsafe { ::core::ptr::addr_of!((*ptr).spriteRect) as usize - ptr as usize },
3911 52usize,
3912 concat!(
3913 "Offset of field: ",
3914 stringify!(SpriteCollisionInfo),
3915 "::",
3916 stringify!(spriteRect)
3917 )
3918 );
3919 assert_eq!(
3920 unsafe { ::core::ptr::addr_of!((*ptr).otherRect) as usize - ptr as usize },
3921 68usize,
3922 concat!(
3923 "Offset of field: ",
3924 stringify!(SpriteCollisionInfo),
3925 "::",
3926 stringify!(otherRect)
3927 )
3928 );
3929}
3930impl Default for SpriteCollisionInfo {
3931 fn default() -> Self {
3932 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
3933 unsafe {
3934 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
3935 s.assume_init()
3936 }
3937 }
3938}
3939#[repr(C)]
3940#[derive(Debug, Copy, Clone, PartialEq)]
3941pub struct SpriteQueryInfo {
3942 pub sprite: *mut LCDSprite,
3943 pub ti1: f32,
3944 pub ti2: f32,
3945 pub entryPoint: CollisionPoint,
3946 pub exitPoint: CollisionPoint,
3947}
3948#[test]
3949fn bindgen_test_layout_SpriteQueryInfo() {
3950 const UNINIT: ::core::mem::MaybeUninit<SpriteQueryInfo> = ::core::mem::MaybeUninit::uninit();
3951 let ptr = UNINIT.as_ptr();
3952 assert_eq!(
3953 ::core::mem::size_of::<SpriteQueryInfo>(),
3954 32usize,
3955 concat!("Size of: ", stringify!(SpriteQueryInfo))
3956 );
3957 assert_eq!(
3958 ::core::mem::align_of::<SpriteQueryInfo>(),
3959 8usize,
3960 concat!("Alignment of ", stringify!(SpriteQueryInfo))
3961 );
3962 assert_eq!(
3963 unsafe { ::core::ptr::addr_of!((*ptr).sprite) as usize - ptr as usize },
3964 0usize,
3965 concat!(
3966 "Offset of field: ",
3967 stringify!(SpriteQueryInfo),
3968 "::",
3969 stringify!(sprite)
3970 )
3971 );
3972 assert_eq!(
3973 unsafe { ::core::ptr::addr_of!((*ptr).ti1) as usize - ptr as usize },
3974 8usize,
3975 concat!(
3976 "Offset of field: ",
3977 stringify!(SpriteQueryInfo),
3978 "::",
3979 stringify!(ti1)
3980 )
3981 );
3982 assert_eq!(
3983 unsafe { ::core::ptr::addr_of!((*ptr).ti2) as usize - ptr as usize },
3984 12usize,
3985 concat!(
3986 "Offset of field: ",
3987 stringify!(SpriteQueryInfo),
3988 "::",
3989 stringify!(ti2)
3990 )
3991 );
3992 assert_eq!(
3993 unsafe { ::core::ptr::addr_of!((*ptr).entryPoint) as usize - ptr as usize },
3994 16usize,
3995 concat!(
3996 "Offset of field: ",
3997 stringify!(SpriteQueryInfo),
3998 "::",
3999 stringify!(entryPoint)
4000 )
4001 );
4002 assert_eq!(
4003 unsafe { ::core::ptr::addr_of!((*ptr).exitPoint) as usize - ptr as usize },
4004 24usize,
4005 concat!(
4006 "Offset of field: ",
4007 stringify!(SpriteQueryInfo),
4008 "::",
4009 stringify!(exitPoint)
4010 )
4011 );
4012}
4013impl Default for SpriteQueryInfo {
4014 fn default() -> Self {
4015 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
4016 unsafe {
4017 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
4018 s.assume_init()
4019 }
4020 }
4021}
4022pub type LCDSpriteDrawFunction = ::core::option::Option<
4023 unsafe extern "C" fn(sprite: *mut LCDSprite, bounds: PDRect, drawrect: PDRect),
4024>;
4025pub type LCDSpriteUpdateFunction =
4026 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>;
4027pub type LCDSpriteCollisionFilterProc = ::core::option::Option<
4028 unsafe extern "C" fn(
4029 sprite: *mut LCDSprite,
4030 other: *mut LCDSprite,
4031 ) -> SpriteCollisionResponseType,
4032>;
4033#[repr(C)]
4034#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
4035pub struct playdate_sprite {
4036 pub setAlwaysRedraw: ::core::option::Option<unsafe extern "C" fn(flag: ctypes::c_int)>,
4037 pub addDirtyRect: ::core::option::Option<unsafe extern "C" fn(dirtyRect: LCDRect)>,
4038 pub drawSprites: ::core::option::Option<unsafe extern "C" fn()>,
4039 pub updateAndDrawSprites: ::core::option::Option<unsafe extern "C" fn()>,
4040 pub newSprite: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDSprite>,
4041 pub freeSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
4042 pub copy:
4043 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDSprite>,
4044 pub addSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
4045 pub removeSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
4046 pub removeSprites: ::core::option::Option<
4047 unsafe extern "C" fn(sprites: *mut *mut LCDSprite, count: ctypes::c_int),
4048 >,
4049 pub removeAllSprites: ::core::option::Option<unsafe extern "C" fn()>,
4050 pub getSpriteCount: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
4051 pub setBounds:
4052 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, bounds: PDRect)>,
4053 pub getBounds: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>,
4054 pub moveTo:
4055 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, x: f32, y: f32)>,
4056 pub moveBy:
4057 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, dx: f32, dy: f32)>,
4058 pub setImage: ::core::option::Option<
4059 unsafe extern "C" fn(sprite: *mut LCDSprite, image: *mut LCDBitmap, flip: LCDBitmapFlip),
4060 >,
4061 pub getImage:
4062 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDBitmap>,
4063 pub setSize:
4064 ::core::option::Option<unsafe extern "C" fn(s: *mut LCDSprite, width: f32, height: f32)>,
4065 pub setZIndex:
4066 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, zIndex: i16)>,
4067 pub getZIndex: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> i16>,
4068 pub setDrawMode: ::core::option::Option<
4069 unsafe extern "C" fn(sprite: *mut LCDSprite, mode: LCDBitmapDrawMode),
4070 >,
4071 pub setImageFlip:
4072 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flip: LCDBitmapFlip)>,
4073 pub getImageFlip:
4074 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> LCDBitmapFlip>,
4075 pub setStencil: ::core::option::Option<
4076 unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap),
4077 >,
4078 pub setClipRect:
4079 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, clipRect: LCDRect)>,
4080 pub clearClipRect: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
4081 pub setClipRectsInRange: ::core::option::Option<
4082 unsafe extern "C" fn(clipRect: LCDRect, startZ: ctypes::c_int, endZ: ctypes::c_int),
4083 >,
4084 pub clearClipRectsInRange:
4085 ::core::option::Option<unsafe extern "C" fn(startZ: ctypes::c_int, endZ: ctypes::c_int)>,
4086 pub setUpdatesEnabled:
4087 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
4088 pub updatesEnabled:
4089 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> ctypes::c_int>,
4090 pub setCollisionsEnabled:
4091 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
4092 pub collisionsEnabled:
4093 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> ctypes::c_int>,
4094 pub setVisible:
4095 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
4096 pub isVisible:
4097 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> ctypes::c_int>,
4098 pub setOpaque:
4099 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
4100 pub markDirty: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
4101 pub setTag: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, tag: u8)>,
4102 pub getTag: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> u8>,
4103 pub setIgnoresDrawOffset:
4104 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
4105 pub setUpdateFunction: ::core::option::Option<
4106 unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteUpdateFunction),
4107 >,
4108 pub setDrawFunction: ::core::option::Option<
4109 unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteDrawFunction),
4110 >,
4111 pub getPosition: ::core::option::Option<
4112 unsafe extern "C" fn(sprite: *mut LCDSprite, x: *mut f32, y: *mut f32),
4113 >,
4114 pub resetCollisionWorld: ::core::option::Option<unsafe extern "C" fn()>,
4115 pub setCollideRect:
4116 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, collideRect: PDRect)>,
4117 pub getCollideRect:
4118 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>,
4119 pub clearCollideRect: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
4120 pub setCollisionResponseFunction: ::core::option::Option<
4121 unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteCollisionFilterProc),
4122 >,
4123 pub checkCollisions: ::core::option::Option<
4124 unsafe extern "C" fn(
4125 sprite: *mut LCDSprite,
4126 goalX: f32,
4127 goalY: f32,
4128 actualX: *mut f32,
4129 actualY: *mut f32,
4130 len: *mut ctypes::c_int,
4131 ) -> *mut SpriteCollisionInfo,
4132 >,
4133 pub moveWithCollisions: ::core::option::Option<
4134 unsafe extern "C" fn(
4135 sprite: *mut LCDSprite,
4136 goalX: f32,
4137 goalY: f32,
4138 actualX: *mut f32,
4139 actualY: *mut f32,
4140 len: *mut ctypes::c_int,
4141 ) -> *mut SpriteCollisionInfo,
4142 >,
4143 pub querySpritesAtPoint: ::core::option::Option<
4144 unsafe extern "C" fn(x: f32, y: f32, len: *mut ctypes::c_int) -> *mut *mut LCDSprite,
4145 >,
4146 pub querySpritesInRect: ::core::option::Option<
4147 unsafe extern "C" fn(
4148 x: f32,
4149 y: f32,
4150 width: f32,
4151 height: f32,
4152 len: *mut ctypes::c_int,
4153 ) -> *mut *mut LCDSprite,
4154 >,
4155 pub querySpritesAlongLine: ::core::option::Option<
4156 unsafe extern "C" fn(
4157 x1: f32,
4158 y1: f32,
4159 x2: f32,
4160 y2: f32,
4161 len: *mut ctypes::c_int,
4162 ) -> *mut *mut LCDSprite,
4163 >,
4164 pub querySpriteInfoAlongLine: ::core::option::Option<
4165 unsafe extern "C" fn(
4166 x1: f32,
4167 y1: f32,
4168 x2: f32,
4169 y2: f32,
4170 len: *mut ctypes::c_int,
4171 ) -> *mut SpriteQueryInfo,
4172 >,
4173 pub overlappingSprites: ::core::option::Option<
4174 unsafe extern "C" fn(
4175 sprite: *mut LCDSprite,
4176 len: *mut ctypes::c_int,
4177 ) -> *mut *mut LCDSprite,
4178 >,
4179 pub allOverlappingSprites: ::core::option::Option<
4180 unsafe extern "C" fn(len: *mut ctypes::c_int) -> *mut *mut LCDSprite,
4181 >,
4182 pub setStencilPattern:
4183 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, pattern: *mut u8)>,
4184 pub clearStencil: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
4185 pub setUserdata: ::core::option::Option<
4186 unsafe extern "C" fn(sprite: *mut LCDSprite, userdata: *mut ctypes::c_void),
4187 >,
4188 pub getUserdata:
4189 ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut ctypes::c_void>,
4190 pub setStencilImage: ::core::option::Option<
4191 unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap, tile: ctypes::c_int),
4192 >,
4193}
4194#[test]
4195fn bindgen_test_layout_playdate_sprite() {
4196 const UNINIT: ::core::mem::MaybeUninit<playdate_sprite> = ::core::mem::MaybeUninit::uninit();
4197 let ptr = UNINIT.as_ptr();
4198 assert_eq!(
4199 ::core::mem::size_of::<playdate_sprite>(),
4200 488usize,
4201 concat!("Size of: ", stringify!(playdate_sprite))
4202 );
4203 assert_eq!(
4204 ::core::mem::align_of::<playdate_sprite>(),
4205 8usize,
4206 concat!("Alignment of ", stringify!(playdate_sprite))
4207 );
4208 assert_eq!(
4209 unsafe { ::core::ptr::addr_of!((*ptr).setAlwaysRedraw) as usize - ptr as usize },
4210 0usize,
4211 concat!(
4212 "Offset of field: ",
4213 stringify!(playdate_sprite),
4214 "::",
4215 stringify!(setAlwaysRedraw)
4216 )
4217 );
4218 assert_eq!(
4219 unsafe { ::core::ptr::addr_of!((*ptr).addDirtyRect) as usize - ptr as usize },
4220 8usize,
4221 concat!(
4222 "Offset of field: ",
4223 stringify!(playdate_sprite),
4224 "::",
4225 stringify!(addDirtyRect)
4226 )
4227 );
4228 assert_eq!(
4229 unsafe { ::core::ptr::addr_of!((*ptr).drawSprites) as usize - ptr as usize },
4230 16usize,
4231 concat!(
4232 "Offset of field: ",
4233 stringify!(playdate_sprite),
4234 "::",
4235 stringify!(drawSprites)
4236 )
4237 );
4238 assert_eq!(
4239 unsafe { ::core::ptr::addr_of!((*ptr).updateAndDrawSprites) as usize - ptr as usize },
4240 24usize,
4241 concat!(
4242 "Offset of field: ",
4243 stringify!(playdate_sprite),
4244 "::",
4245 stringify!(updateAndDrawSprites)
4246 )
4247 );
4248 assert_eq!(
4249 unsafe { ::core::ptr::addr_of!((*ptr).newSprite) as usize - ptr as usize },
4250 32usize,
4251 concat!(
4252 "Offset of field: ",
4253 stringify!(playdate_sprite),
4254 "::",
4255 stringify!(newSprite)
4256 )
4257 );
4258 assert_eq!(
4259 unsafe { ::core::ptr::addr_of!((*ptr).freeSprite) as usize - ptr as usize },
4260 40usize,
4261 concat!(
4262 "Offset of field: ",
4263 stringify!(playdate_sprite),
4264 "::",
4265 stringify!(freeSprite)
4266 )
4267 );
4268 assert_eq!(
4269 unsafe { ::core::ptr::addr_of!((*ptr).copy) as usize - ptr as usize },
4270 48usize,
4271 concat!(
4272 "Offset of field: ",
4273 stringify!(playdate_sprite),
4274 "::",
4275 stringify!(copy)
4276 )
4277 );
4278 assert_eq!(
4279 unsafe { ::core::ptr::addr_of!((*ptr).addSprite) as usize - ptr as usize },
4280 56usize,
4281 concat!(
4282 "Offset of field: ",
4283 stringify!(playdate_sprite),
4284 "::",
4285 stringify!(addSprite)
4286 )
4287 );
4288 assert_eq!(
4289 unsafe { ::core::ptr::addr_of!((*ptr).removeSprite) as usize - ptr as usize },
4290 64usize,
4291 concat!(
4292 "Offset of field: ",
4293 stringify!(playdate_sprite),
4294 "::",
4295 stringify!(removeSprite)
4296 )
4297 );
4298 assert_eq!(
4299 unsafe { ::core::ptr::addr_of!((*ptr).removeSprites) as usize - ptr as usize },
4300 72usize,
4301 concat!(
4302 "Offset of field: ",
4303 stringify!(playdate_sprite),
4304 "::",
4305 stringify!(removeSprites)
4306 )
4307 );
4308 assert_eq!(
4309 unsafe { ::core::ptr::addr_of!((*ptr).removeAllSprites) as usize - ptr as usize },
4310 80usize,
4311 concat!(
4312 "Offset of field: ",
4313 stringify!(playdate_sprite),
4314 "::",
4315 stringify!(removeAllSprites)
4316 )
4317 );
4318 assert_eq!(
4319 unsafe { ::core::ptr::addr_of!((*ptr).getSpriteCount) as usize - ptr as usize },
4320 88usize,
4321 concat!(
4322 "Offset of field: ",
4323 stringify!(playdate_sprite),
4324 "::",
4325 stringify!(getSpriteCount)
4326 )
4327 );
4328 assert_eq!(
4329 unsafe { ::core::ptr::addr_of!((*ptr).setBounds) as usize - ptr as usize },
4330 96usize,
4331 concat!(
4332 "Offset of field: ",
4333 stringify!(playdate_sprite),
4334 "::",
4335 stringify!(setBounds)
4336 )
4337 );
4338 assert_eq!(
4339 unsafe { ::core::ptr::addr_of!((*ptr).getBounds) as usize - ptr as usize },
4340 104usize,
4341 concat!(
4342 "Offset of field: ",
4343 stringify!(playdate_sprite),
4344 "::",
4345 stringify!(getBounds)
4346 )
4347 );
4348 assert_eq!(
4349 unsafe { ::core::ptr::addr_of!((*ptr).moveTo) as usize - ptr as usize },
4350 112usize,
4351 concat!(
4352 "Offset of field: ",
4353 stringify!(playdate_sprite),
4354 "::",
4355 stringify!(moveTo)
4356 )
4357 );
4358 assert_eq!(
4359 unsafe { ::core::ptr::addr_of!((*ptr).moveBy) as usize - ptr as usize },
4360 120usize,
4361 concat!(
4362 "Offset of field: ",
4363 stringify!(playdate_sprite),
4364 "::",
4365 stringify!(moveBy)
4366 )
4367 );
4368 assert_eq!(
4369 unsafe { ::core::ptr::addr_of!((*ptr).setImage) as usize - ptr as usize },
4370 128usize,
4371 concat!(
4372 "Offset of field: ",
4373 stringify!(playdate_sprite),
4374 "::",
4375 stringify!(setImage)
4376 )
4377 );
4378 assert_eq!(
4379 unsafe { ::core::ptr::addr_of!((*ptr).getImage) as usize - ptr as usize },
4380 136usize,
4381 concat!(
4382 "Offset of field: ",
4383 stringify!(playdate_sprite),
4384 "::",
4385 stringify!(getImage)
4386 )
4387 );
4388 assert_eq!(
4389 unsafe { ::core::ptr::addr_of!((*ptr).setSize) as usize - ptr as usize },
4390 144usize,
4391 concat!(
4392 "Offset of field: ",
4393 stringify!(playdate_sprite),
4394 "::",
4395 stringify!(setSize)
4396 )
4397 );
4398 assert_eq!(
4399 unsafe { ::core::ptr::addr_of!((*ptr).setZIndex) as usize - ptr as usize },
4400 152usize,
4401 concat!(
4402 "Offset of field: ",
4403 stringify!(playdate_sprite),
4404 "::",
4405 stringify!(setZIndex)
4406 )
4407 );
4408 assert_eq!(
4409 unsafe { ::core::ptr::addr_of!((*ptr).getZIndex) as usize - ptr as usize },
4410 160usize,
4411 concat!(
4412 "Offset of field: ",
4413 stringify!(playdate_sprite),
4414 "::",
4415 stringify!(getZIndex)
4416 )
4417 );
4418 assert_eq!(
4419 unsafe { ::core::ptr::addr_of!((*ptr).setDrawMode) as usize - ptr as usize },
4420 168usize,
4421 concat!(
4422 "Offset of field: ",
4423 stringify!(playdate_sprite),
4424 "::",
4425 stringify!(setDrawMode)
4426 )
4427 );
4428 assert_eq!(
4429 unsafe { ::core::ptr::addr_of!((*ptr).setImageFlip) as usize - ptr as usize },
4430 176usize,
4431 concat!(
4432 "Offset of field: ",
4433 stringify!(playdate_sprite),
4434 "::",
4435 stringify!(setImageFlip)
4436 )
4437 );
4438 assert_eq!(
4439 unsafe { ::core::ptr::addr_of!((*ptr).getImageFlip) as usize - ptr as usize },
4440 184usize,
4441 concat!(
4442 "Offset of field: ",
4443 stringify!(playdate_sprite),
4444 "::",
4445 stringify!(getImageFlip)
4446 )
4447 );
4448 assert_eq!(
4449 unsafe { ::core::ptr::addr_of!((*ptr).setStencil) as usize - ptr as usize },
4450 192usize,
4451 concat!(
4452 "Offset of field: ",
4453 stringify!(playdate_sprite),
4454 "::",
4455 stringify!(setStencil)
4456 )
4457 );
4458 assert_eq!(
4459 unsafe { ::core::ptr::addr_of!((*ptr).setClipRect) as usize - ptr as usize },
4460 200usize,
4461 concat!(
4462 "Offset of field: ",
4463 stringify!(playdate_sprite),
4464 "::",
4465 stringify!(setClipRect)
4466 )
4467 );
4468 assert_eq!(
4469 unsafe { ::core::ptr::addr_of!((*ptr).clearClipRect) as usize - ptr as usize },
4470 208usize,
4471 concat!(
4472 "Offset of field: ",
4473 stringify!(playdate_sprite),
4474 "::",
4475 stringify!(clearClipRect)
4476 )
4477 );
4478 assert_eq!(
4479 unsafe { ::core::ptr::addr_of!((*ptr).setClipRectsInRange) as usize - ptr as usize },
4480 216usize,
4481 concat!(
4482 "Offset of field: ",
4483 stringify!(playdate_sprite),
4484 "::",
4485 stringify!(setClipRectsInRange)
4486 )
4487 );
4488 assert_eq!(
4489 unsafe { ::core::ptr::addr_of!((*ptr).clearClipRectsInRange) as usize - ptr as usize },
4490 224usize,
4491 concat!(
4492 "Offset of field: ",
4493 stringify!(playdate_sprite),
4494 "::",
4495 stringify!(clearClipRectsInRange)
4496 )
4497 );
4498 assert_eq!(
4499 unsafe { ::core::ptr::addr_of!((*ptr).setUpdatesEnabled) as usize - ptr as usize },
4500 232usize,
4501 concat!(
4502 "Offset of field: ",
4503 stringify!(playdate_sprite),
4504 "::",
4505 stringify!(setUpdatesEnabled)
4506 )
4507 );
4508 assert_eq!(
4509 unsafe { ::core::ptr::addr_of!((*ptr).updatesEnabled) as usize - ptr as usize },
4510 240usize,
4511 concat!(
4512 "Offset of field: ",
4513 stringify!(playdate_sprite),
4514 "::",
4515 stringify!(updatesEnabled)
4516 )
4517 );
4518 assert_eq!(
4519 unsafe { ::core::ptr::addr_of!((*ptr).setCollisionsEnabled) as usize - ptr as usize },
4520 248usize,
4521 concat!(
4522 "Offset of field: ",
4523 stringify!(playdate_sprite),
4524 "::",
4525 stringify!(setCollisionsEnabled)
4526 )
4527 );
4528 assert_eq!(
4529 unsafe { ::core::ptr::addr_of!((*ptr).collisionsEnabled) as usize - ptr as usize },
4530 256usize,
4531 concat!(
4532 "Offset of field: ",
4533 stringify!(playdate_sprite),
4534 "::",
4535 stringify!(collisionsEnabled)
4536 )
4537 );
4538 assert_eq!(
4539 unsafe { ::core::ptr::addr_of!((*ptr).setVisible) as usize - ptr as usize },
4540 264usize,
4541 concat!(
4542 "Offset of field: ",
4543 stringify!(playdate_sprite),
4544 "::",
4545 stringify!(setVisible)
4546 )
4547 );
4548 assert_eq!(
4549 unsafe { ::core::ptr::addr_of!((*ptr).isVisible) as usize - ptr as usize },
4550 272usize,
4551 concat!(
4552 "Offset of field: ",
4553 stringify!(playdate_sprite),
4554 "::",
4555 stringify!(isVisible)
4556 )
4557 );
4558 assert_eq!(
4559 unsafe { ::core::ptr::addr_of!((*ptr).setOpaque) as usize - ptr as usize },
4560 280usize,
4561 concat!(
4562 "Offset of field: ",
4563 stringify!(playdate_sprite),
4564 "::",
4565 stringify!(setOpaque)
4566 )
4567 );
4568 assert_eq!(
4569 unsafe { ::core::ptr::addr_of!((*ptr).markDirty) as usize - ptr as usize },
4570 288usize,
4571 concat!(
4572 "Offset of field: ",
4573 stringify!(playdate_sprite),
4574 "::",
4575 stringify!(markDirty)
4576 )
4577 );
4578 assert_eq!(
4579 unsafe { ::core::ptr::addr_of!((*ptr).setTag) as usize - ptr as usize },
4580 296usize,
4581 concat!(
4582 "Offset of field: ",
4583 stringify!(playdate_sprite),
4584 "::",
4585 stringify!(setTag)
4586 )
4587 );
4588 assert_eq!(
4589 unsafe { ::core::ptr::addr_of!((*ptr).getTag) as usize - ptr as usize },
4590 304usize,
4591 concat!(
4592 "Offset of field: ",
4593 stringify!(playdate_sprite),
4594 "::",
4595 stringify!(getTag)
4596 )
4597 );
4598 assert_eq!(
4599 unsafe { ::core::ptr::addr_of!((*ptr).setIgnoresDrawOffset) as usize - ptr as usize },
4600 312usize,
4601 concat!(
4602 "Offset of field: ",
4603 stringify!(playdate_sprite),
4604 "::",
4605 stringify!(setIgnoresDrawOffset)
4606 )
4607 );
4608 assert_eq!(
4609 unsafe { ::core::ptr::addr_of!((*ptr).setUpdateFunction) as usize - ptr as usize },
4610 320usize,
4611 concat!(
4612 "Offset of field: ",
4613 stringify!(playdate_sprite),
4614 "::",
4615 stringify!(setUpdateFunction)
4616 )
4617 );
4618 assert_eq!(
4619 unsafe { ::core::ptr::addr_of!((*ptr).setDrawFunction) as usize - ptr as usize },
4620 328usize,
4621 concat!(
4622 "Offset of field: ",
4623 stringify!(playdate_sprite),
4624 "::",
4625 stringify!(setDrawFunction)
4626 )
4627 );
4628 assert_eq!(
4629 unsafe { ::core::ptr::addr_of!((*ptr).getPosition) as usize - ptr as usize },
4630 336usize,
4631 concat!(
4632 "Offset of field: ",
4633 stringify!(playdate_sprite),
4634 "::",
4635 stringify!(getPosition)
4636 )
4637 );
4638 assert_eq!(
4639 unsafe { ::core::ptr::addr_of!((*ptr).resetCollisionWorld) as usize - ptr as usize },
4640 344usize,
4641 concat!(
4642 "Offset of field: ",
4643 stringify!(playdate_sprite),
4644 "::",
4645 stringify!(resetCollisionWorld)
4646 )
4647 );
4648 assert_eq!(
4649 unsafe { ::core::ptr::addr_of!((*ptr).setCollideRect) as usize - ptr as usize },
4650 352usize,
4651 concat!(
4652 "Offset of field: ",
4653 stringify!(playdate_sprite),
4654 "::",
4655 stringify!(setCollideRect)
4656 )
4657 );
4658 assert_eq!(
4659 unsafe { ::core::ptr::addr_of!((*ptr).getCollideRect) as usize - ptr as usize },
4660 360usize,
4661 concat!(
4662 "Offset of field: ",
4663 stringify!(playdate_sprite),
4664 "::",
4665 stringify!(getCollideRect)
4666 )
4667 );
4668 assert_eq!(
4669 unsafe { ::core::ptr::addr_of!((*ptr).clearCollideRect) as usize - ptr as usize },
4670 368usize,
4671 concat!(
4672 "Offset of field: ",
4673 stringify!(playdate_sprite),
4674 "::",
4675 stringify!(clearCollideRect)
4676 )
4677 );
4678 assert_eq!(
4679 unsafe {
4680 ::core::ptr::addr_of!((*ptr).setCollisionResponseFunction) as usize - ptr as usize
4681 },
4682 376usize,
4683 concat!(
4684 "Offset of field: ",
4685 stringify!(playdate_sprite),
4686 "::",
4687 stringify!(setCollisionResponseFunction)
4688 )
4689 );
4690 assert_eq!(
4691 unsafe { ::core::ptr::addr_of!((*ptr).checkCollisions) as usize - ptr as usize },
4692 384usize,
4693 concat!(
4694 "Offset of field: ",
4695 stringify!(playdate_sprite),
4696 "::",
4697 stringify!(checkCollisions)
4698 )
4699 );
4700 assert_eq!(
4701 unsafe { ::core::ptr::addr_of!((*ptr).moveWithCollisions) as usize - ptr as usize },
4702 392usize,
4703 concat!(
4704 "Offset of field: ",
4705 stringify!(playdate_sprite),
4706 "::",
4707 stringify!(moveWithCollisions)
4708 )
4709 );
4710 assert_eq!(
4711 unsafe { ::core::ptr::addr_of!((*ptr).querySpritesAtPoint) as usize - ptr as usize },
4712 400usize,
4713 concat!(
4714 "Offset of field: ",
4715 stringify!(playdate_sprite),
4716 "::",
4717 stringify!(querySpritesAtPoint)
4718 )
4719 );
4720 assert_eq!(
4721 unsafe { ::core::ptr::addr_of!((*ptr).querySpritesInRect) as usize - ptr as usize },
4722 408usize,
4723 concat!(
4724 "Offset of field: ",
4725 stringify!(playdate_sprite),
4726 "::",
4727 stringify!(querySpritesInRect)
4728 )
4729 );
4730 assert_eq!(
4731 unsafe { ::core::ptr::addr_of!((*ptr).querySpritesAlongLine) as usize - ptr as usize },
4732 416usize,
4733 concat!(
4734 "Offset of field: ",
4735 stringify!(playdate_sprite),
4736 "::",
4737 stringify!(querySpritesAlongLine)
4738 )
4739 );
4740 assert_eq!(
4741 unsafe { ::core::ptr::addr_of!((*ptr).querySpriteInfoAlongLine) as usize - ptr as usize },
4742 424usize,
4743 concat!(
4744 "Offset of field: ",
4745 stringify!(playdate_sprite),
4746 "::",
4747 stringify!(querySpriteInfoAlongLine)
4748 )
4749 );
4750 assert_eq!(
4751 unsafe { ::core::ptr::addr_of!((*ptr).overlappingSprites) as usize - ptr as usize },
4752 432usize,
4753 concat!(
4754 "Offset of field: ",
4755 stringify!(playdate_sprite),
4756 "::",
4757 stringify!(overlappingSprites)
4758 )
4759 );
4760 assert_eq!(
4761 unsafe { ::core::ptr::addr_of!((*ptr).allOverlappingSprites) as usize - ptr as usize },
4762 440usize,
4763 concat!(
4764 "Offset of field: ",
4765 stringify!(playdate_sprite),
4766 "::",
4767 stringify!(allOverlappingSprites)
4768 )
4769 );
4770 assert_eq!(
4771 unsafe { ::core::ptr::addr_of!((*ptr).setStencilPattern) as usize - ptr as usize },
4772 448usize,
4773 concat!(
4774 "Offset of field: ",
4775 stringify!(playdate_sprite),
4776 "::",
4777 stringify!(setStencilPattern)
4778 )
4779 );
4780 assert_eq!(
4781 unsafe { ::core::ptr::addr_of!((*ptr).clearStencil) as usize - ptr as usize },
4782 456usize,
4783 concat!(
4784 "Offset of field: ",
4785 stringify!(playdate_sprite),
4786 "::",
4787 stringify!(clearStencil)
4788 )
4789 );
4790 assert_eq!(
4791 unsafe { ::core::ptr::addr_of!((*ptr).setUserdata) as usize - ptr as usize },
4792 464usize,
4793 concat!(
4794 "Offset of field: ",
4795 stringify!(playdate_sprite),
4796 "::",
4797 stringify!(setUserdata)
4798 )
4799 );
4800 assert_eq!(
4801 unsafe { ::core::ptr::addr_of!((*ptr).getUserdata) as usize - ptr as usize },
4802 472usize,
4803 concat!(
4804 "Offset of field: ",
4805 stringify!(playdate_sprite),
4806 "::",
4807 stringify!(getUserdata)
4808 )
4809 );
4810 assert_eq!(
4811 unsafe { ::core::ptr::addr_of!((*ptr).setStencilImage) as usize - ptr as usize },
4812 480usize,
4813 concat!(
4814 "Offset of field: ",
4815 stringify!(playdate_sprite),
4816 "::",
4817 stringify!(setStencilImage)
4818 )
4819 );
4820}
4821#[repr(u32)]
4822#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
4823pub enum SoundFormat {
4824 kSound8bitMono = 0,
4825 kSound8bitStereo = 1,
4826 kSound16bitMono = 2,
4827 kSound16bitStereo = 3,
4828 kSoundADPCMMono = 4,
4829 kSoundADPCMStereo = 5,
4830}
4831pub type MIDINote = f32;
4832#[repr(C)]
4833#[derive(Debug, Copy, Clone)]
4834pub struct SoundSource {
4835 _unused: [u8; 0],
4836}
4837pub type sndCallbackProc = ::core::option::Option<unsafe extern "C" fn(c: *mut SoundSource)>;
4838#[repr(C)]
4839#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
4840pub struct playdate_sound_source {
4841 pub setVolume:
4842 ::core::option::Option<unsafe extern "C" fn(c: *mut SoundSource, lvol: f32, rvol: f32)>,
4843 pub getVolume: ::core::option::Option<
4844 unsafe extern "C" fn(c: *mut SoundSource, outl: *mut f32, outr: *mut f32),
4845 >,
4846 pub isPlaying:
4847 ::core::option::Option<unsafe extern "C" fn(c: *mut SoundSource) -> ctypes::c_int>,
4848 pub setFinishCallback: ::core::option::Option<
4849 unsafe extern "C" fn(c: *mut SoundSource, callback: sndCallbackProc),
4850 >,
4851}
4852#[test]
4853fn bindgen_test_layout_playdate_sound_source() {
4854 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_source> =
4855 ::core::mem::MaybeUninit::uninit();
4856 let ptr = UNINIT.as_ptr();
4857 assert_eq!(
4858 ::core::mem::size_of::<playdate_sound_source>(),
4859 32usize,
4860 concat!("Size of: ", stringify!(playdate_sound_source))
4861 );
4862 assert_eq!(
4863 ::core::mem::align_of::<playdate_sound_source>(),
4864 8usize,
4865 concat!("Alignment of ", stringify!(playdate_sound_source))
4866 );
4867 assert_eq!(
4868 unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
4869 0usize,
4870 concat!(
4871 "Offset of field: ",
4872 stringify!(playdate_sound_source),
4873 "::",
4874 stringify!(setVolume)
4875 )
4876 );
4877 assert_eq!(
4878 unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
4879 8usize,
4880 concat!(
4881 "Offset of field: ",
4882 stringify!(playdate_sound_source),
4883 "::",
4884 stringify!(getVolume)
4885 )
4886 );
4887 assert_eq!(
4888 unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
4889 16usize,
4890 concat!(
4891 "Offset of field: ",
4892 stringify!(playdate_sound_source),
4893 "::",
4894 stringify!(isPlaying)
4895 )
4896 );
4897 assert_eq!(
4898 unsafe { ::core::ptr::addr_of!((*ptr).setFinishCallback) as usize - ptr as usize },
4899 24usize,
4900 concat!(
4901 "Offset of field: ",
4902 stringify!(playdate_sound_source),
4903 "::",
4904 stringify!(setFinishCallback)
4905 )
4906 );
4907}
4908#[repr(C)]
4909#[derive(Debug, Copy, Clone)]
4910pub struct FilePlayer {
4911 _unused: [u8; 0],
4912}
4913#[repr(C)]
4914#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
4915pub struct playdate_sound_fileplayer {
4916 pub newPlayer: ::core::option::Option<unsafe extern "C" fn() -> *mut FilePlayer>,
4917 pub freePlayer: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
4918 pub loadIntoPlayer: ::core::option::Option<
4919 unsafe extern "C" fn(player: *mut FilePlayer, path: *const ctypes::c_char) -> ctypes::c_int,
4920 >,
4921 pub setBufferLength:
4922 ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, bufferLen: f32)>,
4923 pub play: ::core::option::Option<
4924 unsafe extern "C" fn(player: *mut FilePlayer, repeat: ctypes::c_int) -> ctypes::c_int,
4925 >,
4926 pub isPlaying:
4927 ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> ctypes::c_int>,
4928 pub pause: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
4929 pub stop: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
4930 pub setVolume: ::core::option::Option<
4931 unsafe extern "C" fn(player: *mut FilePlayer, left: f32, right: f32),
4932 >,
4933 pub getVolume: ::core::option::Option<
4934 unsafe extern "C" fn(player: *mut FilePlayer, left: *mut f32, right: *mut f32),
4935 >,
4936 pub getLength: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> f32>,
4937 pub setOffset:
4938 ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, offset: f32)>,
4939 pub setRate: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, rate: f32)>,
4940 pub setLoopRange:
4941 ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, start: f32, end: f32)>,
4942 pub didUnderrun:
4943 ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> ctypes::c_int>,
4944 pub setFinishCallback: ::core::option::Option<
4945 unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc),
4946 >,
4947 pub setLoopCallback: ::core::option::Option<
4948 unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc),
4949 >,
4950 pub getOffset: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> f32>,
4951 pub getRate: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> f32>,
4952 pub setStopOnUnderrun:
4953 ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, flag: ctypes::c_int)>,
4954 pub fadeVolume: ::core::option::Option<
4955 unsafe extern "C" fn(
4956 player: *mut FilePlayer,
4957 left: f32,
4958 right: f32,
4959 len: i32,
4960 finishCallback: sndCallbackProc,
4961 ),
4962 >,
4963 pub setMP3StreamSource: ::core::option::Option<
4964 unsafe extern "C" fn(
4965 player: *mut FilePlayer,
4966 dataSource: ::core::option::Option<
4967 unsafe extern "C" fn(
4968 data: *mut u8,
4969 bytes: ctypes::c_int,
4970 userdata: *mut ctypes::c_void,
4971 ) -> ctypes::c_int,
4972 >,
4973 userdata: *mut ctypes::c_void,
4974 bufferLen: f32,
4975 ),
4976 >,
4977}
4978#[test]
4979fn bindgen_test_layout_playdate_sound_fileplayer() {
4980 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_fileplayer> =
4981 ::core::mem::MaybeUninit::uninit();
4982 let ptr = UNINIT.as_ptr();
4983 assert_eq!(
4984 ::core::mem::size_of::<playdate_sound_fileplayer>(),
4985 176usize,
4986 concat!("Size of: ", stringify!(playdate_sound_fileplayer))
4987 );
4988 assert_eq!(
4989 ::core::mem::align_of::<playdate_sound_fileplayer>(),
4990 8usize,
4991 concat!("Alignment of ", stringify!(playdate_sound_fileplayer))
4992 );
4993 assert_eq!(
4994 unsafe { ::core::ptr::addr_of!((*ptr).newPlayer) as usize - ptr as usize },
4995 0usize,
4996 concat!(
4997 "Offset of field: ",
4998 stringify!(playdate_sound_fileplayer),
4999 "::",
5000 stringify!(newPlayer)
5001 )
5002 );
5003 assert_eq!(
5004 unsafe { ::core::ptr::addr_of!((*ptr).freePlayer) as usize - ptr as usize },
5005 8usize,
5006 concat!(
5007 "Offset of field: ",
5008 stringify!(playdate_sound_fileplayer),
5009 "::",
5010 stringify!(freePlayer)
5011 )
5012 );
5013 assert_eq!(
5014 unsafe { ::core::ptr::addr_of!((*ptr).loadIntoPlayer) as usize - ptr as usize },
5015 16usize,
5016 concat!(
5017 "Offset of field: ",
5018 stringify!(playdate_sound_fileplayer),
5019 "::",
5020 stringify!(loadIntoPlayer)
5021 )
5022 );
5023 assert_eq!(
5024 unsafe { ::core::ptr::addr_of!((*ptr).setBufferLength) as usize - ptr as usize },
5025 24usize,
5026 concat!(
5027 "Offset of field: ",
5028 stringify!(playdate_sound_fileplayer),
5029 "::",
5030 stringify!(setBufferLength)
5031 )
5032 );
5033 assert_eq!(
5034 unsafe { ::core::ptr::addr_of!((*ptr).play) as usize - ptr as usize },
5035 32usize,
5036 concat!(
5037 "Offset of field: ",
5038 stringify!(playdate_sound_fileplayer),
5039 "::",
5040 stringify!(play)
5041 )
5042 );
5043 assert_eq!(
5044 unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
5045 40usize,
5046 concat!(
5047 "Offset of field: ",
5048 stringify!(playdate_sound_fileplayer),
5049 "::",
5050 stringify!(isPlaying)
5051 )
5052 );
5053 assert_eq!(
5054 unsafe { ::core::ptr::addr_of!((*ptr).pause) as usize - ptr as usize },
5055 48usize,
5056 concat!(
5057 "Offset of field: ",
5058 stringify!(playdate_sound_fileplayer),
5059 "::",
5060 stringify!(pause)
5061 )
5062 );
5063 assert_eq!(
5064 unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
5065 56usize,
5066 concat!(
5067 "Offset of field: ",
5068 stringify!(playdate_sound_fileplayer),
5069 "::",
5070 stringify!(stop)
5071 )
5072 );
5073 assert_eq!(
5074 unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
5075 64usize,
5076 concat!(
5077 "Offset of field: ",
5078 stringify!(playdate_sound_fileplayer),
5079 "::",
5080 stringify!(setVolume)
5081 )
5082 );
5083 assert_eq!(
5084 unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
5085 72usize,
5086 concat!(
5087 "Offset of field: ",
5088 stringify!(playdate_sound_fileplayer),
5089 "::",
5090 stringify!(getVolume)
5091 )
5092 );
5093 assert_eq!(
5094 unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
5095 80usize,
5096 concat!(
5097 "Offset of field: ",
5098 stringify!(playdate_sound_fileplayer),
5099 "::",
5100 stringify!(getLength)
5101 )
5102 );
5103 assert_eq!(
5104 unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
5105 88usize,
5106 concat!(
5107 "Offset of field: ",
5108 stringify!(playdate_sound_fileplayer),
5109 "::",
5110 stringify!(setOffset)
5111 )
5112 );
5113 assert_eq!(
5114 unsafe { ::core::ptr::addr_of!((*ptr).setRate) as usize - ptr as usize },
5115 96usize,
5116 concat!(
5117 "Offset of field: ",
5118 stringify!(playdate_sound_fileplayer),
5119 "::",
5120 stringify!(setRate)
5121 )
5122 );
5123 assert_eq!(
5124 unsafe { ::core::ptr::addr_of!((*ptr).setLoopRange) as usize - ptr as usize },
5125 104usize,
5126 concat!(
5127 "Offset of field: ",
5128 stringify!(playdate_sound_fileplayer),
5129 "::",
5130 stringify!(setLoopRange)
5131 )
5132 );
5133 assert_eq!(
5134 unsafe { ::core::ptr::addr_of!((*ptr).didUnderrun) as usize - ptr as usize },
5135 112usize,
5136 concat!(
5137 "Offset of field: ",
5138 stringify!(playdate_sound_fileplayer),
5139 "::",
5140 stringify!(didUnderrun)
5141 )
5142 );
5143 assert_eq!(
5144 unsafe { ::core::ptr::addr_of!((*ptr).setFinishCallback) as usize - ptr as usize },
5145 120usize,
5146 concat!(
5147 "Offset of field: ",
5148 stringify!(playdate_sound_fileplayer),
5149 "::",
5150 stringify!(setFinishCallback)
5151 )
5152 );
5153 assert_eq!(
5154 unsafe { ::core::ptr::addr_of!((*ptr).setLoopCallback) as usize - ptr as usize },
5155 128usize,
5156 concat!(
5157 "Offset of field: ",
5158 stringify!(playdate_sound_fileplayer),
5159 "::",
5160 stringify!(setLoopCallback)
5161 )
5162 );
5163 assert_eq!(
5164 unsafe { ::core::ptr::addr_of!((*ptr).getOffset) as usize - ptr as usize },
5165 136usize,
5166 concat!(
5167 "Offset of field: ",
5168 stringify!(playdate_sound_fileplayer),
5169 "::",
5170 stringify!(getOffset)
5171 )
5172 );
5173 assert_eq!(
5174 unsafe { ::core::ptr::addr_of!((*ptr).getRate) as usize - ptr as usize },
5175 144usize,
5176 concat!(
5177 "Offset of field: ",
5178 stringify!(playdate_sound_fileplayer),
5179 "::",
5180 stringify!(getRate)
5181 )
5182 );
5183 assert_eq!(
5184 unsafe { ::core::ptr::addr_of!((*ptr).setStopOnUnderrun) as usize - ptr as usize },
5185 152usize,
5186 concat!(
5187 "Offset of field: ",
5188 stringify!(playdate_sound_fileplayer),
5189 "::",
5190 stringify!(setStopOnUnderrun)
5191 )
5192 );
5193 assert_eq!(
5194 unsafe { ::core::ptr::addr_of!((*ptr).fadeVolume) as usize - ptr as usize },
5195 160usize,
5196 concat!(
5197 "Offset of field: ",
5198 stringify!(playdate_sound_fileplayer),
5199 "::",
5200 stringify!(fadeVolume)
5201 )
5202 );
5203 assert_eq!(
5204 unsafe { ::core::ptr::addr_of!((*ptr).setMP3StreamSource) as usize - ptr as usize },
5205 168usize,
5206 concat!(
5207 "Offset of field: ",
5208 stringify!(playdate_sound_fileplayer),
5209 "::",
5210 stringify!(setMP3StreamSource)
5211 )
5212 );
5213}
5214#[repr(C)]
5215#[derive(Debug, Copy, Clone)]
5216pub struct AudioSample {
5217 _unused: [u8; 0],
5218}
5219#[repr(C)]
5220#[derive(Debug, Copy, Clone)]
5221pub struct SamplePlayer {
5222 _unused: [u8; 0],
5223}
5224#[repr(C)]
5225#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
5226pub struct playdate_sound_sample {
5227 pub newSampleBuffer:
5228 ::core::option::Option<unsafe extern "C" fn(byteCount: ctypes::c_int) -> *mut AudioSample>,
5229 pub loadIntoSample: ::core::option::Option<
5230 unsafe extern "C" fn(
5231 sample: *mut AudioSample,
5232 path: *const ctypes::c_char,
5233 ) -> ctypes::c_int,
5234 >,
5235 pub load: ::core::option::Option<
5236 unsafe extern "C" fn(path: *const ctypes::c_char) -> *mut AudioSample,
5237 >,
5238 pub newSampleFromData: ::core::option::Option<
5239 unsafe extern "C" fn(
5240 data: *mut u8,
5241 format: SoundFormat,
5242 sampleRate: u32,
5243 byteCount: ctypes::c_int,
5244 ) -> *mut AudioSample,
5245 >,
5246 pub getData: ::core::option::Option<
5247 unsafe extern "C" fn(
5248 sample: *mut AudioSample,
5249 data: *mut *mut u8,
5250 format: *mut SoundFormat,
5251 sampleRate: *mut u32,
5252 bytelength: *mut u32,
5253 ),
5254 >,
5255 pub freeSample: ::core::option::Option<unsafe extern "C" fn(sample: *mut AudioSample)>,
5256 pub getLength: ::core::option::Option<unsafe extern "C" fn(sample: *mut AudioSample) -> f32>,
5257}
5258#[test]
5259fn bindgen_test_layout_playdate_sound_sample() {
5260 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_sample> =
5261 ::core::mem::MaybeUninit::uninit();
5262 let ptr = UNINIT.as_ptr();
5263 assert_eq!(
5264 ::core::mem::size_of::<playdate_sound_sample>(),
5265 56usize,
5266 concat!("Size of: ", stringify!(playdate_sound_sample))
5267 );
5268 assert_eq!(
5269 ::core::mem::align_of::<playdate_sound_sample>(),
5270 8usize,
5271 concat!("Alignment of ", stringify!(playdate_sound_sample))
5272 );
5273 assert_eq!(
5274 unsafe { ::core::ptr::addr_of!((*ptr).newSampleBuffer) as usize - ptr as usize },
5275 0usize,
5276 concat!(
5277 "Offset of field: ",
5278 stringify!(playdate_sound_sample),
5279 "::",
5280 stringify!(newSampleBuffer)
5281 )
5282 );
5283 assert_eq!(
5284 unsafe { ::core::ptr::addr_of!((*ptr).loadIntoSample) as usize - ptr as usize },
5285 8usize,
5286 concat!(
5287 "Offset of field: ",
5288 stringify!(playdate_sound_sample),
5289 "::",
5290 stringify!(loadIntoSample)
5291 )
5292 );
5293 assert_eq!(
5294 unsafe { ::core::ptr::addr_of!((*ptr).load) as usize - ptr as usize },
5295 16usize,
5296 concat!(
5297 "Offset of field: ",
5298 stringify!(playdate_sound_sample),
5299 "::",
5300 stringify!(load)
5301 )
5302 );
5303 assert_eq!(
5304 unsafe { ::core::ptr::addr_of!((*ptr).newSampleFromData) as usize - ptr as usize },
5305 24usize,
5306 concat!(
5307 "Offset of field: ",
5308 stringify!(playdate_sound_sample),
5309 "::",
5310 stringify!(newSampleFromData)
5311 )
5312 );
5313 assert_eq!(
5314 unsafe { ::core::ptr::addr_of!((*ptr).getData) as usize - ptr as usize },
5315 32usize,
5316 concat!(
5317 "Offset of field: ",
5318 stringify!(playdate_sound_sample),
5319 "::",
5320 stringify!(getData)
5321 )
5322 );
5323 assert_eq!(
5324 unsafe { ::core::ptr::addr_of!((*ptr).freeSample) as usize - ptr as usize },
5325 40usize,
5326 concat!(
5327 "Offset of field: ",
5328 stringify!(playdate_sound_sample),
5329 "::",
5330 stringify!(freeSample)
5331 )
5332 );
5333 assert_eq!(
5334 unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
5335 48usize,
5336 concat!(
5337 "Offset of field: ",
5338 stringify!(playdate_sound_sample),
5339 "::",
5340 stringify!(getLength)
5341 )
5342 );
5343}
5344#[repr(C)]
5345#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
5346pub struct playdate_sound_sampleplayer {
5347 pub newPlayer: ::core::option::Option<unsafe extern "C" fn() -> *mut SamplePlayer>,
5348 pub freePlayer: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer)>,
5349 pub setSample: ::core::option::Option<
5350 unsafe extern "C" fn(player: *mut SamplePlayer, sample: *mut AudioSample),
5351 >,
5352 pub play: ::core::option::Option<
5353 unsafe extern "C" fn(
5354 player: *mut SamplePlayer,
5355 repeat: ctypes::c_int,
5356 rate: f32,
5357 ) -> ctypes::c_int,
5358 >,
5359 pub isPlaying:
5360 ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> ctypes::c_int>,
5361 pub stop: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer)>,
5362 pub setVolume: ::core::option::Option<
5363 unsafe extern "C" fn(player: *mut SamplePlayer, left: f32, right: f32),
5364 >,
5365 pub getVolume: ::core::option::Option<
5366 unsafe extern "C" fn(player: *mut SamplePlayer, left: *mut f32, right: *mut f32),
5367 >,
5368 pub getLength: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> f32>,
5369 pub setOffset:
5370 ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer, offset: f32)>,
5371 pub setRate: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer, rate: f32)>,
5372 pub setPlayRange: ::core::option::Option<
5373 unsafe extern "C" fn(player: *mut SamplePlayer, start: ctypes::c_int, end: ctypes::c_int),
5374 >,
5375 pub setFinishCallback: ::core::option::Option<
5376 unsafe extern "C" fn(player: *mut SamplePlayer, callback: sndCallbackProc),
5377 >,
5378 pub setLoopCallback: ::core::option::Option<
5379 unsafe extern "C" fn(player: *mut SamplePlayer, callback: sndCallbackProc),
5380 >,
5381 pub getOffset: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> f32>,
5382 pub getRate: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> f32>,
5383 pub setPaused: ::core::option::Option<
5384 unsafe extern "C" fn(player: *mut SamplePlayer, flag: ctypes::c_int),
5385 >,
5386}
5387#[test]
5388fn bindgen_test_layout_playdate_sound_sampleplayer() {
5389 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_sampleplayer> =
5390 ::core::mem::MaybeUninit::uninit();
5391 let ptr = UNINIT.as_ptr();
5392 assert_eq!(
5393 ::core::mem::size_of::<playdate_sound_sampleplayer>(),
5394 136usize,
5395 concat!("Size of: ", stringify!(playdate_sound_sampleplayer))
5396 );
5397 assert_eq!(
5398 ::core::mem::align_of::<playdate_sound_sampleplayer>(),
5399 8usize,
5400 concat!("Alignment of ", stringify!(playdate_sound_sampleplayer))
5401 );
5402 assert_eq!(
5403 unsafe { ::core::ptr::addr_of!((*ptr).newPlayer) as usize - ptr as usize },
5404 0usize,
5405 concat!(
5406 "Offset of field: ",
5407 stringify!(playdate_sound_sampleplayer),
5408 "::",
5409 stringify!(newPlayer)
5410 )
5411 );
5412 assert_eq!(
5413 unsafe { ::core::ptr::addr_of!((*ptr).freePlayer) as usize - ptr as usize },
5414 8usize,
5415 concat!(
5416 "Offset of field: ",
5417 stringify!(playdate_sound_sampleplayer),
5418 "::",
5419 stringify!(freePlayer)
5420 )
5421 );
5422 assert_eq!(
5423 unsafe { ::core::ptr::addr_of!((*ptr).setSample) as usize - ptr as usize },
5424 16usize,
5425 concat!(
5426 "Offset of field: ",
5427 stringify!(playdate_sound_sampleplayer),
5428 "::",
5429 stringify!(setSample)
5430 )
5431 );
5432 assert_eq!(
5433 unsafe { ::core::ptr::addr_of!((*ptr).play) as usize - ptr as usize },
5434 24usize,
5435 concat!(
5436 "Offset of field: ",
5437 stringify!(playdate_sound_sampleplayer),
5438 "::",
5439 stringify!(play)
5440 )
5441 );
5442 assert_eq!(
5443 unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
5444 32usize,
5445 concat!(
5446 "Offset of field: ",
5447 stringify!(playdate_sound_sampleplayer),
5448 "::",
5449 stringify!(isPlaying)
5450 )
5451 );
5452 assert_eq!(
5453 unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
5454 40usize,
5455 concat!(
5456 "Offset of field: ",
5457 stringify!(playdate_sound_sampleplayer),
5458 "::",
5459 stringify!(stop)
5460 )
5461 );
5462 assert_eq!(
5463 unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
5464 48usize,
5465 concat!(
5466 "Offset of field: ",
5467 stringify!(playdate_sound_sampleplayer),
5468 "::",
5469 stringify!(setVolume)
5470 )
5471 );
5472 assert_eq!(
5473 unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
5474 56usize,
5475 concat!(
5476 "Offset of field: ",
5477 stringify!(playdate_sound_sampleplayer),
5478 "::",
5479 stringify!(getVolume)
5480 )
5481 );
5482 assert_eq!(
5483 unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
5484 64usize,
5485 concat!(
5486 "Offset of field: ",
5487 stringify!(playdate_sound_sampleplayer),
5488 "::",
5489 stringify!(getLength)
5490 )
5491 );
5492 assert_eq!(
5493 unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
5494 72usize,
5495 concat!(
5496 "Offset of field: ",
5497 stringify!(playdate_sound_sampleplayer),
5498 "::",
5499 stringify!(setOffset)
5500 )
5501 );
5502 assert_eq!(
5503 unsafe { ::core::ptr::addr_of!((*ptr).setRate) as usize - ptr as usize },
5504 80usize,
5505 concat!(
5506 "Offset of field: ",
5507 stringify!(playdate_sound_sampleplayer),
5508 "::",
5509 stringify!(setRate)
5510 )
5511 );
5512 assert_eq!(
5513 unsafe { ::core::ptr::addr_of!((*ptr).setPlayRange) as usize - ptr as usize },
5514 88usize,
5515 concat!(
5516 "Offset of field: ",
5517 stringify!(playdate_sound_sampleplayer),
5518 "::",
5519 stringify!(setPlayRange)
5520 )
5521 );
5522 assert_eq!(
5523 unsafe { ::core::ptr::addr_of!((*ptr).setFinishCallback) as usize - ptr as usize },
5524 96usize,
5525 concat!(
5526 "Offset of field: ",
5527 stringify!(playdate_sound_sampleplayer),
5528 "::",
5529 stringify!(setFinishCallback)
5530 )
5531 );
5532 assert_eq!(
5533 unsafe { ::core::ptr::addr_of!((*ptr).setLoopCallback) as usize - ptr as usize },
5534 104usize,
5535 concat!(
5536 "Offset of field: ",
5537 stringify!(playdate_sound_sampleplayer),
5538 "::",
5539 stringify!(setLoopCallback)
5540 )
5541 );
5542 assert_eq!(
5543 unsafe { ::core::ptr::addr_of!((*ptr).getOffset) as usize - ptr as usize },
5544 112usize,
5545 concat!(
5546 "Offset of field: ",
5547 stringify!(playdate_sound_sampleplayer),
5548 "::",
5549 stringify!(getOffset)
5550 )
5551 );
5552 assert_eq!(
5553 unsafe { ::core::ptr::addr_of!((*ptr).getRate) as usize - ptr as usize },
5554 120usize,
5555 concat!(
5556 "Offset of field: ",
5557 stringify!(playdate_sound_sampleplayer),
5558 "::",
5559 stringify!(getRate)
5560 )
5561 );
5562 assert_eq!(
5563 unsafe { ::core::ptr::addr_of!((*ptr).setPaused) as usize - ptr as usize },
5564 128usize,
5565 concat!(
5566 "Offset of field: ",
5567 stringify!(playdate_sound_sampleplayer),
5568 "::",
5569 stringify!(setPaused)
5570 )
5571 );
5572}
5573#[repr(C)]
5574#[derive(Debug, Copy, Clone)]
5575pub struct PDSynthSignalValue {
5576 _unused: [u8; 0],
5577}
5578#[repr(C)]
5579#[derive(Debug, Copy, Clone)]
5580pub struct PDSynthSignal {
5581 _unused: [u8; 0],
5582}
5583pub type signalStepFunc = ::core::option::Option<
5584 unsafe extern "C" fn(
5585 userdata: *mut ctypes::c_void,
5586 ioframes: *mut ctypes::c_int,
5587 ifval: *mut f32,
5588 ) -> f32,
5589>;
5590pub type signalNoteOnFunc = ::core::option::Option<
5591 unsafe extern "C" fn(userdata: *mut ctypes::c_void, note: MIDINote, vel: f32, len: f32),
5592>;
5593pub type signalNoteOffFunc = ::core::option::Option<
5594 unsafe extern "C" fn(
5595 userdata: *mut ctypes::c_void,
5596 stopped: ctypes::c_int,
5597 offset: ctypes::c_int,
5598 ),
5599>;
5600pub type signalDeallocFunc =
5601 ::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void)>;
5602#[repr(C)]
5603#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
5604pub struct playdate_sound_signal {
5605 pub newSignal: ::core::option::Option<
5606 unsafe extern "C" fn(
5607 step: signalStepFunc,
5608 noteOn: signalNoteOnFunc,
5609 noteOff: signalNoteOffFunc,
5610 dealloc: signalDeallocFunc,
5611 userdata: *mut ctypes::c_void,
5612 ) -> *mut PDSynthSignal,
5613 >,
5614 pub freeSignal: ::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal)>,
5615 pub getValue: ::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal) -> f32>,
5616 pub setValueScale:
5617 ::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal, scale: f32)>,
5618 pub setValueOffset:
5619 ::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal, offset: f32)>,
5620}
5621#[test]
5622fn bindgen_test_layout_playdate_sound_signal() {
5623 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_signal> =
5624 ::core::mem::MaybeUninit::uninit();
5625 let ptr = UNINIT.as_ptr();
5626 assert_eq!(
5627 ::core::mem::size_of::<playdate_sound_signal>(),
5628 40usize,
5629 concat!("Size of: ", stringify!(playdate_sound_signal))
5630 );
5631 assert_eq!(
5632 ::core::mem::align_of::<playdate_sound_signal>(),
5633 8usize,
5634 concat!("Alignment of ", stringify!(playdate_sound_signal))
5635 );
5636 assert_eq!(
5637 unsafe { ::core::ptr::addr_of!((*ptr).newSignal) as usize - ptr as usize },
5638 0usize,
5639 concat!(
5640 "Offset of field: ",
5641 stringify!(playdate_sound_signal),
5642 "::",
5643 stringify!(newSignal)
5644 )
5645 );
5646 assert_eq!(
5647 unsafe { ::core::ptr::addr_of!((*ptr).freeSignal) as usize - ptr as usize },
5648 8usize,
5649 concat!(
5650 "Offset of field: ",
5651 stringify!(playdate_sound_signal),
5652 "::",
5653 stringify!(freeSignal)
5654 )
5655 );
5656 assert_eq!(
5657 unsafe { ::core::ptr::addr_of!((*ptr).getValue) as usize - ptr as usize },
5658 16usize,
5659 concat!(
5660 "Offset of field: ",
5661 stringify!(playdate_sound_signal),
5662 "::",
5663 stringify!(getValue)
5664 )
5665 );
5666 assert_eq!(
5667 unsafe { ::core::ptr::addr_of!((*ptr).setValueScale) as usize - ptr as usize },
5668 24usize,
5669 concat!(
5670 "Offset of field: ",
5671 stringify!(playdate_sound_signal),
5672 "::",
5673 stringify!(setValueScale)
5674 )
5675 );
5676 assert_eq!(
5677 unsafe { ::core::ptr::addr_of!((*ptr).setValueOffset) as usize - ptr as usize },
5678 32usize,
5679 concat!(
5680 "Offset of field: ",
5681 stringify!(playdate_sound_signal),
5682 "::",
5683 stringify!(setValueOffset)
5684 )
5685 );
5686}
5687#[repr(u32)]
5688#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5689pub enum LFOType {
5690 kLFOTypeSquare = 0,
5691 kLFOTypeTriangle = 1,
5692 kLFOTypeSine = 2,
5693 kLFOTypeSampleAndHold = 3,
5694 kLFOTypeSawtoothUp = 4,
5695 kLFOTypeSawtoothDown = 5,
5696 kLFOTypeArpeggiator = 6,
5697 kLFOTypeFunction = 7,
5698}
5699#[repr(C)]
5700#[derive(Debug, Copy, Clone)]
5701pub struct PDSynthLFO {
5702 _unused: [u8; 0],
5703}
5704#[repr(C)]
5705#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
5706pub struct playdate_sound_lfo {
5707 pub newLFO: ::core::option::Option<unsafe extern "C" fn(type_: LFOType) -> *mut PDSynthLFO>,
5708 pub freeLFO: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO)>,
5709 pub setType: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, type_: LFOType)>,
5710 pub setRate: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, rate: f32)>,
5711 pub setPhase: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, phase: f32)>,
5712 pub setCenter: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, center: f32)>,
5713 pub setDepth: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, depth: f32)>,
5714 pub setArpeggiation: ::core::option::Option<
5715 unsafe extern "C" fn(lfo: *mut PDSynthLFO, nSteps: ctypes::c_int, steps: *mut f32),
5716 >,
5717 pub setFunction: ::core::option::Option<
5718 unsafe extern "C" fn(
5719 lfo: *mut PDSynthLFO,
5720 lfoFunc: ::core::option::Option<
5721 unsafe extern "C" fn(lfo: *mut PDSynthLFO, userdata: *mut ctypes::c_void) -> f32,
5722 >,
5723 userdata: *mut ctypes::c_void,
5724 interpolate: ctypes::c_int,
5725 ),
5726 >,
5727 pub setDelay: ::core::option::Option<
5728 unsafe extern "C" fn(lfo: *mut PDSynthLFO, holdoff: f32, ramptime: f32),
5729 >,
5730 pub setRetrigger:
5731 ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, flag: ctypes::c_int)>,
5732 pub getValue: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO) -> f32>,
5733 pub setGlobal:
5734 ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, global: ctypes::c_int)>,
5735}
5736#[test]
5737fn bindgen_test_layout_playdate_sound_lfo() {
5738 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_lfo> = ::core::mem::MaybeUninit::uninit();
5739 let ptr = UNINIT.as_ptr();
5740 assert_eq!(
5741 ::core::mem::size_of::<playdate_sound_lfo>(),
5742 104usize,
5743 concat!("Size of: ", stringify!(playdate_sound_lfo))
5744 );
5745 assert_eq!(
5746 ::core::mem::align_of::<playdate_sound_lfo>(),
5747 8usize,
5748 concat!("Alignment of ", stringify!(playdate_sound_lfo))
5749 );
5750 assert_eq!(
5751 unsafe { ::core::ptr::addr_of!((*ptr).newLFO) as usize - ptr as usize },
5752 0usize,
5753 concat!(
5754 "Offset of field: ",
5755 stringify!(playdate_sound_lfo),
5756 "::",
5757 stringify!(newLFO)
5758 )
5759 );
5760 assert_eq!(
5761 unsafe { ::core::ptr::addr_of!((*ptr).freeLFO) as usize - ptr as usize },
5762 8usize,
5763 concat!(
5764 "Offset of field: ",
5765 stringify!(playdate_sound_lfo),
5766 "::",
5767 stringify!(freeLFO)
5768 )
5769 );
5770 assert_eq!(
5771 unsafe { ::core::ptr::addr_of!((*ptr).setType) as usize - ptr as usize },
5772 16usize,
5773 concat!(
5774 "Offset of field: ",
5775 stringify!(playdate_sound_lfo),
5776 "::",
5777 stringify!(setType)
5778 )
5779 );
5780 assert_eq!(
5781 unsafe { ::core::ptr::addr_of!((*ptr).setRate) as usize - ptr as usize },
5782 24usize,
5783 concat!(
5784 "Offset of field: ",
5785 stringify!(playdate_sound_lfo),
5786 "::",
5787 stringify!(setRate)
5788 )
5789 );
5790 assert_eq!(
5791 unsafe { ::core::ptr::addr_of!((*ptr).setPhase) as usize - ptr as usize },
5792 32usize,
5793 concat!(
5794 "Offset of field: ",
5795 stringify!(playdate_sound_lfo),
5796 "::",
5797 stringify!(setPhase)
5798 )
5799 );
5800 assert_eq!(
5801 unsafe { ::core::ptr::addr_of!((*ptr).setCenter) as usize - ptr as usize },
5802 40usize,
5803 concat!(
5804 "Offset of field: ",
5805 stringify!(playdate_sound_lfo),
5806 "::",
5807 stringify!(setCenter)
5808 )
5809 );
5810 assert_eq!(
5811 unsafe { ::core::ptr::addr_of!((*ptr).setDepth) as usize - ptr as usize },
5812 48usize,
5813 concat!(
5814 "Offset of field: ",
5815 stringify!(playdate_sound_lfo),
5816 "::",
5817 stringify!(setDepth)
5818 )
5819 );
5820 assert_eq!(
5821 unsafe { ::core::ptr::addr_of!((*ptr).setArpeggiation) as usize - ptr as usize },
5822 56usize,
5823 concat!(
5824 "Offset of field: ",
5825 stringify!(playdate_sound_lfo),
5826 "::",
5827 stringify!(setArpeggiation)
5828 )
5829 );
5830 assert_eq!(
5831 unsafe { ::core::ptr::addr_of!((*ptr).setFunction) as usize - ptr as usize },
5832 64usize,
5833 concat!(
5834 "Offset of field: ",
5835 stringify!(playdate_sound_lfo),
5836 "::",
5837 stringify!(setFunction)
5838 )
5839 );
5840 assert_eq!(
5841 unsafe { ::core::ptr::addr_of!((*ptr).setDelay) as usize - ptr as usize },
5842 72usize,
5843 concat!(
5844 "Offset of field: ",
5845 stringify!(playdate_sound_lfo),
5846 "::",
5847 stringify!(setDelay)
5848 )
5849 );
5850 assert_eq!(
5851 unsafe { ::core::ptr::addr_of!((*ptr).setRetrigger) as usize - ptr as usize },
5852 80usize,
5853 concat!(
5854 "Offset of field: ",
5855 stringify!(playdate_sound_lfo),
5856 "::",
5857 stringify!(setRetrigger)
5858 )
5859 );
5860 assert_eq!(
5861 unsafe { ::core::ptr::addr_of!((*ptr).getValue) as usize - ptr as usize },
5862 88usize,
5863 concat!(
5864 "Offset of field: ",
5865 stringify!(playdate_sound_lfo),
5866 "::",
5867 stringify!(getValue)
5868 )
5869 );
5870 assert_eq!(
5871 unsafe { ::core::ptr::addr_of!((*ptr).setGlobal) as usize - ptr as usize },
5872 96usize,
5873 concat!(
5874 "Offset of field: ",
5875 stringify!(playdate_sound_lfo),
5876 "::",
5877 stringify!(setGlobal)
5878 )
5879 );
5880}
5881#[repr(C)]
5882#[derive(Debug, Copy, Clone)]
5883pub struct PDSynthEnvelope {
5884 _unused: [u8; 0],
5885}
5886#[repr(C)]
5887#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
5888pub struct playdate_sound_envelope {
5889 pub newEnvelope: ::core::option::Option<
5890 unsafe extern "C" fn(
5891 attack: f32,
5892 decay: f32,
5893 sustain: f32,
5894 release: f32,
5895 ) -> *mut PDSynthEnvelope,
5896 >,
5897 pub freeEnvelope: ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope)>,
5898 pub setAttack:
5899 ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, attack: f32)>,
5900 pub setDecay:
5901 ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, decay: f32)>,
5902 pub setSustain:
5903 ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, sustain: f32)>,
5904 pub setRelease:
5905 ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, release: f32)>,
5906 pub setLegato: ::core::option::Option<
5907 unsafe extern "C" fn(env: *mut PDSynthEnvelope, flag: ctypes::c_int),
5908 >,
5909 pub setRetrigger: ::core::option::Option<
5910 unsafe extern "C" fn(lfo: *mut PDSynthEnvelope, flag: ctypes::c_int),
5911 >,
5912 pub getValue: ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope) -> f32>,
5913 pub setCurvature:
5914 ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, amount: f32)>,
5915 pub setVelocitySensitivity:
5916 ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, velsens: f32)>,
5917 pub setRateScaling: ::core::option::Option<
5918 unsafe extern "C" fn(
5919 env: *mut PDSynthEnvelope,
5920 scaling: f32,
5921 start: MIDINote,
5922 end: MIDINote,
5923 ),
5924 >,
5925}
5926#[test]
5927fn bindgen_test_layout_playdate_sound_envelope() {
5928 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_envelope> =
5929 ::core::mem::MaybeUninit::uninit();
5930 let ptr = UNINIT.as_ptr();
5931 assert_eq!(
5932 ::core::mem::size_of::<playdate_sound_envelope>(),
5933 96usize,
5934 concat!("Size of: ", stringify!(playdate_sound_envelope))
5935 );
5936 assert_eq!(
5937 ::core::mem::align_of::<playdate_sound_envelope>(),
5938 8usize,
5939 concat!("Alignment of ", stringify!(playdate_sound_envelope))
5940 );
5941 assert_eq!(
5942 unsafe { ::core::ptr::addr_of!((*ptr).newEnvelope) as usize - ptr as usize },
5943 0usize,
5944 concat!(
5945 "Offset of field: ",
5946 stringify!(playdate_sound_envelope),
5947 "::",
5948 stringify!(newEnvelope)
5949 )
5950 );
5951 assert_eq!(
5952 unsafe { ::core::ptr::addr_of!((*ptr).freeEnvelope) as usize - ptr as usize },
5953 8usize,
5954 concat!(
5955 "Offset of field: ",
5956 stringify!(playdate_sound_envelope),
5957 "::",
5958 stringify!(freeEnvelope)
5959 )
5960 );
5961 assert_eq!(
5962 unsafe { ::core::ptr::addr_of!((*ptr).setAttack) as usize - ptr as usize },
5963 16usize,
5964 concat!(
5965 "Offset of field: ",
5966 stringify!(playdate_sound_envelope),
5967 "::",
5968 stringify!(setAttack)
5969 )
5970 );
5971 assert_eq!(
5972 unsafe { ::core::ptr::addr_of!((*ptr).setDecay) as usize - ptr as usize },
5973 24usize,
5974 concat!(
5975 "Offset of field: ",
5976 stringify!(playdate_sound_envelope),
5977 "::",
5978 stringify!(setDecay)
5979 )
5980 );
5981 assert_eq!(
5982 unsafe { ::core::ptr::addr_of!((*ptr).setSustain) as usize - ptr as usize },
5983 32usize,
5984 concat!(
5985 "Offset of field: ",
5986 stringify!(playdate_sound_envelope),
5987 "::",
5988 stringify!(setSustain)
5989 )
5990 );
5991 assert_eq!(
5992 unsafe { ::core::ptr::addr_of!((*ptr).setRelease) as usize - ptr as usize },
5993 40usize,
5994 concat!(
5995 "Offset of field: ",
5996 stringify!(playdate_sound_envelope),
5997 "::",
5998 stringify!(setRelease)
5999 )
6000 );
6001 assert_eq!(
6002 unsafe { ::core::ptr::addr_of!((*ptr).setLegato) as usize - ptr as usize },
6003 48usize,
6004 concat!(
6005 "Offset of field: ",
6006 stringify!(playdate_sound_envelope),
6007 "::",
6008 stringify!(setLegato)
6009 )
6010 );
6011 assert_eq!(
6012 unsafe { ::core::ptr::addr_of!((*ptr).setRetrigger) as usize - ptr as usize },
6013 56usize,
6014 concat!(
6015 "Offset of field: ",
6016 stringify!(playdate_sound_envelope),
6017 "::",
6018 stringify!(setRetrigger)
6019 )
6020 );
6021 assert_eq!(
6022 unsafe { ::core::ptr::addr_of!((*ptr).getValue) as usize - ptr as usize },
6023 64usize,
6024 concat!(
6025 "Offset of field: ",
6026 stringify!(playdate_sound_envelope),
6027 "::",
6028 stringify!(getValue)
6029 )
6030 );
6031 assert_eq!(
6032 unsafe { ::core::ptr::addr_of!((*ptr).setCurvature) as usize - ptr as usize },
6033 72usize,
6034 concat!(
6035 "Offset of field: ",
6036 stringify!(playdate_sound_envelope),
6037 "::",
6038 stringify!(setCurvature)
6039 )
6040 );
6041 assert_eq!(
6042 unsafe { ::core::ptr::addr_of!((*ptr).setVelocitySensitivity) as usize - ptr as usize },
6043 80usize,
6044 concat!(
6045 "Offset of field: ",
6046 stringify!(playdate_sound_envelope),
6047 "::",
6048 stringify!(setVelocitySensitivity)
6049 )
6050 );
6051 assert_eq!(
6052 unsafe { ::core::ptr::addr_of!((*ptr).setRateScaling) as usize - ptr as usize },
6053 88usize,
6054 concat!(
6055 "Offset of field: ",
6056 stringify!(playdate_sound_envelope),
6057 "::",
6058 stringify!(setRateScaling)
6059 )
6060 );
6061}
6062#[repr(u32)]
6063#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6064pub enum SoundWaveform {
6065 kWaveformSquare = 0,
6066 kWaveformTriangle = 1,
6067 kWaveformSine = 2,
6068 kWaveformNoise = 3,
6069 kWaveformSawtooth = 4,
6070 kWaveformPOPhase = 5,
6071 kWaveformPODigital = 6,
6072 kWaveformPOVosim = 7,
6073}
6074pub type synthRenderFunc = ::core::option::Option<
6075 unsafe extern "C" fn(
6076 userdata: *mut ctypes::c_void,
6077 left: *mut i32,
6078 right: *mut i32,
6079 nsamples: ctypes::c_int,
6080 rate: u32,
6081 drate: i32,
6082 ) -> ctypes::c_int,
6083>;
6084pub type synthNoteOnFunc = ::core::option::Option<
6085 unsafe extern "C" fn(userdata: *mut ctypes::c_void, note: MIDINote, velocity: f32, len: f32),
6086>;
6087pub type synthReleaseFunc = ::core::option::Option<
6088 unsafe extern "C" fn(userdata: *mut ctypes::c_void, stop: ctypes::c_int),
6089>;
6090pub type synthSetParameterFunc = ::core::option::Option<
6091 unsafe extern "C" fn(
6092 userdata: *mut ctypes::c_void,
6093 parameter: ctypes::c_int,
6094 value: f32,
6095 ) -> ctypes::c_int,
6096>;
6097pub type synthDeallocFunc =
6098 ::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void)>;
6099#[repr(C)]
6100#[derive(Debug, Copy, Clone)]
6101pub struct PDSynth {
6102 _unused: [u8; 0],
6103}
6104#[repr(C)]
6105#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
6106pub struct playdate_sound_synth {
6107 pub newSynth: ::core::option::Option<unsafe extern "C" fn() -> *mut PDSynth>,
6108 pub freeSynth: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth)>,
6109 pub setWaveform:
6110 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, wave: SoundWaveform)>,
6111 pub setGenerator: ::core::option::Option<
6112 unsafe extern "C" fn(
6113 synth: *mut PDSynth,
6114 stereo: ctypes::c_int,
6115 render: synthRenderFunc,
6116 noteOn: synthNoteOnFunc,
6117 release: synthReleaseFunc,
6118 setparam: synthSetParameterFunc,
6119 dealloc: synthDeallocFunc,
6120 userdata: *mut ctypes::c_void,
6121 ),
6122 >,
6123 pub setSample: ::core::option::Option<
6124 unsafe extern "C" fn(
6125 synth: *mut PDSynth,
6126 sample: *mut AudioSample,
6127 sustainStart: u32,
6128 sustainEnd: u32,
6129 ),
6130 >,
6131 pub setAttackTime:
6132 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, attack: f32)>,
6133 pub setDecayTime: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, decay: f32)>,
6134 pub setSustainLevel:
6135 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, sustain: f32)>,
6136 pub setReleaseTime:
6137 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, release: f32)>,
6138 pub setTranspose:
6139 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, halfSteps: f32)>,
6140 pub setFrequencyModulator: ::core::option::Option<
6141 unsafe extern "C" fn(synth: *mut PDSynth, mod_: *mut PDSynthSignalValue),
6142 >,
6143 pub getFrequencyModulator: ::core::option::Option<
6144 unsafe extern "C" fn(synth: *mut PDSynth) -> *mut PDSynthSignalValue,
6145 >,
6146 pub setAmplitudeModulator: ::core::option::Option<
6147 unsafe extern "C" fn(synth: *mut PDSynth, mod_: *mut PDSynthSignalValue),
6148 >,
6149 pub getAmplitudeModulator: ::core::option::Option<
6150 unsafe extern "C" fn(synth: *mut PDSynth) -> *mut PDSynthSignalValue,
6151 >,
6152 pub getParameterCount:
6153 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth) -> ctypes::c_int>,
6154 pub setParameter: ::core::option::Option<
6155 unsafe extern "C" fn(
6156 synth: *mut PDSynth,
6157 parameter: ctypes::c_int,
6158 value: f32,
6159 ) -> ctypes::c_int,
6160 >,
6161 pub setParameterModulator: ::core::option::Option<
6162 unsafe extern "C" fn(
6163 synth: *mut PDSynth,
6164 parameter: ctypes::c_int,
6165 mod_: *mut PDSynthSignalValue,
6166 ),
6167 >,
6168 pub getParameterModulator: ::core::option::Option<
6169 unsafe extern "C" fn(
6170 synth: *mut PDSynth,
6171 parameter: ctypes::c_int,
6172 ) -> *mut PDSynthSignalValue,
6173 >,
6174 pub playNote: ::core::option::Option<
6175 unsafe extern "C" fn(synth: *mut PDSynth, freq: f32, vel: f32, len: f32, when: u32),
6176 >,
6177 pub playMIDINote: ::core::option::Option<
6178 unsafe extern "C" fn(synth: *mut PDSynth, note: MIDINote, vel: f32, len: f32, when: u32),
6179 >,
6180 pub noteOff: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, when: u32)>,
6181 pub stop: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth)>,
6182 pub setVolume:
6183 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, left: f32, right: f32)>,
6184 pub getVolume: ::core::option::Option<
6185 unsafe extern "C" fn(synth: *mut PDSynth, left: *mut f32, right: *mut f32),
6186 >,
6187 pub isPlaying:
6188 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth) -> ctypes::c_int>,
6189 pub getEnvelope:
6190 ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth) -> *mut PDSynthEnvelope>,
6191}
6192#[test]
6193fn bindgen_test_layout_playdate_sound_synth() {
6194 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_synth> =
6195 ::core::mem::MaybeUninit::uninit();
6196 let ptr = UNINIT.as_ptr();
6197 assert_eq!(
6198 ::core::mem::size_of::<playdate_sound_synth>(),
6199 208usize,
6200 concat!("Size of: ", stringify!(playdate_sound_synth))
6201 );
6202 assert_eq!(
6203 ::core::mem::align_of::<playdate_sound_synth>(),
6204 8usize,
6205 concat!("Alignment of ", stringify!(playdate_sound_synth))
6206 );
6207 assert_eq!(
6208 unsafe { ::core::ptr::addr_of!((*ptr).newSynth) as usize - ptr as usize },
6209 0usize,
6210 concat!(
6211 "Offset of field: ",
6212 stringify!(playdate_sound_synth),
6213 "::",
6214 stringify!(newSynth)
6215 )
6216 );
6217 assert_eq!(
6218 unsafe { ::core::ptr::addr_of!((*ptr).freeSynth) as usize - ptr as usize },
6219 8usize,
6220 concat!(
6221 "Offset of field: ",
6222 stringify!(playdate_sound_synth),
6223 "::",
6224 stringify!(freeSynth)
6225 )
6226 );
6227 assert_eq!(
6228 unsafe { ::core::ptr::addr_of!((*ptr).setWaveform) as usize - ptr as usize },
6229 16usize,
6230 concat!(
6231 "Offset of field: ",
6232 stringify!(playdate_sound_synth),
6233 "::",
6234 stringify!(setWaveform)
6235 )
6236 );
6237 assert_eq!(
6238 unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize },
6239 24usize,
6240 concat!(
6241 "Offset of field: ",
6242 stringify!(playdate_sound_synth),
6243 "::",
6244 stringify!(setGenerator)
6245 )
6246 );
6247 assert_eq!(
6248 unsafe { ::core::ptr::addr_of!((*ptr).setSample) as usize - ptr as usize },
6249 32usize,
6250 concat!(
6251 "Offset of field: ",
6252 stringify!(playdate_sound_synth),
6253 "::",
6254 stringify!(setSample)
6255 )
6256 );
6257 assert_eq!(
6258 unsafe { ::core::ptr::addr_of!((*ptr).setAttackTime) as usize - ptr as usize },
6259 40usize,
6260 concat!(
6261 "Offset of field: ",
6262 stringify!(playdate_sound_synth),
6263 "::",
6264 stringify!(setAttackTime)
6265 )
6266 );
6267 assert_eq!(
6268 unsafe { ::core::ptr::addr_of!((*ptr).setDecayTime) as usize - ptr as usize },
6269 48usize,
6270 concat!(
6271 "Offset of field: ",
6272 stringify!(playdate_sound_synth),
6273 "::",
6274 stringify!(setDecayTime)
6275 )
6276 );
6277 assert_eq!(
6278 unsafe { ::core::ptr::addr_of!((*ptr).setSustainLevel) as usize - ptr as usize },
6279 56usize,
6280 concat!(
6281 "Offset of field: ",
6282 stringify!(playdate_sound_synth),
6283 "::",
6284 stringify!(setSustainLevel)
6285 )
6286 );
6287 assert_eq!(
6288 unsafe { ::core::ptr::addr_of!((*ptr).setReleaseTime) as usize - ptr as usize },
6289 64usize,
6290 concat!(
6291 "Offset of field: ",
6292 stringify!(playdate_sound_synth),
6293 "::",
6294 stringify!(setReleaseTime)
6295 )
6296 );
6297 assert_eq!(
6298 unsafe { ::core::ptr::addr_of!((*ptr).setTranspose) as usize - ptr as usize },
6299 72usize,
6300 concat!(
6301 "Offset of field: ",
6302 stringify!(playdate_sound_synth),
6303 "::",
6304 stringify!(setTranspose)
6305 )
6306 );
6307 assert_eq!(
6308 unsafe { ::core::ptr::addr_of!((*ptr).setFrequencyModulator) as usize - ptr as usize },
6309 80usize,
6310 concat!(
6311 "Offset of field: ",
6312 stringify!(playdate_sound_synth),
6313 "::",
6314 stringify!(setFrequencyModulator)
6315 )
6316 );
6317 assert_eq!(
6318 unsafe { ::core::ptr::addr_of!((*ptr).getFrequencyModulator) as usize - ptr as usize },
6319 88usize,
6320 concat!(
6321 "Offset of field: ",
6322 stringify!(playdate_sound_synth),
6323 "::",
6324 stringify!(getFrequencyModulator)
6325 )
6326 );
6327 assert_eq!(
6328 unsafe { ::core::ptr::addr_of!((*ptr).setAmplitudeModulator) as usize - ptr as usize },
6329 96usize,
6330 concat!(
6331 "Offset of field: ",
6332 stringify!(playdate_sound_synth),
6333 "::",
6334 stringify!(setAmplitudeModulator)
6335 )
6336 );
6337 assert_eq!(
6338 unsafe { ::core::ptr::addr_of!((*ptr).getAmplitudeModulator) as usize - ptr as usize },
6339 104usize,
6340 concat!(
6341 "Offset of field: ",
6342 stringify!(playdate_sound_synth),
6343 "::",
6344 stringify!(getAmplitudeModulator)
6345 )
6346 );
6347 assert_eq!(
6348 unsafe { ::core::ptr::addr_of!((*ptr).getParameterCount) as usize - ptr as usize },
6349 112usize,
6350 concat!(
6351 "Offset of field: ",
6352 stringify!(playdate_sound_synth),
6353 "::",
6354 stringify!(getParameterCount)
6355 )
6356 );
6357 assert_eq!(
6358 unsafe { ::core::ptr::addr_of!((*ptr).setParameter) as usize - ptr as usize },
6359 120usize,
6360 concat!(
6361 "Offset of field: ",
6362 stringify!(playdate_sound_synth),
6363 "::",
6364 stringify!(setParameter)
6365 )
6366 );
6367 assert_eq!(
6368 unsafe { ::core::ptr::addr_of!((*ptr).setParameterModulator) as usize - ptr as usize },
6369 128usize,
6370 concat!(
6371 "Offset of field: ",
6372 stringify!(playdate_sound_synth),
6373 "::",
6374 stringify!(setParameterModulator)
6375 )
6376 );
6377 assert_eq!(
6378 unsafe { ::core::ptr::addr_of!((*ptr).getParameterModulator) as usize - ptr as usize },
6379 136usize,
6380 concat!(
6381 "Offset of field: ",
6382 stringify!(playdate_sound_synth),
6383 "::",
6384 stringify!(getParameterModulator)
6385 )
6386 );
6387 assert_eq!(
6388 unsafe { ::core::ptr::addr_of!((*ptr).playNote) as usize - ptr as usize },
6389 144usize,
6390 concat!(
6391 "Offset of field: ",
6392 stringify!(playdate_sound_synth),
6393 "::",
6394 stringify!(playNote)
6395 )
6396 );
6397 assert_eq!(
6398 unsafe { ::core::ptr::addr_of!((*ptr).playMIDINote) as usize - ptr as usize },
6399 152usize,
6400 concat!(
6401 "Offset of field: ",
6402 stringify!(playdate_sound_synth),
6403 "::",
6404 stringify!(playMIDINote)
6405 )
6406 );
6407 assert_eq!(
6408 unsafe { ::core::ptr::addr_of!((*ptr).noteOff) as usize - ptr as usize },
6409 160usize,
6410 concat!(
6411 "Offset of field: ",
6412 stringify!(playdate_sound_synth),
6413 "::",
6414 stringify!(noteOff)
6415 )
6416 );
6417 assert_eq!(
6418 unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
6419 168usize,
6420 concat!(
6421 "Offset of field: ",
6422 stringify!(playdate_sound_synth),
6423 "::",
6424 stringify!(stop)
6425 )
6426 );
6427 assert_eq!(
6428 unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
6429 176usize,
6430 concat!(
6431 "Offset of field: ",
6432 stringify!(playdate_sound_synth),
6433 "::",
6434 stringify!(setVolume)
6435 )
6436 );
6437 assert_eq!(
6438 unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
6439 184usize,
6440 concat!(
6441 "Offset of field: ",
6442 stringify!(playdate_sound_synth),
6443 "::",
6444 stringify!(getVolume)
6445 )
6446 );
6447 assert_eq!(
6448 unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
6449 192usize,
6450 concat!(
6451 "Offset of field: ",
6452 stringify!(playdate_sound_synth),
6453 "::",
6454 stringify!(isPlaying)
6455 )
6456 );
6457 assert_eq!(
6458 unsafe { ::core::ptr::addr_of!((*ptr).getEnvelope) as usize - ptr as usize },
6459 200usize,
6460 concat!(
6461 "Offset of field: ",
6462 stringify!(playdate_sound_synth),
6463 "::",
6464 stringify!(getEnvelope)
6465 )
6466 );
6467}
6468#[repr(C)]
6469#[derive(Debug, Copy, Clone)]
6470pub struct ControlSignal {
6471 _unused: [u8; 0],
6472}
6473#[repr(C)]
6474#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
6475pub struct playdate_control_signal {
6476 pub newSignal: ::core::option::Option<unsafe extern "C" fn() -> *mut ControlSignal>,
6477 pub freeSignal: ::core::option::Option<unsafe extern "C" fn(signal: *mut ControlSignal)>,
6478 pub clearEvents: ::core::option::Option<unsafe extern "C" fn(control: *mut ControlSignal)>,
6479 pub addEvent: ::core::option::Option<
6480 unsafe extern "C" fn(
6481 control: *mut ControlSignal,
6482 step: ctypes::c_int,
6483 value: f32,
6484 interpolate: ctypes::c_int,
6485 ),
6486 >,
6487 pub removeEvent: ::core::option::Option<
6488 unsafe extern "C" fn(control: *mut ControlSignal, step: ctypes::c_int),
6489 >,
6490 pub getMIDIControllerNumber:
6491 ::core::option::Option<unsafe extern "C" fn(control: *mut ControlSignal) -> ctypes::c_int>,
6492}
6493#[test]
6494fn bindgen_test_layout_playdate_control_signal() {
6495 const UNINIT: ::core::mem::MaybeUninit<playdate_control_signal> =
6496 ::core::mem::MaybeUninit::uninit();
6497 let ptr = UNINIT.as_ptr();
6498 assert_eq!(
6499 ::core::mem::size_of::<playdate_control_signal>(),
6500 48usize,
6501 concat!("Size of: ", stringify!(playdate_control_signal))
6502 );
6503 assert_eq!(
6504 ::core::mem::align_of::<playdate_control_signal>(),
6505 8usize,
6506 concat!("Alignment of ", stringify!(playdate_control_signal))
6507 );
6508 assert_eq!(
6509 unsafe { ::core::ptr::addr_of!((*ptr).newSignal) as usize - ptr as usize },
6510 0usize,
6511 concat!(
6512 "Offset of field: ",
6513 stringify!(playdate_control_signal),
6514 "::",
6515 stringify!(newSignal)
6516 )
6517 );
6518 assert_eq!(
6519 unsafe { ::core::ptr::addr_of!((*ptr).freeSignal) as usize - ptr as usize },
6520 8usize,
6521 concat!(
6522 "Offset of field: ",
6523 stringify!(playdate_control_signal),
6524 "::",
6525 stringify!(freeSignal)
6526 )
6527 );
6528 assert_eq!(
6529 unsafe { ::core::ptr::addr_of!((*ptr).clearEvents) as usize - ptr as usize },
6530 16usize,
6531 concat!(
6532 "Offset of field: ",
6533 stringify!(playdate_control_signal),
6534 "::",
6535 stringify!(clearEvents)
6536 )
6537 );
6538 assert_eq!(
6539 unsafe { ::core::ptr::addr_of!((*ptr).addEvent) as usize - ptr as usize },
6540 24usize,
6541 concat!(
6542 "Offset of field: ",
6543 stringify!(playdate_control_signal),
6544 "::",
6545 stringify!(addEvent)
6546 )
6547 );
6548 assert_eq!(
6549 unsafe { ::core::ptr::addr_of!((*ptr).removeEvent) as usize - ptr as usize },
6550 32usize,
6551 concat!(
6552 "Offset of field: ",
6553 stringify!(playdate_control_signal),
6554 "::",
6555 stringify!(removeEvent)
6556 )
6557 );
6558 assert_eq!(
6559 unsafe { ::core::ptr::addr_of!((*ptr).getMIDIControllerNumber) as usize - ptr as usize },
6560 40usize,
6561 concat!(
6562 "Offset of field: ",
6563 stringify!(playdate_control_signal),
6564 "::",
6565 stringify!(getMIDIControllerNumber)
6566 )
6567 );
6568}
6569#[repr(C)]
6570#[derive(Debug, Copy, Clone)]
6571pub struct PDSynthInstrument {
6572 _unused: [u8; 0],
6573}
6574#[repr(C)]
6575#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
6576pub struct playdate_sound_instrument {
6577 pub newInstrument: ::core::option::Option<unsafe extern "C" fn() -> *mut PDSynthInstrument>,
6578 pub freeInstrument: ::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument)>,
6579 pub addVoice: ::core::option::Option<
6580 unsafe extern "C" fn(
6581 inst: *mut PDSynthInstrument,
6582 synth: *mut PDSynth,
6583 rangeStart: MIDINote,
6584 rangeEnd: MIDINote,
6585 transpose: f32,
6586 ) -> ctypes::c_int,
6587 >,
6588 pub playNote: ::core::option::Option<
6589 unsafe extern "C" fn(
6590 inst: *mut PDSynthInstrument,
6591 frequency: f32,
6592 vel: f32,
6593 len: f32,
6594 when: u32,
6595 ) -> *mut PDSynth,
6596 >,
6597 pub playMIDINote: ::core::option::Option<
6598 unsafe extern "C" fn(
6599 inst: *mut PDSynthInstrument,
6600 note: MIDINote,
6601 vel: f32,
6602 len: f32,
6603 when: u32,
6604 ) -> *mut PDSynth,
6605 >,
6606 pub setPitchBend:
6607 ::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, bend: f32)>,
6608 pub setPitchBendRange:
6609 ::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, halfSteps: f32)>,
6610 pub setTranspose:
6611 ::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, halfSteps: f32)>,
6612 pub noteOff: ::core::option::Option<
6613 unsafe extern "C" fn(inst: *mut PDSynthInstrument, note: MIDINote, when: u32),
6614 >,
6615 pub allNotesOff:
6616 ::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, when: u32)>,
6617 pub setVolume: ::core::option::Option<
6618 unsafe extern "C" fn(inst: *mut PDSynthInstrument, left: f32, right: f32),
6619 >,
6620 pub getVolume: ::core::option::Option<
6621 unsafe extern "C" fn(inst: *mut PDSynthInstrument, left: *mut f32, right: *mut f32),
6622 >,
6623 pub activeVoiceCount:
6624 ::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument) -> ctypes::c_int>,
6625}
6626#[test]
6627fn bindgen_test_layout_playdate_sound_instrument() {
6628 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_instrument> =
6629 ::core::mem::MaybeUninit::uninit();
6630 let ptr = UNINIT.as_ptr();
6631 assert_eq!(
6632 ::core::mem::size_of::<playdate_sound_instrument>(),
6633 104usize,
6634 concat!("Size of: ", stringify!(playdate_sound_instrument))
6635 );
6636 assert_eq!(
6637 ::core::mem::align_of::<playdate_sound_instrument>(),
6638 8usize,
6639 concat!("Alignment of ", stringify!(playdate_sound_instrument))
6640 );
6641 assert_eq!(
6642 unsafe { ::core::ptr::addr_of!((*ptr).newInstrument) as usize - ptr as usize },
6643 0usize,
6644 concat!(
6645 "Offset of field: ",
6646 stringify!(playdate_sound_instrument),
6647 "::",
6648 stringify!(newInstrument)
6649 )
6650 );
6651 assert_eq!(
6652 unsafe { ::core::ptr::addr_of!((*ptr).freeInstrument) as usize - ptr as usize },
6653 8usize,
6654 concat!(
6655 "Offset of field: ",
6656 stringify!(playdate_sound_instrument),
6657 "::",
6658 stringify!(freeInstrument)
6659 )
6660 );
6661 assert_eq!(
6662 unsafe { ::core::ptr::addr_of!((*ptr).addVoice) as usize - ptr as usize },
6663 16usize,
6664 concat!(
6665 "Offset of field: ",
6666 stringify!(playdate_sound_instrument),
6667 "::",
6668 stringify!(addVoice)
6669 )
6670 );
6671 assert_eq!(
6672 unsafe { ::core::ptr::addr_of!((*ptr).playNote) as usize - ptr as usize },
6673 24usize,
6674 concat!(
6675 "Offset of field: ",
6676 stringify!(playdate_sound_instrument),
6677 "::",
6678 stringify!(playNote)
6679 )
6680 );
6681 assert_eq!(
6682 unsafe { ::core::ptr::addr_of!((*ptr).playMIDINote) as usize - ptr as usize },
6683 32usize,
6684 concat!(
6685 "Offset of field: ",
6686 stringify!(playdate_sound_instrument),
6687 "::",
6688 stringify!(playMIDINote)
6689 )
6690 );
6691 assert_eq!(
6692 unsafe { ::core::ptr::addr_of!((*ptr).setPitchBend) as usize - ptr as usize },
6693 40usize,
6694 concat!(
6695 "Offset of field: ",
6696 stringify!(playdate_sound_instrument),
6697 "::",
6698 stringify!(setPitchBend)
6699 )
6700 );
6701 assert_eq!(
6702 unsafe { ::core::ptr::addr_of!((*ptr).setPitchBendRange) as usize - ptr as usize },
6703 48usize,
6704 concat!(
6705 "Offset of field: ",
6706 stringify!(playdate_sound_instrument),
6707 "::",
6708 stringify!(setPitchBendRange)
6709 )
6710 );
6711 assert_eq!(
6712 unsafe { ::core::ptr::addr_of!((*ptr).setTranspose) as usize - ptr as usize },
6713 56usize,
6714 concat!(
6715 "Offset of field: ",
6716 stringify!(playdate_sound_instrument),
6717 "::",
6718 stringify!(setTranspose)
6719 )
6720 );
6721 assert_eq!(
6722 unsafe { ::core::ptr::addr_of!((*ptr).noteOff) as usize - ptr as usize },
6723 64usize,
6724 concat!(
6725 "Offset of field: ",
6726 stringify!(playdate_sound_instrument),
6727 "::",
6728 stringify!(noteOff)
6729 )
6730 );
6731 assert_eq!(
6732 unsafe { ::core::ptr::addr_of!((*ptr).allNotesOff) as usize - ptr as usize },
6733 72usize,
6734 concat!(
6735 "Offset of field: ",
6736 stringify!(playdate_sound_instrument),
6737 "::",
6738 stringify!(allNotesOff)
6739 )
6740 );
6741 assert_eq!(
6742 unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
6743 80usize,
6744 concat!(
6745 "Offset of field: ",
6746 stringify!(playdate_sound_instrument),
6747 "::",
6748 stringify!(setVolume)
6749 )
6750 );
6751 assert_eq!(
6752 unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
6753 88usize,
6754 concat!(
6755 "Offset of field: ",
6756 stringify!(playdate_sound_instrument),
6757 "::",
6758 stringify!(getVolume)
6759 )
6760 );
6761 assert_eq!(
6762 unsafe { ::core::ptr::addr_of!((*ptr).activeVoiceCount) as usize - ptr as usize },
6763 96usize,
6764 concat!(
6765 "Offset of field: ",
6766 stringify!(playdate_sound_instrument),
6767 "::",
6768 stringify!(activeVoiceCount)
6769 )
6770 );
6771}
6772#[repr(C)]
6773#[derive(Debug, Copy, Clone)]
6774pub struct SequenceTrack {
6775 _unused: [u8; 0],
6776}
6777#[repr(C)]
6778#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
6779pub struct playdate_sound_track {
6780 pub newTrack: ::core::option::Option<unsafe extern "C" fn() -> *mut SequenceTrack>,
6781 pub freeTrack: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack)>,
6782 pub setInstrument: ::core::option::Option<
6783 unsafe extern "C" fn(track: *mut SequenceTrack, inst: *mut PDSynthInstrument),
6784 >,
6785 pub getInstrument: ::core::option::Option<
6786 unsafe extern "C" fn(track: *mut SequenceTrack) -> *mut PDSynthInstrument,
6787 >,
6788 pub addNoteEvent: ::core::option::Option<
6789 unsafe extern "C" fn(
6790 track: *mut SequenceTrack,
6791 step: u32,
6792 len: u32,
6793 note: MIDINote,
6794 velocity: f32,
6795 ),
6796 >,
6797 pub removeNoteEvent: ::core::option::Option<
6798 unsafe extern "C" fn(track: *mut SequenceTrack, step: u32, note: MIDINote),
6799 >,
6800 pub clearNotes: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack)>,
6801 pub getControlSignalCount:
6802 ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> ctypes::c_int>,
6803 pub getControlSignal: ::core::option::Option<
6804 unsafe extern "C" fn(track: *mut SequenceTrack, idx: ctypes::c_int) -> *mut ControlSignal,
6805 >,
6806 pub clearControlEvents: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack)>,
6807 pub getPolyphony:
6808 ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> ctypes::c_int>,
6809 pub activeVoiceCount:
6810 ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> ctypes::c_int>,
6811 pub setMuted: ::core::option::Option<
6812 unsafe extern "C" fn(track: *mut SequenceTrack, mute: ctypes::c_int),
6813 >,
6814 pub getLength: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> u32>,
6815 pub getIndexForStep: ::core::option::Option<
6816 unsafe extern "C" fn(track: *mut SequenceTrack, step: u32) -> ctypes::c_int,
6817 >,
6818 pub getNoteAtIndex: ::core::option::Option<
6819 unsafe extern "C" fn(
6820 track: *mut SequenceTrack,
6821 index: ctypes::c_int,
6822 outStep: *mut u32,
6823 outLen: *mut u32,
6824 outNote: *mut MIDINote,
6825 outVelocity: *mut f32,
6826 ) -> ctypes::c_int,
6827 >,
6828 pub getSignalForController: ::core::option::Option<
6829 unsafe extern "C" fn(
6830 track: *mut SequenceTrack,
6831 controller: ctypes::c_int,
6832 create: ctypes::c_int,
6833 ) -> *mut ControlSignal,
6834 >,
6835}
6836#[test]
6837fn bindgen_test_layout_playdate_sound_track() {
6838 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_track> =
6839 ::core::mem::MaybeUninit::uninit();
6840 let ptr = UNINIT.as_ptr();
6841 assert_eq!(
6842 ::core::mem::size_of::<playdate_sound_track>(),
6843 136usize,
6844 concat!("Size of: ", stringify!(playdate_sound_track))
6845 );
6846 assert_eq!(
6847 ::core::mem::align_of::<playdate_sound_track>(),
6848 8usize,
6849 concat!("Alignment of ", stringify!(playdate_sound_track))
6850 );
6851 assert_eq!(
6852 unsafe { ::core::ptr::addr_of!((*ptr).newTrack) as usize - ptr as usize },
6853 0usize,
6854 concat!(
6855 "Offset of field: ",
6856 stringify!(playdate_sound_track),
6857 "::",
6858 stringify!(newTrack)
6859 )
6860 );
6861 assert_eq!(
6862 unsafe { ::core::ptr::addr_of!((*ptr).freeTrack) as usize - ptr as usize },
6863 8usize,
6864 concat!(
6865 "Offset of field: ",
6866 stringify!(playdate_sound_track),
6867 "::",
6868 stringify!(freeTrack)
6869 )
6870 );
6871 assert_eq!(
6872 unsafe { ::core::ptr::addr_of!((*ptr).setInstrument) as usize - ptr as usize },
6873 16usize,
6874 concat!(
6875 "Offset of field: ",
6876 stringify!(playdate_sound_track),
6877 "::",
6878 stringify!(setInstrument)
6879 )
6880 );
6881 assert_eq!(
6882 unsafe { ::core::ptr::addr_of!((*ptr).getInstrument) as usize - ptr as usize },
6883 24usize,
6884 concat!(
6885 "Offset of field: ",
6886 stringify!(playdate_sound_track),
6887 "::",
6888 stringify!(getInstrument)
6889 )
6890 );
6891 assert_eq!(
6892 unsafe { ::core::ptr::addr_of!((*ptr).addNoteEvent) as usize - ptr as usize },
6893 32usize,
6894 concat!(
6895 "Offset of field: ",
6896 stringify!(playdate_sound_track),
6897 "::",
6898 stringify!(addNoteEvent)
6899 )
6900 );
6901 assert_eq!(
6902 unsafe { ::core::ptr::addr_of!((*ptr).removeNoteEvent) as usize - ptr as usize },
6903 40usize,
6904 concat!(
6905 "Offset of field: ",
6906 stringify!(playdate_sound_track),
6907 "::",
6908 stringify!(removeNoteEvent)
6909 )
6910 );
6911 assert_eq!(
6912 unsafe { ::core::ptr::addr_of!((*ptr).clearNotes) as usize - ptr as usize },
6913 48usize,
6914 concat!(
6915 "Offset of field: ",
6916 stringify!(playdate_sound_track),
6917 "::",
6918 stringify!(clearNotes)
6919 )
6920 );
6921 assert_eq!(
6922 unsafe { ::core::ptr::addr_of!((*ptr).getControlSignalCount) as usize - ptr as usize },
6923 56usize,
6924 concat!(
6925 "Offset of field: ",
6926 stringify!(playdate_sound_track),
6927 "::",
6928 stringify!(getControlSignalCount)
6929 )
6930 );
6931 assert_eq!(
6932 unsafe { ::core::ptr::addr_of!((*ptr).getControlSignal) as usize - ptr as usize },
6933 64usize,
6934 concat!(
6935 "Offset of field: ",
6936 stringify!(playdate_sound_track),
6937 "::",
6938 stringify!(getControlSignal)
6939 )
6940 );
6941 assert_eq!(
6942 unsafe { ::core::ptr::addr_of!((*ptr).clearControlEvents) as usize - ptr as usize },
6943 72usize,
6944 concat!(
6945 "Offset of field: ",
6946 stringify!(playdate_sound_track),
6947 "::",
6948 stringify!(clearControlEvents)
6949 )
6950 );
6951 assert_eq!(
6952 unsafe { ::core::ptr::addr_of!((*ptr).getPolyphony) as usize - ptr as usize },
6953 80usize,
6954 concat!(
6955 "Offset of field: ",
6956 stringify!(playdate_sound_track),
6957 "::",
6958 stringify!(getPolyphony)
6959 )
6960 );
6961 assert_eq!(
6962 unsafe { ::core::ptr::addr_of!((*ptr).activeVoiceCount) as usize - ptr as usize },
6963 88usize,
6964 concat!(
6965 "Offset of field: ",
6966 stringify!(playdate_sound_track),
6967 "::",
6968 stringify!(activeVoiceCount)
6969 )
6970 );
6971 assert_eq!(
6972 unsafe { ::core::ptr::addr_of!((*ptr).setMuted) as usize - ptr as usize },
6973 96usize,
6974 concat!(
6975 "Offset of field: ",
6976 stringify!(playdate_sound_track),
6977 "::",
6978 stringify!(setMuted)
6979 )
6980 );
6981 assert_eq!(
6982 unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
6983 104usize,
6984 concat!(
6985 "Offset of field: ",
6986 stringify!(playdate_sound_track),
6987 "::",
6988 stringify!(getLength)
6989 )
6990 );
6991 assert_eq!(
6992 unsafe { ::core::ptr::addr_of!((*ptr).getIndexForStep) as usize - ptr as usize },
6993 112usize,
6994 concat!(
6995 "Offset of field: ",
6996 stringify!(playdate_sound_track),
6997 "::",
6998 stringify!(getIndexForStep)
6999 )
7000 );
7001 assert_eq!(
7002 unsafe { ::core::ptr::addr_of!((*ptr).getNoteAtIndex) as usize - ptr as usize },
7003 120usize,
7004 concat!(
7005 "Offset of field: ",
7006 stringify!(playdate_sound_track),
7007 "::",
7008 stringify!(getNoteAtIndex)
7009 )
7010 );
7011 assert_eq!(
7012 unsafe { ::core::ptr::addr_of!((*ptr).getSignalForController) as usize - ptr as usize },
7013 128usize,
7014 concat!(
7015 "Offset of field: ",
7016 stringify!(playdate_sound_track),
7017 "::",
7018 stringify!(getSignalForController)
7019 )
7020 );
7021}
7022#[repr(C)]
7023#[derive(Debug, Copy, Clone)]
7024pub struct SoundSequence {
7025 _unused: [u8; 0],
7026}
7027pub type SequenceFinishedCallback = ::core::option::Option<
7028 unsafe extern "C" fn(seq: *mut SoundSequence, userdata: *mut ctypes::c_void),
7029>;
7030#[repr(C)]
7031#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
7032pub struct playdate_sound_sequence {
7033 pub newSequence: ::core::option::Option<unsafe extern "C" fn() -> *mut SoundSequence>,
7034 pub freeSequence: ::core::option::Option<unsafe extern "C" fn(sequence: *mut SoundSequence)>,
7035 pub loadMidiFile: ::core::option::Option<
7036 unsafe extern "C" fn(seq: *mut SoundSequence, path: *const ctypes::c_char) -> ctypes::c_int,
7037 >,
7038 pub getTime: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> u32>,
7039 pub setTime: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence, time: u32)>,
7040 pub setLoops: ::core::option::Option<
7041 unsafe extern "C" fn(
7042 seq: *mut SoundSequence,
7043 loopstart: ctypes::c_int,
7044 loopend: ctypes::c_int,
7045 loops: ctypes::c_int,
7046 ),
7047 >,
7048 pub getTempo:
7049 ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> ctypes::c_int>,
7050 pub setTempo: ::core::option::Option<
7051 unsafe extern "C" fn(seq: *mut SoundSequence, stepsPerSecond: ctypes::c_int),
7052 >,
7053 pub getTrackCount:
7054 ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> ctypes::c_int>,
7055 pub addTrack:
7056 ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> *mut SequenceTrack>,
7057 pub getTrackAtIndex: ::core::option::Option<
7058 unsafe extern "C" fn(seq: *mut SoundSequence, track: ctypes::c_uint) -> *mut SequenceTrack,
7059 >,
7060 pub setTrackAtIndex: ::core::option::Option<
7061 unsafe extern "C" fn(
7062 seq: *mut SoundSequence,
7063 track: *mut SequenceTrack,
7064 idx: ctypes::c_uint,
7065 ),
7066 >,
7067 pub allNotesOff: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence)>,
7068 pub isPlaying:
7069 ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> ctypes::c_int>,
7070 pub getLength: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> u32>,
7071 pub play: ::core::option::Option<
7072 unsafe extern "C" fn(
7073 seq: *mut SoundSequence,
7074 finishCallback: SequenceFinishedCallback,
7075 userdata: *mut ctypes::c_void,
7076 ),
7077 >,
7078 pub stop: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence)>,
7079 pub getCurrentStep: ::core::option::Option<
7080 unsafe extern "C" fn(
7081 seq: *mut SoundSequence,
7082 timeOffset: *mut ctypes::c_int,
7083 ) -> ctypes::c_int,
7084 >,
7085 pub setCurrentStep: ::core::option::Option<
7086 unsafe extern "C" fn(
7087 seq: *mut SoundSequence,
7088 step: ctypes::c_int,
7089 timeOffset: ctypes::c_int,
7090 playNotes: ctypes::c_int,
7091 ),
7092 >,
7093}
7094#[test]
7095fn bindgen_test_layout_playdate_sound_sequence() {
7096 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_sequence> =
7097 ::core::mem::MaybeUninit::uninit();
7098 let ptr = UNINIT.as_ptr();
7099 assert_eq!(
7100 ::core::mem::size_of::<playdate_sound_sequence>(),
7101 152usize,
7102 concat!("Size of: ", stringify!(playdate_sound_sequence))
7103 );
7104 assert_eq!(
7105 ::core::mem::align_of::<playdate_sound_sequence>(),
7106 8usize,
7107 concat!("Alignment of ", stringify!(playdate_sound_sequence))
7108 );
7109 assert_eq!(
7110 unsafe { ::core::ptr::addr_of!((*ptr).newSequence) as usize - ptr as usize },
7111 0usize,
7112 concat!(
7113 "Offset of field: ",
7114 stringify!(playdate_sound_sequence),
7115 "::",
7116 stringify!(newSequence)
7117 )
7118 );
7119 assert_eq!(
7120 unsafe { ::core::ptr::addr_of!((*ptr).freeSequence) as usize - ptr as usize },
7121 8usize,
7122 concat!(
7123 "Offset of field: ",
7124 stringify!(playdate_sound_sequence),
7125 "::",
7126 stringify!(freeSequence)
7127 )
7128 );
7129 assert_eq!(
7130 unsafe { ::core::ptr::addr_of!((*ptr).loadMidiFile) as usize - ptr as usize },
7131 16usize,
7132 concat!(
7133 "Offset of field: ",
7134 stringify!(playdate_sound_sequence),
7135 "::",
7136 stringify!(loadMidiFile)
7137 )
7138 );
7139 assert_eq!(
7140 unsafe { ::core::ptr::addr_of!((*ptr).getTime) as usize - ptr as usize },
7141 24usize,
7142 concat!(
7143 "Offset of field: ",
7144 stringify!(playdate_sound_sequence),
7145 "::",
7146 stringify!(getTime)
7147 )
7148 );
7149 assert_eq!(
7150 unsafe { ::core::ptr::addr_of!((*ptr).setTime) as usize - ptr as usize },
7151 32usize,
7152 concat!(
7153 "Offset of field: ",
7154 stringify!(playdate_sound_sequence),
7155 "::",
7156 stringify!(setTime)
7157 )
7158 );
7159 assert_eq!(
7160 unsafe { ::core::ptr::addr_of!((*ptr).setLoops) as usize - ptr as usize },
7161 40usize,
7162 concat!(
7163 "Offset of field: ",
7164 stringify!(playdate_sound_sequence),
7165 "::",
7166 stringify!(setLoops)
7167 )
7168 );
7169 assert_eq!(
7170 unsafe { ::core::ptr::addr_of!((*ptr).getTempo) as usize - ptr as usize },
7171 48usize,
7172 concat!(
7173 "Offset of field: ",
7174 stringify!(playdate_sound_sequence),
7175 "::",
7176 stringify!(getTempo)
7177 )
7178 );
7179 assert_eq!(
7180 unsafe { ::core::ptr::addr_of!((*ptr).setTempo) as usize - ptr as usize },
7181 56usize,
7182 concat!(
7183 "Offset of field: ",
7184 stringify!(playdate_sound_sequence),
7185 "::",
7186 stringify!(setTempo)
7187 )
7188 );
7189 assert_eq!(
7190 unsafe { ::core::ptr::addr_of!((*ptr).getTrackCount) as usize - ptr as usize },
7191 64usize,
7192 concat!(
7193 "Offset of field: ",
7194 stringify!(playdate_sound_sequence),
7195 "::",
7196 stringify!(getTrackCount)
7197 )
7198 );
7199 assert_eq!(
7200 unsafe { ::core::ptr::addr_of!((*ptr).addTrack) as usize - ptr as usize },
7201 72usize,
7202 concat!(
7203 "Offset of field: ",
7204 stringify!(playdate_sound_sequence),
7205 "::",
7206 stringify!(addTrack)
7207 )
7208 );
7209 assert_eq!(
7210 unsafe { ::core::ptr::addr_of!((*ptr).getTrackAtIndex) as usize - ptr as usize },
7211 80usize,
7212 concat!(
7213 "Offset of field: ",
7214 stringify!(playdate_sound_sequence),
7215 "::",
7216 stringify!(getTrackAtIndex)
7217 )
7218 );
7219 assert_eq!(
7220 unsafe { ::core::ptr::addr_of!((*ptr).setTrackAtIndex) as usize - ptr as usize },
7221 88usize,
7222 concat!(
7223 "Offset of field: ",
7224 stringify!(playdate_sound_sequence),
7225 "::",
7226 stringify!(setTrackAtIndex)
7227 )
7228 );
7229 assert_eq!(
7230 unsafe { ::core::ptr::addr_of!((*ptr).allNotesOff) as usize - ptr as usize },
7231 96usize,
7232 concat!(
7233 "Offset of field: ",
7234 stringify!(playdate_sound_sequence),
7235 "::",
7236 stringify!(allNotesOff)
7237 )
7238 );
7239 assert_eq!(
7240 unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
7241 104usize,
7242 concat!(
7243 "Offset of field: ",
7244 stringify!(playdate_sound_sequence),
7245 "::",
7246 stringify!(isPlaying)
7247 )
7248 );
7249 assert_eq!(
7250 unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
7251 112usize,
7252 concat!(
7253 "Offset of field: ",
7254 stringify!(playdate_sound_sequence),
7255 "::",
7256 stringify!(getLength)
7257 )
7258 );
7259 assert_eq!(
7260 unsafe { ::core::ptr::addr_of!((*ptr).play) as usize - ptr as usize },
7261 120usize,
7262 concat!(
7263 "Offset of field: ",
7264 stringify!(playdate_sound_sequence),
7265 "::",
7266 stringify!(play)
7267 )
7268 );
7269 assert_eq!(
7270 unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
7271 128usize,
7272 concat!(
7273 "Offset of field: ",
7274 stringify!(playdate_sound_sequence),
7275 "::",
7276 stringify!(stop)
7277 )
7278 );
7279 assert_eq!(
7280 unsafe { ::core::ptr::addr_of!((*ptr).getCurrentStep) as usize - ptr as usize },
7281 136usize,
7282 concat!(
7283 "Offset of field: ",
7284 stringify!(playdate_sound_sequence),
7285 "::",
7286 stringify!(getCurrentStep)
7287 )
7288 );
7289 assert_eq!(
7290 unsafe { ::core::ptr::addr_of!((*ptr).setCurrentStep) as usize - ptr as usize },
7291 144usize,
7292 concat!(
7293 "Offset of field: ",
7294 stringify!(playdate_sound_sequence),
7295 "::",
7296 stringify!(setCurrentStep)
7297 )
7298 );
7299}
7300#[repr(C)]
7301#[derive(Debug, Copy, Clone)]
7302pub struct TwoPoleFilter {
7303 _unused: [u8; 0],
7304}
7305#[repr(u32)]
7306#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7307pub enum TwoPoleFilterType {
7308 kFilterTypeLowPass = 0,
7309 kFilterTypeHighPass = 1,
7310 kFilterTypeBandPass = 2,
7311 kFilterTypeNotch = 3,
7312 kFilterTypePEQ = 4,
7313 kFilterTypeLowShelf = 5,
7314 kFilterTypeHighShelf = 6,
7315}
7316#[repr(C)]
7317#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
7318pub struct playdate_sound_effect_twopolefilter {
7319 pub newFilter: ::core::option::Option<unsafe extern "C" fn() -> *mut TwoPoleFilter>,
7320 pub freeFilter: ::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter)>,
7321 pub setType: ::core::option::Option<
7322 unsafe extern "C" fn(filter: *mut TwoPoleFilter, type_: TwoPoleFilterType),
7323 >,
7324 pub setFrequency:
7325 ::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter, frequency: f32)>,
7326 pub setFrequencyModulator: ::core::option::Option<
7327 unsafe extern "C" fn(filter: *mut TwoPoleFilter, signal: *mut PDSynthSignalValue),
7328 >,
7329 pub getFrequencyModulator: ::core::option::Option<
7330 unsafe extern "C" fn(filter: *mut TwoPoleFilter) -> *mut PDSynthSignalValue,
7331 >,
7332 pub setGain:
7333 ::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter, gain: f32)>,
7334 pub setResonance:
7335 ::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter, resonance: f32)>,
7336 pub setResonanceModulator: ::core::option::Option<
7337 unsafe extern "C" fn(filter: *mut TwoPoleFilter, signal: *mut PDSynthSignalValue),
7338 >,
7339 pub getResonanceModulator: ::core::option::Option<
7340 unsafe extern "C" fn(filter: *mut TwoPoleFilter) -> *mut PDSynthSignalValue,
7341 >,
7342}
7343#[test]
7344fn bindgen_test_layout_playdate_sound_effect_twopolefilter() {
7345 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_twopolefilter> =
7346 ::core::mem::MaybeUninit::uninit();
7347 let ptr = UNINIT.as_ptr();
7348 assert_eq!(
7349 ::core::mem::size_of::<playdate_sound_effect_twopolefilter>(),
7350 80usize,
7351 concat!("Size of: ", stringify!(playdate_sound_effect_twopolefilter))
7352 );
7353 assert_eq!(
7354 ::core::mem::align_of::<playdate_sound_effect_twopolefilter>(),
7355 8usize,
7356 concat!(
7357 "Alignment of ",
7358 stringify!(playdate_sound_effect_twopolefilter)
7359 )
7360 );
7361 assert_eq!(
7362 unsafe { ::core::ptr::addr_of!((*ptr).newFilter) as usize - ptr as usize },
7363 0usize,
7364 concat!(
7365 "Offset of field: ",
7366 stringify!(playdate_sound_effect_twopolefilter),
7367 "::",
7368 stringify!(newFilter)
7369 )
7370 );
7371 assert_eq!(
7372 unsafe { ::core::ptr::addr_of!((*ptr).freeFilter) as usize - ptr as usize },
7373 8usize,
7374 concat!(
7375 "Offset of field: ",
7376 stringify!(playdate_sound_effect_twopolefilter),
7377 "::",
7378 stringify!(freeFilter)
7379 )
7380 );
7381 assert_eq!(
7382 unsafe { ::core::ptr::addr_of!((*ptr).setType) as usize - ptr as usize },
7383 16usize,
7384 concat!(
7385 "Offset of field: ",
7386 stringify!(playdate_sound_effect_twopolefilter),
7387 "::",
7388 stringify!(setType)
7389 )
7390 );
7391 assert_eq!(
7392 unsafe { ::core::ptr::addr_of!((*ptr).setFrequency) as usize - ptr as usize },
7393 24usize,
7394 concat!(
7395 "Offset of field: ",
7396 stringify!(playdate_sound_effect_twopolefilter),
7397 "::",
7398 stringify!(setFrequency)
7399 )
7400 );
7401 assert_eq!(
7402 unsafe { ::core::ptr::addr_of!((*ptr).setFrequencyModulator) as usize - ptr as usize },
7403 32usize,
7404 concat!(
7405 "Offset of field: ",
7406 stringify!(playdate_sound_effect_twopolefilter),
7407 "::",
7408 stringify!(setFrequencyModulator)
7409 )
7410 );
7411 assert_eq!(
7412 unsafe { ::core::ptr::addr_of!((*ptr).getFrequencyModulator) as usize - ptr as usize },
7413 40usize,
7414 concat!(
7415 "Offset of field: ",
7416 stringify!(playdate_sound_effect_twopolefilter),
7417 "::",
7418 stringify!(getFrequencyModulator)
7419 )
7420 );
7421 assert_eq!(
7422 unsafe { ::core::ptr::addr_of!((*ptr).setGain) as usize - ptr as usize },
7423 48usize,
7424 concat!(
7425 "Offset of field: ",
7426 stringify!(playdate_sound_effect_twopolefilter),
7427 "::",
7428 stringify!(setGain)
7429 )
7430 );
7431 assert_eq!(
7432 unsafe { ::core::ptr::addr_of!((*ptr).setResonance) as usize - ptr as usize },
7433 56usize,
7434 concat!(
7435 "Offset of field: ",
7436 stringify!(playdate_sound_effect_twopolefilter),
7437 "::",
7438 stringify!(setResonance)
7439 )
7440 );
7441 assert_eq!(
7442 unsafe { ::core::ptr::addr_of!((*ptr).setResonanceModulator) as usize - ptr as usize },
7443 64usize,
7444 concat!(
7445 "Offset of field: ",
7446 stringify!(playdate_sound_effect_twopolefilter),
7447 "::",
7448 stringify!(setResonanceModulator)
7449 )
7450 );
7451 assert_eq!(
7452 unsafe { ::core::ptr::addr_of!((*ptr).getResonanceModulator) as usize - ptr as usize },
7453 72usize,
7454 concat!(
7455 "Offset of field: ",
7456 stringify!(playdate_sound_effect_twopolefilter),
7457 "::",
7458 stringify!(getResonanceModulator)
7459 )
7460 );
7461}
7462#[repr(C)]
7463#[derive(Debug, Copy, Clone)]
7464pub struct OnePoleFilter {
7465 _unused: [u8; 0],
7466}
7467#[repr(C)]
7468#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
7469pub struct playdate_sound_effect_onepolefilter {
7470 pub newFilter: ::core::option::Option<unsafe extern "C" fn() -> *mut OnePoleFilter>,
7471 pub freeFilter: ::core::option::Option<unsafe extern "C" fn(filter: *mut OnePoleFilter)>,
7472 pub setParameter:
7473 ::core::option::Option<unsafe extern "C" fn(filter: *mut OnePoleFilter, parameter: f32)>,
7474 pub setParameterModulator: ::core::option::Option<
7475 unsafe extern "C" fn(filter: *mut OnePoleFilter, signal: *mut PDSynthSignalValue),
7476 >,
7477 pub getParameterModulator: ::core::option::Option<
7478 unsafe extern "C" fn(filter: *mut OnePoleFilter) -> *mut PDSynthSignalValue,
7479 >,
7480}
7481#[test]
7482fn bindgen_test_layout_playdate_sound_effect_onepolefilter() {
7483 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_onepolefilter> =
7484 ::core::mem::MaybeUninit::uninit();
7485 let ptr = UNINIT.as_ptr();
7486 assert_eq!(
7487 ::core::mem::size_of::<playdate_sound_effect_onepolefilter>(),
7488 40usize,
7489 concat!("Size of: ", stringify!(playdate_sound_effect_onepolefilter))
7490 );
7491 assert_eq!(
7492 ::core::mem::align_of::<playdate_sound_effect_onepolefilter>(),
7493 8usize,
7494 concat!(
7495 "Alignment of ",
7496 stringify!(playdate_sound_effect_onepolefilter)
7497 )
7498 );
7499 assert_eq!(
7500 unsafe { ::core::ptr::addr_of!((*ptr).newFilter) as usize - ptr as usize },
7501 0usize,
7502 concat!(
7503 "Offset of field: ",
7504 stringify!(playdate_sound_effect_onepolefilter),
7505 "::",
7506 stringify!(newFilter)
7507 )
7508 );
7509 assert_eq!(
7510 unsafe { ::core::ptr::addr_of!((*ptr).freeFilter) as usize - ptr as usize },
7511 8usize,
7512 concat!(
7513 "Offset of field: ",
7514 stringify!(playdate_sound_effect_onepolefilter),
7515 "::",
7516 stringify!(freeFilter)
7517 )
7518 );
7519 assert_eq!(
7520 unsafe { ::core::ptr::addr_of!((*ptr).setParameter) as usize - ptr as usize },
7521 16usize,
7522 concat!(
7523 "Offset of field: ",
7524 stringify!(playdate_sound_effect_onepolefilter),
7525 "::",
7526 stringify!(setParameter)
7527 )
7528 );
7529 assert_eq!(
7530 unsafe { ::core::ptr::addr_of!((*ptr).setParameterModulator) as usize - ptr as usize },
7531 24usize,
7532 concat!(
7533 "Offset of field: ",
7534 stringify!(playdate_sound_effect_onepolefilter),
7535 "::",
7536 stringify!(setParameterModulator)
7537 )
7538 );
7539 assert_eq!(
7540 unsafe { ::core::ptr::addr_of!((*ptr).getParameterModulator) as usize - ptr as usize },
7541 32usize,
7542 concat!(
7543 "Offset of field: ",
7544 stringify!(playdate_sound_effect_onepolefilter),
7545 "::",
7546 stringify!(getParameterModulator)
7547 )
7548 );
7549}
7550#[repr(C)]
7551#[derive(Debug, Copy, Clone)]
7552pub struct BitCrusher {
7553 _unused: [u8; 0],
7554}
7555#[repr(C)]
7556#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
7557pub struct playdate_sound_effect_bitcrusher {
7558 pub newBitCrusher: ::core::option::Option<unsafe extern "C" fn() -> *mut BitCrusher>,
7559 pub freeBitCrusher: ::core::option::Option<unsafe extern "C" fn(filter: *mut BitCrusher)>,
7560 pub setAmount:
7561 ::core::option::Option<unsafe extern "C" fn(filter: *mut BitCrusher, amount: f32)>,
7562 pub setAmountModulator: ::core::option::Option<
7563 unsafe extern "C" fn(filter: *mut BitCrusher, signal: *mut PDSynthSignalValue),
7564 >,
7565 pub getAmountModulator: ::core::option::Option<
7566 unsafe extern "C" fn(filter: *mut BitCrusher) -> *mut PDSynthSignalValue,
7567 >,
7568 pub setUndersampling:
7569 ::core::option::Option<unsafe extern "C" fn(filter: *mut BitCrusher, undersampling: f32)>,
7570 pub setUndersampleModulator: ::core::option::Option<
7571 unsafe extern "C" fn(filter: *mut BitCrusher, signal: *mut PDSynthSignalValue),
7572 >,
7573 pub getUndersampleModulator: ::core::option::Option<
7574 unsafe extern "C" fn(filter: *mut BitCrusher) -> *mut PDSynthSignalValue,
7575 >,
7576}
7577#[test]
7578fn bindgen_test_layout_playdate_sound_effect_bitcrusher() {
7579 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_bitcrusher> =
7580 ::core::mem::MaybeUninit::uninit();
7581 let ptr = UNINIT.as_ptr();
7582 assert_eq!(
7583 ::core::mem::size_of::<playdate_sound_effect_bitcrusher>(),
7584 64usize,
7585 concat!("Size of: ", stringify!(playdate_sound_effect_bitcrusher))
7586 );
7587 assert_eq!(
7588 ::core::mem::align_of::<playdate_sound_effect_bitcrusher>(),
7589 8usize,
7590 concat!(
7591 "Alignment of ",
7592 stringify!(playdate_sound_effect_bitcrusher)
7593 )
7594 );
7595 assert_eq!(
7596 unsafe { ::core::ptr::addr_of!((*ptr).newBitCrusher) as usize - ptr as usize },
7597 0usize,
7598 concat!(
7599 "Offset of field: ",
7600 stringify!(playdate_sound_effect_bitcrusher),
7601 "::",
7602 stringify!(newBitCrusher)
7603 )
7604 );
7605 assert_eq!(
7606 unsafe { ::core::ptr::addr_of!((*ptr).freeBitCrusher) as usize - ptr as usize },
7607 8usize,
7608 concat!(
7609 "Offset of field: ",
7610 stringify!(playdate_sound_effect_bitcrusher),
7611 "::",
7612 stringify!(freeBitCrusher)
7613 )
7614 );
7615 assert_eq!(
7616 unsafe { ::core::ptr::addr_of!((*ptr).setAmount) as usize - ptr as usize },
7617 16usize,
7618 concat!(
7619 "Offset of field: ",
7620 stringify!(playdate_sound_effect_bitcrusher),
7621 "::",
7622 stringify!(setAmount)
7623 )
7624 );
7625 assert_eq!(
7626 unsafe { ::core::ptr::addr_of!((*ptr).setAmountModulator) as usize - ptr as usize },
7627 24usize,
7628 concat!(
7629 "Offset of field: ",
7630 stringify!(playdate_sound_effect_bitcrusher),
7631 "::",
7632 stringify!(setAmountModulator)
7633 )
7634 );
7635 assert_eq!(
7636 unsafe { ::core::ptr::addr_of!((*ptr).getAmountModulator) as usize - ptr as usize },
7637 32usize,
7638 concat!(
7639 "Offset of field: ",
7640 stringify!(playdate_sound_effect_bitcrusher),
7641 "::",
7642 stringify!(getAmountModulator)
7643 )
7644 );
7645 assert_eq!(
7646 unsafe { ::core::ptr::addr_of!((*ptr).setUndersampling) as usize - ptr as usize },
7647 40usize,
7648 concat!(
7649 "Offset of field: ",
7650 stringify!(playdate_sound_effect_bitcrusher),
7651 "::",
7652 stringify!(setUndersampling)
7653 )
7654 );
7655 assert_eq!(
7656 unsafe { ::core::ptr::addr_of!((*ptr).setUndersampleModulator) as usize - ptr as usize },
7657 48usize,
7658 concat!(
7659 "Offset of field: ",
7660 stringify!(playdate_sound_effect_bitcrusher),
7661 "::",
7662 stringify!(setUndersampleModulator)
7663 )
7664 );
7665 assert_eq!(
7666 unsafe { ::core::ptr::addr_of!((*ptr).getUndersampleModulator) as usize - ptr as usize },
7667 56usize,
7668 concat!(
7669 "Offset of field: ",
7670 stringify!(playdate_sound_effect_bitcrusher),
7671 "::",
7672 stringify!(getUndersampleModulator)
7673 )
7674 );
7675}
7676#[repr(C)]
7677#[derive(Debug, Copy, Clone)]
7678pub struct RingModulator {
7679 _unused: [u8; 0],
7680}
7681#[repr(C)]
7682#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
7683pub struct playdate_sound_effect_ringmodulator {
7684 pub newRingmod: ::core::option::Option<unsafe extern "C" fn() -> *mut RingModulator>,
7685 pub freeRingmod: ::core::option::Option<unsafe extern "C" fn(filter: *mut RingModulator)>,
7686 pub setFrequency:
7687 ::core::option::Option<unsafe extern "C" fn(filter: *mut RingModulator, frequency: f32)>,
7688 pub setFrequencyModulator: ::core::option::Option<
7689 unsafe extern "C" fn(filter: *mut RingModulator, signal: *mut PDSynthSignalValue),
7690 >,
7691 pub getFrequencyModulator: ::core::option::Option<
7692 unsafe extern "C" fn(filter: *mut RingModulator) -> *mut PDSynthSignalValue,
7693 >,
7694}
7695#[test]
7696fn bindgen_test_layout_playdate_sound_effect_ringmodulator() {
7697 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_ringmodulator> =
7698 ::core::mem::MaybeUninit::uninit();
7699 let ptr = UNINIT.as_ptr();
7700 assert_eq!(
7701 ::core::mem::size_of::<playdate_sound_effect_ringmodulator>(),
7702 40usize,
7703 concat!("Size of: ", stringify!(playdate_sound_effect_ringmodulator))
7704 );
7705 assert_eq!(
7706 ::core::mem::align_of::<playdate_sound_effect_ringmodulator>(),
7707 8usize,
7708 concat!(
7709 "Alignment of ",
7710 stringify!(playdate_sound_effect_ringmodulator)
7711 )
7712 );
7713 assert_eq!(
7714 unsafe { ::core::ptr::addr_of!((*ptr).newRingmod) as usize - ptr as usize },
7715 0usize,
7716 concat!(
7717 "Offset of field: ",
7718 stringify!(playdate_sound_effect_ringmodulator),
7719 "::",
7720 stringify!(newRingmod)
7721 )
7722 );
7723 assert_eq!(
7724 unsafe { ::core::ptr::addr_of!((*ptr).freeRingmod) as usize - ptr as usize },
7725 8usize,
7726 concat!(
7727 "Offset of field: ",
7728 stringify!(playdate_sound_effect_ringmodulator),
7729 "::",
7730 stringify!(freeRingmod)
7731 )
7732 );
7733 assert_eq!(
7734 unsafe { ::core::ptr::addr_of!((*ptr).setFrequency) as usize - ptr as usize },
7735 16usize,
7736 concat!(
7737 "Offset of field: ",
7738 stringify!(playdate_sound_effect_ringmodulator),
7739 "::",
7740 stringify!(setFrequency)
7741 )
7742 );
7743 assert_eq!(
7744 unsafe { ::core::ptr::addr_of!((*ptr).setFrequencyModulator) as usize - ptr as usize },
7745 24usize,
7746 concat!(
7747 "Offset of field: ",
7748 stringify!(playdate_sound_effect_ringmodulator),
7749 "::",
7750 stringify!(setFrequencyModulator)
7751 )
7752 );
7753 assert_eq!(
7754 unsafe { ::core::ptr::addr_of!((*ptr).getFrequencyModulator) as usize - ptr as usize },
7755 32usize,
7756 concat!(
7757 "Offset of field: ",
7758 stringify!(playdate_sound_effect_ringmodulator),
7759 "::",
7760 stringify!(getFrequencyModulator)
7761 )
7762 );
7763}
7764#[repr(C)]
7765#[derive(Debug, Copy, Clone)]
7766pub struct DelayLine {
7767 _unused: [u8; 0],
7768}
7769#[repr(C)]
7770#[derive(Debug, Copy, Clone)]
7771pub struct DelayLineTap {
7772 _unused: [u8; 0],
7773}
7774#[repr(C)]
7775#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
7776pub struct playdate_sound_effect_delayline {
7777 pub newDelayLine: ::core::option::Option<
7778 unsafe extern "C" fn(length: ctypes::c_int, stereo: ctypes::c_int) -> *mut DelayLine,
7779 >,
7780 pub freeDelayLine: ::core::option::Option<unsafe extern "C" fn(filter: *mut DelayLine)>,
7781 pub setLength:
7782 ::core::option::Option<unsafe extern "C" fn(d: *mut DelayLine, frames: ctypes::c_int)>,
7783 pub setFeedback: ::core::option::Option<unsafe extern "C" fn(d: *mut DelayLine, fb: f32)>,
7784 pub addTap: ::core::option::Option<
7785 unsafe extern "C" fn(d: *mut DelayLine, delay: ctypes::c_int) -> *mut DelayLineTap,
7786 >,
7787 pub freeTap: ::core::option::Option<unsafe extern "C" fn(tap: *mut DelayLineTap)>,
7788 pub setTapDelay:
7789 ::core::option::Option<unsafe extern "C" fn(t: *mut DelayLineTap, frames: ctypes::c_int)>,
7790 pub setTapDelayModulator: ::core::option::Option<
7791 unsafe extern "C" fn(t: *mut DelayLineTap, mod_: *mut PDSynthSignalValue),
7792 >,
7793 pub getTapDelayModulator: ::core::option::Option<
7794 unsafe extern "C" fn(t: *mut DelayLineTap) -> *mut PDSynthSignalValue,
7795 >,
7796 pub setTapChannelsFlipped:
7797 ::core::option::Option<unsafe extern "C" fn(t: *mut DelayLineTap, flip: ctypes::c_int)>,
7798}
7799#[test]
7800fn bindgen_test_layout_playdate_sound_effect_delayline() {
7801 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_delayline> =
7802 ::core::mem::MaybeUninit::uninit();
7803 let ptr = UNINIT.as_ptr();
7804 assert_eq!(
7805 ::core::mem::size_of::<playdate_sound_effect_delayline>(),
7806 80usize,
7807 concat!("Size of: ", stringify!(playdate_sound_effect_delayline))
7808 );
7809 assert_eq!(
7810 ::core::mem::align_of::<playdate_sound_effect_delayline>(),
7811 8usize,
7812 concat!("Alignment of ", stringify!(playdate_sound_effect_delayline))
7813 );
7814 assert_eq!(
7815 unsafe { ::core::ptr::addr_of!((*ptr).newDelayLine) as usize - ptr as usize },
7816 0usize,
7817 concat!(
7818 "Offset of field: ",
7819 stringify!(playdate_sound_effect_delayline),
7820 "::",
7821 stringify!(newDelayLine)
7822 )
7823 );
7824 assert_eq!(
7825 unsafe { ::core::ptr::addr_of!((*ptr).freeDelayLine) as usize - ptr as usize },
7826 8usize,
7827 concat!(
7828 "Offset of field: ",
7829 stringify!(playdate_sound_effect_delayline),
7830 "::",
7831 stringify!(freeDelayLine)
7832 )
7833 );
7834 assert_eq!(
7835 unsafe { ::core::ptr::addr_of!((*ptr).setLength) as usize - ptr as usize },
7836 16usize,
7837 concat!(
7838 "Offset of field: ",
7839 stringify!(playdate_sound_effect_delayline),
7840 "::",
7841 stringify!(setLength)
7842 )
7843 );
7844 assert_eq!(
7845 unsafe { ::core::ptr::addr_of!((*ptr).setFeedback) as usize - ptr as usize },
7846 24usize,
7847 concat!(
7848 "Offset of field: ",
7849 stringify!(playdate_sound_effect_delayline),
7850 "::",
7851 stringify!(setFeedback)
7852 )
7853 );
7854 assert_eq!(
7855 unsafe { ::core::ptr::addr_of!((*ptr).addTap) as usize - ptr as usize },
7856 32usize,
7857 concat!(
7858 "Offset of field: ",
7859 stringify!(playdate_sound_effect_delayline),
7860 "::",
7861 stringify!(addTap)
7862 )
7863 );
7864 assert_eq!(
7865 unsafe { ::core::ptr::addr_of!((*ptr).freeTap) as usize - ptr as usize },
7866 40usize,
7867 concat!(
7868 "Offset of field: ",
7869 stringify!(playdate_sound_effect_delayline),
7870 "::",
7871 stringify!(freeTap)
7872 )
7873 );
7874 assert_eq!(
7875 unsafe { ::core::ptr::addr_of!((*ptr).setTapDelay) as usize - ptr as usize },
7876 48usize,
7877 concat!(
7878 "Offset of field: ",
7879 stringify!(playdate_sound_effect_delayline),
7880 "::",
7881 stringify!(setTapDelay)
7882 )
7883 );
7884 assert_eq!(
7885 unsafe { ::core::ptr::addr_of!((*ptr).setTapDelayModulator) as usize - ptr as usize },
7886 56usize,
7887 concat!(
7888 "Offset of field: ",
7889 stringify!(playdate_sound_effect_delayline),
7890 "::",
7891 stringify!(setTapDelayModulator)
7892 )
7893 );
7894 assert_eq!(
7895 unsafe { ::core::ptr::addr_of!((*ptr).getTapDelayModulator) as usize - ptr as usize },
7896 64usize,
7897 concat!(
7898 "Offset of field: ",
7899 stringify!(playdate_sound_effect_delayline),
7900 "::",
7901 stringify!(getTapDelayModulator)
7902 )
7903 );
7904 assert_eq!(
7905 unsafe { ::core::ptr::addr_of!((*ptr).setTapChannelsFlipped) as usize - ptr as usize },
7906 72usize,
7907 concat!(
7908 "Offset of field: ",
7909 stringify!(playdate_sound_effect_delayline),
7910 "::",
7911 stringify!(setTapChannelsFlipped)
7912 )
7913 );
7914}
7915#[repr(C)]
7916#[derive(Debug, Copy, Clone)]
7917pub struct Overdrive {
7918 _unused: [u8; 0],
7919}
7920#[repr(C)]
7921#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
7922pub struct playdate_sound_effect_overdrive {
7923 pub newOverdrive: ::core::option::Option<unsafe extern "C" fn() -> *mut Overdrive>,
7924 pub freeOverdrive: ::core::option::Option<unsafe extern "C" fn(filter: *mut Overdrive)>,
7925 pub setGain: ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive, gain: f32)>,
7926 pub setLimit: ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive, limit: f32)>,
7927 pub setLimitModulator: ::core::option::Option<
7928 unsafe extern "C" fn(o: *mut Overdrive, mod_: *mut PDSynthSignalValue),
7929 >,
7930 pub getLimitModulator:
7931 ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive) -> *mut PDSynthSignalValue>,
7932 pub setOffset: ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive, offset: f32)>,
7933 pub setOffsetModulator: ::core::option::Option<
7934 unsafe extern "C" fn(o: *mut Overdrive, mod_: *mut PDSynthSignalValue),
7935 >,
7936 pub getOffsetModulator:
7937 ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive) -> *mut PDSynthSignalValue>,
7938}
7939#[test]
7940fn bindgen_test_layout_playdate_sound_effect_overdrive() {
7941 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_overdrive> =
7942 ::core::mem::MaybeUninit::uninit();
7943 let ptr = UNINIT.as_ptr();
7944 assert_eq!(
7945 ::core::mem::size_of::<playdate_sound_effect_overdrive>(),
7946 72usize,
7947 concat!("Size of: ", stringify!(playdate_sound_effect_overdrive))
7948 );
7949 assert_eq!(
7950 ::core::mem::align_of::<playdate_sound_effect_overdrive>(),
7951 8usize,
7952 concat!("Alignment of ", stringify!(playdate_sound_effect_overdrive))
7953 );
7954 assert_eq!(
7955 unsafe { ::core::ptr::addr_of!((*ptr).newOverdrive) as usize - ptr as usize },
7956 0usize,
7957 concat!(
7958 "Offset of field: ",
7959 stringify!(playdate_sound_effect_overdrive),
7960 "::",
7961 stringify!(newOverdrive)
7962 )
7963 );
7964 assert_eq!(
7965 unsafe { ::core::ptr::addr_of!((*ptr).freeOverdrive) as usize - ptr as usize },
7966 8usize,
7967 concat!(
7968 "Offset of field: ",
7969 stringify!(playdate_sound_effect_overdrive),
7970 "::",
7971 stringify!(freeOverdrive)
7972 )
7973 );
7974 assert_eq!(
7975 unsafe { ::core::ptr::addr_of!((*ptr).setGain) as usize - ptr as usize },
7976 16usize,
7977 concat!(
7978 "Offset of field: ",
7979 stringify!(playdate_sound_effect_overdrive),
7980 "::",
7981 stringify!(setGain)
7982 )
7983 );
7984 assert_eq!(
7985 unsafe { ::core::ptr::addr_of!((*ptr).setLimit) as usize - ptr as usize },
7986 24usize,
7987 concat!(
7988 "Offset of field: ",
7989 stringify!(playdate_sound_effect_overdrive),
7990 "::",
7991 stringify!(setLimit)
7992 )
7993 );
7994 assert_eq!(
7995 unsafe { ::core::ptr::addr_of!((*ptr).setLimitModulator) as usize - ptr as usize },
7996 32usize,
7997 concat!(
7998 "Offset of field: ",
7999 stringify!(playdate_sound_effect_overdrive),
8000 "::",
8001 stringify!(setLimitModulator)
8002 )
8003 );
8004 assert_eq!(
8005 unsafe { ::core::ptr::addr_of!((*ptr).getLimitModulator) as usize - ptr as usize },
8006 40usize,
8007 concat!(
8008 "Offset of field: ",
8009 stringify!(playdate_sound_effect_overdrive),
8010 "::",
8011 stringify!(getLimitModulator)
8012 )
8013 );
8014 assert_eq!(
8015 unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
8016 48usize,
8017 concat!(
8018 "Offset of field: ",
8019 stringify!(playdate_sound_effect_overdrive),
8020 "::",
8021 stringify!(setOffset)
8022 )
8023 );
8024 assert_eq!(
8025 unsafe { ::core::ptr::addr_of!((*ptr).setOffsetModulator) as usize - ptr as usize },
8026 56usize,
8027 concat!(
8028 "Offset of field: ",
8029 stringify!(playdate_sound_effect_overdrive),
8030 "::",
8031 stringify!(setOffsetModulator)
8032 )
8033 );
8034 assert_eq!(
8035 unsafe { ::core::ptr::addr_of!((*ptr).getOffsetModulator) as usize - ptr as usize },
8036 64usize,
8037 concat!(
8038 "Offset of field: ",
8039 stringify!(playdate_sound_effect_overdrive),
8040 "::",
8041 stringify!(getOffsetModulator)
8042 )
8043 );
8044}
8045#[repr(C)]
8046#[derive(Debug, Copy, Clone)]
8047pub struct SoundEffect {
8048 _unused: [u8; 0],
8049}
8050pub type effectProc = ::core::option::Option<
8051 unsafe extern "C" fn(
8052 e: *mut SoundEffect,
8053 left: *mut i32,
8054 right: *mut i32,
8055 nsamples: ctypes::c_int,
8056 bufactive: ctypes::c_int,
8057 ) -> ctypes::c_int,
8058>;
8059#[repr(C)]
8060#[derive(Debug, Copy, Clone, PartialEq, Eq)]
8061pub struct playdate_sound_effect {
8062 pub newEffect: ::core::option::Option<
8063 unsafe extern "C" fn(proc_: effectProc, userdata: *mut ctypes::c_void) -> *mut SoundEffect,
8064 >,
8065 pub freeEffect: ::core::option::Option<unsafe extern "C" fn(effect: *mut SoundEffect)>,
8066 pub setMix: ::core::option::Option<unsafe extern "C" fn(effect: *mut SoundEffect, level: f32)>,
8067 pub setMixModulator: ::core::option::Option<
8068 unsafe extern "C" fn(effect: *mut SoundEffect, signal: *mut PDSynthSignalValue),
8069 >,
8070 pub getMixModulator: ::core::option::Option<
8071 unsafe extern "C" fn(effect: *mut SoundEffect) -> *mut PDSynthSignalValue,
8072 >,
8073 pub setUserdata: ::core::option::Option<
8074 unsafe extern "C" fn(effect: *mut SoundEffect, userdata: *mut ctypes::c_void),
8075 >,
8076 pub getUserdata: ::core::option::Option<
8077 unsafe extern "C" fn(effect: *mut SoundEffect) -> *mut ctypes::c_void,
8078 >,
8079 pub twopolefilter: *const playdate_sound_effect_twopolefilter,
8080 pub onepolefilter: *const playdate_sound_effect_onepolefilter,
8081 pub bitcrusher: *const playdate_sound_effect_bitcrusher,
8082 pub ringmodulator: *const playdate_sound_effect_ringmodulator,
8083 pub delayline: *const playdate_sound_effect_delayline,
8084 pub overdrive: *const playdate_sound_effect_overdrive,
8085}
8086#[test]
8087fn bindgen_test_layout_playdate_sound_effect() {
8088 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect> =
8089 ::core::mem::MaybeUninit::uninit();
8090 let ptr = UNINIT.as_ptr();
8091 assert_eq!(
8092 ::core::mem::size_of::<playdate_sound_effect>(),
8093 104usize,
8094 concat!("Size of: ", stringify!(playdate_sound_effect))
8095 );
8096 assert_eq!(
8097 ::core::mem::align_of::<playdate_sound_effect>(),
8098 8usize,
8099 concat!("Alignment of ", stringify!(playdate_sound_effect))
8100 );
8101 assert_eq!(
8102 unsafe { ::core::ptr::addr_of!((*ptr).newEffect) as usize - ptr as usize },
8103 0usize,
8104 concat!(
8105 "Offset of field: ",
8106 stringify!(playdate_sound_effect),
8107 "::",
8108 stringify!(newEffect)
8109 )
8110 );
8111 assert_eq!(
8112 unsafe { ::core::ptr::addr_of!((*ptr).freeEffect) as usize - ptr as usize },
8113 8usize,
8114 concat!(
8115 "Offset of field: ",
8116 stringify!(playdate_sound_effect),
8117 "::",
8118 stringify!(freeEffect)
8119 )
8120 );
8121 assert_eq!(
8122 unsafe { ::core::ptr::addr_of!((*ptr).setMix) as usize - ptr as usize },
8123 16usize,
8124 concat!(
8125 "Offset of field: ",
8126 stringify!(playdate_sound_effect),
8127 "::",
8128 stringify!(setMix)
8129 )
8130 );
8131 assert_eq!(
8132 unsafe { ::core::ptr::addr_of!((*ptr).setMixModulator) as usize - ptr as usize },
8133 24usize,
8134 concat!(
8135 "Offset of field: ",
8136 stringify!(playdate_sound_effect),
8137 "::",
8138 stringify!(setMixModulator)
8139 )
8140 );
8141 assert_eq!(
8142 unsafe { ::core::ptr::addr_of!((*ptr).getMixModulator) as usize - ptr as usize },
8143 32usize,
8144 concat!(
8145 "Offset of field: ",
8146 stringify!(playdate_sound_effect),
8147 "::",
8148 stringify!(getMixModulator)
8149 )
8150 );
8151 assert_eq!(
8152 unsafe { ::core::ptr::addr_of!((*ptr).setUserdata) as usize - ptr as usize },
8153 40usize,
8154 concat!(
8155 "Offset of field: ",
8156 stringify!(playdate_sound_effect),
8157 "::",
8158 stringify!(setUserdata)
8159 )
8160 );
8161 assert_eq!(
8162 unsafe { ::core::ptr::addr_of!((*ptr).getUserdata) as usize - ptr as usize },
8163 48usize,
8164 concat!(
8165 "Offset of field: ",
8166 stringify!(playdate_sound_effect),
8167 "::",
8168 stringify!(getUserdata)
8169 )
8170 );
8171 assert_eq!(
8172 unsafe { ::core::ptr::addr_of!((*ptr).twopolefilter) as usize - ptr as usize },
8173 56usize,
8174 concat!(
8175 "Offset of field: ",
8176 stringify!(playdate_sound_effect),
8177 "::",
8178 stringify!(twopolefilter)
8179 )
8180 );
8181 assert_eq!(
8182 unsafe { ::core::ptr::addr_of!((*ptr).onepolefilter) as usize - ptr as usize },
8183 64usize,
8184 concat!(
8185 "Offset of field: ",
8186 stringify!(playdate_sound_effect),
8187 "::",
8188 stringify!(onepolefilter)
8189 )
8190 );
8191 assert_eq!(
8192 unsafe { ::core::ptr::addr_of!((*ptr).bitcrusher) as usize - ptr as usize },
8193 72usize,
8194 concat!(
8195 "Offset of field: ",
8196 stringify!(playdate_sound_effect),
8197 "::",
8198 stringify!(bitcrusher)
8199 )
8200 );
8201 assert_eq!(
8202 unsafe { ::core::ptr::addr_of!((*ptr).ringmodulator) as usize - ptr as usize },
8203 80usize,
8204 concat!(
8205 "Offset of field: ",
8206 stringify!(playdate_sound_effect),
8207 "::",
8208 stringify!(ringmodulator)
8209 )
8210 );
8211 assert_eq!(
8212 unsafe { ::core::ptr::addr_of!((*ptr).delayline) as usize - ptr as usize },
8213 88usize,
8214 concat!(
8215 "Offset of field: ",
8216 stringify!(playdate_sound_effect),
8217 "::",
8218 stringify!(delayline)
8219 )
8220 );
8221 assert_eq!(
8222 unsafe { ::core::ptr::addr_of!((*ptr).overdrive) as usize - ptr as usize },
8223 96usize,
8224 concat!(
8225 "Offset of field: ",
8226 stringify!(playdate_sound_effect),
8227 "::",
8228 stringify!(overdrive)
8229 )
8230 );
8231}
8232impl Default for playdate_sound_effect {
8233 fn default() -> Self {
8234 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
8235 unsafe {
8236 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
8237 s.assume_init()
8238 }
8239 }
8240}
8241#[repr(C)]
8242#[derive(Debug, Copy, Clone)]
8243pub struct SoundChannel {
8244 _unused: [u8; 0],
8245}
8246pub type AudioSourceFunction = ::core::option::Option<
8247 unsafe extern "C" fn(
8248 context: *mut ctypes::c_void,
8249 left: *mut i16,
8250 right: *mut i16,
8251 len: ctypes::c_int,
8252 ) -> ctypes::c_int,
8253>;
8254#[repr(C)]
8255#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
8256pub struct playdate_sound_channel {
8257 pub newChannel: ::core::option::Option<unsafe extern "C" fn() -> *mut SoundChannel>,
8258 pub freeChannel: ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel)>,
8259 pub addSource: ::core::option::Option<
8260 unsafe extern "C" fn(channel: *mut SoundChannel, source: *mut SoundSource) -> ctypes::c_int,
8261 >,
8262 pub removeSource: ::core::option::Option<
8263 unsafe extern "C" fn(channel: *mut SoundChannel, source: *mut SoundSource) -> ctypes::c_int,
8264 >,
8265 pub addCallbackSource: ::core::option::Option<
8266 unsafe extern "C" fn(
8267 channel: *mut SoundChannel,
8268 callback: AudioSourceFunction,
8269 context: *mut ctypes::c_void,
8270 stereo: ctypes::c_int,
8271 ) -> *mut SoundSource,
8272 >,
8273 pub addEffect: ::core::option::Option<
8274 unsafe extern "C" fn(channel: *mut SoundChannel, effect: *mut SoundEffect),
8275 >,
8276 pub removeEffect: ::core::option::Option<
8277 unsafe extern "C" fn(channel: *mut SoundChannel, effect: *mut SoundEffect),
8278 >,
8279 pub setVolume:
8280 ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel, volume: f32)>,
8281 pub getVolume: ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel) -> f32>,
8282 pub setVolumeModulator: ::core::option::Option<
8283 unsafe extern "C" fn(channel: *mut SoundChannel, mod_: *mut PDSynthSignalValue),
8284 >,
8285 pub getVolumeModulator: ::core::option::Option<
8286 unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
8287 >,
8288 pub setPan: ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel, pan: f32)>,
8289 pub setPanModulator: ::core::option::Option<
8290 unsafe extern "C" fn(channel: *mut SoundChannel, mod_: *mut PDSynthSignalValue),
8291 >,
8292 pub getPanModulator: ::core::option::Option<
8293 unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
8294 >,
8295 pub getDryLevelSignal: ::core::option::Option<
8296 unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
8297 >,
8298 pub getWetLevelSignal: ::core::option::Option<
8299 unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
8300 >,
8301}
8302#[test]
8303fn bindgen_test_layout_playdate_sound_channel() {
8304 const UNINIT: ::core::mem::MaybeUninit<playdate_sound_channel> =
8305 ::core::mem::MaybeUninit::uninit();
8306 let ptr = UNINIT.as_ptr();
8307 assert_eq!(
8308 ::core::mem::size_of::<playdate_sound_channel>(),
8309 128usize,
8310 concat!("Size of: ", stringify!(playdate_sound_channel))
8311 );
8312 assert_eq!(
8313 ::core::mem::align_of::<playdate_sound_channel>(),
8314 8usize,
8315 concat!("Alignment of ", stringify!(playdate_sound_channel))
8316 );
8317 assert_eq!(
8318 unsafe { ::core::ptr::addr_of!((*ptr).newChannel) as usize - ptr as usize },
8319 0usize,
8320 concat!(
8321 "Offset of field: ",
8322 stringify!(playdate_sound_channel),
8323 "::",
8324 stringify!(newChannel)
8325 )
8326 );
8327 assert_eq!(
8328 unsafe { ::core::ptr::addr_of!((*ptr).freeChannel) as usize - ptr as usize },
8329 8usize,
8330 concat!(
8331 "Offset of field: ",
8332 stringify!(playdate_sound_channel),
8333 "::",
8334 stringify!(freeChannel)
8335 )
8336 );
8337 assert_eq!(
8338 unsafe { ::core::ptr::addr_of!((*ptr).addSource) as usize - ptr as usize },
8339 16usize,
8340 concat!(
8341 "Offset of field: ",
8342 stringify!(playdate_sound_channel),
8343 "::",
8344 stringify!(addSource)
8345 )
8346 );
8347 assert_eq!(
8348 unsafe { ::core::ptr::addr_of!((*ptr).removeSource) as usize - ptr as usize },
8349 24usize,
8350 concat!(
8351 "Offset of field: ",
8352 stringify!(playdate_sound_channel),
8353 "::",
8354 stringify!(removeSource)
8355 )
8356 );
8357 assert_eq!(
8358 unsafe { ::core::ptr::addr_of!((*ptr).addCallbackSource) as usize - ptr as usize },
8359 32usize,
8360 concat!(
8361 "Offset of field: ",
8362 stringify!(playdate_sound_channel),
8363 "::",
8364 stringify!(addCallbackSource)
8365 )
8366 );
8367 assert_eq!(
8368 unsafe { ::core::ptr::addr_of!((*ptr).addEffect) as usize - ptr as usize },
8369 40usize,
8370 concat!(
8371 "Offset of field: ",
8372 stringify!(playdate_sound_channel),
8373 "::",
8374 stringify!(addEffect)
8375 )
8376 );
8377 assert_eq!(
8378 unsafe { ::core::ptr::addr_of!((*ptr).removeEffect) as usize - ptr as usize },
8379 48usize,
8380 concat!(
8381 "Offset of field: ",
8382 stringify!(playdate_sound_channel),
8383 "::",
8384 stringify!(removeEffect)
8385 )
8386 );
8387 assert_eq!(
8388 unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
8389 56usize,
8390 concat!(
8391 "Offset of field: ",
8392 stringify!(playdate_sound_channel),
8393 "::",
8394 stringify!(setVolume)
8395 )
8396 );
8397 assert_eq!(
8398 unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
8399 64usize,
8400 concat!(
8401 "Offset of field: ",
8402 stringify!(playdate_sound_channel),
8403 "::",
8404 stringify!(getVolume)
8405 )
8406 );
8407 assert_eq!(
8408 unsafe { ::core::ptr::addr_of!((*ptr).setVolumeModulator) as usize - ptr as usize },
8409 72usize,
8410 concat!(
8411 "Offset of field: ",
8412 stringify!(playdate_sound_channel),
8413 "::",
8414 stringify!(setVolumeModulator)
8415 )
8416 );
8417 assert_eq!(
8418 unsafe { ::core::ptr::addr_of!((*ptr).getVolumeModulator) as usize - ptr as usize },
8419 80usize,
8420 concat!(
8421 "Offset of field: ",
8422 stringify!(playdate_sound_channel),
8423 "::",
8424 stringify!(getVolumeModulator)
8425 )
8426 );
8427 assert_eq!(
8428 unsafe { ::core::ptr::addr_of!((*ptr).setPan) as usize - ptr as usize },
8429 88usize,
8430 concat!(
8431 "Offset of field: ",
8432 stringify!(playdate_sound_channel),
8433 "::",
8434 stringify!(setPan)
8435 )
8436 );
8437 assert_eq!(
8438 unsafe { ::core::ptr::addr_of!((*ptr).setPanModulator) as usize - ptr as usize },
8439 96usize,
8440 concat!(
8441 "Offset of field: ",
8442 stringify!(playdate_sound_channel),
8443 "::",
8444 stringify!(setPanModulator)
8445 )
8446 );
8447 assert_eq!(
8448 unsafe { ::core::ptr::addr_of!((*ptr).getPanModulator) as usize - ptr as usize },
8449 104usize,
8450 concat!(
8451 "Offset of field: ",
8452 stringify!(playdate_sound_channel),
8453 "::",
8454 stringify!(getPanModulator)
8455 )
8456 );
8457 assert_eq!(
8458 unsafe { ::core::ptr::addr_of!((*ptr).getDryLevelSignal) as usize - ptr as usize },
8459 112usize,
8460 concat!(
8461 "Offset of field: ",
8462 stringify!(playdate_sound_channel),
8463 "::",
8464 stringify!(getDryLevelSignal)
8465 )
8466 );
8467 assert_eq!(
8468 unsafe { ::core::ptr::addr_of!((*ptr).getWetLevelSignal) as usize - ptr as usize },
8469 120usize,
8470 concat!(
8471 "Offset of field: ",
8472 stringify!(playdate_sound_channel),
8473 "::",
8474 stringify!(getWetLevelSignal)
8475 )
8476 );
8477}
8478pub type RecordCallback = ::core::option::Option<
8479 unsafe extern "C" fn(
8480 context: *mut ctypes::c_void,
8481 buffer: *mut i16,
8482 length: ctypes::c_int,
8483 ) -> ctypes::c_int,
8484>;
8485#[repr(C)]
8486#[derive(Debug, Copy, Clone, PartialEq, Eq)]
8487pub struct playdate_sound {
8488 pub channel: *const playdate_sound_channel,
8489 pub fileplayer: *const playdate_sound_fileplayer,
8490 pub sample: *const playdate_sound_sample,
8491 pub sampleplayer: *const playdate_sound_sampleplayer,
8492 pub synth: *const playdate_sound_synth,
8493 pub sequence: *const playdate_sound_sequence,
8494 pub effect: *const playdate_sound_effect,
8495 pub lfo: *const playdate_sound_lfo,
8496 pub envelope: *const playdate_sound_envelope,
8497 pub source: *const playdate_sound_source,
8498 pub controlsignal: *const playdate_control_signal,
8499 pub track: *const playdate_sound_track,
8500 pub instrument: *const playdate_sound_instrument,
8501 pub getCurrentTime: ::core::option::Option<unsafe extern "C" fn() -> u32>,
8502 pub addSource: ::core::option::Option<
8503 unsafe extern "C" fn(
8504 callback: AudioSourceFunction,
8505 context: *mut ctypes::c_void,
8506 stereo: ctypes::c_int,
8507 ) -> *mut SoundSource,
8508 >,
8509 pub getDefaultChannel: ::core::option::Option<unsafe extern "C" fn() -> *mut SoundChannel>,
8510 pub addChannel:
8511 ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel) -> ctypes::c_int>,
8512 pub removeChannel:
8513 ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel) -> ctypes::c_int>,
8514 pub setMicCallback: ::core::option::Option<
8515 unsafe extern "C" fn(
8516 callback: RecordCallback,
8517 context: *mut ctypes::c_void,
8518 forceInternal: ctypes::c_int,
8519 ),
8520 >,
8521 pub getHeadphoneState: ::core::option::Option<
8522 unsafe extern "C" fn(
8523 headphone: *mut ctypes::c_int,
8524 headsetmic: *mut ctypes::c_int,
8525 changeCallback: ::core::option::Option<
8526 unsafe extern "C" fn(headphone: ctypes::c_int, mic: ctypes::c_int),
8527 >,
8528 ),
8529 >,
8530 pub setOutputsActive: ::core::option::Option<
8531 unsafe extern "C" fn(headphone: ctypes::c_int, speaker: ctypes::c_int),
8532 >,
8533 pub removeSource:
8534 ::core::option::Option<unsafe extern "C" fn(source: *mut SoundSource) -> ctypes::c_int>,
8535 pub signal: *const playdate_sound_signal,
8536}
8537#[test]
8538fn bindgen_test_layout_playdate_sound() {
8539 const UNINIT: ::core::mem::MaybeUninit<playdate_sound> = ::core::mem::MaybeUninit::uninit();
8540 let ptr = UNINIT.as_ptr();
8541 assert_eq!(
8542 ::core::mem::size_of::<playdate_sound>(),
8543 184usize,
8544 concat!("Size of: ", stringify!(playdate_sound))
8545 );
8546 assert_eq!(
8547 ::core::mem::align_of::<playdate_sound>(),
8548 8usize,
8549 concat!("Alignment of ", stringify!(playdate_sound))
8550 );
8551 assert_eq!(
8552 unsafe { ::core::ptr::addr_of!((*ptr).channel) as usize - ptr as usize },
8553 0usize,
8554 concat!(
8555 "Offset of field: ",
8556 stringify!(playdate_sound),
8557 "::",
8558 stringify!(channel)
8559 )
8560 );
8561 assert_eq!(
8562 unsafe { ::core::ptr::addr_of!((*ptr).fileplayer) as usize - ptr as usize },
8563 8usize,
8564 concat!(
8565 "Offset of field: ",
8566 stringify!(playdate_sound),
8567 "::",
8568 stringify!(fileplayer)
8569 )
8570 );
8571 assert_eq!(
8572 unsafe { ::core::ptr::addr_of!((*ptr).sample) as usize - ptr as usize },
8573 16usize,
8574 concat!(
8575 "Offset of field: ",
8576 stringify!(playdate_sound),
8577 "::",
8578 stringify!(sample)
8579 )
8580 );
8581 assert_eq!(
8582 unsafe { ::core::ptr::addr_of!((*ptr).sampleplayer) as usize - ptr as usize },
8583 24usize,
8584 concat!(
8585 "Offset of field: ",
8586 stringify!(playdate_sound),
8587 "::",
8588 stringify!(sampleplayer)
8589 )
8590 );
8591 assert_eq!(
8592 unsafe { ::core::ptr::addr_of!((*ptr).synth) as usize - ptr as usize },
8593 32usize,
8594 concat!(
8595 "Offset of field: ",
8596 stringify!(playdate_sound),
8597 "::",
8598 stringify!(synth)
8599 )
8600 );
8601 assert_eq!(
8602 unsafe { ::core::ptr::addr_of!((*ptr).sequence) as usize - ptr as usize },
8603 40usize,
8604 concat!(
8605 "Offset of field: ",
8606 stringify!(playdate_sound),
8607 "::",
8608 stringify!(sequence)
8609 )
8610 );
8611 assert_eq!(
8612 unsafe { ::core::ptr::addr_of!((*ptr).effect) as usize - ptr as usize },
8613 48usize,
8614 concat!(
8615 "Offset of field: ",
8616 stringify!(playdate_sound),
8617 "::",
8618 stringify!(effect)
8619 )
8620 );
8621 assert_eq!(
8622 unsafe { ::core::ptr::addr_of!((*ptr).lfo) as usize - ptr as usize },
8623 56usize,
8624 concat!(
8625 "Offset of field: ",
8626 stringify!(playdate_sound),
8627 "::",
8628 stringify!(lfo)
8629 )
8630 );
8631 assert_eq!(
8632 unsafe { ::core::ptr::addr_of!((*ptr).envelope) as usize - ptr as usize },
8633 64usize,
8634 concat!(
8635 "Offset of field: ",
8636 stringify!(playdate_sound),
8637 "::",
8638 stringify!(envelope)
8639 )
8640 );
8641 assert_eq!(
8642 unsafe { ::core::ptr::addr_of!((*ptr).source) as usize - ptr as usize },
8643 72usize,
8644 concat!(
8645 "Offset of field: ",
8646 stringify!(playdate_sound),
8647 "::",
8648 stringify!(source)
8649 )
8650 );
8651 assert_eq!(
8652 unsafe { ::core::ptr::addr_of!((*ptr).controlsignal) as usize - ptr as usize },
8653 80usize,
8654 concat!(
8655 "Offset of field: ",
8656 stringify!(playdate_sound),
8657 "::",
8658 stringify!(controlsignal)
8659 )
8660 );
8661 assert_eq!(
8662 unsafe { ::core::ptr::addr_of!((*ptr).track) as usize - ptr as usize },
8663 88usize,
8664 concat!(
8665 "Offset of field: ",
8666 stringify!(playdate_sound),
8667 "::",
8668 stringify!(track)
8669 )
8670 );
8671 assert_eq!(
8672 unsafe { ::core::ptr::addr_of!((*ptr).instrument) as usize - ptr as usize },
8673 96usize,
8674 concat!(
8675 "Offset of field: ",
8676 stringify!(playdate_sound),
8677 "::",
8678 stringify!(instrument)
8679 )
8680 );
8681 assert_eq!(
8682 unsafe { ::core::ptr::addr_of!((*ptr).getCurrentTime) as usize - ptr as usize },
8683 104usize,
8684 concat!(
8685 "Offset of field: ",
8686 stringify!(playdate_sound),
8687 "::",
8688 stringify!(getCurrentTime)
8689 )
8690 );
8691 assert_eq!(
8692 unsafe { ::core::ptr::addr_of!((*ptr).addSource) as usize - ptr as usize },
8693 112usize,
8694 concat!(
8695 "Offset of field: ",
8696 stringify!(playdate_sound),
8697 "::",
8698 stringify!(addSource)
8699 )
8700 );
8701 assert_eq!(
8702 unsafe { ::core::ptr::addr_of!((*ptr).getDefaultChannel) as usize - ptr as usize },
8703 120usize,
8704 concat!(
8705 "Offset of field: ",
8706 stringify!(playdate_sound),
8707 "::",
8708 stringify!(getDefaultChannel)
8709 )
8710 );
8711 assert_eq!(
8712 unsafe { ::core::ptr::addr_of!((*ptr).addChannel) as usize - ptr as usize },
8713 128usize,
8714 concat!(
8715 "Offset of field: ",
8716 stringify!(playdate_sound),
8717 "::",
8718 stringify!(addChannel)
8719 )
8720 );
8721 assert_eq!(
8722 unsafe { ::core::ptr::addr_of!((*ptr).removeChannel) as usize - ptr as usize },
8723 136usize,
8724 concat!(
8725 "Offset of field: ",
8726 stringify!(playdate_sound),
8727 "::",
8728 stringify!(removeChannel)
8729 )
8730 );
8731 assert_eq!(
8732 unsafe { ::core::ptr::addr_of!((*ptr).setMicCallback) as usize - ptr as usize },
8733 144usize,
8734 concat!(
8735 "Offset of field: ",
8736 stringify!(playdate_sound),
8737 "::",
8738 stringify!(setMicCallback)
8739 )
8740 );
8741 assert_eq!(
8742 unsafe { ::core::ptr::addr_of!((*ptr).getHeadphoneState) as usize - ptr as usize },
8743 152usize,
8744 concat!(
8745 "Offset of field: ",
8746 stringify!(playdate_sound),
8747 "::",
8748 stringify!(getHeadphoneState)
8749 )
8750 );
8751 assert_eq!(
8752 unsafe { ::core::ptr::addr_of!((*ptr).setOutputsActive) as usize - ptr as usize },
8753 160usize,
8754 concat!(
8755 "Offset of field: ",
8756 stringify!(playdate_sound),
8757 "::",
8758 stringify!(setOutputsActive)
8759 )
8760 );
8761 assert_eq!(
8762 unsafe { ::core::ptr::addr_of!((*ptr).removeSource) as usize - ptr as usize },
8763 168usize,
8764 concat!(
8765 "Offset of field: ",
8766 stringify!(playdate_sound),
8767 "::",
8768 stringify!(removeSource)
8769 )
8770 );
8771 assert_eq!(
8772 unsafe { ::core::ptr::addr_of!((*ptr).signal) as usize - ptr as usize },
8773 176usize,
8774 concat!(
8775 "Offset of field: ",
8776 stringify!(playdate_sound),
8777 "::",
8778 stringify!(signal)
8779 )
8780 );
8781}
8782impl Default for playdate_sound {
8783 fn default() -> Self {
8784 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
8785 unsafe {
8786 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
8787 s.assume_init()
8788 }
8789 }
8790}
8791#[repr(C)]
8792#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
8793pub struct playdate_display {
8794 pub getWidth: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
8795 pub getHeight: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
8796 pub setRefreshRate: ::core::option::Option<unsafe extern "C" fn(rate: f32)>,
8797 pub setInverted: ::core::option::Option<unsafe extern "C" fn(flag: ctypes::c_int)>,
8798 pub setScale: ::core::option::Option<unsafe extern "C" fn(s: ctypes::c_uint)>,
8799 pub setMosaic:
8800 ::core::option::Option<unsafe extern "C" fn(x: ctypes::c_uint, y: ctypes::c_uint)>,
8801 pub setFlipped:
8802 ::core::option::Option<unsafe extern "C" fn(x: ctypes::c_int, y: ctypes::c_int)>,
8803 pub setOffset: ::core::option::Option<unsafe extern "C" fn(x: ctypes::c_int, y: ctypes::c_int)>,
8804}
8805#[test]
8806fn bindgen_test_layout_playdate_display() {
8807 const UNINIT: ::core::mem::MaybeUninit<playdate_display> = ::core::mem::MaybeUninit::uninit();
8808 let ptr = UNINIT.as_ptr();
8809 assert_eq!(
8810 ::core::mem::size_of::<playdate_display>(),
8811 64usize,
8812 concat!("Size of: ", stringify!(playdate_display))
8813 );
8814 assert_eq!(
8815 ::core::mem::align_of::<playdate_display>(),
8816 8usize,
8817 concat!("Alignment of ", stringify!(playdate_display))
8818 );
8819 assert_eq!(
8820 unsafe { ::core::ptr::addr_of!((*ptr).getWidth) as usize - ptr as usize },
8821 0usize,
8822 concat!(
8823 "Offset of field: ",
8824 stringify!(playdate_display),
8825 "::",
8826 stringify!(getWidth)
8827 )
8828 );
8829 assert_eq!(
8830 unsafe { ::core::ptr::addr_of!((*ptr).getHeight) as usize - ptr as usize },
8831 8usize,
8832 concat!(
8833 "Offset of field: ",
8834 stringify!(playdate_display),
8835 "::",
8836 stringify!(getHeight)
8837 )
8838 );
8839 assert_eq!(
8840 unsafe { ::core::ptr::addr_of!((*ptr).setRefreshRate) as usize - ptr as usize },
8841 16usize,
8842 concat!(
8843 "Offset of field: ",
8844 stringify!(playdate_display),
8845 "::",
8846 stringify!(setRefreshRate)
8847 )
8848 );
8849 assert_eq!(
8850 unsafe { ::core::ptr::addr_of!((*ptr).setInverted) as usize - ptr as usize },
8851 24usize,
8852 concat!(
8853 "Offset of field: ",
8854 stringify!(playdate_display),
8855 "::",
8856 stringify!(setInverted)
8857 )
8858 );
8859 assert_eq!(
8860 unsafe { ::core::ptr::addr_of!((*ptr).setScale) as usize - ptr as usize },
8861 32usize,
8862 concat!(
8863 "Offset of field: ",
8864 stringify!(playdate_display),
8865 "::",
8866 stringify!(setScale)
8867 )
8868 );
8869 assert_eq!(
8870 unsafe { ::core::ptr::addr_of!((*ptr).setMosaic) as usize - ptr as usize },
8871 40usize,
8872 concat!(
8873 "Offset of field: ",
8874 stringify!(playdate_display),
8875 "::",
8876 stringify!(setMosaic)
8877 )
8878 );
8879 assert_eq!(
8880 unsafe { ::core::ptr::addr_of!((*ptr).setFlipped) as usize - ptr as usize },
8881 48usize,
8882 concat!(
8883 "Offset of field: ",
8884 stringify!(playdate_display),
8885 "::",
8886 stringify!(setFlipped)
8887 )
8888 );
8889 assert_eq!(
8890 unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
8891 56usize,
8892 concat!(
8893 "Offset of field: ",
8894 stringify!(playdate_display),
8895 "::",
8896 stringify!(setOffset)
8897 )
8898 );
8899}
8900#[repr(C)]
8901#[derive(Debug, Copy, Clone, PartialEq, Eq)]
8902pub struct PDScore {
8903 pub rank: u32,
8904 pub value: u32,
8905 pub player: *mut ctypes::c_char,
8906}
8907#[test]
8908fn bindgen_test_layout_PDScore() {
8909 const UNINIT: ::core::mem::MaybeUninit<PDScore> = ::core::mem::MaybeUninit::uninit();
8910 let ptr = UNINIT.as_ptr();
8911 assert_eq!(
8912 ::core::mem::size_of::<PDScore>(),
8913 16usize,
8914 concat!("Size of: ", stringify!(PDScore))
8915 );
8916 assert_eq!(
8917 ::core::mem::align_of::<PDScore>(),
8918 8usize,
8919 concat!("Alignment of ", stringify!(PDScore))
8920 );
8921 assert_eq!(
8922 unsafe { ::core::ptr::addr_of!((*ptr).rank) as usize - ptr as usize },
8923 0usize,
8924 concat!(
8925 "Offset of field: ",
8926 stringify!(PDScore),
8927 "::",
8928 stringify!(rank)
8929 )
8930 );
8931 assert_eq!(
8932 unsafe { ::core::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
8933 4usize,
8934 concat!(
8935 "Offset of field: ",
8936 stringify!(PDScore),
8937 "::",
8938 stringify!(value)
8939 )
8940 );
8941 assert_eq!(
8942 unsafe { ::core::ptr::addr_of!((*ptr).player) as usize - ptr as usize },
8943 8usize,
8944 concat!(
8945 "Offset of field: ",
8946 stringify!(PDScore),
8947 "::",
8948 stringify!(player)
8949 )
8950 );
8951}
8952impl Default for PDScore {
8953 fn default() -> Self {
8954 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
8955 unsafe {
8956 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
8957 s.assume_init()
8958 }
8959 }
8960}
8961#[repr(C)]
8962#[derive(Debug, Copy, Clone, PartialEq, Eq)]
8963pub struct PDScoresList {
8964 pub boardID: *mut ctypes::c_char,
8965 pub count: ctypes::c_uint,
8966 pub lastUpdated: u32,
8967 pub playerIncluded: ctypes::c_int,
8968 pub limit: ctypes::c_uint,
8969 pub scores: *mut PDScore,
8970}
8971#[test]
8972fn bindgen_test_layout_PDScoresList() {
8973 const UNINIT: ::core::mem::MaybeUninit<PDScoresList> = ::core::mem::MaybeUninit::uninit();
8974 let ptr = UNINIT.as_ptr();
8975 assert_eq!(
8976 ::core::mem::size_of::<PDScoresList>(),
8977 32usize,
8978 concat!("Size of: ", stringify!(PDScoresList))
8979 );
8980 assert_eq!(
8981 ::core::mem::align_of::<PDScoresList>(),
8982 8usize,
8983 concat!("Alignment of ", stringify!(PDScoresList))
8984 );
8985 assert_eq!(
8986 unsafe { ::core::ptr::addr_of!((*ptr).boardID) as usize - ptr as usize },
8987 0usize,
8988 concat!(
8989 "Offset of field: ",
8990 stringify!(PDScoresList),
8991 "::",
8992 stringify!(boardID)
8993 )
8994 );
8995 assert_eq!(
8996 unsafe { ::core::ptr::addr_of!((*ptr).count) as usize - ptr as usize },
8997 8usize,
8998 concat!(
8999 "Offset of field: ",
9000 stringify!(PDScoresList),
9001 "::",
9002 stringify!(count)
9003 )
9004 );
9005 assert_eq!(
9006 unsafe { ::core::ptr::addr_of!((*ptr).lastUpdated) as usize - ptr as usize },
9007 12usize,
9008 concat!(
9009 "Offset of field: ",
9010 stringify!(PDScoresList),
9011 "::",
9012 stringify!(lastUpdated)
9013 )
9014 );
9015 assert_eq!(
9016 unsafe { ::core::ptr::addr_of!((*ptr).playerIncluded) as usize - ptr as usize },
9017 16usize,
9018 concat!(
9019 "Offset of field: ",
9020 stringify!(PDScoresList),
9021 "::",
9022 stringify!(playerIncluded)
9023 )
9024 );
9025 assert_eq!(
9026 unsafe { ::core::ptr::addr_of!((*ptr).limit) as usize - ptr as usize },
9027 20usize,
9028 concat!(
9029 "Offset of field: ",
9030 stringify!(PDScoresList),
9031 "::",
9032 stringify!(limit)
9033 )
9034 );
9035 assert_eq!(
9036 unsafe { ::core::ptr::addr_of!((*ptr).scores) as usize - ptr as usize },
9037 24usize,
9038 concat!(
9039 "Offset of field: ",
9040 stringify!(PDScoresList),
9041 "::",
9042 stringify!(scores)
9043 )
9044 );
9045}
9046impl Default for PDScoresList {
9047 fn default() -> Self {
9048 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9049 unsafe {
9050 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9051 s.assume_init()
9052 }
9053 }
9054}
9055#[repr(C)]
9056#[derive(Debug, Copy, Clone, PartialEq, Eq)]
9057pub struct PDBoard {
9058 pub boardID: *mut ctypes::c_char,
9059 pub name: *mut ctypes::c_char,
9060}
9061#[test]
9062fn bindgen_test_layout_PDBoard() {
9063 const UNINIT: ::core::mem::MaybeUninit<PDBoard> = ::core::mem::MaybeUninit::uninit();
9064 let ptr = UNINIT.as_ptr();
9065 assert_eq!(
9066 ::core::mem::size_of::<PDBoard>(),
9067 16usize,
9068 concat!("Size of: ", stringify!(PDBoard))
9069 );
9070 assert_eq!(
9071 ::core::mem::align_of::<PDBoard>(),
9072 8usize,
9073 concat!("Alignment of ", stringify!(PDBoard))
9074 );
9075 assert_eq!(
9076 unsafe { ::core::ptr::addr_of!((*ptr).boardID) as usize - ptr as usize },
9077 0usize,
9078 concat!(
9079 "Offset of field: ",
9080 stringify!(PDBoard),
9081 "::",
9082 stringify!(boardID)
9083 )
9084 );
9085 assert_eq!(
9086 unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
9087 8usize,
9088 concat!(
9089 "Offset of field: ",
9090 stringify!(PDBoard),
9091 "::",
9092 stringify!(name)
9093 )
9094 );
9095}
9096impl Default for PDBoard {
9097 fn default() -> Self {
9098 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9099 unsafe {
9100 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9101 s.assume_init()
9102 }
9103 }
9104}
9105#[repr(C)]
9106#[derive(Debug, Copy, Clone, PartialEq, Eq)]
9107pub struct PDBoardsList {
9108 pub count: ctypes::c_uint,
9109 pub lastUpdated: u32,
9110 pub boards: *mut PDBoard,
9111}
9112#[test]
9113fn bindgen_test_layout_PDBoardsList() {
9114 const UNINIT: ::core::mem::MaybeUninit<PDBoardsList> = ::core::mem::MaybeUninit::uninit();
9115 let ptr = UNINIT.as_ptr();
9116 assert_eq!(
9117 ::core::mem::size_of::<PDBoardsList>(),
9118 16usize,
9119 concat!("Size of: ", stringify!(PDBoardsList))
9120 );
9121 assert_eq!(
9122 ::core::mem::align_of::<PDBoardsList>(),
9123 8usize,
9124 concat!("Alignment of ", stringify!(PDBoardsList))
9125 );
9126 assert_eq!(
9127 unsafe { ::core::ptr::addr_of!((*ptr).count) as usize - ptr as usize },
9128 0usize,
9129 concat!(
9130 "Offset of field: ",
9131 stringify!(PDBoardsList),
9132 "::",
9133 stringify!(count)
9134 )
9135 );
9136 assert_eq!(
9137 unsafe { ::core::ptr::addr_of!((*ptr).lastUpdated) as usize - ptr as usize },
9138 4usize,
9139 concat!(
9140 "Offset of field: ",
9141 stringify!(PDBoardsList),
9142 "::",
9143 stringify!(lastUpdated)
9144 )
9145 );
9146 assert_eq!(
9147 unsafe { ::core::ptr::addr_of!((*ptr).boards) as usize - ptr as usize },
9148 8usize,
9149 concat!(
9150 "Offset of field: ",
9151 stringify!(PDBoardsList),
9152 "::",
9153 stringify!(boards)
9154 )
9155 );
9156}
9157impl Default for PDBoardsList {
9158 fn default() -> Self {
9159 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9160 unsafe {
9161 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9162 s.assume_init()
9163 }
9164 }
9165}
9166pub type AddScoreCallback = ::core::option::Option<
9167 unsafe extern "C" fn(score: *mut PDScore, errorMessage: *const ctypes::c_char),
9168>;
9169pub type PersonalBestCallback = ::core::option::Option<
9170 unsafe extern "C" fn(score: *mut PDScore, errorMessage: *const ctypes::c_char),
9171>;
9172pub type BoardsListCallback = ::core::option::Option<
9173 unsafe extern "C" fn(boards: *mut PDBoardsList, errorMessage: *const ctypes::c_char),
9174>;
9175pub type ScoresCallback = ::core::option::Option<
9176 unsafe extern "C" fn(scores: *mut PDScoresList, errorMessage: *const ctypes::c_char),
9177>;
9178#[repr(C)]
9179#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
9180pub struct playdate_scoreboards {
9181 pub addScore: ::core::option::Option<
9182 unsafe extern "C" fn(
9183 boardId: *const ctypes::c_char,
9184 value: u32,
9185 callback: AddScoreCallback,
9186 ) -> ctypes::c_int,
9187 >,
9188 pub getPersonalBest: ::core::option::Option<
9189 unsafe extern "C" fn(
9190 boardId: *const ctypes::c_char,
9191 callback: PersonalBestCallback,
9192 ) -> ctypes::c_int,
9193 >,
9194 pub freeScore: ::core::option::Option<unsafe extern "C" fn(score: *mut PDScore)>,
9195 pub getScoreboards:
9196 ::core::option::Option<unsafe extern "C" fn(callback: BoardsListCallback) -> ctypes::c_int>,
9197 pub freeBoardsList: ::core::option::Option<unsafe extern "C" fn(boardsList: *mut PDBoardsList)>,
9198 pub getScores: ::core::option::Option<
9199 unsafe extern "C" fn(
9200 boardId: *const ctypes::c_char,
9201 callback: ScoresCallback,
9202 ) -> ctypes::c_int,
9203 >,
9204 pub freeScoresList: ::core::option::Option<unsafe extern "C" fn(scoresList: *mut PDScoresList)>,
9205}
9206#[test]
9207fn bindgen_test_layout_playdate_scoreboards() {
9208 const UNINIT: ::core::mem::MaybeUninit<playdate_scoreboards> =
9209 ::core::mem::MaybeUninit::uninit();
9210 let ptr = UNINIT.as_ptr();
9211 assert_eq!(
9212 ::core::mem::size_of::<playdate_scoreboards>(),
9213 56usize,
9214 concat!("Size of: ", stringify!(playdate_scoreboards))
9215 );
9216 assert_eq!(
9217 ::core::mem::align_of::<playdate_scoreboards>(),
9218 8usize,
9219 concat!("Alignment of ", stringify!(playdate_scoreboards))
9220 );
9221 assert_eq!(
9222 unsafe { ::core::ptr::addr_of!((*ptr).addScore) as usize - ptr as usize },
9223 0usize,
9224 concat!(
9225 "Offset of field: ",
9226 stringify!(playdate_scoreboards),
9227 "::",
9228 stringify!(addScore)
9229 )
9230 );
9231 assert_eq!(
9232 unsafe { ::core::ptr::addr_of!((*ptr).getPersonalBest) as usize - ptr as usize },
9233 8usize,
9234 concat!(
9235 "Offset of field: ",
9236 stringify!(playdate_scoreboards),
9237 "::",
9238 stringify!(getPersonalBest)
9239 )
9240 );
9241 assert_eq!(
9242 unsafe { ::core::ptr::addr_of!((*ptr).freeScore) as usize - ptr as usize },
9243 16usize,
9244 concat!(
9245 "Offset of field: ",
9246 stringify!(playdate_scoreboards),
9247 "::",
9248 stringify!(freeScore)
9249 )
9250 );
9251 assert_eq!(
9252 unsafe { ::core::ptr::addr_of!((*ptr).getScoreboards) as usize - ptr as usize },
9253 24usize,
9254 concat!(
9255 "Offset of field: ",
9256 stringify!(playdate_scoreboards),
9257 "::",
9258 stringify!(getScoreboards)
9259 )
9260 );
9261 assert_eq!(
9262 unsafe { ::core::ptr::addr_of!((*ptr).freeBoardsList) as usize - ptr as usize },
9263 32usize,
9264 concat!(
9265 "Offset of field: ",
9266 stringify!(playdate_scoreboards),
9267 "::",
9268 stringify!(freeBoardsList)
9269 )
9270 );
9271 assert_eq!(
9272 unsafe { ::core::ptr::addr_of!((*ptr).getScores) as usize - ptr as usize },
9273 40usize,
9274 concat!(
9275 "Offset of field: ",
9276 stringify!(playdate_scoreboards),
9277 "::",
9278 stringify!(getScores)
9279 )
9280 );
9281 assert_eq!(
9282 unsafe { ::core::ptr::addr_of!((*ptr).freeScoresList) as usize - ptr as usize },
9283 48usize,
9284 concat!(
9285 "Offset of field: ",
9286 stringify!(playdate_scoreboards),
9287 "::",
9288 stringify!(freeScoresList)
9289 )
9290 );
9291}
9292#[repr(C)]
9293#[derive(Debug, Copy, Clone, PartialEq, Eq)]
9294pub struct PlaydateAPI {
9295 pub system: *const playdate_sys,
9296 pub file: *const playdate_file,
9297 pub graphics: *const playdate_graphics,
9298 pub sprite: *const playdate_sprite,
9299 pub display: *const playdate_display,
9300 pub sound: *const playdate_sound,
9301 pub lua: *const playdate_lua,
9302 pub json: *const playdate_json,
9303 pub scoreboards: *const playdate_scoreboards,
9304}
9305#[test]
9306fn bindgen_test_layout_PlaydateAPI() {
9307 const UNINIT: ::core::mem::MaybeUninit<PlaydateAPI> = ::core::mem::MaybeUninit::uninit();
9308 let ptr = UNINIT.as_ptr();
9309 assert_eq!(
9310 ::core::mem::size_of::<PlaydateAPI>(),
9311 72usize,
9312 concat!("Size of: ", stringify!(PlaydateAPI))
9313 );
9314 assert_eq!(
9315 ::core::mem::align_of::<PlaydateAPI>(),
9316 8usize,
9317 concat!("Alignment of ", stringify!(PlaydateAPI))
9318 );
9319 assert_eq!(
9320 unsafe { ::core::ptr::addr_of!((*ptr).system) as usize - ptr as usize },
9321 0usize,
9322 concat!(
9323 "Offset of field: ",
9324 stringify!(PlaydateAPI),
9325 "::",
9326 stringify!(system)
9327 )
9328 );
9329 assert_eq!(
9330 unsafe { ::core::ptr::addr_of!((*ptr).file) as usize - ptr as usize },
9331 8usize,
9332 concat!(
9333 "Offset of field: ",
9334 stringify!(PlaydateAPI),
9335 "::",
9336 stringify!(file)
9337 )
9338 );
9339 assert_eq!(
9340 unsafe { ::core::ptr::addr_of!((*ptr).graphics) as usize - ptr as usize },
9341 16usize,
9342 concat!(
9343 "Offset of field: ",
9344 stringify!(PlaydateAPI),
9345 "::",
9346 stringify!(graphics)
9347 )
9348 );
9349 assert_eq!(
9350 unsafe { ::core::ptr::addr_of!((*ptr).sprite) as usize - ptr as usize },
9351 24usize,
9352 concat!(
9353 "Offset of field: ",
9354 stringify!(PlaydateAPI),
9355 "::",
9356 stringify!(sprite)
9357 )
9358 );
9359 assert_eq!(
9360 unsafe { ::core::ptr::addr_of!((*ptr).display) as usize - ptr as usize },
9361 32usize,
9362 concat!(
9363 "Offset of field: ",
9364 stringify!(PlaydateAPI),
9365 "::",
9366 stringify!(display)
9367 )
9368 );
9369 assert_eq!(
9370 unsafe { ::core::ptr::addr_of!((*ptr).sound) as usize - ptr as usize },
9371 40usize,
9372 concat!(
9373 "Offset of field: ",
9374 stringify!(PlaydateAPI),
9375 "::",
9376 stringify!(sound)
9377 )
9378 );
9379 assert_eq!(
9380 unsafe { ::core::ptr::addr_of!((*ptr).lua) as usize - ptr as usize },
9381 48usize,
9382 concat!(
9383 "Offset of field: ",
9384 stringify!(PlaydateAPI),
9385 "::",
9386 stringify!(lua)
9387 )
9388 );
9389 assert_eq!(
9390 unsafe { ::core::ptr::addr_of!((*ptr).json) as usize - ptr as usize },
9391 56usize,
9392 concat!(
9393 "Offset of field: ",
9394 stringify!(PlaydateAPI),
9395 "::",
9396 stringify!(json)
9397 )
9398 );
9399 assert_eq!(
9400 unsafe { ::core::ptr::addr_of!((*ptr).scoreboards) as usize - ptr as usize },
9401 64usize,
9402 concat!(
9403 "Offset of field: ",
9404 stringify!(PlaydateAPI),
9405 "::",
9406 stringify!(scoreboards)
9407 )
9408 );
9409}
9410impl Default for PlaydateAPI {
9411 fn default() -> Self {
9412 let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
9413 unsafe {
9414 ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
9415 s.assume_init()
9416 }
9417 }
9418}
9419#[repr(u32)]
9420#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
9421pub enum PDSystemEvent {
9422 kEventInit = 0,
9423 kEventInitLua = 1,
9424 kEventLock = 2,
9425 kEventUnlock = 3,
9426 kEventPause = 4,
9427 kEventResume = 5,
9428 kEventTerminate = 6,
9429 kEventKeyPressed = 7,
9430 kEventKeyReleased = 8,
9431 kEventLowPower = 9,
9432}