#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
storage: Storage,
}
impl<Storage> __BindgenBitfieldUnit<Storage> {
#[inline]
pub const fn new(storage: Storage) -> Self {
Self { storage }
}
}
impl<Storage> __BindgenBitfieldUnit<Storage>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
byte & mask == mask
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
if val {
*byte |= mask;
} else {
*byte &= !mask;
}
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
let mut val = 0;
for i in 0..(bit_width as usize) {
if self.get_bit(i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
}
pub const LCD_COLUMNS: u32 = 400;
pub const LCD_ROWS: u32 = 240;
pub const LCD_ROWSIZE: u32 = 52;
pub const SEEK_SET: u32 = 0;
pub const SEEK_CUR: u32 = 1;
pub const SEEK_END: u32 = 2;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct LCDRect {
pub left: ctypes::c_int,
pub right: ctypes::c_int,
pub top: ctypes::c_int,
pub bottom: ctypes::c_int,
}
#[test]
fn bindgen_test_layout_LCDRect() {
const UNINIT: ::core::mem::MaybeUninit<LCDRect> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<LCDRect>(),
16usize,
concat!("Size of: ", stringify!(LCDRect))
);
assert_eq!(
::core::mem::align_of::<LCDRect>(),
4usize,
concat!("Alignment of ", stringify!(LCDRect))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(LCDRect),
"::",
stringify!(left)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(LCDRect),
"::",
stringify!(right)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).top) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(LCDRect),
"::",
stringify!(top)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).bottom) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(LCDRect),
"::",
stringify!(bottom)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum LCDBitmapDrawMode {
kDrawModeCopy = 0,
kDrawModeWhiteTransparent = 1,
kDrawModeBlackTransparent = 2,
kDrawModeFillWhite = 3,
kDrawModeFillBlack = 4,
kDrawModeXOR = 5,
kDrawModeNXOR = 6,
kDrawModeInverted = 7,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum LCDBitmapFlip {
kBitmapUnflipped = 0,
kBitmapFlippedX = 1,
kBitmapFlippedY = 2,
kBitmapFlippedXY = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum LCDSolidColor {
kColorBlack = 0,
kColorWhite = 1,
kColorClear = 2,
kColorXOR = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum LCDLineCapStyle {
kLineCapStyleButt = 0,
kLineCapStyleSquare = 1,
kLineCapStyleRound = 2,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PDStringEncoding {
kASCIIEncoding = 0,
kUTF8Encoding = 1,
k16BitLEEncoding = 2,
}
pub type LCDPattern = [u8; 16usize];
pub type LCDColor = usize;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum LCDPolygonFillRule {
kPolygonFillNonZero = 0,
kPolygonFillEvenOdd = 1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDBitmap {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDBitmapTable {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDFont {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDFontData {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDFontPage {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDFontGlyph {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDVideoPlayer {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_video {
pub loadVideo: ::core::option::Option<
unsafe extern "C" fn(path: *const ctypes::c_char) -> *mut LCDVideoPlayer,
>,
pub freePlayer: ::core::option::Option<unsafe extern "C" fn(p: *mut LCDVideoPlayer)>,
pub setContext: ::core::option::Option<
unsafe extern "C" fn(p: *mut LCDVideoPlayer, context: *mut LCDBitmap) -> ctypes::c_int,
>,
pub useScreenContext: ::core::option::Option<unsafe extern "C" fn(p: *mut LCDVideoPlayer)>,
pub renderFrame: ::core::option::Option<
unsafe extern "C" fn(p: *mut LCDVideoPlayer, n: ctypes::c_int) -> ctypes::c_int,
>,
pub getError: ::core::option::Option<
unsafe extern "C" fn(p: *mut LCDVideoPlayer) -> *const ctypes::c_char,
>,
pub getInfo: ::core::option::Option<
unsafe extern "C" fn(
p: *mut LCDVideoPlayer,
outWidth: *mut ctypes::c_int,
outHeight: *mut ctypes::c_int,
outFrameRate: *mut f32,
outFrameCount: *mut ctypes::c_int,
outCurrentFrame: *mut ctypes::c_int,
),
>,
pub getContext:
::core::option::Option<unsafe extern "C" fn(p: *mut LCDVideoPlayer) -> *mut LCDBitmap>,
}
#[test]
fn bindgen_test_layout_playdate_video() {
const UNINIT: ::core::mem::MaybeUninit<playdate_video> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_video>(),
64usize,
concat!("Size of: ", stringify!(playdate_video))
);
assert_eq!(
::core::mem::align_of::<playdate_video>(),
8usize,
concat!("Alignment of ", stringify!(playdate_video))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadVideo) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(loadVideo)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freePlayer) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(freePlayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setContext) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(setContext)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).useScreenContext) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(useScreenContext)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).renderFrame) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(renderFrame)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getError) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(getError)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getInfo) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(getInfo)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getContext) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_video),
"::",
stringify!(getContext)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct playdate_graphics {
pub video: *const playdate_video,
pub clear: ::core::option::Option<unsafe extern "C" fn(color: LCDColor)>,
pub setBackgroundColor: ::core::option::Option<unsafe extern "C" fn(color: LCDSolidColor)>,
pub setStencil: ::core::option::Option<unsafe extern "C" fn(stencil: *mut LCDBitmap)>,
pub setDrawMode: ::core::option::Option<unsafe extern "C" fn(mode: LCDBitmapDrawMode)>,
pub setDrawOffset:
::core::option::Option<unsafe extern "C" fn(dx: ctypes::c_int, dy: ctypes::c_int)>,
pub setClipRect: ::core::option::Option<
unsafe extern "C" fn(
x: ctypes::c_int,
y: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
),
>,
pub clearClipRect: ::core::option::Option<unsafe extern "C" fn()>,
pub setLineCapStyle: ::core::option::Option<unsafe extern "C" fn(endCapStyle: LCDLineCapStyle)>,
pub setFont: ::core::option::Option<unsafe extern "C" fn(font: *mut LCDFont)>,
pub setTextTracking: ::core::option::Option<unsafe extern "C" fn(tracking: ctypes::c_int)>,
pub pushContext: ::core::option::Option<unsafe extern "C" fn(target: *mut LCDBitmap)>,
pub popContext: ::core::option::Option<unsafe extern "C" fn()>,
pub drawBitmap: ::core::option::Option<
unsafe extern "C" fn(
bitmap: *mut LCDBitmap,
x: ctypes::c_int,
y: ctypes::c_int,
flip: LCDBitmapFlip,
),
>,
pub tileBitmap: ::core::option::Option<
unsafe extern "C" fn(
bitmap: *mut LCDBitmap,
x: ctypes::c_int,
y: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
flip: LCDBitmapFlip,
),
>,
pub drawLine: ::core::option::Option<
unsafe extern "C" fn(
x1: ctypes::c_int,
y1: ctypes::c_int,
x2: ctypes::c_int,
y2: ctypes::c_int,
width: ctypes::c_int,
color: LCDColor,
),
>,
pub fillTriangle: ::core::option::Option<
unsafe extern "C" fn(
x1: ctypes::c_int,
y1: ctypes::c_int,
x2: ctypes::c_int,
y2: ctypes::c_int,
x3: ctypes::c_int,
y3: ctypes::c_int,
color: LCDColor,
),
>,
pub drawRect: ::core::option::Option<
unsafe extern "C" fn(
x: ctypes::c_int,
y: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
color: LCDColor,
),
>,
pub fillRect: ::core::option::Option<
unsafe extern "C" fn(
x: ctypes::c_int,
y: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
color: LCDColor,
),
>,
pub drawEllipse: ::core::option::Option<
unsafe extern "C" fn(
x: ctypes::c_int,
y: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
lineWidth: ctypes::c_int,
startAngle: f32,
endAngle: f32,
color: LCDColor,
),
>,
pub fillEllipse: ::core::option::Option<
unsafe extern "C" fn(
x: ctypes::c_int,
y: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
startAngle: f32,
endAngle: f32,
color: LCDColor,
),
>,
pub drawScaledBitmap: ::core::option::Option<
unsafe extern "C" fn(
bitmap: *mut LCDBitmap,
x: ctypes::c_int,
y: ctypes::c_int,
xscale: f32,
yscale: f32,
),
>,
pub drawText: ::core::option::Option<
unsafe extern "C" fn(
text: *const ctypes::c_void,
len: usize,
encoding: PDStringEncoding,
x: ctypes::c_int,
y: ctypes::c_int,
) -> ctypes::c_int,
>,
pub newBitmap: ::core::option::Option<
unsafe extern "C" fn(
width: ctypes::c_int,
height: ctypes::c_int,
bgcolor: LCDColor,
) -> *mut LCDBitmap,
>,
pub freeBitmap: ::core::option::Option<unsafe extern "C" fn(arg1: *mut LCDBitmap)>,
pub loadBitmap: ::core::option::Option<
unsafe extern "C" fn(
path: *const ctypes::c_char,
outerr: *mut *const ctypes::c_char,
) -> *mut LCDBitmap,
>,
pub copyBitmap:
::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap) -> *mut LCDBitmap>,
pub loadIntoBitmap: ::core::option::Option<
unsafe extern "C" fn(
path: *const ctypes::c_char,
bitmap: *mut LCDBitmap,
outerr: *mut *const ctypes::c_char,
),
>,
pub getBitmapData: ::core::option::Option<
unsafe extern "C" fn(
bitmap: *mut LCDBitmap,
width: *mut ctypes::c_int,
height: *mut ctypes::c_int,
rowbytes: *mut ctypes::c_int,
mask: *mut *mut u8,
data: *mut *mut u8,
),
>,
pub clearBitmap:
::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap, bgcolor: LCDColor)>,
pub rotatedBitmap: ::core::option::Option<
unsafe extern "C" fn(
bitmap: *mut LCDBitmap,
rotation: f32,
xscale: f32,
yscale: f32,
allocedSize: *mut ctypes::c_int,
) -> *mut LCDBitmap,
>,
pub newBitmapTable: ::core::option::Option<
unsafe extern "C" fn(
count: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
) -> *mut LCDBitmapTable,
>,
pub freeBitmapTable: ::core::option::Option<unsafe extern "C" fn(table: *mut LCDBitmapTable)>,
pub loadBitmapTable: ::core::option::Option<
unsafe extern "C" fn(
path: *const ctypes::c_char,
outerr: *mut *const ctypes::c_char,
) -> *mut LCDBitmapTable,
>,
pub loadIntoBitmapTable: ::core::option::Option<
unsafe extern "C" fn(
path: *const ctypes::c_char,
table: *mut LCDBitmapTable,
outerr: *mut *const ctypes::c_char,
),
>,
pub getTableBitmap: ::core::option::Option<
unsafe extern "C" fn(table: *mut LCDBitmapTable, idx: ctypes::c_int) -> *mut LCDBitmap,
>,
pub loadFont: ::core::option::Option<
unsafe extern "C" fn(
path: *const ctypes::c_char,
outErr: *mut *const ctypes::c_char,
) -> *mut LCDFont,
>,
pub getFontPage: ::core::option::Option<
unsafe extern "C" fn(font: *mut LCDFont, c: u32) -> *mut LCDFontPage,
>,
pub getPageGlyph: ::core::option::Option<
unsafe extern "C" fn(
page: *mut LCDFontPage,
c: u32,
bitmap: *mut *mut LCDBitmap,
advance: *mut ctypes::c_int,
) -> *mut LCDFontGlyph,
>,
pub getGlyphKerning: ::core::option::Option<
unsafe extern "C" fn(
glyph: *mut LCDFontGlyph,
glyphcode: u32,
nextcode: u32,
) -> ctypes::c_int,
>,
pub getTextWidth: ::core::option::Option<
unsafe extern "C" fn(
font: *mut LCDFont,
text: *const ctypes::c_void,
len: usize,
encoding: PDStringEncoding,
tracking: ctypes::c_int,
) -> ctypes::c_int,
>,
pub getFrame: ::core::option::Option<unsafe extern "C" fn() -> *mut u8>,
pub getDisplayFrame: ::core::option::Option<unsafe extern "C" fn() -> *mut u8>,
pub getDebugBitmap: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDBitmap>,
pub copyFrameBufferBitmap: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDBitmap>,
pub markUpdatedRows:
::core::option::Option<unsafe extern "C" fn(start: ctypes::c_int, end: ctypes::c_int)>,
pub display: ::core::option::Option<unsafe extern "C" fn()>,
pub setColorToPattern: ::core::option::Option<
unsafe extern "C" fn(
color: *mut LCDColor,
bitmap: *mut LCDBitmap,
x: ctypes::c_int,
y: ctypes::c_int,
),
>,
pub checkMaskCollision: ::core::option::Option<
unsafe extern "C" fn(
bitmap1: *mut LCDBitmap,
x1: ctypes::c_int,
y1: ctypes::c_int,
flip1: LCDBitmapFlip,
bitmap2: *mut LCDBitmap,
x2: ctypes::c_int,
y2: ctypes::c_int,
flip2: LCDBitmapFlip,
rect: LCDRect,
) -> ctypes::c_int,
>,
pub setScreenClipRect: ::core::option::Option<
unsafe extern "C" fn(
x: ctypes::c_int,
y: ctypes::c_int,
width: ctypes::c_int,
height: ctypes::c_int,
),
>,
pub fillPolygon: ::core::option::Option<
unsafe extern "C" fn(
nPoints: ctypes::c_int,
coords: *mut ctypes::c_int,
color: LCDColor,
fillrule: LCDPolygonFillRule,
),
>,
pub getFontHeight: ::core::option::Option<unsafe extern "C" fn(font: *mut LCDFont) -> u8>,
pub getDisplayBufferBitmap: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDBitmap>,
pub drawRotatedBitmap: ::core::option::Option<
unsafe extern "C" fn(
bitmap: *mut LCDBitmap,
x: ctypes::c_int,
y: ctypes::c_int,
rotation: f32,
centerx: f32,
centery: f32,
xscale: f32,
yscale: f32,
),
>,
pub setTextLeading:
::core::option::Option<unsafe extern "C" fn(lineHeightAdustment: ctypes::c_int)>,
pub setBitmapMask: ::core::option::Option<
unsafe extern "C" fn(bitmap: *mut LCDBitmap, mask: *mut LCDBitmap) -> ctypes::c_int,
>,
pub getBitmapMask:
::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap) -> *mut LCDBitmap>,
pub setStencilImage:
::core::option::Option<unsafe extern "C" fn(stencil: *mut LCDBitmap, tile: ctypes::c_int)>,
pub makeFontFromData: ::core::option::Option<
unsafe extern "C" fn(data: *mut LCDFontData, wide: ctypes::c_int) -> *mut LCDFont,
>,
}
#[test]
fn bindgen_test_layout_playdate_graphics() {
const UNINIT: ::core::mem::MaybeUninit<playdate_graphics> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_graphics>(),
472usize,
concat!("Size of: ", stringify!(playdate_graphics))
);
assert_eq!(
::core::mem::align_of::<playdate_graphics>(),
8usize,
concat!("Alignment of ", stringify!(playdate_graphics))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).video) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(video)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clear) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(clear)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setBackgroundColor) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setBackgroundColor)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setStencil) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setStencil)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDrawMode) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setDrawMode)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDrawOffset) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setDrawOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setClipRect) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setClipRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearClipRect) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(clearClipRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLineCapStyle) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setLineCapStyle)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFont) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setFont)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTextTracking) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setTextTracking)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushContext) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(pushContext)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).popContext) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(popContext)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawBitmap) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(drawBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).tileBitmap) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(tileBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawLine) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(drawLine)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fillTriangle) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(fillTriangle)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawRect) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(drawRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fillRect) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(fillRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawEllipse) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(drawEllipse)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fillEllipse) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(fillEllipse)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawScaledBitmap) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(drawScaledBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawText) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(drawText)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newBitmap) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(newBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeBitmap) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(freeBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadBitmap) as usize - ptr as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(loadBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).copyBitmap) as usize - ptr as usize },
208usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(copyBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadIntoBitmap) as usize - ptr as usize },
216usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(loadIntoBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getBitmapData) as usize - ptr as usize },
224usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getBitmapData)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearBitmap) as usize - ptr as usize },
232usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(clearBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).rotatedBitmap) as usize - ptr as usize },
240usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(rotatedBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newBitmapTable) as usize - ptr as usize },
248usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(newBitmapTable)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeBitmapTable) as usize - ptr as usize },
256usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(freeBitmapTable)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadBitmapTable) as usize - ptr as usize },
264usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(loadBitmapTable)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadIntoBitmapTable) as usize - ptr as usize },
272usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(loadIntoBitmapTable)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTableBitmap) as usize - ptr as usize },
280usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getTableBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadFont) as usize - ptr as usize },
288usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(loadFont)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getFontPage) as usize - ptr as usize },
296usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getFontPage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getPageGlyph) as usize - ptr as usize },
304usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getPageGlyph)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getGlyphKerning) as usize - ptr as usize },
312usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getGlyphKerning)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTextWidth) as usize - ptr as usize },
320usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getTextWidth)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getFrame) as usize - ptr as usize },
328usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getFrame)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getDisplayFrame) as usize - ptr as usize },
336usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getDisplayFrame)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getDebugBitmap) as usize - ptr as usize },
344usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getDebugBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).copyFrameBufferBitmap) as usize - ptr as usize },
352usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(copyFrameBufferBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).markUpdatedRows) as usize - ptr as usize },
360usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(markUpdatedRows)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).display) as usize - ptr as usize },
368usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(display)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setColorToPattern) as usize - ptr as usize },
376usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setColorToPattern)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).checkMaskCollision) as usize - ptr as usize },
384usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(checkMaskCollision)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setScreenClipRect) as usize - ptr as usize },
392usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setScreenClipRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fillPolygon) as usize - ptr as usize },
400usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(fillPolygon)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getFontHeight) as usize - ptr as usize },
408usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getFontHeight)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getDisplayBufferBitmap) as usize - ptr as usize },
416usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getDisplayBufferBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawRotatedBitmap) as usize - ptr as usize },
424usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(drawRotatedBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTextLeading) as usize - ptr as usize },
432usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setTextLeading)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setBitmapMask) as usize - ptr as usize },
440usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setBitmapMask)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getBitmapMask) as usize - ptr as usize },
448usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(getBitmapMask)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setStencilImage) as usize - ptr as usize },
456usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(setStencilImage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).makeFontFromData) as usize - ptr as usize },
464usize,
concat!(
"Offset of field: ",
stringify!(playdate_graphics),
"::",
stringify!(makeFontFromData)
)
);
}
impl Default for playdate_graphics {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
impl PDButtons {
pub const kButtonLeft: PDButtons = PDButtons(1);
}
impl PDButtons {
pub const kButtonRight: PDButtons = PDButtons(2);
}
impl PDButtons {
pub const kButtonUp: PDButtons = PDButtons(4);
}
impl PDButtons {
pub const kButtonDown: PDButtons = PDButtons(8);
}
impl PDButtons {
pub const kButtonB: PDButtons = PDButtons(16);
}
impl PDButtons {
pub const kButtonA: PDButtons = PDButtons(32);
}
impl ::core::ops::BitOr<PDButtons> for PDButtons {
type Output = Self;
#[inline]
fn bitor(self, other: Self) -> Self {
PDButtons(self.0 | other.0)
}
}
impl ::core::ops::BitOrAssign for PDButtons {
#[inline]
fn bitor_assign(&mut self, rhs: PDButtons) {
self.0 |= rhs.0;
}
}
impl ::core::ops::BitAnd<PDButtons> for PDButtons {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self {
PDButtons(self.0 & other.0)
}
}
impl ::core::ops::BitAndAssign for PDButtons {
#[inline]
fn bitand_assign(&mut self, rhs: PDButtons) {
self.0 &= rhs.0;
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct PDButtons(pub ctypes::c_uint);
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PDLanguage {
kPDLanguageEnglish = 0,
kPDLanguageJapanese = 1,
kPDLanguageUnknown = 2,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct PDDateTime {
pub year: u16,
pub month: u8,
pub day: u8,
pub weekday: u8,
pub hour: u8,
pub minute: u8,
pub second: u8,
}
#[test]
fn bindgen_test_layout_PDDateTime() {
const UNINIT: ::core::mem::MaybeUninit<PDDateTime> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<PDDateTime>(),
8usize,
concat!("Size of: ", stringify!(PDDateTime))
);
assert_eq!(
::core::mem::align_of::<PDDateTime>(),
2usize,
concat!("Alignment of ", stringify!(PDDateTime))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).year) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PDDateTime),
"::",
stringify!(year)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).month) as usize - ptr as usize },
2usize,
concat!(
"Offset of field: ",
stringify!(PDDateTime),
"::",
stringify!(month)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).day) as usize - ptr as usize },
3usize,
concat!(
"Offset of field: ",
stringify!(PDDateTime),
"::",
stringify!(day)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).weekday) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(PDDateTime),
"::",
stringify!(weekday)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).hour) as usize - ptr as usize },
5usize,
concat!(
"Offset of field: ",
stringify!(PDDateTime),
"::",
stringify!(hour)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).minute) as usize - ptr as usize },
6usize,
concat!(
"Offset of field: ",
stringify!(PDDateTime),
"::",
stringify!(minute)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).second) as usize - ptr as usize },
7usize,
concat!(
"Offset of field: ",
stringify!(PDDateTime),
"::",
stringify!(second)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PDMenuItem {
_unused: [u8; 0],
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PDPeripherals {
kNone = 0,
kAccelerometer = 1,
kAllPeripherals = 65535,
}
pub type PDCallbackFunction =
::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void) -> ctypes::c_int>;
pub type PDMenuItemCallbackFunction =
::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void)>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sys {
pub realloc: ::core::option::Option<
unsafe extern "C" fn(ptr: *mut ctypes::c_void, size: usize) -> *mut ctypes::c_void,
>,
pub formatString: ::core::option::Option<
unsafe extern "C" fn(
ret: *mut *mut ctypes::c_char,
fmt: *const ctypes::c_char,
...
) -> ctypes::c_int,
>,
pub logToConsole: ::core::option::Option<unsafe extern "C" fn(fmt: *const ctypes::c_char, ...)>,
pub error: ::core::option::Option<unsafe extern "C" fn(fmt: *const ctypes::c_char, ...)>,
pub getLanguage: ::core::option::Option<unsafe extern "C" fn() -> PDLanguage>,
pub getCurrentTimeMilliseconds:
::core::option::Option<unsafe extern "C" fn() -> ctypes::c_uint>,
pub getSecondsSinceEpoch: ::core::option::Option<
unsafe extern "C" fn(milliseconds: *mut ctypes::c_uint) -> ctypes::c_uint,
>,
pub drawFPS: ::core::option::Option<unsafe extern "C" fn(x: ctypes::c_int, y: ctypes::c_int)>,
pub setUpdateCallback: ::core::option::Option<
unsafe extern "C" fn(update: PDCallbackFunction, userdata: *mut ctypes::c_void),
>,
pub getButtonState: ::core::option::Option<
unsafe extern "C" fn(
current: *mut PDButtons,
pushed: *mut PDButtons,
released: *mut PDButtons,
),
>,
pub setPeripheralsEnabled: ::core::option::Option<unsafe extern "C" fn(mask: PDPeripherals)>,
pub getAccelerometer: ::core::option::Option<
unsafe extern "C" fn(outx: *mut f32, outy: *mut f32, outz: *mut f32),
>,
pub getCrankChange: ::core::option::Option<unsafe extern "C" fn() -> f32>,
pub getCrankAngle: ::core::option::Option<unsafe extern "C" fn() -> f32>,
pub isCrankDocked: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub setCrankSoundsDisabled:
::core::option::Option<unsafe extern "C" fn(flag: ctypes::c_int) -> ctypes::c_int>,
pub getFlipped: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub setAutoLockDisabled: ::core::option::Option<unsafe extern "C" fn(disable: ctypes::c_int)>,
pub setMenuImage: ::core::option::Option<
unsafe extern "C" fn(bitmap: *mut LCDBitmap, xOffset: ctypes::c_int),
>,
pub addMenuItem: ::core::option::Option<
unsafe extern "C" fn(
title: *const ctypes::c_char,
callback: PDMenuItemCallbackFunction,
userdata: *mut ctypes::c_void,
) -> *mut PDMenuItem,
>,
pub addCheckmarkMenuItem: ::core::option::Option<
unsafe extern "C" fn(
title: *const ctypes::c_char,
value: ctypes::c_int,
callback: PDMenuItemCallbackFunction,
userdata: *mut ctypes::c_void,
) -> *mut PDMenuItem,
>,
pub addOptionsMenuItem: ::core::option::Option<
unsafe extern "C" fn(
title: *const ctypes::c_char,
optionTitles: *mut *const ctypes::c_char,
optionsCount: ctypes::c_int,
f: PDMenuItemCallbackFunction,
userdata: *mut ctypes::c_void,
) -> *mut PDMenuItem,
>,
pub removeAllMenuItems: ::core::option::Option<unsafe extern "C" fn()>,
pub removeMenuItem: ::core::option::Option<unsafe extern "C" fn(menuItem: *mut PDMenuItem)>,
pub getMenuItemValue:
::core::option::Option<unsafe extern "C" fn(menuItem: *mut PDMenuItem) -> ctypes::c_int>,
pub setMenuItemValue: ::core::option::Option<
unsafe extern "C" fn(menuItem: *mut PDMenuItem, value: ctypes::c_int),
>,
pub getMenuItemTitle: ::core::option::Option<
unsafe extern "C" fn(menuItem: *mut PDMenuItem) -> *const ctypes::c_char,
>,
pub setMenuItemTitle: ::core::option::Option<
unsafe extern "C" fn(menuItem: *mut PDMenuItem, title: *const ctypes::c_char),
>,
pub getMenuItemUserdata: ::core::option::Option<
unsafe extern "C" fn(menuItem: *mut PDMenuItem) -> *mut ctypes::c_void,
>,
pub setMenuItemUserdata: ::core::option::Option<
unsafe extern "C" fn(menuItem: *mut PDMenuItem, ud: *mut ctypes::c_void),
>,
pub getReduceFlashing: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub getElapsedTime: ::core::option::Option<unsafe extern "C" fn() -> f32>,
pub resetElapsedTime: ::core::option::Option<unsafe extern "C" fn()>,
pub getBatteryPercentage: ::core::option::Option<unsafe extern "C" fn() -> f32>,
pub getBatteryVoltage: ::core::option::Option<unsafe extern "C" fn() -> f32>,
pub getTimezoneOffset: ::core::option::Option<unsafe extern "C" fn() -> i32>,
pub shouldDisplay24HourTime: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub convertEpochToDateTime:
::core::option::Option<unsafe extern "C" fn(epoch: u32, datetime: *mut PDDateTime)>,
pub convertDateTimeToEpoch:
::core::option::Option<unsafe extern "C" fn(datetime: *mut PDDateTime) -> u32>,
pub clearICache: ::core::option::Option<unsafe extern "C" fn()>,
}
#[test]
fn bindgen_test_layout_playdate_sys() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sys> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sys>(),
320usize,
concat!("Size of: ", stringify!(playdate_sys))
);
assert_eq!(
::core::mem::align_of::<playdate_sys>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sys))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).realloc) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(realloc)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).formatString) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(formatString)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).logToConsole) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(logToConsole)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).error) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(error)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getLanguage) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getLanguage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getCurrentTimeMilliseconds) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getCurrentTimeMilliseconds)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getSecondsSinceEpoch) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getSecondsSinceEpoch)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawFPS) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(drawFPS)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUpdateCallback) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setUpdateCallback)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getButtonState) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getButtonState)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPeripheralsEnabled) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setPeripheralsEnabled)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getAccelerometer) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getAccelerometer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getCrankChange) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getCrankChange)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getCrankAngle) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getCrankAngle)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isCrankDocked) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(isCrankDocked)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setCrankSoundsDisabled) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setCrankSoundsDisabled)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getFlipped) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getFlipped)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setAutoLockDisabled) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setAutoLockDisabled)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMenuImage) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setMenuImage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addMenuItem) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(addMenuItem)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addCheckmarkMenuItem) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(addCheckmarkMenuItem)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addOptionsMenuItem) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(addOptionsMenuItem)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeAllMenuItems) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(removeAllMenuItems)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeMenuItem) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(removeMenuItem)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getMenuItemValue) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getMenuItemValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMenuItemValue) as usize - ptr as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setMenuItemValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getMenuItemTitle) as usize - ptr as usize },
208usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getMenuItemTitle)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMenuItemTitle) as usize - ptr as usize },
216usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setMenuItemTitle)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getMenuItemUserdata) as usize - ptr as usize },
224usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getMenuItemUserdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMenuItemUserdata) as usize - ptr as usize },
232usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(setMenuItemUserdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getReduceFlashing) as usize - ptr as usize },
240usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getReduceFlashing)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getElapsedTime) as usize - ptr as usize },
248usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getElapsedTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).resetElapsedTime) as usize - ptr as usize },
256usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(resetElapsedTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getBatteryPercentage) as usize - ptr as usize },
264usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getBatteryPercentage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getBatteryVoltage) as usize - ptr as usize },
272usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getBatteryVoltage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTimezoneOffset) as usize - ptr as usize },
280usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(getTimezoneOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).shouldDisplay24HourTime) as usize - ptr as usize },
288usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(shouldDisplay24HourTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).convertEpochToDateTime) as usize - ptr as usize },
296usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(convertEpochToDateTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).convertDateTimeToEpoch) as usize - ptr as usize },
304usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(convertDateTimeToEpoch)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearICache) as usize - ptr as usize },
312usize,
concat!(
"Offset of field: ",
stringify!(playdate_sys),
"::",
stringify!(clearICache)
)
);
}
pub type lua_State = *mut ctypes::c_void;
pub type lua_CFunction =
::core::option::Option<unsafe extern "C" fn(L: *mut lua_State) -> ctypes::c_int>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LuaUDObject {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct LCDSprite {
_unused: [u8; 0],
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum l_valtype {
kInt = 0,
kFloat = 1,
kStr = 2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct lua_reg {
pub name: *const ctypes::c_char,
pub func: lua_CFunction,
}
#[test]
fn bindgen_test_layout_lua_reg() {
const UNINIT: ::core::mem::MaybeUninit<lua_reg> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<lua_reg>(),
16usize,
concat!("Size of: ", stringify!(lua_reg))
);
assert_eq!(
::core::mem::align_of::<lua_reg>(),
8usize,
concat!("Alignment of ", stringify!(lua_reg))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(lua_reg),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).func) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(lua_reg),
"::",
stringify!(func)
)
);
}
impl Default for lua_reg {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum LuaType {
kTypeNil = 0,
kTypeBool = 1,
kTypeInt = 2,
kTypeFloat = 3,
kTypeString = 4,
kTypeTable = 5,
kTypeFunction = 6,
kTypeThread = 7,
kTypeObject = 8,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct lua_val {
pub name: *const ctypes::c_char,
pub type_: l_valtype,
pub v: lua_val__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union lua_val__bindgen_ty_1 {
pub intval: ctypes::c_uint,
pub floatval: f32,
pub strval: *const ctypes::c_char,
}
#[test]
fn bindgen_test_layout_lua_val__bindgen_ty_1() {
const UNINIT: ::core::mem::MaybeUninit<lua_val__bindgen_ty_1> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<lua_val__bindgen_ty_1>(),
8usize,
concat!("Size of: ", stringify!(lua_val__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<lua_val__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(lua_val__bindgen_ty_1))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).intval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(lua_val__bindgen_ty_1),
"::",
stringify!(intval)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).floatval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(lua_val__bindgen_ty_1),
"::",
stringify!(floatval)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).strval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(lua_val__bindgen_ty_1),
"::",
stringify!(strval)
)
);
}
impl Default for lua_val__bindgen_ty_1 {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
fn bindgen_test_layout_lua_val() {
const UNINIT: ::core::mem::MaybeUninit<lua_val> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<lua_val>(),
24usize,
concat!("Size of: ", stringify!(lua_val))
);
assert_eq!(
::core::mem::align_of::<lua_val>(),
8usize,
concat!("Alignment of ", stringify!(lua_val))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(lua_val),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(lua_val),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).v) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(lua_val),
"::",
stringify!(v)
)
);
}
impl Default for lua_val {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_lua {
pub addFunction: ::core::option::Option<
unsafe extern "C" fn(
f: lua_CFunction,
name: *const ctypes::c_char,
outErr: *mut *const ctypes::c_char,
) -> ctypes::c_int,
>,
pub registerClass: ::core::option::Option<
unsafe extern "C" fn(
name: *const ctypes::c_char,
reg: *const lua_reg,
vals: *const lua_val,
isstatic: ctypes::c_int,
outErr: *mut *const ctypes::c_char,
) -> ctypes::c_int,
>,
pub pushFunction: ::core::option::Option<unsafe extern "C" fn(f: lua_CFunction)>,
pub indexMetatable: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub stop: ::core::option::Option<unsafe extern "C" fn()>,
pub start: ::core::option::Option<unsafe extern "C" fn()>,
pub getArgCount: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub getArgType: ::core::option::Option<
unsafe extern "C" fn(pos: ctypes::c_int, outClass: *mut *const ctypes::c_char) -> LuaType,
>,
pub argIsNil: ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> ctypes::c_int>,
pub getArgBool:
::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> ctypes::c_int>,
pub getArgInt:
::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> ctypes::c_int>,
pub getArgFloat: ::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> f32>,
pub getArgString:
::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> *const ctypes::c_char>,
pub getArgBytes: ::core::option::Option<
unsafe extern "C" fn(pos: ctypes::c_int, outlen: *mut usize) -> *const ctypes::c_char,
>,
pub getArgObject: ::core::option::Option<
unsafe extern "C" fn(
pos: ctypes::c_int,
type_: *mut ctypes::c_char,
outud: *mut *mut LuaUDObject,
) -> *mut ctypes::c_void,
>,
pub getBitmap:
::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> *mut LCDBitmap>,
pub getSprite:
::core::option::Option<unsafe extern "C" fn(pos: ctypes::c_int) -> *mut LCDSprite>,
pub pushNil: ::core::option::Option<unsafe extern "C" fn()>,
pub pushBool: ::core::option::Option<unsafe extern "C" fn(val: ctypes::c_int)>,
pub pushInt: ::core::option::Option<unsafe extern "C" fn(val: ctypes::c_int)>,
pub pushFloat: ::core::option::Option<unsafe extern "C" fn(val: f32)>,
pub pushString: ::core::option::Option<unsafe extern "C" fn(str_: *const ctypes::c_char)>,
pub pushBytes:
::core::option::Option<unsafe extern "C" fn(str_: *const ctypes::c_char, len: usize)>,
pub pushBitmap: ::core::option::Option<unsafe extern "C" fn(bitmap: *mut LCDBitmap)>,
pub pushSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub pushObject: ::core::option::Option<
unsafe extern "C" fn(
obj: *mut ctypes::c_void,
type_: *mut ctypes::c_char,
nValues: ctypes::c_int,
) -> *mut LuaUDObject,
>,
pub retainObject:
::core::option::Option<unsafe extern "C" fn(obj: *mut LuaUDObject) -> *mut LuaUDObject>,
pub releaseObject: ::core::option::Option<unsafe extern "C" fn(obj: *mut LuaUDObject)>,
pub setUserValue:
::core::option::Option<unsafe extern "C" fn(obj: *mut LuaUDObject, slot: ctypes::c_uint)>,
pub getUserValue: ::core::option::Option<
unsafe extern "C" fn(obj: *mut LuaUDObject, slot: ctypes::c_uint) -> ctypes::c_int,
>,
pub callFunction_deprecated: ::core::option::Option<
unsafe extern "C" fn(name: *const ctypes::c_char, nargs: ctypes::c_int),
>,
pub callFunction: ::core::option::Option<
unsafe extern "C" fn(
name: *const ctypes::c_char,
nargs: ctypes::c_int,
outerr: *mut *const ctypes::c_char,
) -> ctypes::c_int,
>,
}
#[test]
fn bindgen_test_layout_playdate_lua() {
const UNINIT: ::core::mem::MaybeUninit<playdate_lua> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_lua>(),
256usize,
concat!("Size of: ", stringify!(playdate_lua))
);
assert_eq!(
::core::mem::align_of::<playdate_lua>(),
8usize,
concat!("Alignment of ", stringify!(playdate_lua))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addFunction) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(addFunction)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).registerClass) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(registerClass)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushFunction) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushFunction)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).indexMetatable) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(indexMetatable)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(stop)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).start) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(start)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgCount) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgCount)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgType) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgType)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).argIsNil) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(argIsNil)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgBool) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgBool)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgInt) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgInt)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgFloat) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgFloat)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgString) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgString)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgBytes) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgBytes)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getArgObject) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getArgObject)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getBitmap) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getSprite) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getSprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushNil) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushNil)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushBool) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushBool)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushInt) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushInt)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushFloat) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushFloat)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushString) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushString)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushBytes) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushBytes)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushBitmap) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushBitmap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushSprite) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushSprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pushObject) as usize - ptr as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(pushObject)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).retainObject) as usize - ptr as usize },
208usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(retainObject)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).releaseObject) as usize - ptr as usize },
216usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(releaseObject)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUserValue) as usize - ptr as usize },
224usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(setUserValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getUserValue) as usize - ptr as usize },
232usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(getUserValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).callFunction_deprecated) as usize - ptr as usize },
240usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(callFunction_deprecated)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).callFunction) as usize - ptr as usize },
248usize,
concat!(
"Offset of field: ",
stringify!(playdate_lua),
"::",
stringify!(callFunction)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum json_value_type {
kJSONNull = 0,
kJSONTrue = 1,
kJSONFalse = 2,
kJSONInteger = 3,
kJSONFloat = 4,
kJSONString = 5,
kJSONArray = 6,
kJSONTable = 7,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct json_value {
pub type_: ctypes::c_char,
pub data: json_value__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union json_value__bindgen_ty_1 {
pub intval: ctypes::c_int,
pub floatval: f32,
pub stringval: *mut ctypes::c_char,
pub arrayval: *mut ctypes::c_void,
pub tableval: *mut ctypes::c_void,
}
#[test]
fn bindgen_test_layout_json_value__bindgen_ty_1() {
const UNINIT: ::core::mem::MaybeUninit<json_value__bindgen_ty_1> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<json_value__bindgen_ty_1>(),
8usize,
concat!("Size of: ", stringify!(json_value__bindgen_ty_1))
);
assert_eq!(
::core::mem::align_of::<json_value__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(json_value__bindgen_ty_1))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).intval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_value__bindgen_ty_1),
"::",
stringify!(intval)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).floatval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_value__bindgen_ty_1),
"::",
stringify!(floatval)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).stringval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_value__bindgen_ty_1),
"::",
stringify!(stringval)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).arrayval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_value__bindgen_ty_1),
"::",
stringify!(arrayval)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).tableval) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_value__bindgen_ty_1),
"::",
stringify!(tableval)
)
);
}
impl Default for json_value__bindgen_ty_1 {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[test]
fn bindgen_test_layout_json_value() {
const UNINIT: ::core::mem::MaybeUninit<json_value> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<json_value>(),
16usize,
concat!("Size of: ", stringify!(json_value))
);
assert_eq!(
::core::mem::align_of::<json_value>(),
8usize,
concat!("Alignment of ", stringify!(json_value))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_value),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(json_value),
"::",
stringify!(data)
)
);
}
impl Default for json_value {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct json_decoder {
pub decodeError: ::core::option::Option<
unsafe extern "C" fn(
decoder: *mut json_decoder,
error: *const ctypes::c_char,
linenum: ctypes::c_int,
),
>,
pub willDecodeSublist: ::core::option::Option<
unsafe extern "C" fn(
decoder: *mut json_decoder,
name: *const ctypes::c_char,
type_: json_value_type,
),
>,
pub shouldDecodeTableValueForKey: ::core::option::Option<
unsafe extern "C" fn(
decoder: *mut json_decoder,
key: *const ctypes::c_char,
) -> ctypes::c_int,
>,
pub didDecodeTableValue: ::core::option::Option<
unsafe extern "C" fn(
decoder: *mut json_decoder,
key: *const ctypes::c_char,
value: json_value,
),
>,
pub shouldDecodeArrayValueAtIndex: ::core::option::Option<
unsafe extern "C" fn(decoder: *mut json_decoder, pos: ctypes::c_int) -> ctypes::c_int,
>,
pub didDecodeArrayValue: ::core::option::Option<
unsafe extern "C" fn(decoder: *mut json_decoder, pos: ctypes::c_int, value: json_value),
>,
pub didDecodeSublist: ::core::option::Option<
unsafe extern "C" fn(
decoder: *mut json_decoder,
name: *const ctypes::c_char,
type_: json_value_type,
) -> *mut ctypes::c_void,
>,
pub userdata: *mut ctypes::c_void,
pub returnString: ctypes::c_int,
pub path: *const ctypes::c_char,
}
#[test]
fn bindgen_test_layout_json_decoder() {
const UNINIT: ::core::mem::MaybeUninit<json_decoder> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<json_decoder>(),
80usize,
concat!("Size of: ", stringify!(json_decoder))
);
assert_eq!(
::core::mem::align_of::<json_decoder>(),
8usize,
concat!("Alignment of ", stringify!(json_decoder))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).decodeError) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(decodeError)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).willDecodeSublist) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(willDecodeSublist)
)
);
assert_eq!(
unsafe {
::core::ptr::addr_of!((*ptr).shouldDecodeTableValueForKey) as usize - ptr as usize
},
16usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(shouldDecodeTableValueForKey)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).didDecodeTableValue) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(didDecodeTableValue)
)
);
assert_eq!(
unsafe {
::core::ptr::addr_of!((*ptr).shouldDecodeArrayValueAtIndex) as usize - ptr as usize
},
32usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(shouldDecodeArrayValueAtIndex)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).didDecodeArrayValue) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(didDecodeArrayValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).didDecodeSublist) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(didDecodeSublist)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(userdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).returnString) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(returnString)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).path) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(json_decoder),
"::",
stringify!(path)
)
);
}
impl Default for json_decoder {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct json_reader {
pub read: ::core::option::Option<
unsafe extern "C" fn(
userdata: *mut ctypes::c_void,
buf: *mut u8,
bufsize: ctypes::c_int,
) -> ctypes::c_int,
>,
pub userdata: *mut ctypes::c_void,
}
#[test]
fn bindgen_test_layout_json_reader() {
const UNINIT: ::core::mem::MaybeUninit<json_reader> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<json_reader>(),
16usize,
concat!("Size of: ", stringify!(json_reader))
);
assert_eq!(
::core::mem::align_of::<json_reader>(),
8usize,
concat!("Alignment of ", stringify!(json_reader))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_reader),
"::",
stringify!(read)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(json_reader),
"::",
stringify!(userdata)
)
);
}
impl Default for json_reader {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type writeFunc = ::core::option::Option<
unsafe extern "C" fn(
userdata: *mut ctypes::c_void,
str_: *const ctypes::c_char,
len: ctypes::c_int,
),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct json_encoder {
pub writeStringFunc: writeFunc,
pub userdata: *mut ctypes::c_void,
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
pub startArray: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub addArrayMember: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub endArray: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub startTable: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub addTableMember: ::core::option::Option<
unsafe extern "C" fn(
encoder: *mut json_encoder,
name: *const ctypes::c_char,
len: ctypes::c_int,
),
>,
pub endTable: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub writeNull: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub writeFalse: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub writeTrue: ::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder)>,
pub writeInt: ::core::option::Option<
unsafe extern "C" fn(encoder: *mut json_encoder, num: ctypes::c_int),
>,
pub writeDouble:
::core::option::Option<unsafe extern "C" fn(encoder: *mut json_encoder, num: f64)>,
pub writeString: ::core::option::Option<
unsafe extern "C" fn(
encoder: *mut json_encoder,
str_: *const ctypes::c_char,
len: ctypes::c_int,
),
>,
}
#[test]
fn bindgen_test_layout_json_encoder() {
const UNINIT: ::core::mem::MaybeUninit<json_encoder> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<json_encoder>(),
120usize,
concat!("Size of: ", stringify!(json_encoder))
);
assert_eq!(
::core::mem::align_of::<json_encoder>(),
8usize,
concat!("Alignment of ", stringify!(json_encoder))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).writeStringFunc) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(writeStringFunc)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).userdata) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(userdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).startArray) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(startArray)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addArrayMember) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(addArrayMember)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).endArray) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(endArray)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).startTable) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(startTable)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addTableMember) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(addTableMember)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).endTable) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(endTable)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).writeNull) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(writeNull)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).writeFalse) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(writeFalse)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).writeTrue) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(writeTrue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).writeInt) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(writeInt)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).writeDouble) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(writeDouble)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).writeString) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(json_encoder),
"::",
stringify!(writeString)
)
);
}
impl Default for json_encoder {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
impl json_encoder {
#[inline]
pub fn pretty(&self) -> ctypes::c_int {
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) }
}
#[inline]
pub fn set_pretty(&mut self, val: ctypes::c_int) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(0usize, 1u8, val as u64)
}
}
#[inline]
pub fn startedTable(&self) -> ctypes::c_int {
unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
}
#[inline]
pub fn set_startedTable(&mut self, val: ctypes::c_int) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline]
pub fn startedArray(&self) -> ctypes::c_int {
unsafe { ::core::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) }
}
#[inline]
pub fn set_startedArray(&mut self, val: ctypes::c_int) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(2usize, 1u8, val as u64)
}
}
#[inline]
pub fn depth(&self) -> ctypes::c_int {
unsafe { ::core::mem::transmute(self._bitfield_1.get(3usize, 29u8) as u32) }
}
#[inline]
pub fn set_depth(&mut self, val: ctypes::c_int) {
unsafe {
let val: u32 = ::core::mem::transmute(val);
self._bitfield_1.set(3usize, 29u8, val as u64)
}
}
#[inline]
pub fn new_bitfield_1(
pretty: ctypes::c_int,
startedTable: ctypes::c_int,
startedArray: ctypes::c_int,
depth: ctypes::c_int,
) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 1u8, {
let pretty: u32 = unsafe { ::core::mem::transmute(pretty) };
pretty as u64
});
__bindgen_bitfield_unit.set(1usize, 1u8, {
let startedTable: u32 = unsafe { ::core::mem::transmute(startedTable) };
startedTable as u64
});
__bindgen_bitfield_unit.set(2usize, 1u8, {
let startedArray: u32 = unsafe { ::core::mem::transmute(startedArray) };
startedArray as u64
});
__bindgen_bitfield_unit.set(3usize, 29u8, {
let depth: u32 = unsafe { ::core::mem::transmute(depth) };
depth as u64
});
__bindgen_bitfield_unit
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_json {
pub initEncoder: ::core::option::Option<
unsafe extern "C" fn(
encoder: *mut json_encoder,
write: writeFunc,
userdata: *mut ctypes::c_void,
pretty: ctypes::c_int,
),
>,
pub decode: ::core::option::Option<
unsafe extern "C" fn(
functions: *mut json_decoder,
reader: json_reader,
outval: *mut json_value,
) -> ctypes::c_int,
>,
pub decodeString: ::core::option::Option<
unsafe extern "C" fn(
functions: *mut json_decoder,
jsonString: *const ctypes::c_char,
outval: *mut json_value,
) -> ctypes::c_int,
>,
}
#[test]
fn bindgen_test_layout_playdate_json() {
const UNINIT: ::core::mem::MaybeUninit<playdate_json> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_json>(),
24usize,
concat!("Size of: ", stringify!(playdate_json))
);
assert_eq!(
::core::mem::align_of::<playdate_json>(),
8usize,
concat!("Alignment of ", stringify!(playdate_json))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).initEncoder) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_json),
"::",
stringify!(initEncoder)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).decode) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_json),
"::",
stringify!(decode)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).decodeString) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_json),
"::",
stringify!(decodeString)
)
);
}
pub type SDFile = ctypes::c_void;
impl FileOptions {
pub const kFileRead: FileOptions = FileOptions(1);
}
impl FileOptions {
pub const kFileReadData: FileOptions = FileOptions(2);
}
impl FileOptions {
pub const kFileWrite: FileOptions = FileOptions(4);
}
impl FileOptions {
pub const kFileAppend: FileOptions = FileOptions(8);
}
impl ::core::ops::BitOr<FileOptions> for FileOptions {
type Output = Self;
#[inline]
fn bitor(self, other: Self) -> Self {
FileOptions(self.0 | other.0)
}
}
impl ::core::ops::BitOrAssign for FileOptions {
#[inline]
fn bitor_assign(&mut self, rhs: FileOptions) {
self.0 |= rhs.0;
}
}
impl ::core::ops::BitAnd<FileOptions> for FileOptions {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self {
FileOptions(self.0 & other.0)
}
}
impl ::core::ops::BitAndAssign for FileOptions {
#[inline]
fn bitand_assign(&mut self, rhs: FileOptions) {
self.0 &= rhs.0;
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct FileOptions(pub ctypes::c_uint);
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct FileStat {
pub isdir: ctypes::c_int,
pub size: ctypes::c_uint,
pub m_year: ctypes::c_int,
pub m_month: ctypes::c_int,
pub m_day: ctypes::c_int,
pub m_hour: ctypes::c_int,
pub m_minute: ctypes::c_int,
pub m_second: ctypes::c_int,
}
#[test]
fn bindgen_test_layout_FileStat() {
const UNINIT: ::core::mem::MaybeUninit<FileStat> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<FileStat>(),
32usize,
concat!("Size of: ", stringify!(FileStat))
);
assert_eq!(
::core::mem::align_of::<FileStat>(),
4usize,
concat!("Alignment of ", stringify!(FileStat))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isdir) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(isdir)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).m_year) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(m_year)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).m_month) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(m_month)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).m_day) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(m_day)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).m_hour) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(m_hour)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).m_minute) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(m_minute)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).m_second) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(FileStat),
"::",
stringify!(m_second)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_file {
pub geterr: ::core::option::Option<unsafe extern "C" fn() -> *const ctypes::c_char>,
pub listfiles: ::core::option::Option<
unsafe extern "C" fn(
path: *const ctypes::c_char,
callback: ::core::option::Option<
unsafe extern "C" fn(path: *const ctypes::c_char, userdata: *mut ctypes::c_void),
>,
userdata: *mut ctypes::c_void,
showhidden: ctypes::c_int,
) -> ctypes::c_int,
>,
pub stat: ::core::option::Option<
unsafe extern "C" fn(path: *const ctypes::c_char, stat: *mut FileStat) -> ctypes::c_int,
>,
pub mkdir:
::core::option::Option<unsafe extern "C" fn(path: *const ctypes::c_char) -> ctypes::c_int>,
pub unlink: ::core::option::Option<
unsafe extern "C" fn(
name: *const ctypes::c_char,
recursive: ctypes::c_int,
) -> ctypes::c_int,
>,
pub rename: ::core::option::Option<
unsafe extern "C" fn(
from: *const ctypes::c_char,
to: *const ctypes::c_char,
) -> ctypes::c_int,
>,
pub open: ::core::option::Option<
unsafe extern "C" fn(name: *const ctypes::c_char, mode: FileOptions) -> *mut SDFile,
>,
pub close: ::core::option::Option<unsafe extern "C" fn(file: *mut SDFile) -> ctypes::c_int>,
pub read: ::core::option::Option<
unsafe extern "C" fn(
file: *mut SDFile,
buf: *mut ctypes::c_void,
len: ctypes::c_uint,
) -> ctypes::c_int,
>,
pub write: ::core::option::Option<
unsafe extern "C" fn(
file: *mut SDFile,
buf: *const ctypes::c_void,
len: ctypes::c_uint,
) -> ctypes::c_int,
>,
pub flush: ::core::option::Option<unsafe extern "C" fn(file: *mut SDFile) -> ctypes::c_int>,
pub tell: ::core::option::Option<unsafe extern "C" fn(file: *mut SDFile) -> ctypes::c_int>,
pub seek: ::core::option::Option<
unsafe extern "C" fn(
file: *mut SDFile,
pos: ctypes::c_int,
whence: ctypes::c_int,
) -> ctypes::c_int,
>,
}
#[test]
fn bindgen_test_layout_playdate_file() {
const UNINIT: ::core::mem::MaybeUninit<playdate_file> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_file>(),
104usize,
concat!("Size of: ", stringify!(playdate_file))
);
assert_eq!(
::core::mem::align_of::<playdate_file>(),
8usize,
concat!("Alignment of ", stringify!(playdate_file))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).geterr) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(geterr)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).listfiles) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(listfiles)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).stat) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(stat)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).mkdir) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(mkdir)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).unlink) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(unlink)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).rename) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(rename)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).open) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(open)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).close) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(close)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(read)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).write) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(write)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).flush) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(flush)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).tell) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(tell)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).seek) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_file),
"::",
stringify!(seek)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum SpriteCollisionResponseType {
kCollisionTypeSlide = 0,
kCollisionTypeFreeze = 1,
kCollisionTypeOverlap = 2,
kCollisionTypeBounce = 3,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct PDRect {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}
#[test]
fn bindgen_test_layout_PDRect() {
const UNINIT: ::core::mem::MaybeUninit<PDRect> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<PDRect>(),
16usize,
concat!("Size of: ", stringify!(PDRect))
);
assert_eq!(
::core::mem::align_of::<PDRect>(),
4usize,
concat!("Alignment of ", stringify!(PDRect))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
0usize,
concat!("Offset of field: ", stringify!(PDRect), "::", stringify!(x))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
4usize,
concat!("Offset of field: ", stringify!(PDRect), "::", stringify!(y))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).width) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PDRect),
"::",
stringify!(width)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).height) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(PDRect),
"::",
stringify!(height)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct CollisionPoint {
pub x: f32,
pub y: f32,
}
#[test]
fn bindgen_test_layout_CollisionPoint() {
const UNINIT: ::core::mem::MaybeUninit<CollisionPoint> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<CollisionPoint>(),
8usize,
concat!("Size of: ", stringify!(CollisionPoint))
);
assert_eq!(
::core::mem::align_of::<CollisionPoint>(),
4usize,
concat!("Alignment of ", stringify!(CollisionPoint))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(CollisionPoint),
"::",
stringify!(x)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(CollisionPoint),
"::",
stringify!(y)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct CollisionVector {
pub x: ctypes::c_int,
pub y: ctypes::c_int,
}
#[test]
fn bindgen_test_layout_CollisionVector() {
const UNINIT: ::core::mem::MaybeUninit<CollisionVector> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<CollisionVector>(),
8usize,
concat!("Size of: ", stringify!(CollisionVector))
);
assert_eq!(
::core::mem::align_of::<CollisionVector>(),
4usize,
concat!("Alignment of ", stringify!(CollisionVector))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(CollisionVector),
"::",
stringify!(x)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).y) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(CollisionVector),
"::",
stringify!(y)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct SpriteCollisionInfo {
pub sprite: *mut LCDSprite,
pub other: *mut LCDSprite,
pub responseType: SpriteCollisionResponseType,
pub overlaps: u8,
pub ti: f32,
pub move_: CollisionPoint,
pub normal: CollisionVector,
pub touch: CollisionPoint,
pub spriteRect: PDRect,
pub otherRect: PDRect,
}
#[test]
fn bindgen_test_layout_SpriteCollisionInfo() {
const UNINIT: ::core::mem::MaybeUninit<SpriteCollisionInfo> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<SpriteCollisionInfo>(),
88usize,
concat!("Size of: ", stringify!(SpriteCollisionInfo))
);
assert_eq!(
::core::mem::align_of::<SpriteCollisionInfo>(),
8usize,
concat!("Alignment of ", stringify!(SpriteCollisionInfo))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sprite) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(sprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).other) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(other)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).responseType) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(responseType)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).overlaps) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(overlaps)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ti) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(ti)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).move_) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(move_)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).normal) as usize - ptr as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(normal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).touch) as usize - ptr as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(touch)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).spriteRect) as usize - ptr as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(spriteRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).otherRect) as usize - ptr as usize },
68usize,
concat!(
"Offset of field: ",
stringify!(SpriteCollisionInfo),
"::",
stringify!(otherRect)
)
);
}
impl Default for SpriteCollisionInfo {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct SpriteQueryInfo {
pub sprite: *mut LCDSprite,
pub ti1: f32,
pub ti2: f32,
pub entryPoint: CollisionPoint,
pub exitPoint: CollisionPoint,
}
#[test]
fn bindgen_test_layout_SpriteQueryInfo() {
const UNINIT: ::core::mem::MaybeUninit<SpriteQueryInfo> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<SpriteQueryInfo>(),
32usize,
concat!("Size of: ", stringify!(SpriteQueryInfo))
);
assert_eq!(
::core::mem::align_of::<SpriteQueryInfo>(),
8usize,
concat!("Alignment of ", stringify!(SpriteQueryInfo))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sprite) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(SpriteQueryInfo),
"::",
stringify!(sprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ti1) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(SpriteQueryInfo),
"::",
stringify!(ti1)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ti2) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(SpriteQueryInfo),
"::",
stringify!(ti2)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).entryPoint) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(SpriteQueryInfo),
"::",
stringify!(entryPoint)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).exitPoint) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(SpriteQueryInfo),
"::",
stringify!(exitPoint)
)
);
}
impl Default for SpriteQueryInfo {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type LCDSpriteDrawFunction = ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, bounds: PDRect, drawrect: PDRect),
>;
pub type LCDSpriteUpdateFunction =
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>;
pub type LCDSpriteCollisionFilterProc = ::core::option::Option<
unsafe extern "C" fn(
sprite: *mut LCDSprite,
other: *mut LCDSprite,
) -> SpriteCollisionResponseType,
>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sprite {
pub setAlwaysRedraw: ::core::option::Option<unsafe extern "C" fn(flag: ctypes::c_int)>,
pub addDirtyRect: ::core::option::Option<unsafe extern "C" fn(dirtyRect: LCDRect)>,
pub drawSprites: ::core::option::Option<unsafe extern "C" fn()>,
pub updateAndDrawSprites: ::core::option::Option<unsafe extern "C" fn()>,
pub newSprite: ::core::option::Option<unsafe extern "C" fn() -> *mut LCDSprite>,
pub freeSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub copy:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDSprite>,
pub addSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub removeSprite: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub removeSprites: ::core::option::Option<
unsafe extern "C" fn(sprites: *mut *mut LCDSprite, count: ctypes::c_int),
>,
pub removeAllSprites: ::core::option::Option<unsafe extern "C" fn()>,
pub getSpriteCount: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub setBounds:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, bounds: PDRect)>,
pub getBounds: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>,
pub moveTo:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, x: f32, y: f32)>,
pub moveBy:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, dx: f32, dy: f32)>,
pub setImage: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, image: *mut LCDBitmap, flip: LCDBitmapFlip),
>,
pub getImage:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut LCDBitmap>,
pub setSize:
::core::option::Option<unsafe extern "C" fn(s: *mut LCDSprite, width: f32, height: f32)>,
pub setZIndex:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, zIndex: i16)>,
pub getZIndex: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> i16>,
pub setDrawMode: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, mode: LCDBitmapDrawMode),
>,
pub setImageFlip:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flip: LCDBitmapFlip)>,
pub getImageFlip:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> LCDBitmapFlip>,
pub setStencil: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap),
>,
pub setClipRect:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, clipRect: LCDRect)>,
pub clearClipRect: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setClipRectsInRange: ::core::option::Option<
unsafe extern "C" fn(clipRect: LCDRect, startZ: ctypes::c_int, endZ: ctypes::c_int),
>,
pub clearClipRectsInRange:
::core::option::Option<unsafe extern "C" fn(startZ: ctypes::c_int, endZ: ctypes::c_int)>,
pub setUpdatesEnabled:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
pub updatesEnabled:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> ctypes::c_int>,
pub setCollisionsEnabled:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
pub collisionsEnabled:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> ctypes::c_int>,
pub setVisible:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
pub isVisible:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> ctypes::c_int>,
pub setOpaque:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
pub markDirty: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setTag: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, tag: u8)>,
pub getTag: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> u8>,
pub setIgnoresDrawOffset:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, flag: ctypes::c_int)>,
pub setUpdateFunction: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteUpdateFunction),
>,
pub setDrawFunction: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteDrawFunction),
>,
pub getPosition: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, x: *mut f32, y: *mut f32),
>,
pub resetCollisionWorld: ::core::option::Option<unsafe extern "C" fn()>,
pub setCollideRect:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, collideRect: PDRect)>,
pub getCollideRect:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> PDRect>,
pub clearCollideRect: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setCollisionResponseFunction: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, func: LCDSpriteCollisionFilterProc),
>,
pub checkCollisions: ::core::option::Option<
unsafe extern "C" fn(
sprite: *mut LCDSprite,
goalX: f32,
goalY: f32,
actualX: *mut f32,
actualY: *mut f32,
len: *mut ctypes::c_int,
) -> *mut SpriteCollisionInfo,
>,
pub moveWithCollisions: ::core::option::Option<
unsafe extern "C" fn(
sprite: *mut LCDSprite,
goalX: f32,
goalY: f32,
actualX: *mut f32,
actualY: *mut f32,
len: *mut ctypes::c_int,
) -> *mut SpriteCollisionInfo,
>,
pub querySpritesAtPoint: ::core::option::Option<
unsafe extern "C" fn(x: f32, y: f32, len: *mut ctypes::c_int) -> *mut *mut LCDSprite,
>,
pub querySpritesInRect: ::core::option::Option<
unsafe extern "C" fn(
x: f32,
y: f32,
width: f32,
height: f32,
len: *mut ctypes::c_int,
) -> *mut *mut LCDSprite,
>,
pub querySpritesAlongLine: ::core::option::Option<
unsafe extern "C" fn(
x1: f32,
y1: f32,
x2: f32,
y2: f32,
len: *mut ctypes::c_int,
) -> *mut *mut LCDSprite,
>,
pub querySpriteInfoAlongLine: ::core::option::Option<
unsafe extern "C" fn(
x1: f32,
y1: f32,
x2: f32,
y2: f32,
len: *mut ctypes::c_int,
) -> *mut SpriteQueryInfo,
>,
pub overlappingSprites: ::core::option::Option<
unsafe extern "C" fn(
sprite: *mut LCDSprite,
len: *mut ctypes::c_int,
) -> *mut *mut LCDSprite,
>,
pub allOverlappingSprites: ::core::option::Option<
unsafe extern "C" fn(len: *mut ctypes::c_int) -> *mut *mut LCDSprite,
>,
pub setStencilPattern:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite, pattern: *mut u8)>,
pub clearStencil: ::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite)>,
pub setUserdata: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, userdata: *mut ctypes::c_void),
>,
pub getUserdata:
::core::option::Option<unsafe extern "C" fn(sprite: *mut LCDSprite) -> *mut ctypes::c_void>,
pub setStencilImage: ::core::option::Option<
unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap, tile: ctypes::c_int),
>,
}
#[test]
fn bindgen_test_layout_playdate_sprite() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sprite> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sprite>(),
488usize,
concat!("Size of: ", stringify!(playdate_sprite))
);
assert_eq!(
::core::mem::align_of::<playdate_sprite>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sprite))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setAlwaysRedraw) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setAlwaysRedraw)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addDirtyRect) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(addDirtyRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).drawSprites) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(drawSprites)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).updateAndDrawSprites) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(updateAndDrawSprites)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newSprite) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(newSprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeSprite) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(freeSprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).copy) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(copy)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addSprite) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(addSprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeSprite) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(removeSprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeSprites) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(removeSprites)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeAllSprites) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(removeAllSprites)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getSpriteCount) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getSpriteCount)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setBounds) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setBounds)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getBounds) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getBounds)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).moveTo) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(moveTo)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).moveBy) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(moveBy)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setImage) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setImage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getImage) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getImage)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setSize) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setSize)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setZIndex) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setZIndex)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getZIndex) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getZIndex)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDrawMode) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setDrawMode)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setImageFlip) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setImageFlip)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getImageFlip) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getImageFlip)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setStencil) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setStencil)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setClipRect) as usize - ptr as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setClipRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearClipRect) as usize - ptr as usize },
208usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(clearClipRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setClipRectsInRange) as usize - ptr as usize },
216usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setClipRectsInRange)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearClipRectsInRange) as usize - ptr as usize },
224usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(clearClipRectsInRange)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUpdatesEnabled) as usize - ptr as usize },
232usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setUpdatesEnabled)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).updatesEnabled) as usize - ptr as usize },
240usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(updatesEnabled)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setCollisionsEnabled) as usize - ptr as usize },
248usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setCollisionsEnabled)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).collisionsEnabled) as usize - ptr as usize },
256usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(collisionsEnabled)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVisible) as usize - ptr as usize },
264usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setVisible)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isVisible) as usize - ptr as usize },
272usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(isVisible)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setOpaque) as usize - ptr as usize },
280usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setOpaque)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).markDirty) as usize - ptr as usize },
288usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(markDirty)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTag) as usize - ptr as usize },
296usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setTag)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTag) as usize - ptr as usize },
304usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getTag)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setIgnoresDrawOffset) as usize - ptr as usize },
312usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setIgnoresDrawOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUpdateFunction) as usize - ptr as usize },
320usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setUpdateFunction)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDrawFunction) as usize - ptr as usize },
328usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setDrawFunction)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getPosition) as usize - ptr as usize },
336usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getPosition)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).resetCollisionWorld) as usize - ptr as usize },
344usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(resetCollisionWorld)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setCollideRect) as usize - ptr as usize },
352usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setCollideRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getCollideRect) as usize - ptr as usize },
360usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getCollideRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearCollideRect) as usize - ptr as usize },
368usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(clearCollideRect)
)
);
assert_eq!(
unsafe {
::core::ptr::addr_of!((*ptr).setCollisionResponseFunction) as usize - ptr as usize
},
376usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setCollisionResponseFunction)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).checkCollisions) as usize - ptr as usize },
384usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(checkCollisions)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).moveWithCollisions) as usize - ptr as usize },
392usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(moveWithCollisions)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).querySpritesAtPoint) as usize - ptr as usize },
400usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(querySpritesAtPoint)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).querySpritesInRect) as usize - ptr as usize },
408usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(querySpritesInRect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).querySpritesAlongLine) as usize - ptr as usize },
416usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(querySpritesAlongLine)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).querySpriteInfoAlongLine) as usize - ptr as usize },
424usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(querySpriteInfoAlongLine)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).overlappingSprites) as usize - ptr as usize },
432usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(overlappingSprites)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).allOverlappingSprites) as usize - ptr as usize },
440usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(allOverlappingSprites)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setStencilPattern) as usize - ptr as usize },
448usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setStencilPattern)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearStencil) as usize - ptr as usize },
456usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(clearStencil)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUserdata) as usize - ptr as usize },
464usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setUserdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getUserdata) as usize - ptr as usize },
472usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(getUserdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setStencilImage) as usize - ptr as usize },
480usize,
concat!(
"Offset of field: ",
stringify!(playdate_sprite),
"::",
stringify!(setStencilImage)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum SoundFormat {
kSound8bitMono = 0,
kSound8bitStereo = 1,
kSound16bitMono = 2,
kSound16bitStereo = 3,
kSoundADPCMMono = 4,
kSoundADPCMStereo = 5,
}
pub type MIDINote = f32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SoundSource {
_unused: [u8; 0],
}
pub type sndCallbackProc = ::core::option::Option<unsafe extern "C" fn(c: *mut SoundSource)>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_source {
pub setVolume:
::core::option::Option<unsafe extern "C" fn(c: *mut SoundSource, lvol: f32, rvol: f32)>,
pub getVolume: ::core::option::Option<
unsafe extern "C" fn(c: *mut SoundSource, outl: *mut f32, outr: *mut f32),
>,
pub isPlaying:
::core::option::Option<unsafe extern "C" fn(c: *mut SoundSource) -> ctypes::c_int>,
pub setFinishCallback: ::core::option::Option<
unsafe extern "C" fn(c: *mut SoundSource, callback: sndCallbackProc),
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_source() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_source> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_source>(),
32usize,
concat!("Size of: ", stringify!(playdate_sound_source))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_source>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_source))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_source),
"::",
stringify!(setVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_source),
"::",
stringify!(getVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_source),
"::",
stringify!(isPlaying)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFinishCallback) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_source),
"::",
stringify!(setFinishCallback)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FilePlayer {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_fileplayer {
pub newPlayer: ::core::option::Option<unsafe extern "C" fn() -> *mut FilePlayer>,
pub freePlayer: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
pub loadIntoPlayer: ::core::option::Option<
unsafe extern "C" fn(player: *mut FilePlayer, path: *const ctypes::c_char) -> ctypes::c_int,
>,
pub setBufferLength:
::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, bufferLen: f32)>,
pub play: ::core::option::Option<
unsafe extern "C" fn(player: *mut FilePlayer, repeat: ctypes::c_int) -> ctypes::c_int,
>,
pub isPlaying:
::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> ctypes::c_int>,
pub pause: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
pub stop: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer)>,
pub setVolume: ::core::option::Option<
unsafe extern "C" fn(player: *mut FilePlayer, left: f32, right: f32),
>,
pub getVolume: ::core::option::Option<
unsafe extern "C" fn(player: *mut FilePlayer, left: *mut f32, right: *mut f32),
>,
pub getLength: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> f32>,
pub setOffset:
::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, offset: f32)>,
pub setRate: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, rate: f32)>,
pub setLoopRange:
::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, start: f32, end: f32)>,
pub didUnderrun:
::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> ctypes::c_int>,
pub setFinishCallback: ::core::option::Option<
unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc),
>,
pub setLoopCallback: ::core::option::Option<
unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc),
>,
pub getOffset: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> f32>,
pub getRate: ::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer) -> f32>,
pub setStopOnUnderrun:
::core::option::Option<unsafe extern "C" fn(player: *mut FilePlayer, flag: ctypes::c_int)>,
pub fadeVolume: ::core::option::Option<
unsafe extern "C" fn(
player: *mut FilePlayer,
left: f32,
right: f32,
len: i32,
finishCallback: sndCallbackProc,
),
>,
pub setMP3StreamSource: ::core::option::Option<
unsafe extern "C" fn(
player: *mut FilePlayer,
dataSource: ::core::option::Option<
unsafe extern "C" fn(
data: *mut u8,
bytes: ctypes::c_int,
userdata: *mut ctypes::c_void,
) -> ctypes::c_int,
>,
userdata: *mut ctypes::c_void,
bufferLen: f32,
),
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_fileplayer() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_fileplayer> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_fileplayer>(),
176usize,
concat!("Size of: ", stringify!(playdate_sound_fileplayer))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_fileplayer>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_fileplayer))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newPlayer) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(newPlayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freePlayer) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(freePlayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadIntoPlayer) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(loadIntoPlayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setBufferLength) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setBufferLength)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).play) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(play)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(isPlaying)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).pause) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(pause)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(stop)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(getVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(getLength)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRate) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setRate)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLoopRange) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setLoopRange)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).didUnderrun) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(didUnderrun)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFinishCallback) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setFinishCallback)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLoopCallback) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setLoopCallback)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getOffset) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(getOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getRate) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(getRate)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setStopOnUnderrun) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setStopOnUnderrun)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fadeVolume) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(fadeVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMP3StreamSource) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_fileplayer),
"::",
stringify!(setMP3StreamSource)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct AudioSample {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SamplePlayer {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_sample {
pub newSampleBuffer:
::core::option::Option<unsafe extern "C" fn(byteCount: ctypes::c_int) -> *mut AudioSample>,
pub loadIntoSample: ::core::option::Option<
unsafe extern "C" fn(
sample: *mut AudioSample,
path: *const ctypes::c_char,
) -> ctypes::c_int,
>,
pub load: ::core::option::Option<
unsafe extern "C" fn(path: *const ctypes::c_char) -> *mut AudioSample,
>,
pub newSampleFromData: ::core::option::Option<
unsafe extern "C" fn(
data: *mut u8,
format: SoundFormat,
sampleRate: u32,
byteCount: ctypes::c_int,
) -> *mut AudioSample,
>,
pub getData: ::core::option::Option<
unsafe extern "C" fn(
sample: *mut AudioSample,
data: *mut *mut u8,
format: *mut SoundFormat,
sampleRate: *mut u32,
bytelength: *mut u32,
),
>,
pub freeSample: ::core::option::Option<unsafe extern "C" fn(sample: *mut AudioSample)>,
pub getLength: ::core::option::Option<unsafe extern "C" fn(sample: *mut AudioSample) -> f32>,
}
#[test]
fn bindgen_test_layout_playdate_sound_sample() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_sample> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_sample>(),
56usize,
concat!("Size of: ", stringify!(playdate_sound_sample))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_sample>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_sample))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newSampleBuffer) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sample),
"::",
stringify!(newSampleBuffer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadIntoSample) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sample),
"::",
stringify!(loadIntoSample)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).load) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sample),
"::",
stringify!(load)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newSampleFromData) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sample),
"::",
stringify!(newSampleFromData)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getData) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sample),
"::",
stringify!(getData)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeSample) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sample),
"::",
stringify!(freeSample)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sample),
"::",
stringify!(getLength)
)
);
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_sampleplayer {
pub newPlayer: ::core::option::Option<unsafe extern "C" fn() -> *mut SamplePlayer>,
pub freePlayer: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer)>,
pub setSample: ::core::option::Option<
unsafe extern "C" fn(player: *mut SamplePlayer, sample: *mut AudioSample),
>,
pub play: ::core::option::Option<
unsafe extern "C" fn(
player: *mut SamplePlayer,
repeat: ctypes::c_int,
rate: f32,
) -> ctypes::c_int,
>,
pub isPlaying:
::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> ctypes::c_int>,
pub stop: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer)>,
pub setVolume: ::core::option::Option<
unsafe extern "C" fn(player: *mut SamplePlayer, left: f32, right: f32),
>,
pub getVolume: ::core::option::Option<
unsafe extern "C" fn(player: *mut SamplePlayer, left: *mut f32, right: *mut f32),
>,
pub getLength: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> f32>,
pub setOffset:
::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer, offset: f32)>,
pub setRate: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer, rate: f32)>,
pub setPlayRange: ::core::option::Option<
unsafe extern "C" fn(player: *mut SamplePlayer, start: ctypes::c_int, end: ctypes::c_int),
>,
pub setFinishCallback: ::core::option::Option<
unsafe extern "C" fn(player: *mut SamplePlayer, callback: sndCallbackProc),
>,
pub setLoopCallback: ::core::option::Option<
unsafe extern "C" fn(player: *mut SamplePlayer, callback: sndCallbackProc),
>,
pub getOffset: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> f32>,
pub getRate: ::core::option::Option<unsafe extern "C" fn(player: *mut SamplePlayer) -> f32>,
pub setPaused: ::core::option::Option<
unsafe extern "C" fn(player: *mut SamplePlayer, flag: ctypes::c_int),
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_sampleplayer() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_sampleplayer> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_sampleplayer>(),
136usize,
concat!("Size of: ", stringify!(playdate_sound_sampleplayer))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_sampleplayer>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_sampleplayer))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newPlayer) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(newPlayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freePlayer) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(freePlayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setSample) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setSample)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).play) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(play)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(isPlaying)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(stop)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(getVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(getLength)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRate) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setRate)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPlayRange) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setPlayRange)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFinishCallback) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setFinishCallback)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLoopCallback) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setLoopCallback)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getOffset) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(getOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getRate) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(getRate)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPaused) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sampleplayer),
"::",
stringify!(setPaused)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PDSynthSignalValue {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PDSynthSignal {
_unused: [u8; 0],
}
pub type signalStepFunc = ::core::option::Option<
unsafe extern "C" fn(
userdata: *mut ctypes::c_void,
ioframes: *mut ctypes::c_int,
ifval: *mut f32,
) -> f32,
>;
pub type signalNoteOnFunc = ::core::option::Option<
unsafe extern "C" fn(userdata: *mut ctypes::c_void, note: MIDINote, vel: f32, len: f32),
>;
pub type signalNoteOffFunc = ::core::option::Option<
unsafe extern "C" fn(
userdata: *mut ctypes::c_void,
stopped: ctypes::c_int,
offset: ctypes::c_int,
),
>;
pub type signalDeallocFunc =
::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void)>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_signal {
pub newSignal: ::core::option::Option<
unsafe extern "C" fn(
step: signalStepFunc,
noteOn: signalNoteOnFunc,
noteOff: signalNoteOffFunc,
dealloc: signalDeallocFunc,
userdata: *mut ctypes::c_void,
) -> *mut PDSynthSignal,
>,
pub freeSignal: ::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal)>,
pub getValue: ::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal) -> f32>,
pub setValueScale:
::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal, scale: f32)>,
pub setValueOffset:
::core::option::Option<unsafe extern "C" fn(signal: *mut PDSynthSignal, offset: f32)>,
}
#[test]
fn bindgen_test_layout_playdate_sound_signal() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_signal> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_signal>(),
40usize,
concat!("Size of: ", stringify!(playdate_sound_signal))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_signal>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_signal))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newSignal) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_signal),
"::",
stringify!(newSignal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeSignal) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_signal),
"::",
stringify!(freeSignal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getValue) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_signal),
"::",
stringify!(getValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setValueScale) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_signal),
"::",
stringify!(setValueScale)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setValueOffset) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_signal),
"::",
stringify!(setValueOffset)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum LFOType {
kLFOTypeSquare = 0,
kLFOTypeTriangle = 1,
kLFOTypeSine = 2,
kLFOTypeSampleAndHold = 3,
kLFOTypeSawtoothUp = 4,
kLFOTypeSawtoothDown = 5,
kLFOTypeArpeggiator = 6,
kLFOTypeFunction = 7,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PDSynthLFO {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_lfo {
pub newLFO: ::core::option::Option<unsafe extern "C" fn(type_: LFOType) -> *mut PDSynthLFO>,
pub freeLFO: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO)>,
pub setType: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, type_: LFOType)>,
pub setRate: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, rate: f32)>,
pub setPhase: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, phase: f32)>,
pub setCenter: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, center: f32)>,
pub setDepth: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, depth: f32)>,
pub setArpeggiation: ::core::option::Option<
unsafe extern "C" fn(lfo: *mut PDSynthLFO, nSteps: ctypes::c_int, steps: *mut f32),
>,
pub setFunction: ::core::option::Option<
unsafe extern "C" fn(
lfo: *mut PDSynthLFO,
lfoFunc: ::core::option::Option<
unsafe extern "C" fn(lfo: *mut PDSynthLFO, userdata: *mut ctypes::c_void) -> f32,
>,
userdata: *mut ctypes::c_void,
interpolate: ctypes::c_int,
),
>,
pub setDelay: ::core::option::Option<
unsafe extern "C" fn(lfo: *mut PDSynthLFO, holdoff: f32, ramptime: f32),
>,
pub setRetrigger:
::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, flag: ctypes::c_int)>,
pub getValue: ::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO) -> f32>,
pub setGlobal:
::core::option::Option<unsafe extern "C" fn(lfo: *mut PDSynthLFO, global: ctypes::c_int)>,
}
#[test]
fn bindgen_test_layout_playdate_sound_lfo() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_lfo> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_lfo>(),
104usize,
concat!("Size of: ", stringify!(playdate_sound_lfo))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_lfo>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_lfo))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newLFO) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(newLFO)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeLFO) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(freeLFO)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setType) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setType)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRate) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setRate)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPhase) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setPhase)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setCenter) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setCenter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDepth) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setDepth)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setArpeggiation) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setArpeggiation)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFunction) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setFunction)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDelay) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setDelay)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRetrigger) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setRetrigger)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getValue) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(getValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setGlobal) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_lfo),
"::",
stringify!(setGlobal)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PDSynthEnvelope {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_envelope {
pub newEnvelope: ::core::option::Option<
unsafe extern "C" fn(
attack: f32,
decay: f32,
sustain: f32,
release: f32,
) -> *mut PDSynthEnvelope,
>,
pub freeEnvelope: ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope)>,
pub setAttack:
::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, attack: f32)>,
pub setDecay:
::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, decay: f32)>,
pub setSustain:
::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, sustain: f32)>,
pub setRelease:
::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, release: f32)>,
pub setLegato: ::core::option::Option<
unsafe extern "C" fn(env: *mut PDSynthEnvelope, flag: ctypes::c_int),
>,
pub setRetrigger: ::core::option::Option<
unsafe extern "C" fn(lfo: *mut PDSynthEnvelope, flag: ctypes::c_int),
>,
pub getValue: ::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope) -> f32>,
pub setCurvature:
::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, amount: f32)>,
pub setVelocitySensitivity:
::core::option::Option<unsafe extern "C" fn(env: *mut PDSynthEnvelope, velsens: f32)>,
pub setRateScaling: ::core::option::Option<
unsafe extern "C" fn(
env: *mut PDSynthEnvelope,
scaling: f32,
start: MIDINote,
end: MIDINote,
),
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_envelope() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_envelope> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_envelope>(),
96usize,
concat!("Size of: ", stringify!(playdate_sound_envelope))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_envelope>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_envelope))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newEnvelope) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(newEnvelope)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeEnvelope) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(freeEnvelope)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setAttack) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setAttack)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDecay) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setDecay)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setSustain) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setSustain)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRelease) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setRelease)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLegato) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setLegato)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRetrigger) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setRetrigger)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getValue) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(getValue)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setCurvature) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setCurvature)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVelocitySensitivity) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setVelocitySensitivity)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRateScaling) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_envelope),
"::",
stringify!(setRateScaling)
)
);
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum SoundWaveform {
kWaveformSquare = 0,
kWaveformTriangle = 1,
kWaveformSine = 2,
kWaveformNoise = 3,
kWaveformSawtooth = 4,
kWaveformPOPhase = 5,
kWaveformPODigital = 6,
kWaveformPOVosim = 7,
}
pub type synthRenderFunc = ::core::option::Option<
unsafe extern "C" fn(
userdata: *mut ctypes::c_void,
left: *mut i32,
right: *mut i32,
nsamples: ctypes::c_int,
rate: u32,
drate: i32,
) -> ctypes::c_int,
>;
pub type synthNoteOnFunc = ::core::option::Option<
unsafe extern "C" fn(userdata: *mut ctypes::c_void, note: MIDINote, velocity: f32, len: f32),
>;
pub type synthReleaseFunc = ::core::option::Option<
unsafe extern "C" fn(userdata: *mut ctypes::c_void, stop: ctypes::c_int),
>;
pub type synthSetParameterFunc = ::core::option::Option<
unsafe extern "C" fn(
userdata: *mut ctypes::c_void,
parameter: ctypes::c_int,
value: f32,
) -> ctypes::c_int,
>;
pub type synthDeallocFunc =
::core::option::Option<unsafe extern "C" fn(userdata: *mut ctypes::c_void)>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PDSynth {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_synth {
pub newSynth: ::core::option::Option<unsafe extern "C" fn() -> *mut PDSynth>,
pub freeSynth: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth)>,
pub setWaveform:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, wave: SoundWaveform)>,
pub setGenerator: ::core::option::Option<
unsafe extern "C" fn(
synth: *mut PDSynth,
stereo: ctypes::c_int,
render: synthRenderFunc,
noteOn: synthNoteOnFunc,
release: synthReleaseFunc,
setparam: synthSetParameterFunc,
dealloc: synthDeallocFunc,
userdata: *mut ctypes::c_void,
),
>,
pub setSample: ::core::option::Option<
unsafe extern "C" fn(
synth: *mut PDSynth,
sample: *mut AudioSample,
sustainStart: u32,
sustainEnd: u32,
),
>,
pub setAttackTime:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, attack: f32)>,
pub setDecayTime: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, decay: f32)>,
pub setSustainLevel:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, sustain: f32)>,
pub setReleaseTime:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, release: f32)>,
pub setTranspose:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, halfSteps: f32)>,
pub setFrequencyModulator: ::core::option::Option<
unsafe extern "C" fn(synth: *mut PDSynth, mod_: *mut PDSynthSignalValue),
>,
pub getFrequencyModulator: ::core::option::Option<
unsafe extern "C" fn(synth: *mut PDSynth) -> *mut PDSynthSignalValue,
>,
pub setAmplitudeModulator: ::core::option::Option<
unsafe extern "C" fn(synth: *mut PDSynth, mod_: *mut PDSynthSignalValue),
>,
pub getAmplitudeModulator: ::core::option::Option<
unsafe extern "C" fn(synth: *mut PDSynth) -> *mut PDSynthSignalValue,
>,
pub getParameterCount:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth) -> ctypes::c_int>,
pub setParameter: ::core::option::Option<
unsafe extern "C" fn(
synth: *mut PDSynth,
parameter: ctypes::c_int,
value: f32,
) -> ctypes::c_int,
>,
pub setParameterModulator: ::core::option::Option<
unsafe extern "C" fn(
synth: *mut PDSynth,
parameter: ctypes::c_int,
mod_: *mut PDSynthSignalValue,
),
>,
pub getParameterModulator: ::core::option::Option<
unsafe extern "C" fn(
synth: *mut PDSynth,
parameter: ctypes::c_int,
) -> *mut PDSynthSignalValue,
>,
pub playNote: ::core::option::Option<
unsafe extern "C" fn(synth: *mut PDSynth, freq: f32, vel: f32, len: f32, when: u32),
>,
pub playMIDINote: ::core::option::Option<
unsafe extern "C" fn(synth: *mut PDSynth, note: MIDINote, vel: f32, len: f32, when: u32),
>,
pub noteOff: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, when: u32)>,
pub stop: ::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth)>,
pub setVolume:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth, left: f32, right: f32)>,
pub getVolume: ::core::option::Option<
unsafe extern "C" fn(synth: *mut PDSynth, left: *mut f32, right: *mut f32),
>,
pub isPlaying:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth) -> ctypes::c_int>,
pub getEnvelope:
::core::option::Option<unsafe extern "C" fn(synth: *mut PDSynth) -> *mut PDSynthEnvelope>,
}
#[test]
fn bindgen_test_layout_playdate_sound_synth() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_synth> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_synth>(),
208usize,
concat!("Size of: ", stringify!(playdate_sound_synth))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_synth>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_synth))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newSynth) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(newSynth)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeSynth) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(freeSynth)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setWaveform) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setWaveform)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setGenerator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setSample) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setSample)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setAttackTime) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setAttackTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setDecayTime) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setDecayTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setSustainLevel) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setSustainLevel)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setReleaseTime) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setReleaseTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTranspose) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setTranspose)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFrequencyModulator) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setFrequencyModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getFrequencyModulator) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(getFrequencyModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setAmplitudeModulator) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setAmplitudeModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getAmplitudeModulator) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(getAmplitudeModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getParameterCount) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(getParameterCount)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setParameter) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setParameter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setParameterModulator) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setParameterModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getParameterModulator) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(getParameterModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).playNote) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(playNote)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).playMIDINote) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(playMIDINote)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).noteOff) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(noteOff)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(stop)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(setVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(getVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(isPlaying)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getEnvelope) as usize - ptr as usize },
200usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_synth),
"::",
stringify!(getEnvelope)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ControlSignal {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_control_signal {
pub newSignal: ::core::option::Option<unsafe extern "C" fn() -> *mut ControlSignal>,
pub freeSignal: ::core::option::Option<unsafe extern "C" fn(signal: *mut ControlSignal)>,
pub clearEvents: ::core::option::Option<unsafe extern "C" fn(control: *mut ControlSignal)>,
pub addEvent: ::core::option::Option<
unsafe extern "C" fn(
control: *mut ControlSignal,
step: ctypes::c_int,
value: f32,
interpolate: ctypes::c_int,
),
>,
pub removeEvent: ::core::option::Option<
unsafe extern "C" fn(control: *mut ControlSignal, step: ctypes::c_int),
>,
pub getMIDIControllerNumber:
::core::option::Option<unsafe extern "C" fn(control: *mut ControlSignal) -> ctypes::c_int>,
}
#[test]
fn bindgen_test_layout_playdate_control_signal() {
const UNINIT: ::core::mem::MaybeUninit<playdate_control_signal> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_control_signal>(),
48usize,
concat!("Size of: ", stringify!(playdate_control_signal))
);
assert_eq!(
::core::mem::align_of::<playdate_control_signal>(),
8usize,
concat!("Alignment of ", stringify!(playdate_control_signal))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newSignal) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_control_signal),
"::",
stringify!(newSignal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeSignal) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_control_signal),
"::",
stringify!(freeSignal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearEvents) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_control_signal),
"::",
stringify!(clearEvents)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addEvent) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_control_signal),
"::",
stringify!(addEvent)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeEvent) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_control_signal),
"::",
stringify!(removeEvent)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getMIDIControllerNumber) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_control_signal),
"::",
stringify!(getMIDIControllerNumber)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PDSynthInstrument {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_instrument {
pub newInstrument: ::core::option::Option<unsafe extern "C" fn() -> *mut PDSynthInstrument>,
pub freeInstrument: ::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument)>,
pub addVoice: ::core::option::Option<
unsafe extern "C" fn(
inst: *mut PDSynthInstrument,
synth: *mut PDSynth,
rangeStart: MIDINote,
rangeEnd: MIDINote,
transpose: f32,
) -> ctypes::c_int,
>,
pub playNote: ::core::option::Option<
unsafe extern "C" fn(
inst: *mut PDSynthInstrument,
frequency: f32,
vel: f32,
len: f32,
when: u32,
) -> *mut PDSynth,
>,
pub playMIDINote: ::core::option::Option<
unsafe extern "C" fn(
inst: *mut PDSynthInstrument,
note: MIDINote,
vel: f32,
len: f32,
when: u32,
) -> *mut PDSynth,
>,
pub setPitchBend:
::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, bend: f32)>,
pub setPitchBendRange:
::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, halfSteps: f32)>,
pub setTranspose:
::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, halfSteps: f32)>,
pub noteOff: ::core::option::Option<
unsafe extern "C" fn(inst: *mut PDSynthInstrument, note: MIDINote, when: u32),
>,
pub allNotesOff:
::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument, when: u32)>,
pub setVolume: ::core::option::Option<
unsafe extern "C" fn(inst: *mut PDSynthInstrument, left: f32, right: f32),
>,
pub getVolume: ::core::option::Option<
unsafe extern "C" fn(inst: *mut PDSynthInstrument, left: *mut f32, right: *mut f32),
>,
pub activeVoiceCount:
::core::option::Option<unsafe extern "C" fn(inst: *mut PDSynthInstrument) -> ctypes::c_int>,
}
#[test]
fn bindgen_test_layout_playdate_sound_instrument() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_instrument> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_instrument>(),
104usize,
concat!("Size of: ", stringify!(playdate_sound_instrument))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_instrument>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_instrument))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newInstrument) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(newInstrument)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeInstrument) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(freeInstrument)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addVoice) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(addVoice)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).playNote) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(playNote)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).playMIDINote) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(playMIDINote)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPitchBend) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(setPitchBend)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPitchBendRange) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(setPitchBendRange)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTranspose) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(setTranspose)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).noteOff) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(noteOff)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).allNotesOff) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(allNotesOff)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(setVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(getVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).activeVoiceCount) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_instrument),
"::",
stringify!(activeVoiceCount)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SequenceTrack {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_track {
pub newTrack: ::core::option::Option<unsafe extern "C" fn() -> *mut SequenceTrack>,
pub freeTrack: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack)>,
pub setInstrument: ::core::option::Option<
unsafe extern "C" fn(track: *mut SequenceTrack, inst: *mut PDSynthInstrument),
>,
pub getInstrument: ::core::option::Option<
unsafe extern "C" fn(track: *mut SequenceTrack) -> *mut PDSynthInstrument,
>,
pub addNoteEvent: ::core::option::Option<
unsafe extern "C" fn(
track: *mut SequenceTrack,
step: u32,
len: u32,
note: MIDINote,
velocity: f32,
),
>,
pub removeNoteEvent: ::core::option::Option<
unsafe extern "C" fn(track: *mut SequenceTrack, step: u32, note: MIDINote),
>,
pub clearNotes: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack)>,
pub getControlSignalCount:
::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> ctypes::c_int>,
pub getControlSignal: ::core::option::Option<
unsafe extern "C" fn(track: *mut SequenceTrack, idx: ctypes::c_int) -> *mut ControlSignal,
>,
pub clearControlEvents: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack)>,
pub getPolyphony:
::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> ctypes::c_int>,
pub activeVoiceCount:
::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> ctypes::c_int>,
pub setMuted: ::core::option::Option<
unsafe extern "C" fn(track: *mut SequenceTrack, mute: ctypes::c_int),
>,
pub getLength: ::core::option::Option<unsafe extern "C" fn(track: *mut SequenceTrack) -> u32>,
pub getIndexForStep: ::core::option::Option<
unsafe extern "C" fn(track: *mut SequenceTrack, step: u32) -> ctypes::c_int,
>,
pub getNoteAtIndex: ::core::option::Option<
unsafe extern "C" fn(
track: *mut SequenceTrack,
index: ctypes::c_int,
outStep: *mut u32,
outLen: *mut u32,
outNote: *mut MIDINote,
outVelocity: *mut f32,
) -> ctypes::c_int,
>,
pub getSignalForController: ::core::option::Option<
unsafe extern "C" fn(
track: *mut SequenceTrack,
controller: ctypes::c_int,
create: ctypes::c_int,
) -> *mut ControlSignal,
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_track() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_track> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_track>(),
136usize,
concat!("Size of: ", stringify!(playdate_sound_track))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_track>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_track))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newTrack) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(newTrack)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeTrack) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(freeTrack)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setInstrument) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(setInstrument)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getInstrument) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getInstrument)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addNoteEvent) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(addNoteEvent)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeNoteEvent) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(removeNoteEvent)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearNotes) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(clearNotes)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getControlSignalCount) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getControlSignalCount)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getControlSignal) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getControlSignal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).clearControlEvents) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(clearControlEvents)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getPolyphony) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getPolyphony)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).activeVoiceCount) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(activeVoiceCount)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMuted) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(setMuted)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getLength)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getIndexForStep) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getIndexForStep)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getNoteAtIndex) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getNoteAtIndex)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getSignalForController) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_track),
"::",
stringify!(getSignalForController)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SoundSequence {
_unused: [u8; 0],
}
pub type SequenceFinishedCallback = ::core::option::Option<
unsafe extern "C" fn(seq: *mut SoundSequence, userdata: *mut ctypes::c_void),
>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_sequence {
pub newSequence: ::core::option::Option<unsafe extern "C" fn() -> *mut SoundSequence>,
pub freeSequence: ::core::option::Option<unsafe extern "C" fn(sequence: *mut SoundSequence)>,
pub loadMidiFile: ::core::option::Option<
unsafe extern "C" fn(seq: *mut SoundSequence, path: *const ctypes::c_char) -> ctypes::c_int,
>,
pub getTime: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> u32>,
pub setTime: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence, time: u32)>,
pub setLoops: ::core::option::Option<
unsafe extern "C" fn(
seq: *mut SoundSequence,
loopstart: ctypes::c_int,
loopend: ctypes::c_int,
loops: ctypes::c_int,
),
>,
pub getTempo:
::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> ctypes::c_int>,
pub setTempo: ::core::option::Option<
unsafe extern "C" fn(seq: *mut SoundSequence, stepsPerSecond: ctypes::c_int),
>,
pub getTrackCount:
::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> ctypes::c_int>,
pub addTrack:
::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> *mut SequenceTrack>,
pub getTrackAtIndex: ::core::option::Option<
unsafe extern "C" fn(seq: *mut SoundSequence, track: ctypes::c_uint) -> *mut SequenceTrack,
>,
pub setTrackAtIndex: ::core::option::Option<
unsafe extern "C" fn(
seq: *mut SoundSequence,
track: *mut SequenceTrack,
idx: ctypes::c_uint,
),
>,
pub allNotesOff: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence)>,
pub isPlaying:
::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> ctypes::c_int>,
pub getLength: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence) -> u32>,
pub play: ::core::option::Option<
unsafe extern "C" fn(
seq: *mut SoundSequence,
finishCallback: SequenceFinishedCallback,
userdata: *mut ctypes::c_void,
),
>,
pub stop: ::core::option::Option<unsafe extern "C" fn(seq: *mut SoundSequence)>,
pub getCurrentStep: ::core::option::Option<
unsafe extern "C" fn(
seq: *mut SoundSequence,
timeOffset: *mut ctypes::c_int,
) -> ctypes::c_int,
>,
pub setCurrentStep: ::core::option::Option<
unsafe extern "C" fn(
seq: *mut SoundSequence,
step: ctypes::c_int,
timeOffset: ctypes::c_int,
playNotes: ctypes::c_int,
),
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_sequence() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_sequence> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_sequence>(),
152usize,
concat!("Size of: ", stringify!(playdate_sound_sequence))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_sequence>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_sequence))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newSequence) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(newSequence)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeSequence) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(freeSequence)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).loadMidiFile) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(loadMidiFile)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTime) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(getTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTime) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(setTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLoops) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(setLoops)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTempo) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(getTempo)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTempo) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(setTempo)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTrackCount) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(getTrackCount)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addTrack) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(addTrack)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTrackAtIndex) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(getTrackAtIndex)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTrackAtIndex) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(setTrackAtIndex)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).allNotesOff) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(allNotesOff)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).isPlaying) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(isPlaying)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getLength) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(getLength)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).play) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(play)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).stop) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(stop)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getCurrentStep) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(getCurrentStep)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setCurrentStep) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_sequence),
"::",
stringify!(setCurrentStep)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TwoPoleFilter {
_unused: [u8; 0],
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum TwoPoleFilterType {
kFilterTypeLowPass = 0,
kFilterTypeHighPass = 1,
kFilterTypeBandPass = 2,
kFilterTypeNotch = 3,
kFilterTypePEQ = 4,
kFilterTypeLowShelf = 5,
kFilterTypeHighShelf = 6,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_effect_twopolefilter {
pub newFilter: ::core::option::Option<unsafe extern "C" fn() -> *mut TwoPoleFilter>,
pub freeFilter: ::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter)>,
pub setType: ::core::option::Option<
unsafe extern "C" fn(filter: *mut TwoPoleFilter, type_: TwoPoleFilterType),
>,
pub setFrequency:
::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter, frequency: f32)>,
pub setFrequencyModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut TwoPoleFilter, signal: *mut PDSynthSignalValue),
>,
pub getFrequencyModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut TwoPoleFilter) -> *mut PDSynthSignalValue,
>,
pub setGain:
::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter, gain: f32)>,
pub setResonance:
::core::option::Option<unsafe extern "C" fn(filter: *mut TwoPoleFilter, resonance: f32)>,
pub setResonanceModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut TwoPoleFilter, signal: *mut PDSynthSignalValue),
>,
pub getResonanceModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut TwoPoleFilter) -> *mut PDSynthSignalValue,
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_effect_twopolefilter() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_twopolefilter> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_effect_twopolefilter>(),
80usize,
concat!("Size of: ", stringify!(playdate_sound_effect_twopolefilter))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_effect_twopolefilter>(),
8usize,
concat!(
"Alignment of ",
stringify!(playdate_sound_effect_twopolefilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newFilter) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(newFilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeFilter) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(freeFilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setType) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(setType)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFrequency) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(setFrequency)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFrequencyModulator) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(setFrequencyModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getFrequencyModulator) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(getFrequencyModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setGain) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(setGain)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setResonance) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(setResonance)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setResonanceModulator) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(setResonanceModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getResonanceModulator) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_twopolefilter),
"::",
stringify!(getResonanceModulator)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OnePoleFilter {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_effect_onepolefilter {
pub newFilter: ::core::option::Option<unsafe extern "C" fn() -> *mut OnePoleFilter>,
pub freeFilter: ::core::option::Option<unsafe extern "C" fn(filter: *mut OnePoleFilter)>,
pub setParameter:
::core::option::Option<unsafe extern "C" fn(filter: *mut OnePoleFilter, parameter: f32)>,
pub setParameterModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut OnePoleFilter, signal: *mut PDSynthSignalValue),
>,
pub getParameterModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut OnePoleFilter) -> *mut PDSynthSignalValue,
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_effect_onepolefilter() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_onepolefilter> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_effect_onepolefilter>(),
40usize,
concat!("Size of: ", stringify!(playdate_sound_effect_onepolefilter))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_effect_onepolefilter>(),
8usize,
concat!(
"Alignment of ",
stringify!(playdate_sound_effect_onepolefilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newFilter) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_onepolefilter),
"::",
stringify!(newFilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeFilter) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_onepolefilter),
"::",
stringify!(freeFilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setParameter) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_onepolefilter),
"::",
stringify!(setParameter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setParameterModulator) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_onepolefilter),
"::",
stringify!(setParameterModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getParameterModulator) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_onepolefilter),
"::",
stringify!(getParameterModulator)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct BitCrusher {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_effect_bitcrusher {
pub newBitCrusher: ::core::option::Option<unsafe extern "C" fn() -> *mut BitCrusher>,
pub freeBitCrusher: ::core::option::Option<unsafe extern "C" fn(filter: *mut BitCrusher)>,
pub setAmount:
::core::option::Option<unsafe extern "C" fn(filter: *mut BitCrusher, amount: f32)>,
pub setAmountModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut BitCrusher, signal: *mut PDSynthSignalValue),
>,
pub getAmountModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut BitCrusher) -> *mut PDSynthSignalValue,
>,
pub setUndersampling:
::core::option::Option<unsafe extern "C" fn(filter: *mut BitCrusher, undersampling: f32)>,
pub setUndersampleModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut BitCrusher, signal: *mut PDSynthSignalValue),
>,
pub getUndersampleModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut BitCrusher) -> *mut PDSynthSignalValue,
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_effect_bitcrusher() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_bitcrusher> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_effect_bitcrusher>(),
64usize,
concat!("Size of: ", stringify!(playdate_sound_effect_bitcrusher))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_effect_bitcrusher>(),
8usize,
concat!(
"Alignment of ",
stringify!(playdate_sound_effect_bitcrusher)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newBitCrusher) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(newBitCrusher)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeBitCrusher) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(freeBitCrusher)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setAmount) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(setAmount)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setAmountModulator) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(setAmountModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getAmountModulator) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(getAmountModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUndersampling) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(setUndersampling)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUndersampleModulator) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(setUndersampleModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getUndersampleModulator) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_bitcrusher),
"::",
stringify!(getUndersampleModulator)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct RingModulator {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_effect_ringmodulator {
pub newRingmod: ::core::option::Option<unsafe extern "C" fn() -> *mut RingModulator>,
pub freeRingmod: ::core::option::Option<unsafe extern "C" fn(filter: *mut RingModulator)>,
pub setFrequency:
::core::option::Option<unsafe extern "C" fn(filter: *mut RingModulator, frequency: f32)>,
pub setFrequencyModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut RingModulator, signal: *mut PDSynthSignalValue),
>,
pub getFrequencyModulator: ::core::option::Option<
unsafe extern "C" fn(filter: *mut RingModulator) -> *mut PDSynthSignalValue,
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_effect_ringmodulator() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_ringmodulator> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_effect_ringmodulator>(),
40usize,
concat!("Size of: ", stringify!(playdate_sound_effect_ringmodulator))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_effect_ringmodulator>(),
8usize,
concat!(
"Alignment of ",
stringify!(playdate_sound_effect_ringmodulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newRingmod) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_ringmodulator),
"::",
stringify!(newRingmod)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeRingmod) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_ringmodulator),
"::",
stringify!(freeRingmod)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFrequency) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_ringmodulator),
"::",
stringify!(setFrequency)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFrequencyModulator) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_ringmodulator),
"::",
stringify!(setFrequencyModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getFrequencyModulator) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_ringmodulator),
"::",
stringify!(getFrequencyModulator)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DelayLine {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DelayLineTap {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_effect_delayline {
pub newDelayLine: ::core::option::Option<
unsafe extern "C" fn(length: ctypes::c_int, stereo: ctypes::c_int) -> *mut DelayLine,
>,
pub freeDelayLine: ::core::option::Option<unsafe extern "C" fn(filter: *mut DelayLine)>,
pub setLength:
::core::option::Option<unsafe extern "C" fn(d: *mut DelayLine, frames: ctypes::c_int)>,
pub setFeedback: ::core::option::Option<unsafe extern "C" fn(d: *mut DelayLine, fb: f32)>,
pub addTap: ::core::option::Option<
unsafe extern "C" fn(d: *mut DelayLine, delay: ctypes::c_int) -> *mut DelayLineTap,
>,
pub freeTap: ::core::option::Option<unsafe extern "C" fn(tap: *mut DelayLineTap)>,
pub setTapDelay:
::core::option::Option<unsafe extern "C" fn(t: *mut DelayLineTap, frames: ctypes::c_int)>,
pub setTapDelayModulator: ::core::option::Option<
unsafe extern "C" fn(t: *mut DelayLineTap, mod_: *mut PDSynthSignalValue),
>,
pub getTapDelayModulator: ::core::option::Option<
unsafe extern "C" fn(t: *mut DelayLineTap) -> *mut PDSynthSignalValue,
>,
pub setTapChannelsFlipped:
::core::option::Option<unsafe extern "C" fn(t: *mut DelayLineTap, flip: ctypes::c_int)>,
}
#[test]
fn bindgen_test_layout_playdate_sound_effect_delayline() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_delayline> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_effect_delayline>(),
80usize,
concat!("Size of: ", stringify!(playdate_sound_effect_delayline))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_effect_delayline>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_effect_delayline))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newDelayLine) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(newDelayLine)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeDelayLine) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(freeDelayLine)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLength) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(setLength)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFeedback) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(setFeedback)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addTap) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(addTap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeTap) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(freeTap)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTapDelay) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(setTapDelay)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTapDelayModulator) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(setTapDelayModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getTapDelayModulator) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(getTapDelayModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setTapChannelsFlipped) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_delayline),
"::",
stringify!(setTapChannelsFlipped)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Overdrive {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_effect_overdrive {
pub newOverdrive: ::core::option::Option<unsafe extern "C" fn() -> *mut Overdrive>,
pub freeOverdrive: ::core::option::Option<unsafe extern "C" fn(filter: *mut Overdrive)>,
pub setGain: ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive, gain: f32)>,
pub setLimit: ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive, limit: f32)>,
pub setLimitModulator: ::core::option::Option<
unsafe extern "C" fn(o: *mut Overdrive, mod_: *mut PDSynthSignalValue),
>,
pub getLimitModulator:
::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive) -> *mut PDSynthSignalValue>,
pub setOffset: ::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive, offset: f32)>,
pub setOffsetModulator: ::core::option::Option<
unsafe extern "C" fn(o: *mut Overdrive, mod_: *mut PDSynthSignalValue),
>,
pub getOffsetModulator:
::core::option::Option<unsafe extern "C" fn(o: *mut Overdrive) -> *mut PDSynthSignalValue>,
}
#[test]
fn bindgen_test_layout_playdate_sound_effect_overdrive() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect_overdrive> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_effect_overdrive>(),
72usize,
concat!("Size of: ", stringify!(playdate_sound_effect_overdrive))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_effect_overdrive>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_effect_overdrive))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newOverdrive) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(newOverdrive)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeOverdrive) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(freeOverdrive)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setGain) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(setGain)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLimit) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(setLimit)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setLimitModulator) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(setLimitModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getLimitModulator) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(getLimitModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(setOffset)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setOffsetModulator) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(setOffsetModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getOffsetModulator) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect_overdrive),
"::",
stringify!(getOffsetModulator)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SoundEffect {
_unused: [u8; 0],
}
pub type effectProc = ::core::option::Option<
unsafe extern "C" fn(
e: *mut SoundEffect,
left: *mut i32,
right: *mut i32,
nsamples: ctypes::c_int,
bufactive: ctypes::c_int,
) -> ctypes::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_effect {
pub newEffect: ::core::option::Option<
unsafe extern "C" fn(proc_: effectProc, userdata: *mut ctypes::c_void) -> *mut SoundEffect,
>,
pub freeEffect: ::core::option::Option<unsafe extern "C" fn(effect: *mut SoundEffect)>,
pub setMix: ::core::option::Option<unsafe extern "C" fn(effect: *mut SoundEffect, level: f32)>,
pub setMixModulator: ::core::option::Option<
unsafe extern "C" fn(effect: *mut SoundEffect, signal: *mut PDSynthSignalValue),
>,
pub getMixModulator: ::core::option::Option<
unsafe extern "C" fn(effect: *mut SoundEffect) -> *mut PDSynthSignalValue,
>,
pub setUserdata: ::core::option::Option<
unsafe extern "C" fn(effect: *mut SoundEffect, userdata: *mut ctypes::c_void),
>,
pub getUserdata: ::core::option::Option<
unsafe extern "C" fn(effect: *mut SoundEffect) -> *mut ctypes::c_void,
>,
pub twopolefilter: *const playdate_sound_effect_twopolefilter,
pub onepolefilter: *const playdate_sound_effect_onepolefilter,
pub bitcrusher: *const playdate_sound_effect_bitcrusher,
pub ringmodulator: *const playdate_sound_effect_ringmodulator,
pub delayline: *const playdate_sound_effect_delayline,
pub overdrive: *const playdate_sound_effect_overdrive,
}
#[test]
fn bindgen_test_layout_playdate_sound_effect() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_effect> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_effect>(),
104usize,
concat!("Size of: ", stringify!(playdate_sound_effect))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_effect>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_effect))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newEffect) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(newEffect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeEffect) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(freeEffect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMix) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(setMix)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMixModulator) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(setMixModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getMixModulator) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(getMixModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setUserdata) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(setUserdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getUserdata) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(getUserdata)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).twopolefilter) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(twopolefilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).onepolefilter) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(onepolefilter)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).bitcrusher) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(bitcrusher)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).ringmodulator) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(ringmodulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).delayline) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(delayline)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).overdrive) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_effect),
"::",
stringify!(overdrive)
)
);
}
impl Default for playdate_sound_effect {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SoundChannel {
_unused: [u8; 0],
}
pub type AudioSourceFunction = ::core::option::Option<
unsafe extern "C" fn(
context: *mut ctypes::c_void,
left: *mut i16,
right: *mut i16,
len: ctypes::c_int,
) -> ctypes::c_int,
>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound_channel {
pub newChannel: ::core::option::Option<unsafe extern "C" fn() -> *mut SoundChannel>,
pub freeChannel: ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel)>,
pub addSource: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel, source: *mut SoundSource) -> ctypes::c_int,
>,
pub removeSource: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel, source: *mut SoundSource) -> ctypes::c_int,
>,
pub addCallbackSource: ::core::option::Option<
unsafe extern "C" fn(
channel: *mut SoundChannel,
callback: AudioSourceFunction,
context: *mut ctypes::c_void,
stereo: ctypes::c_int,
) -> *mut SoundSource,
>,
pub addEffect: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel, effect: *mut SoundEffect),
>,
pub removeEffect: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel, effect: *mut SoundEffect),
>,
pub setVolume:
::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel, volume: f32)>,
pub getVolume: ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel) -> f32>,
pub setVolumeModulator: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel, mod_: *mut PDSynthSignalValue),
>,
pub getVolumeModulator: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
>,
pub setPan: ::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel, pan: f32)>,
pub setPanModulator: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel, mod_: *mut PDSynthSignalValue),
>,
pub getPanModulator: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
>,
pub getDryLevelSignal: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
>,
pub getWetLevelSignal: ::core::option::Option<
unsafe extern "C" fn(channel: *mut SoundChannel) -> *mut PDSynthSignalValue,
>,
}
#[test]
fn bindgen_test_layout_playdate_sound_channel() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound_channel> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound_channel>(),
128usize,
concat!("Size of: ", stringify!(playdate_sound_channel))
);
assert_eq!(
::core::mem::align_of::<playdate_sound_channel>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound_channel))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).newChannel) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(newChannel)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeChannel) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(freeChannel)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addSource) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(addSource)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeSource) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(removeSource)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addCallbackSource) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(addCallbackSource)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addEffect) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(addEffect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeEffect) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(removeEffect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVolume) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(setVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getVolume) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(getVolume)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setVolumeModulator) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(setVolumeModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getVolumeModulator) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(getVolumeModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPan) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(setPan)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setPanModulator) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(setPanModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getPanModulator) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(getPanModulator)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getDryLevelSignal) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(getDryLevelSignal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getWetLevelSignal) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound_channel),
"::",
stringify!(getWetLevelSignal)
)
);
}
pub type RecordCallback = ::core::option::Option<
unsafe extern "C" fn(
context: *mut ctypes::c_void,
buffer: *mut i16,
length: ctypes::c_int,
) -> ctypes::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct playdate_sound {
pub channel: *const playdate_sound_channel,
pub fileplayer: *const playdate_sound_fileplayer,
pub sample: *const playdate_sound_sample,
pub sampleplayer: *const playdate_sound_sampleplayer,
pub synth: *const playdate_sound_synth,
pub sequence: *const playdate_sound_sequence,
pub effect: *const playdate_sound_effect,
pub lfo: *const playdate_sound_lfo,
pub envelope: *const playdate_sound_envelope,
pub source: *const playdate_sound_source,
pub controlsignal: *const playdate_control_signal,
pub track: *const playdate_sound_track,
pub instrument: *const playdate_sound_instrument,
pub getCurrentTime: ::core::option::Option<unsafe extern "C" fn() -> u32>,
pub addSource: ::core::option::Option<
unsafe extern "C" fn(
callback: AudioSourceFunction,
context: *mut ctypes::c_void,
stereo: ctypes::c_int,
) -> *mut SoundSource,
>,
pub getDefaultChannel: ::core::option::Option<unsafe extern "C" fn() -> *mut SoundChannel>,
pub addChannel:
::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel) -> ctypes::c_int>,
pub removeChannel:
::core::option::Option<unsafe extern "C" fn(channel: *mut SoundChannel) -> ctypes::c_int>,
pub setMicCallback: ::core::option::Option<
unsafe extern "C" fn(
callback: RecordCallback,
context: *mut ctypes::c_void,
forceInternal: ctypes::c_int,
),
>,
pub getHeadphoneState: ::core::option::Option<
unsafe extern "C" fn(
headphone: *mut ctypes::c_int,
headsetmic: *mut ctypes::c_int,
changeCallback: ::core::option::Option<
unsafe extern "C" fn(headphone: ctypes::c_int, mic: ctypes::c_int),
>,
),
>,
pub setOutputsActive: ::core::option::Option<
unsafe extern "C" fn(headphone: ctypes::c_int, speaker: ctypes::c_int),
>,
pub removeSource:
::core::option::Option<unsafe extern "C" fn(source: *mut SoundSource) -> ctypes::c_int>,
pub signal: *const playdate_sound_signal,
}
#[test]
fn bindgen_test_layout_playdate_sound() {
const UNINIT: ::core::mem::MaybeUninit<playdate_sound> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_sound>(),
184usize,
concat!("Size of: ", stringify!(playdate_sound))
);
assert_eq!(
::core::mem::align_of::<playdate_sound>(),
8usize,
concat!("Alignment of ", stringify!(playdate_sound))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).channel) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(channel)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).fileplayer) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(fileplayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sample) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(sample)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sampleplayer) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(sampleplayer)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).synth) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(synth)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sequence) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(sequence)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).effect) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(effect)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).lfo) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(lfo)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).envelope) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(envelope)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).source) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(source)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).controlsignal) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(controlsignal)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).track) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(track)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).instrument) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(instrument)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getCurrentTime) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(getCurrentTime)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addSource) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(addSource)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getDefaultChannel) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(getDefaultChannel)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addChannel) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(addChannel)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeChannel) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(removeChannel)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMicCallback) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(setMicCallback)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getHeadphoneState) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(getHeadphoneState)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setOutputsActive) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(setOutputsActive)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).removeSource) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(removeSource)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).signal) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(playdate_sound),
"::",
stringify!(signal)
)
);
}
impl Default for playdate_sound {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_display {
pub getWidth: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub getHeight: ::core::option::Option<unsafe extern "C" fn() -> ctypes::c_int>,
pub setRefreshRate: ::core::option::Option<unsafe extern "C" fn(rate: f32)>,
pub setInverted: ::core::option::Option<unsafe extern "C" fn(flag: ctypes::c_int)>,
pub setScale: ::core::option::Option<unsafe extern "C" fn(s: ctypes::c_uint)>,
pub setMosaic:
::core::option::Option<unsafe extern "C" fn(x: ctypes::c_uint, y: ctypes::c_uint)>,
pub setFlipped:
::core::option::Option<unsafe extern "C" fn(x: ctypes::c_int, y: ctypes::c_int)>,
pub setOffset: ::core::option::Option<unsafe extern "C" fn(x: ctypes::c_int, y: ctypes::c_int)>,
}
#[test]
fn bindgen_test_layout_playdate_display() {
const UNINIT: ::core::mem::MaybeUninit<playdate_display> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_display>(),
64usize,
concat!("Size of: ", stringify!(playdate_display))
);
assert_eq!(
::core::mem::align_of::<playdate_display>(),
8usize,
concat!("Alignment of ", stringify!(playdate_display))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getWidth) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(getWidth)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getHeight) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(getHeight)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setRefreshRate) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(setRefreshRate)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setInverted) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(setInverted)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setScale) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(setScale)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setMosaic) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(setMosaic)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setFlipped) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(setFlipped)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).setOffset) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(playdate_display),
"::",
stringify!(setOffset)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct PDScore {
pub rank: u32,
pub value: u32,
pub player: *mut ctypes::c_char,
}
#[test]
fn bindgen_test_layout_PDScore() {
const UNINIT: ::core::mem::MaybeUninit<PDScore> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<PDScore>(),
16usize,
concat!("Size of: ", stringify!(PDScore))
);
assert_eq!(
::core::mem::align_of::<PDScore>(),
8usize,
concat!("Alignment of ", stringify!(PDScore))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).rank) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PDScore),
"::",
stringify!(rank)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(PDScore),
"::",
stringify!(value)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).player) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PDScore),
"::",
stringify!(player)
)
);
}
impl Default for PDScore {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct PDScoresList {
pub boardID: *mut ctypes::c_char,
pub count: ctypes::c_uint,
pub lastUpdated: u32,
pub playerIncluded: ctypes::c_int,
pub limit: ctypes::c_uint,
pub scores: *mut PDScore,
}
#[test]
fn bindgen_test_layout_PDScoresList() {
const UNINIT: ::core::mem::MaybeUninit<PDScoresList> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<PDScoresList>(),
32usize,
concat!("Size of: ", stringify!(PDScoresList))
);
assert_eq!(
::core::mem::align_of::<PDScoresList>(),
8usize,
concat!("Alignment of ", stringify!(PDScoresList))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).boardID) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PDScoresList),
"::",
stringify!(boardID)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).count) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PDScoresList),
"::",
stringify!(count)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).lastUpdated) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(PDScoresList),
"::",
stringify!(lastUpdated)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).playerIncluded) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(PDScoresList),
"::",
stringify!(playerIncluded)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).limit) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(PDScoresList),
"::",
stringify!(limit)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).scores) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(PDScoresList),
"::",
stringify!(scores)
)
);
}
impl Default for PDScoresList {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct PDBoard {
pub boardID: *mut ctypes::c_char,
pub name: *mut ctypes::c_char,
}
#[test]
fn bindgen_test_layout_PDBoard() {
const UNINIT: ::core::mem::MaybeUninit<PDBoard> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<PDBoard>(),
16usize,
concat!("Size of: ", stringify!(PDBoard))
);
assert_eq!(
::core::mem::align_of::<PDBoard>(),
8usize,
concat!("Alignment of ", stringify!(PDBoard))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).boardID) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PDBoard),
"::",
stringify!(boardID)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PDBoard),
"::",
stringify!(name)
)
);
}
impl Default for PDBoard {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct PDBoardsList {
pub count: ctypes::c_uint,
pub lastUpdated: u32,
pub boards: *mut PDBoard,
}
#[test]
fn bindgen_test_layout_PDBoardsList() {
const UNINIT: ::core::mem::MaybeUninit<PDBoardsList> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<PDBoardsList>(),
16usize,
concat!("Size of: ", stringify!(PDBoardsList))
);
assert_eq!(
::core::mem::align_of::<PDBoardsList>(),
8usize,
concat!("Alignment of ", stringify!(PDBoardsList))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).count) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PDBoardsList),
"::",
stringify!(count)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).lastUpdated) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(PDBoardsList),
"::",
stringify!(lastUpdated)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).boards) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PDBoardsList),
"::",
stringify!(boards)
)
);
}
impl Default for PDBoardsList {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
pub type AddScoreCallback = ::core::option::Option<
unsafe extern "C" fn(score: *mut PDScore, errorMessage: *const ctypes::c_char),
>;
pub type PersonalBestCallback = ::core::option::Option<
unsafe extern "C" fn(score: *mut PDScore, errorMessage: *const ctypes::c_char),
>;
pub type BoardsListCallback = ::core::option::Option<
unsafe extern "C" fn(boards: *mut PDBoardsList, errorMessage: *const ctypes::c_char),
>;
pub type ScoresCallback = ::core::option::Option<
unsafe extern "C" fn(scores: *mut PDScoresList, errorMessage: *const ctypes::c_char),
>;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq)]
pub struct playdate_scoreboards {
pub addScore: ::core::option::Option<
unsafe extern "C" fn(
boardId: *const ctypes::c_char,
value: u32,
callback: AddScoreCallback,
) -> ctypes::c_int,
>,
pub getPersonalBest: ::core::option::Option<
unsafe extern "C" fn(
boardId: *const ctypes::c_char,
callback: PersonalBestCallback,
) -> ctypes::c_int,
>,
pub freeScore: ::core::option::Option<unsafe extern "C" fn(score: *mut PDScore)>,
pub getScoreboards:
::core::option::Option<unsafe extern "C" fn(callback: BoardsListCallback) -> ctypes::c_int>,
pub freeBoardsList: ::core::option::Option<unsafe extern "C" fn(boardsList: *mut PDBoardsList)>,
pub getScores: ::core::option::Option<
unsafe extern "C" fn(
boardId: *const ctypes::c_char,
callback: ScoresCallback,
) -> ctypes::c_int,
>,
pub freeScoresList: ::core::option::Option<unsafe extern "C" fn(scoresList: *mut PDScoresList)>,
}
#[test]
fn bindgen_test_layout_playdate_scoreboards() {
const UNINIT: ::core::mem::MaybeUninit<playdate_scoreboards> =
::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<playdate_scoreboards>(),
56usize,
concat!("Size of: ", stringify!(playdate_scoreboards))
);
assert_eq!(
::core::mem::align_of::<playdate_scoreboards>(),
8usize,
concat!("Alignment of ", stringify!(playdate_scoreboards))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).addScore) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(playdate_scoreboards),
"::",
stringify!(addScore)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getPersonalBest) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(playdate_scoreboards),
"::",
stringify!(getPersonalBest)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeScore) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(playdate_scoreboards),
"::",
stringify!(freeScore)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getScoreboards) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(playdate_scoreboards),
"::",
stringify!(getScoreboards)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeBoardsList) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(playdate_scoreboards),
"::",
stringify!(freeBoardsList)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).getScores) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(playdate_scoreboards),
"::",
stringify!(getScores)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).freeScoresList) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(playdate_scoreboards),
"::",
stringify!(freeScoresList)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct PlaydateAPI {
pub system: *const playdate_sys,
pub file: *const playdate_file,
pub graphics: *const playdate_graphics,
pub sprite: *const playdate_sprite,
pub display: *const playdate_display,
pub sound: *const playdate_sound,
pub lua: *const playdate_lua,
pub json: *const playdate_json,
pub scoreboards: *const playdate_scoreboards,
}
#[test]
fn bindgen_test_layout_PlaydateAPI() {
const UNINIT: ::core::mem::MaybeUninit<PlaydateAPI> = ::core::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::core::mem::size_of::<PlaydateAPI>(),
72usize,
concat!("Size of: ", stringify!(PlaydateAPI))
);
assert_eq!(
::core::mem::align_of::<PlaydateAPI>(),
8usize,
concat!("Alignment of ", stringify!(PlaydateAPI))
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).system) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(system)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).file) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(file)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).graphics) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(graphics)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sprite) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(sprite)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).display) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(display)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).sound) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(sound)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).lua) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(lua)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).json) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(json)
)
);
assert_eq!(
unsafe { ::core::ptr::addr_of!((*ptr).scoreboards) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(PlaydateAPI),
"::",
stringify!(scoreboards)
)
);
}
impl Default for PlaydateAPI {
fn default() -> Self {
let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
unsafe {
::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
s.assume_init()
}
}
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum PDSystemEvent {
kEventInit = 0,
kEventInitLua = 1,
kEventLock = 2,
kEventUnlock = 3,
kEventPause = 4,
kEventResume = 5,
kEventTerminate = 6,
kEventKeyPressed = 7,
kEventKeyReleased = 8,
kEventLowPower = 9,
}