diff --git a/crankstart-sys/src/bindings_aarch64.rs b/crankstart-sys/src/bindings_aarch64.rs index b5298fa..590e1ee 100644 --- a/crankstart-sys/src/bindings_aarch64.rs +++ b/crankstart-sys/src/bindings_aarch64.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.66.1 */ +/* automatically generated by rust-bindgen 0.69.4 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -652,6 +652,7 @@ pub struct playdate_graphics { pub makeFontFromData: ::core::option::Option< unsafe extern "C" fn(data: *mut LCDFontData, wide: ctypes::c_int) -> *mut LCDFont, >, + pub getTextTracking: ::core::option::Option ctypes::c_int>, } #[test] fn bindgen_test_layout_playdate_graphics() { @@ -659,7 +660,7 @@ fn bindgen_test_layout_playdate_graphics() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 472usize, + 480usize, concat!("Size of: ", stringify!(playdate_graphics)) ); assert_eq!( @@ -1257,6 +1258,16 @@ fn bindgen_test_layout_playdate_graphics() { stringify!(makeFontFromData) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getTextTracking) as usize - ptr as usize }, + 472usize, + concat!( + "Offset of field: ", + stringify!(playdate_graphics), + "::", + stringify!(getTextTracking) + ) + ); } impl Default for playdate_graphics { fn default() -> Self { @@ -1267,6 +1278,7 @@ impl Default for playdate_graphics { } } } +pub type va_list = [u64; 4usize]; impl PDButtons { pub const kButtonLeft: PDButtons = PDButtons(1); } @@ -1433,6 +1445,14 @@ pub type PDCallbackFunction = ::core::option::Option ctypes::c_int>; pub type PDMenuItemCallbackFunction = ::core::option::Option; +pub type PDButtonCallbackFunction = ::core::option::Option< + unsafe extern "C" fn( + button: PDButtons, + down: ctypes::c_int, + when: u32, + userdata: *mut ctypes::c_void, + ) -> ctypes::c_int, +>; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] pub struct playdate_sys { @@ -1534,6 +1554,32 @@ pub struct playdate_sys { pub convertDateTimeToEpoch: ::core::option::Option u32>, pub clearICache: ::core::option::Option, + pub setButtonCallback: ::core::option::Option< + unsafe extern "C" fn( + cb: PDButtonCallbackFunction, + buttonud: *mut ctypes::c_void, + queuesize: ctypes::c_int, + ), + >, + pub setSerialMessageCallback: ::core::option::Option< + unsafe extern "C" fn( + callback: ::core::option::Option, + ), + >, + pub vaFormatString: ::core::option::Option< + unsafe extern "C" fn( + outstr: *mut *mut ctypes::c_char, + fmt: *const ctypes::c_char, + args: va_list, + ) -> ctypes::c_int, + >, + pub parseString: ::core::option::Option< + unsafe extern "C" fn( + str_: *const ctypes::c_char, + format: *const ctypes::c_char, + ... + ) -> ctypes::c_int, + >, } #[test] fn bindgen_test_layout_playdate_sys() { @@ -1541,7 +1587,7 @@ fn bindgen_test_layout_playdate_sys() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 320usize, + 352usize, concat!("Size of: ", stringify!(playdate_sys)) ); assert_eq!( @@ -1949,6 +1995,46 @@ fn bindgen_test_layout_playdate_sys() { stringify!(clearICache) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setButtonCallback) as usize - ptr as usize }, + 320usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(setButtonCallback) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setSerialMessageCallback) as usize - ptr as usize }, + 328usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(setSerialMessageCallback) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).vaFormatString) as usize - ptr as usize }, + 336usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(vaFormatString) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).parseString) as usize - ptr as usize }, + 344usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(parseString) + ) + ); } pub type lua_State = *mut ctypes::c_void; pub type lua_CFunction = @@ -2896,16 +2982,17 @@ impl Default for json_decoder { } } } +pub type json_readFunc = ::core::option::Option< + unsafe extern "C" fn( + userdata: *mut ctypes::c_void, + buf: *mut u8, + bufsize: ctypes::c_int, + ) -> ctypes::c_int, +>; #[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 read: json_readFunc, pub userdata: *mut ctypes::c_void, } #[test] @@ -2952,7 +3039,7 @@ impl Default for json_reader { } } } -pub type writeFunc = ::core::option::Option< +pub type json_writeFunc = ::core::option::Option< unsafe extern "C" fn( userdata: *mut ctypes::c_void, str_: *const ctypes::c_char, @@ -2962,7 +3049,7 @@ pub type writeFunc = ::core::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct json_encoder { - pub writeStringFunc: writeFunc, + pub writeStringFunc: json_writeFunc, pub userdata: *mut ctypes::c_void, pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, @@ -3236,7 +3323,7 @@ pub struct playdate_json { pub initEncoder: ::core::option::Option< unsafe extern "C" fn( encoder: *mut json_encoder, - write: writeFunc, + write: json_writeFunc, userdata: *mut ctypes::c_void, pretty: ctypes::c_int, ), @@ -4190,6 +4277,9 @@ pub struct playdate_sprite { pub setStencilImage: ::core::option::Option< unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap, tile: ctypes::c_int), >, + pub setCenter: ::core::option::Option, + pub getCenter: + ::core::option::Option, } #[test] fn bindgen_test_layout_playdate_sprite() { @@ -4197,7 +4287,7 @@ fn bindgen_test_layout_playdate_sprite() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 488usize, + 504usize, concat!("Size of: ", stringify!(playdate_sprite)) ); assert_eq!( @@ -4817,6 +4907,26 @@ fn bindgen_test_layout_playdate_sprite() { stringify!(setStencilImage) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setCenter) as usize - ptr as usize }, + 488usize, + concat!( + "Offset of field: ", + stringify!(playdate_sprite), + "::", + stringify!(setCenter) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getCenter) as usize - ptr as usize }, + 496usize, + concat!( + "Offset of field: ", + stringify!(playdate_sprite), + "::", + stringify!(getCenter) + ) + ); } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -4834,7 +4944,9 @@ pub type MIDINote = f32; pub struct SoundSource { _unused: [u8; 0], } -pub type sndCallbackProc = ::core::option::Option; +pub type sndCallbackProc = ::core::option::Option< + unsafe extern "C" fn(c: *mut SoundSource, userdata: *mut ctypes::c_void), +>; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] pub struct playdate_sound_source { @@ -4846,7 +4958,11 @@ pub struct playdate_sound_source { pub isPlaying: ::core::option::Option ctypes::c_int>, pub setFinishCallback: ::core::option::Option< - unsafe extern "C" fn(c: *mut SoundSource, callback: sndCallbackProc), + unsafe extern "C" fn( + c: *mut SoundSource, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, } #[test] @@ -4942,10 +5058,18 @@ pub struct playdate_sound_fileplayer { pub didUnderrun: ::core::option::Option ctypes::c_int>, pub setFinishCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut FilePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub setLoopCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut FilePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub getOffset: ::core::option::Option f32>, pub getRate: ::core::option::Option f32>, @@ -4958,6 +5082,7 @@ pub struct playdate_sound_fileplayer { right: f32, len: i32, finishCallback: sndCallbackProc, + userdata: *mut ctypes::c_void, ), >, pub setMP3StreamSource: ::core::option::Option< @@ -5254,6 +5379,8 @@ pub struct playdate_sound_sample { >, pub freeSample: ::core::option::Option, pub getLength: ::core::option::Option f32>, + pub decompress: + ::core::option::Option ctypes::c_int>, } #[test] fn bindgen_test_layout_playdate_sound_sample() { @@ -5262,7 +5389,7 @@ fn bindgen_test_layout_playdate_sound_sample() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(playdate_sound_sample)) ); assert_eq!( @@ -5340,6 +5467,16 @@ fn bindgen_test_layout_playdate_sound_sample() { stringify!(getLength) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).decompress) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_sample), + "::", + stringify!(decompress) + ) + ); } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] @@ -5373,10 +5510,18 @@ pub struct playdate_sound_sampleplayer { 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), + unsafe extern "C" fn( + player: *mut SamplePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub setLoopCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut SamplePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut SamplePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub getOffset: ::core::option::Option f32>, pub getRate: ::core::option::Option f32>, @@ -5591,11 +5736,7 @@ 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, - ), + unsafe extern "C" fn(userdata: *mut ctypes::c_void, stop: ctypes::c_int, offset: ctypes::c_int), >; pub type signalDeallocFunc = ::core::option::Option; @@ -5732,6 +5873,8 @@ pub struct playdate_sound_lfo { pub getValue: ::core::option::Option f32>, pub setGlobal: ::core::option::Option, + pub setStartPhase: + ::core::option::Option, } #[test] fn bindgen_test_layout_playdate_sound_lfo() { @@ -5739,7 +5882,7 @@ fn bindgen_test_layout_playdate_sound_lfo() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 104usize, + 112usize, concat!("Size of: ", stringify!(playdate_sound_lfo)) ); assert_eq!( @@ -5877,6 +6020,16 @@ fn bindgen_test_layout_playdate_sound_lfo() { stringify!(setGlobal) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setStartPhase) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_lfo), + "::", + stringify!(setStartPhase) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6096,6 +6249,9 @@ pub type synthSetParameterFunc = ::core::option::Option< >; pub type synthDeallocFunc = ::core::option::Option; +pub type synthCopyUserdata = ::core::option::Option< + unsafe extern "C" fn(userdata: *mut ctypes::c_void) -> *mut ctypes::c_void, +>; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PDSynth { @@ -6108,7 +6264,7 @@ pub struct playdate_sound_synth { pub freeSynth: ::core::option::Option, pub setWaveform: ::core::option::Option, - pub setGenerator: ::core::option::Option< + pub setGenerator_deprecated: ::core::option::Option< unsafe extern "C" fn( synth: *mut PDSynth, stereo: ctypes::c_int, @@ -6188,6 +6344,29 @@ pub struct playdate_sound_synth { ::core::option::Option ctypes::c_int>, pub getEnvelope: ::core::option::Option *mut PDSynthEnvelope>, + pub setWavetable: ::core::option::Option< + unsafe extern "C" fn( + synth: *mut PDSynth, + sample: *mut AudioSample, + log2size: ctypes::c_int, + columns: ctypes::c_int, + rows: ctypes::c_int, + ) -> ctypes::c_int, + >, + 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, + copyUserdata: synthCopyUserdata, + userdata: *mut ctypes::c_void, + ), + >, + pub copy: ::core::option::Option *mut PDSynth>, } #[test] fn bindgen_test_layout_playdate_sound_synth() { @@ -6196,7 +6375,7 @@ fn bindgen_test_layout_playdate_sound_synth() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 208usize, + 232usize, concat!("Size of: ", stringify!(playdate_sound_synth)) ); assert_eq!( @@ -6235,13 +6414,13 @@ fn bindgen_test_layout_playdate_sound_synth() { ) ); assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize }, + unsafe { ::core::ptr::addr_of!((*ptr).setGenerator_deprecated) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(playdate_sound_synth), "::", - stringify!(setGenerator) + stringify!(setGenerator_deprecated) ) ); assert_eq!( @@ -6464,6 +6643,36 @@ fn bindgen_test_layout_playdate_sound_synth() { stringify!(getEnvelope) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setWavetable) as usize - ptr as usize }, + 208usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(setWavetable) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(setGenerator) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).copy) as usize - ptr as usize }, + 224usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(copy) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7032,7 +7241,7 @@ pub type SequenceFinishedCallback = ::core::option::Option< pub struct playdate_sound_sequence { pub newSequence: ::core::option::Option *mut SoundSequence>, pub freeSequence: ::core::option::Option, - pub loadMidiFile: ::core::option::Option< + 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 u32>, @@ -7047,9 +7256,8 @@ pub struct playdate_sound_sequence { >, pub getTempo: ::core::option::Option ctypes::c_int>, - pub setTempo: ::core::option::Option< - unsafe extern "C" fn(seq: *mut SoundSequence, stepsPerSecond: ctypes::c_int), - >, + pub setTempo: + ::core::option::Option, pub getTrackCount: ::core::option::Option ctypes::c_int>, pub addTrack: @@ -7127,13 +7335,13 @@ fn bindgen_test_layout_playdate_sound_sequence() { ) ); assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).loadMidiFile) as usize - ptr as usize }, + unsafe { ::core::ptr::addr_of!((*ptr).loadMIDIFile) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(playdate_sound_sequence), "::", - stringify!(loadMidiFile) + stringify!(loadMIDIFile) ) ); assert_eq!( @@ -8482,6 +8690,13 @@ pub type RecordCallback = ::core::option::Option< length: ctypes::c_int, ) -> ctypes::c_int, >; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum MicSource { + kMicInputAutodetect = 0, + kMicInputInternal = 1, + kMicInputHeadset = 2, +} #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct playdate_sound { @@ -8515,8 +8730,8 @@ pub struct playdate_sound { unsafe extern "C" fn( callback: RecordCallback, context: *mut ctypes::c_void, - forceInternal: ctypes::c_int, - ), + source: MicSource, + ) -> ctypes::c_int, >, pub getHeadphoneState: ::core::option::Option< unsafe extern "C" fn( @@ -8533,6 +8748,7 @@ pub struct playdate_sound { pub removeSource: ::core::option::Option ctypes::c_int>, pub signal: *const playdate_sound_signal, + pub getError: ::core::option::Option *const ctypes::c_char>, } #[test] fn bindgen_test_layout_playdate_sound() { @@ -8540,7 +8756,7 @@ fn bindgen_test_layout_playdate_sound() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 184usize, + 192usize, concat!("Size of: ", stringify!(playdate_sound)) ); assert_eq!( @@ -8778,6 +8994,16 @@ fn bindgen_test_layout_playdate_sound() { stringify!(signal) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getError) as usize - ptr as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound), + "::", + stringify!(getError) + ) + ); } impl Default for playdate_sound { fn default() -> Self { diff --git a/crankstart-sys/src/bindings_playdate.rs b/crankstart-sys/src/bindings_playdate.rs index d8a8c40..64cd530 100644 --- a/crankstart-sys/src/bindings_playdate.rs +++ b/crankstart-sys/src/bindings_playdate.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.66.1 */ +/* automatically generated by rust-bindgen 0.69.4 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -652,6 +652,7 @@ pub struct playdate_graphics { pub makeFontFromData: ::core::option::Option< unsafe extern "C" fn(data: *mut LCDFontData, wide: ctypes::c_int) -> *mut LCDFont, >, + pub getTextTracking: ::core::option::Option ctypes::c_int>, } #[test] fn bindgen_test_layout_playdate_graphics() { @@ -659,7 +660,7 @@ fn bindgen_test_layout_playdate_graphics() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 236usize, + 240usize, concat!("Size of: ", stringify!(playdate_graphics)) ); assert_eq!( @@ -1257,6 +1258,16 @@ fn bindgen_test_layout_playdate_graphics() { stringify!(makeFontFromData) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getTextTracking) as usize - ptr as usize }, + 236usize, + concat!( + "Offset of field: ", + stringify!(playdate_graphics), + "::", + stringify!(getTextTracking) + ) + ); } impl Default for playdate_graphics { fn default() -> Self { @@ -1267,6 +1278,7 @@ impl Default for playdate_graphics { } } } +pub type va_list = u32; impl PDButtons { pub const kButtonLeft: PDButtons = PDButtons(1); } @@ -1433,6 +1445,14 @@ pub type PDCallbackFunction = ::core::option::Option ctypes::c_int>; pub type PDMenuItemCallbackFunction = ::core::option::Option; +pub type PDButtonCallbackFunction = ::core::option::Option< + unsafe extern "C" fn( + button: PDButtons, + down: ctypes::c_int, + when: u32, + userdata: *mut ctypes::c_void, + ) -> ctypes::c_int, +>; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] pub struct playdate_sys { @@ -1534,6 +1554,32 @@ pub struct playdate_sys { pub convertDateTimeToEpoch: ::core::option::Option u32>, pub clearICache: ::core::option::Option, + pub setButtonCallback: ::core::option::Option< + unsafe extern "C" fn( + cb: PDButtonCallbackFunction, + buttonud: *mut ctypes::c_void, + queuesize: ctypes::c_int, + ), + >, + pub setSerialMessageCallback: ::core::option::Option< + unsafe extern "C" fn( + callback: ::core::option::Option, + ), + >, + pub vaFormatString: ::core::option::Option< + unsafe extern "C" fn( + outstr: *mut *mut ctypes::c_char, + fmt: *const ctypes::c_char, + args: va_list, + ) -> ctypes::c_int, + >, + pub parseString: ::core::option::Option< + unsafe extern "C" fn( + str_: *const ctypes::c_char, + format: *const ctypes::c_char, + ... + ) -> ctypes::c_int, + >, } #[test] fn bindgen_test_layout_playdate_sys() { @@ -1541,7 +1587,7 @@ fn bindgen_test_layout_playdate_sys() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 160usize, + 176usize, concat!("Size of: ", stringify!(playdate_sys)) ); assert_eq!( @@ -1949,6 +1995,46 @@ fn bindgen_test_layout_playdate_sys() { stringify!(clearICache) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setButtonCallback) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(setButtonCallback) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setSerialMessageCallback) as usize - ptr as usize }, + 164usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(setSerialMessageCallback) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).vaFormatString) as usize - ptr as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(vaFormatString) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).parseString) as usize - ptr as usize }, + 172usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(parseString) + ) + ); } pub type lua_State = *mut ctypes::c_void; pub type lua_CFunction = @@ -2896,16 +2982,17 @@ impl Default for json_decoder { } } } +pub type json_readFunc = ::core::option::Option< + unsafe extern "C" fn( + userdata: *mut ctypes::c_void, + buf: *mut u8, + bufsize: ctypes::c_int, + ) -> ctypes::c_int, +>; #[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 read: json_readFunc, pub userdata: *mut ctypes::c_void, } #[test] @@ -2952,7 +3039,7 @@ impl Default for json_reader { } } } -pub type writeFunc = ::core::option::Option< +pub type json_writeFunc = ::core::option::Option< unsafe extern "C" fn( userdata: *mut ctypes::c_void, str_: *const ctypes::c_char, @@ -2962,7 +3049,7 @@ pub type writeFunc = ::core::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct json_encoder { - pub writeStringFunc: writeFunc, + pub writeStringFunc: json_writeFunc, pub userdata: *mut ctypes::c_void, pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, @@ -3236,7 +3323,7 @@ pub struct playdate_json { pub initEncoder: ::core::option::Option< unsafe extern "C" fn( encoder: *mut json_encoder, - write: writeFunc, + write: json_writeFunc, userdata: *mut ctypes::c_void, pretty: ctypes::c_int, ), @@ -4190,6 +4277,9 @@ pub struct playdate_sprite { pub setStencilImage: ::core::option::Option< unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap, tile: ctypes::c_int), >, + pub setCenter: ::core::option::Option, + pub getCenter: + ::core::option::Option, } #[test] fn bindgen_test_layout_playdate_sprite() { @@ -4197,7 +4287,7 @@ fn bindgen_test_layout_playdate_sprite() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 244usize, + 252usize, concat!("Size of: ", stringify!(playdate_sprite)) ); assert_eq!( @@ -4817,6 +4907,26 @@ fn bindgen_test_layout_playdate_sprite() { stringify!(setStencilImage) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setCenter) as usize - ptr as usize }, + 244usize, + concat!( + "Offset of field: ", + stringify!(playdate_sprite), + "::", + stringify!(setCenter) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getCenter) as usize - ptr as usize }, + 248usize, + concat!( + "Offset of field: ", + stringify!(playdate_sprite), + "::", + stringify!(getCenter) + ) + ); } #[repr(u8)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -4834,7 +4944,9 @@ pub type MIDINote = f32; pub struct SoundSource { _unused: [u8; 0], } -pub type sndCallbackProc = ::core::option::Option; +pub type sndCallbackProc = ::core::option::Option< + unsafe extern "C" fn(c: *mut SoundSource, userdata: *mut ctypes::c_void), +>; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] pub struct playdate_sound_source { @@ -4846,7 +4958,11 @@ pub struct playdate_sound_source { pub isPlaying: ::core::option::Option ctypes::c_int>, pub setFinishCallback: ::core::option::Option< - unsafe extern "C" fn(c: *mut SoundSource, callback: sndCallbackProc), + unsafe extern "C" fn( + c: *mut SoundSource, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, } #[test] @@ -4942,10 +5058,18 @@ pub struct playdate_sound_fileplayer { pub didUnderrun: ::core::option::Option ctypes::c_int>, pub setFinishCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut FilePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub setLoopCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut FilePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub getOffset: ::core::option::Option f32>, pub getRate: ::core::option::Option f32>, @@ -4958,6 +5082,7 @@ pub struct playdate_sound_fileplayer { right: f32, len: i32, finishCallback: sndCallbackProc, + userdata: *mut ctypes::c_void, ), >, pub setMP3StreamSource: ::core::option::Option< @@ -5254,6 +5379,8 @@ pub struct playdate_sound_sample { >, pub freeSample: ::core::option::Option, pub getLength: ::core::option::Option f32>, + pub decompress: + ::core::option::Option ctypes::c_int>, } #[test] fn bindgen_test_layout_playdate_sound_sample() { @@ -5262,7 +5389,7 @@ fn bindgen_test_layout_playdate_sound_sample() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 28usize, + 32usize, concat!("Size of: ", stringify!(playdate_sound_sample)) ); assert_eq!( @@ -5340,6 +5467,16 @@ fn bindgen_test_layout_playdate_sound_sample() { stringify!(getLength) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).decompress) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_sample), + "::", + stringify!(decompress) + ) + ); } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] @@ -5373,10 +5510,18 @@ pub struct playdate_sound_sampleplayer { 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), + unsafe extern "C" fn( + player: *mut SamplePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub setLoopCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut SamplePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut SamplePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub getOffset: ::core::option::Option f32>, pub getRate: ::core::option::Option f32>, @@ -5591,11 +5736,7 @@ 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, - ), + unsafe extern "C" fn(userdata: *mut ctypes::c_void, stop: ctypes::c_int, offset: ctypes::c_int), >; pub type signalDeallocFunc = ::core::option::Option; @@ -5732,6 +5873,8 @@ pub struct playdate_sound_lfo { pub getValue: ::core::option::Option f32>, pub setGlobal: ::core::option::Option, + pub setStartPhase: + ::core::option::Option, } #[test] fn bindgen_test_layout_playdate_sound_lfo() { @@ -5739,7 +5882,7 @@ fn bindgen_test_layout_playdate_sound_lfo() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 52usize, + 56usize, concat!("Size of: ", stringify!(playdate_sound_lfo)) ); assert_eq!( @@ -5877,6 +6020,16 @@ fn bindgen_test_layout_playdate_sound_lfo() { stringify!(setGlobal) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setStartPhase) as usize - ptr as usize }, + 52usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_lfo), + "::", + stringify!(setStartPhase) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6096,6 +6249,9 @@ pub type synthSetParameterFunc = ::core::option::Option< >; pub type synthDeallocFunc = ::core::option::Option; +pub type synthCopyUserdata = ::core::option::Option< + unsafe extern "C" fn(userdata: *mut ctypes::c_void) -> *mut ctypes::c_void, +>; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PDSynth { @@ -6108,7 +6264,7 @@ pub struct playdate_sound_synth { pub freeSynth: ::core::option::Option, pub setWaveform: ::core::option::Option, - pub setGenerator: ::core::option::Option< + pub setGenerator_deprecated: ::core::option::Option< unsafe extern "C" fn( synth: *mut PDSynth, stereo: ctypes::c_int, @@ -6188,6 +6344,29 @@ pub struct playdate_sound_synth { ::core::option::Option ctypes::c_int>, pub getEnvelope: ::core::option::Option *mut PDSynthEnvelope>, + pub setWavetable: ::core::option::Option< + unsafe extern "C" fn( + synth: *mut PDSynth, + sample: *mut AudioSample, + log2size: ctypes::c_int, + columns: ctypes::c_int, + rows: ctypes::c_int, + ) -> ctypes::c_int, + >, + 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, + copyUserdata: synthCopyUserdata, + userdata: *mut ctypes::c_void, + ), + >, + pub copy: ::core::option::Option *mut PDSynth>, } #[test] fn bindgen_test_layout_playdate_sound_synth() { @@ -6196,7 +6375,7 @@ fn bindgen_test_layout_playdate_sound_synth() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 104usize, + 116usize, concat!("Size of: ", stringify!(playdate_sound_synth)) ); assert_eq!( @@ -6235,13 +6414,13 @@ fn bindgen_test_layout_playdate_sound_synth() { ) ); assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize }, + unsafe { ::core::ptr::addr_of!((*ptr).setGenerator_deprecated) as usize - ptr as usize }, 12usize, concat!( "Offset of field: ", stringify!(playdate_sound_synth), "::", - stringify!(setGenerator) + stringify!(setGenerator_deprecated) ) ); assert_eq!( @@ -6464,6 +6643,36 @@ fn bindgen_test_layout_playdate_sound_synth() { stringify!(getEnvelope) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setWavetable) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(setWavetable) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize }, + 108usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(setGenerator) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).copy) as usize - ptr as usize }, + 112usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(copy) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7032,7 +7241,7 @@ pub type SequenceFinishedCallback = ::core::option::Option< pub struct playdate_sound_sequence { pub newSequence: ::core::option::Option *mut SoundSequence>, pub freeSequence: ::core::option::Option, - pub loadMidiFile: ::core::option::Option< + 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 u32>, @@ -7047,9 +7256,8 @@ pub struct playdate_sound_sequence { >, pub getTempo: ::core::option::Option ctypes::c_int>, - pub setTempo: ::core::option::Option< - unsafe extern "C" fn(seq: *mut SoundSequence, stepsPerSecond: ctypes::c_int), - >, + pub setTempo: + ::core::option::Option, pub getTrackCount: ::core::option::Option ctypes::c_int>, pub addTrack: @@ -7127,13 +7335,13 @@ fn bindgen_test_layout_playdate_sound_sequence() { ) ); assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).loadMidiFile) as usize - ptr as usize }, + unsafe { ::core::ptr::addr_of!((*ptr).loadMIDIFile) as usize - ptr as usize }, 8usize, concat!( "Offset of field: ", stringify!(playdate_sound_sequence), "::", - stringify!(loadMidiFile) + stringify!(loadMIDIFile) ) ); assert_eq!( @@ -8482,6 +8690,13 @@ pub type RecordCallback = ::core::option::Option< length: ctypes::c_int, ) -> ctypes::c_int, >; +#[repr(u8)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum MicSource { + kMicInputAutodetect = 0, + kMicInputInternal = 1, + kMicInputHeadset = 2, +} #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct playdate_sound { @@ -8515,8 +8730,8 @@ pub struct playdate_sound { unsafe extern "C" fn( callback: RecordCallback, context: *mut ctypes::c_void, - forceInternal: ctypes::c_int, - ), + source: MicSource, + ) -> ctypes::c_int, >, pub getHeadphoneState: ::core::option::Option< unsafe extern "C" fn( @@ -8533,6 +8748,7 @@ pub struct playdate_sound { pub removeSource: ::core::option::Option ctypes::c_int>, pub signal: *const playdate_sound_signal, + pub getError: ::core::option::Option *const ctypes::c_char>, } #[test] fn bindgen_test_layout_playdate_sound() { @@ -8540,7 +8756,7 @@ fn bindgen_test_layout_playdate_sound() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 92usize, + 96usize, concat!("Size of: ", stringify!(playdate_sound)) ); assert_eq!( @@ -8778,6 +8994,16 @@ fn bindgen_test_layout_playdate_sound() { stringify!(signal) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getError) as usize - ptr as usize }, + 92usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound), + "::", + stringify!(getError) + ) + ); } impl Default for playdate_sound { fn default() -> Self { diff --git a/crankstart-sys/src/bindings_x86.rs b/crankstart-sys/src/bindings_x86.rs index b5298fa..1069ac4 100644 --- a/crankstart-sys/src/bindings_x86.rs +++ b/crankstart-sys/src/bindings_x86.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.66.1 */ +/* automatically generated by rust-bindgen 0.69.4 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -652,6 +652,7 @@ pub struct playdate_graphics { pub makeFontFromData: ::core::option::Option< unsafe extern "C" fn(data: *mut LCDFontData, wide: ctypes::c_int) -> *mut LCDFont, >, + pub getTextTracking: ::core::option::Option ctypes::c_int>, } #[test] fn bindgen_test_layout_playdate_graphics() { @@ -659,7 +660,7 @@ fn bindgen_test_layout_playdate_graphics() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 472usize, + 480usize, concat!("Size of: ", stringify!(playdate_graphics)) ); assert_eq!( @@ -1257,6 +1258,16 @@ fn bindgen_test_layout_playdate_graphics() { stringify!(makeFontFromData) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getTextTracking) as usize - ptr as usize }, + 472usize, + concat!( + "Offset of field: ", + stringify!(playdate_graphics), + "::", + stringify!(getTextTracking) + ) + ); } impl Default for playdate_graphics { fn default() -> Self { @@ -1267,6 +1278,7 @@ impl Default for playdate_graphics { } } } +pub type va_list = __builtin_va_list; impl PDButtons { pub const kButtonLeft: PDButtons = PDButtons(1); } @@ -1433,6 +1445,14 @@ pub type PDCallbackFunction = ::core::option::Option ctypes::c_int>; pub type PDMenuItemCallbackFunction = ::core::option::Option; +pub type PDButtonCallbackFunction = ::core::option::Option< + unsafe extern "C" fn( + button: PDButtons, + down: ctypes::c_int, + when: u32, + userdata: *mut ctypes::c_void, + ) -> ctypes::c_int, +>; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] pub struct playdate_sys { @@ -1534,6 +1554,32 @@ pub struct playdate_sys { pub convertDateTimeToEpoch: ::core::option::Option u32>, pub clearICache: ::core::option::Option, + pub setButtonCallback: ::core::option::Option< + unsafe extern "C" fn( + cb: PDButtonCallbackFunction, + buttonud: *mut ctypes::c_void, + queuesize: ctypes::c_int, + ), + >, + pub setSerialMessageCallback: ::core::option::Option< + unsafe extern "C" fn( + callback: ::core::option::Option, + ), + >, + pub vaFormatString: ::core::option::Option< + unsafe extern "C" fn( + outstr: *mut *mut ctypes::c_char, + fmt: *const ctypes::c_char, + args: *mut __va_list_tag, + ) -> ctypes::c_int, + >, + pub parseString: ::core::option::Option< + unsafe extern "C" fn( + str_: *const ctypes::c_char, + format: *const ctypes::c_char, + ... + ) -> ctypes::c_int, + >, } #[test] fn bindgen_test_layout_playdate_sys() { @@ -1541,7 +1587,7 @@ fn bindgen_test_layout_playdate_sys() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 320usize, + 352usize, concat!("Size of: ", stringify!(playdate_sys)) ); assert_eq!( @@ -1949,6 +1995,46 @@ fn bindgen_test_layout_playdate_sys() { stringify!(clearICache) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setButtonCallback) as usize - ptr as usize }, + 320usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(setButtonCallback) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setSerialMessageCallback) as usize - ptr as usize }, + 328usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(setSerialMessageCallback) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).vaFormatString) as usize - ptr as usize }, + 336usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(vaFormatString) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).parseString) as usize - ptr as usize }, + 344usize, + concat!( + "Offset of field: ", + stringify!(playdate_sys), + "::", + stringify!(parseString) + ) + ); } pub type lua_State = *mut ctypes::c_void; pub type lua_CFunction = @@ -2896,16 +2982,17 @@ impl Default for json_decoder { } } } +pub type json_readFunc = ::core::option::Option< + unsafe extern "C" fn( + userdata: *mut ctypes::c_void, + buf: *mut u8, + bufsize: ctypes::c_int, + ) -> ctypes::c_int, +>; #[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 read: json_readFunc, pub userdata: *mut ctypes::c_void, } #[test] @@ -2952,7 +3039,7 @@ impl Default for json_reader { } } } -pub type writeFunc = ::core::option::Option< +pub type json_writeFunc = ::core::option::Option< unsafe extern "C" fn( userdata: *mut ctypes::c_void, str_: *const ctypes::c_char, @@ -2962,7 +3049,7 @@ pub type writeFunc = ::core::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct json_encoder { - pub writeStringFunc: writeFunc, + pub writeStringFunc: json_writeFunc, pub userdata: *mut ctypes::c_void, pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, @@ -3236,7 +3323,7 @@ pub struct playdate_json { pub initEncoder: ::core::option::Option< unsafe extern "C" fn( encoder: *mut json_encoder, - write: writeFunc, + write: json_writeFunc, userdata: *mut ctypes::c_void, pretty: ctypes::c_int, ), @@ -4190,6 +4277,9 @@ pub struct playdate_sprite { pub setStencilImage: ::core::option::Option< unsafe extern "C" fn(sprite: *mut LCDSprite, stencil: *mut LCDBitmap, tile: ctypes::c_int), >, + pub setCenter: ::core::option::Option, + pub getCenter: + ::core::option::Option, } #[test] fn bindgen_test_layout_playdate_sprite() { @@ -4197,7 +4287,7 @@ fn bindgen_test_layout_playdate_sprite() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 488usize, + 504usize, concat!("Size of: ", stringify!(playdate_sprite)) ); assert_eq!( @@ -4817,6 +4907,26 @@ fn bindgen_test_layout_playdate_sprite() { stringify!(setStencilImage) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setCenter) as usize - ptr as usize }, + 488usize, + concat!( + "Offset of field: ", + stringify!(playdate_sprite), + "::", + stringify!(setCenter) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getCenter) as usize - ptr as usize }, + 496usize, + concat!( + "Offset of field: ", + stringify!(playdate_sprite), + "::", + stringify!(getCenter) + ) + ); } #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] @@ -4834,7 +4944,9 @@ pub type MIDINote = f32; pub struct SoundSource { _unused: [u8; 0], } -pub type sndCallbackProc = ::core::option::Option; +pub type sndCallbackProc = ::core::option::Option< + unsafe extern "C" fn(c: *mut SoundSource, userdata: *mut ctypes::c_void), +>; #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] pub struct playdate_sound_source { @@ -4846,7 +4958,11 @@ pub struct playdate_sound_source { pub isPlaying: ::core::option::Option ctypes::c_int>, pub setFinishCallback: ::core::option::Option< - unsafe extern "C" fn(c: *mut SoundSource, callback: sndCallbackProc), + unsafe extern "C" fn( + c: *mut SoundSource, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, } #[test] @@ -4942,10 +5058,18 @@ pub struct playdate_sound_fileplayer { pub didUnderrun: ::core::option::Option ctypes::c_int>, pub setFinishCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut FilePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub setLoopCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut FilePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut FilePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub getOffset: ::core::option::Option f32>, pub getRate: ::core::option::Option f32>, @@ -4958,6 +5082,7 @@ pub struct playdate_sound_fileplayer { right: f32, len: i32, finishCallback: sndCallbackProc, + userdata: *mut ctypes::c_void, ), >, pub setMP3StreamSource: ::core::option::Option< @@ -5254,6 +5379,8 @@ pub struct playdate_sound_sample { >, pub freeSample: ::core::option::Option, pub getLength: ::core::option::Option f32>, + pub decompress: + ::core::option::Option ctypes::c_int>, } #[test] fn bindgen_test_layout_playdate_sound_sample() { @@ -5262,7 +5389,7 @@ fn bindgen_test_layout_playdate_sound_sample() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 56usize, + 64usize, concat!("Size of: ", stringify!(playdate_sound_sample)) ); assert_eq!( @@ -5340,6 +5467,16 @@ fn bindgen_test_layout_playdate_sound_sample() { stringify!(getLength) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).decompress) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_sample), + "::", + stringify!(decompress) + ) + ); } #[repr(C)] #[derive(Debug, Default, Copy, Clone, PartialEq, Eq)] @@ -5373,10 +5510,18 @@ pub struct playdate_sound_sampleplayer { 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), + unsafe extern "C" fn( + player: *mut SamplePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub setLoopCallback: ::core::option::Option< - unsafe extern "C" fn(player: *mut SamplePlayer, callback: sndCallbackProc), + unsafe extern "C" fn( + player: *mut SamplePlayer, + callback: sndCallbackProc, + userdata: *mut ctypes::c_void, + ), >, pub getOffset: ::core::option::Option f32>, pub getRate: ::core::option::Option f32>, @@ -5591,11 +5736,7 @@ 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, - ), + unsafe extern "C" fn(userdata: *mut ctypes::c_void, stop: ctypes::c_int, offset: ctypes::c_int), >; pub type signalDeallocFunc = ::core::option::Option; @@ -5732,6 +5873,8 @@ pub struct playdate_sound_lfo { pub getValue: ::core::option::Option f32>, pub setGlobal: ::core::option::Option, + pub setStartPhase: + ::core::option::Option, } #[test] fn bindgen_test_layout_playdate_sound_lfo() { @@ -5739,7 +5882,7 @@ fn bindgen_test_layout_playdate_sound_lfo() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 104usize, + 112usize, concat!("Size of: ", stringify!(playdate_sound_lfo)) ); assert_eq!( @@ -5877,6 +6020,16 @@ fn bindgen_test_layout_playdate_sound_lfo() { stringify!(setGlobal) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setStartPhase) as usize - ptr as usize }, + 104usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_lfo), + "::", + stringify!(setStartPhase) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -6096,6 +6249,9 @@ pub type synthSetParameterFunc = ::core::option::Option< >; pub type synthDeallocFunc = ::core::option::Option; +pub type synthCopyUserdata = ::core::option::Option< + unsafe extern "C" fn(userdata: *mut ctypes::c_void) -> *mut ctypes::c_void, +>; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PDSynth { @@ -6108,7 +6264,7 @@ pub struct playdate_sound_synth { pub freeSynth: ::core::option::Option, pub setWaveform: ::core::option::Option, - pub setGenerator: ::core::option::Option< + pub setGenerator_deprecated: ::core::option::Option< unsafe extern "C" fn( synth: *mut PDSynth, stereo: ctypes::c_int, @@ -6188,6 +6344,29 @@ pub struct playdate_sound_synth { ::core::option::Option ctypes::c_int>, pub getEnvelope: ::core::option::Option *mut PDSynthEnvelope>, + pub setWavetable: ::core::option::Option< + unsafe extern "C" fn( + synth: *mut PDSynth, + sample: *mut AudioSample, + log2size: ctypes::c_int, + columns: ctypes::c_int, + rows: ctypes::c_int, + ) -> ctypes::c_int, + >, + 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, + copyUserdata: synthCopyUserdata, + userdata: *mut ctypes::c_void, + ), + >, + pub copy: ::core::option::Option *mut PDSynth>, } #[test] fn bindgen_test_layout_playdate_sound_synth() { @@ -6196,7 +6375,7 @@ fn bindgen_test_layout_playdate_sound_synth() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 208usize, + 232usize, concat!("Size of: ", stringify!(playdate_sound_synth)) ); assert_eq!( @@ -6235,13 +6414,13 @@ fn bindgen_test_layout_playdate_sound_synth() { ) ); assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize }, + unsafe { ::core::ptr::addr_of!((*ptr).setGenerator_deprecated) as usize - ptr as usize }, 24usize, concat!( "Offset of field: ", stringify!(playdate_sound_synth), "::", - stringify!(setGenerator) + stringify!(setGenerator_deprecated) ) ); assert_eq!( @@ -6464,6 +6643,36 @@ fn bindgen_test_layout_playdate_sound_synth() { stringify!(getEnvelope) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setWavetable) as usize - ptr as usize }, + 208usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(setWavetable) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).setGenerator) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(setGenerator) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).copy) as usize - ptr as usize }, + 224usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound_synth), + "::", + stringify!(copy) + ) + ); } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -7032,7 +7241,7 @@ pub type SequenceFinishedCallback = ::core::option::Option< pub struct playdate_sound_sequence { pub newSequence: ::core::option::Option *mut SoundSequence>, pub freeSequence: ::core::option::Option, - pub loadMidiFile: ::core::option::Option< + 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 u32>, @@ -7047,9 +7256,8 @@ pub struct playdate_sound_sequence { >, pub getTempo: ::core::option::Option ctypes::c_int>, - pub setTempo: ::core::option::Option< - unsafe extern "C" fn(seq: *mut SoundSequence, stepsPerSecond: ctypes::c_int), - >, + pub setTempo: + ::core::option::Option, pub getTrackCount: ::core::option::Option ctypes::c_int>, pub addTrack: @@ -7127,13 +7335,13 @@ fn bindgen_test_layout_playdate_sound_sequence() { ) ); assert_eq!( - unsafe { ::core::ptr::addr_of!((*ptr).loadMidiFile) as usize - ptr as usize }, + unsafe { ::core::ptr::addr_of!((*ptr).loadMIDIFile) as usize - ptr as usize }, 16usize, concat!( "Offset of field: ", stringify!(playdate_sound_sequence), "::", - stringify!(loadMidiFile) + stringify!(loadMIDIFile) ) ); assert_eq!( @@ -8482,6 +8690,13 @@ pub type RecordCallback = ::core::option::Option< length: ctypes::c_int, ) -> ctypes::c_int, >; +#[repr(u32)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub enum MicSource { + kMicInputAutodetect = 0, + kMicInputInternal = 1, + kMicInputHeadset = 2, +} #[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub struct playdate_sound { @@ -8515,8 +8730,8 @@ pub struct playdate_sound { unsafe extern "C" fn( callback: RecordCallback, context: *mut ctypes::c_void, - forceInternal: ctypes::c_int, - ), + source: MicSource, + ) -> ctypes::c_int, >, pub getHeadphoneState: ::core::option::Option< unsafe extern "C" fn( @@ -8533,6 +8748,7 @@ pub struct playdate_sound { pub removeSource: ::core::option::Option ctypes::c_int>, pub signal: *const playdate_sound_signal, + pub getError: ::core::option::Option *const ctypes::c_char>, } #[test] fn bindgen_test_layout_playdate_sound() { @@ -8540,7 +8756,7 @@ fn bindgen_test_layout_playdate_sound() { let ptr = UNINIT.as_ptr(); assert_eq!( ::core::mem::size_of::(), - 184usize, + 192usize, concat!("Size of: ", stringify!(playdate_sound)) ); assert_eq!( @@ -8778,6 +8994,16 @@ fn bindgen_test_layout_playdate_sound() { stringify!(signal) ) ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).getError) as usize - ptr as usize }, + 184usize, + concat!( + "Offset of field: ", + stringify!(playdate_sound), + "::", + stringify!(getError) + ) + ); } impl Default for playdate_sound { fn default() -> Self { @@ -9430,3 +9656,76 @@ pub enum PDSystemEvent { kEventKeyReleased = 8, kEventLowPower = 9, } +pub type __builtin_va_list = [__va_list_tag; 1usize]; +#[repr(C)] +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub struct __va_list_tag { + pub gp_offset: ctypes::c_uint, + pub fp_offset: ctypes::c_uint, + pub overflow_arg_area: *mut ctypes::c_void, + pub reg_save_area: *mut ctypes::c_void, +} +#[test] +fn bindgen_test_layout___va_list_tag() { + const UNINIT: ::core::mem::MaybeUninit<__va_list_tag> = ::core::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::core::mem::size_of::<__va_list_tag>(), + 24usize, + concat!("Size of: ", stringify!(__va_list_tag)) + ); + assert_eq!( + ::core::mem::align_of::<__va_list_tag>(), + 8usize, + concat!("Alignment of ", stringify!(__va_list_tag)) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(gp_offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(fp_offset) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(overflow_arg_area) + ) + ); + assert_eq!( + unsafe { ::core::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(__va_list_tag), + "::", + stringify!(reg_save_area) + ) + ); +} +impl Default for __va_list_tag { + fn default() -> Self { + let mut s = ::core::mem::MaybeUninit::::uninit(); + unsafe { + ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +}