diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..4b01400 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[alias] +xtask = "run --manifest-path xtask/Cargo.toml --" diff --git a/.gitignore b/.gitignore index 96d4f30..25f0f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ # Generated by Cargo /target/ /libvlc-sys/target +/xtask/target Cargo.lock diff --git a/Cargo.toml b/Cargo.toml index 7382cb0..9d39c33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,8 @@ repository = "https://code.videolan.org/videolan/vlc-rs" homepage = "https://code.videolan.org/videolan/vlc-rs" license = "MIT" readme = "README.md" -edition = "2018" +edition = "2021" +rust-version = "1.82" [lib] name = "vlc" @@ -21,6 +22,7 @@ crate-type = ["rlib"] libc = "0.2" libvlc-sys = { path = "libvlc-sys" } -[features] -default = [] -use-bindgen = ["libvlc-sys/use-bindgen"] +# `xtask` contains maintenance tools; keep it out of the workspace so normal +# builds never compile it. +[workspace] +exclude = ["xtask"] diff --git a/libvlc-sys/Cargo.toml b/libvlc-sys/Cargo.toml index c437a6c..b263112 100644 --- a/libvlc-sys/Cargo.toml +++ b/libvlc-sys/Cargo.toml @@ -10,7 +10,8 @@ documentation = "https://docs.rs/vlc-rs" repository = "https://code.videolan.org/videolan/vlc-rs" homepage = "https://code.videolan.org/videolan/vlc-rs" license = "MIT" -edition = "2018" +edition = "2021" +rust-version = "1.82" build = "build.rs" [lib] @@ -21,12 +22,7 @@ crate-type = ["rlib"] libc = "0.2" [build-dependencies] -bindgen = {version = "0.59", optional = true } pkg-config = "0.3" [target.'cfg(target_os = "windows")'.build-dependencies] vswhom = "0.1.0" - -[features] -default = [] -use-bindgen = ["bindgen"] diff --git a/libvlc-sys/bindings.rs b/libvlc-sys/bindings.rs index 5edb4b3..baef517 100644 --- a/libvlc-sys/bindings.rs +++ b/libvlc-sys/bindings.rs @@ -1,13 +1,164 @@ -/* automatically generated by rust-bindgen 0.59.2 */ +/* automatically generated by rust-bindgen 0.72.1 */ -pub type size_t = libc::c_ulong; -pub type va_list = __builtin_va_list; -pub type __uint32_t = libc::c_uint; -pub type __int64_t = libc::c_long; +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit { + storage: Storage, +} +impl __BindgenBitfieldUnit { + #[inline] + pub const fn new(storage: Storage) -> Self { + Self { storage } + } +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + fn extract_bit(byte: u8, index: usize) -> bool { + 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 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]; + Self::extract_bit(byte, index) + } + #[inline] + pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = unsafe { + *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize) + }; + Self::extract_bit(byte, index) + } + #[inline] + fn change_bit(byte: u8, index: usize, val: bool) -> u8 { + 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 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]; + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = unsafe { + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize) + }; + unsafe { *byte = Self::change_bit(*byte, index, val) }; + } + #[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 unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if unsafe { Self::raw_get_bit(this, 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); + } + } + #[inline] + pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + 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 + }; + unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) }; + } + } +} +pub const VLC_VLC_H: u32 = 1; +pub const VLC_LIBVLC_H: u32 = 1; +pub const VLC_LIBVLC_RENDERER_DISCOVERER_H: u32 = 1; +pub const LIBVLC_RENDERER_CAN_AUDIO: u32 = 1; +pub const LIBVLC_RENDERER_CAN_VIDEO: u32 = 2; +pub const VLC_LIBVLC_MEDIA_H: u32 = 1; +pub const VLC_LIBVLC_MEDIA_PLAYER_H: u32 = 1; +pub const LIBVLC_MEDIA_LIST_H: u32 = 1; +pub const LIBVLC_MEDIA_LIST_PLAYER_H: u32 = 1; +pub const VLC_LIBVLC_MEDIA_LIBRARY_H: u32 = 1; +pub const VLC_LIBVLC_MEDIA_DISCOVERER_H: u32 = 1; +pub const LIBVLC_EVENTS_H: u32 = 1; +pub const LIBVLC_DIALOG_H: u32 = 1; +pub const LIBVLC_VLM_H: u32 = 1; +pub const LIBVLC_DEPRECATED_H: u32 = 1; +pub type __gnuc_va_list = __builtin_va_list; pub type __uint64_t = libc::c_ulong; pub type __off_t = libc::c_long; pub type __off64_t = libc::c_long; -pub type __ssize_t = libc::c_long; pub type FILE = _IO_FILE; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -43,7 +194,9 @@ pub struct _IO_FILE { pub _markers: *mut _IO_marker, pub _chain: *mut _IO_FILE, pub _fileno: libc::c_int, - pub _flags2: libc::c_int, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, + pub _short_backupbuf: [libc::c_char; 1usize], pub _old_offset: __off_t, pub _cur_column: libc::c_ushort, pub _vtable_offset: libc::c_schar, @@ -54,315 +207,115 @@ pub struct _IO_FILE { pub _wide_data: *mut _IO_wide_data, pub _freeres_list: *mut _IO_FILE, pub _freeres_buf: *mut libc::c_void, - pub __pad5: size_t, + pub _prevchain: *mut *mut _IO_FILE, pub _mode: libc::c_int, - pub _unused2: [libc::c_char; 20usize], + pub _unused3: libc::c_int, + pub _total_written: __uint64_t, + pub _unused2: [libc::c_char; 8usize], } -#[test] -fn bindgen_test_layout__IO_FILE() { - assert_eq!( - ::core::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::core::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_read_ptr as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_read_end as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_read_base as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_write_base as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_write_ptr as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_write_end as *const _ as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_buf_base as *const _ as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_buf_end as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_save_base as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_backup_base as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._IO_save_end as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._markers as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._chain as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._fileno as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._flags2 as *const _ as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._old_offset as *const _ as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._cur_column as *const _ as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._vtable_offset as *const _ as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._shortbuf as *const _ as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._lock as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._offset as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._codecvt as *const _ as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._wide_data as *const _ as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._freeres_list as *const _ as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._freeres_buf as *const _ as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>())).__pad5 as *const _ as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._mode as *const _ as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<_IO_FILE>()))._unused2 as *const _ as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_FILE"][::core::mem::size_of::<_IO_FILE>() - 216usize]; + ["Alignment of _IO_FILE"][::core::mem::align_of::<_IO_FILE>() - 8usize]; + ["Offset of field: _IO_FILE::_flags"][::core::mem::offset_of!(_IO_FILE, _flags) - 0usize]; + ["Offset of field: _IO_FILE::_IO_read_ptr"] + [::core::mem::offset_of!(_IO_FILE, _IO_read_ptr) - 8usize]; + ["Offset of field: _IO_FILE::_IO_read_end"] + [::core::mem::offset_of!(_IO_FILE, _IO_read_end) - 16usize]; + ["Offset of field: _IO_FILE::_IO_read_base"] + [::core::mem::offset_of!(_IO_FILE, _IO_read_base) - 24usize]; + ["Offset of field: _IO_FILE::_IO_write_base"] + [::core::mem::offset_of!(_IO_FILE, _IO_write_base) - 32usize]; + ["Offset of field: _IO_FILE::_IO_write_ptr"] + [::core::mem::offset_of!(_IO_FILE, _IO_write_ptr) - 40usize]; + ["Offset of field: _IO_FILE::_IO_write_end"] + [::core::mem::offset_of!(_IO_FILE, _IO_write_end) - 48usize]; + ["Offset of field: _IO_FILE::_IO_buf_base"] + [::core::mem::offset_of!(_IO_FILE, _IO_buf_base) - 56usize]; + ["Offset of field: _IO_FILE::_IO_buf_end"] + [::core::mem::offset_of!(_IO_FILE, _IO_buf_end) - 64usize]; + ["Offset of field: _IO_FILE::_IO_save_base"] + [::core::mem::offset_of!(_IO_FILE, _IO_save_base) - 72usize]; + ["Offset of field: _IO_FILE::_IO_backup_base"] + [::core::mem::offset_of!(_IO_FILE, _IO_backup_base) - 80usize]; + ["Offset of field: _IO_FILE::_IO_save_end"] + [::core::mem::offset_of!(_IO_FILE, _IO_save_end) - 88usize]; + ["Offset of field: _IO_FILE::_markers"][::core::mem::offset_of!(_IO_FILE, _markers) - 96usize]; + ["Offset of field: _IO_FILE::_chain"][::core::mem::offset_of!(_IO_FILE, _chain) - 104usize]; + ["Offset of field: _IO_FILE::_fileno"][::core::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; + ["Offset of field: _IO_FILE::_short_backupbuf"] + [::core::mem::offset_of!(_IO_FILE, _short_backupbuf) - 119usize]; + ["Offset of field: _IO_FILE::_old_offset"] + [::core::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; + ["Offset of field: _IO_FILE::_cur_column"] + [::core::mem::offset_of!(_IO_FILE, _cur_column) - 128usize]; + ["Offset of field: _IO_FILE::_vtable_offset"] + [::core::mem::offset_of!(_IO_FILE, _vtable_offset) - 130usize]; + ["Offset of field: _IO_FILE::_shortbuf"] + [::core::mem::offset_of!(_IO_FILE, _shortbuf) - 131usize]; + ["Offset of field: _IO_FILE::_lock"][::core::mem::offset_of!(_IO_FILE, _lock) - 136usize]; + ["Offset of field: _IO_FILE::_offset"][::core::mem::offset_of!(_IO_FILE, _offset) - 144usize]; + ["Offset of field: _IO_FILE::_codecvt"][::core::mem::offset_of!(_IO_FILE, _codecvt) - 152usize]; + ["Offset of field: _IO_FILE::_wide_data"] + [::core::mem::offset_of!(_IO_FILE, _wide_data) - 160usize]; + ["Offset of field: _IO_FILE::_freeres_list"] + [::core::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; + ["Offset of field: _IO_FILE::_freeres_buf"] + [::core::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; + ["Offset of field: _IO_FILE::_prevchain"] + [::core::mem::offset_of!(_IO_FILE, _prevchain) - 184usize]; + ["Offset of field: _IO_FILE::_mode"][::core::mem::offset_of!(_IO_FILE, _mode) - 192usize]; + ["Offset of field: _IO_FILE::_unused3"][::core::mem::offset_of!(_IO_FILE, _unused3) - 196usize]; + ["Offset of field: _IO_FILE::_total_written"] + [::core::mem::offset_of!(_IO_FILE, _total_written) - 200usize]; + ["Offset of field: _IO_FILE::_unused2"][::core::mem::offset_of!(_IO_FILE, _unused2) - 208usize]; +}; +impl _IO_FILE { + #[inline] + pub fn _flags2(&self) -> libc::c_int { + unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) } + } + #[inline] + pub fn set__flags2(&mut self, val: libc::c_int) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + self._bitfield_1.set(0usize, 24u8, val as u64) + } + } + #[inline] + pub unsafe fn _flags2_raw(this: *const Self) -> libc::c_int { + unsafe { + ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 3usize]>>::raw_get( + ::core::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 24u8, + ) as u32) + } + } + #[inline] + pub unsafe fn set__flags2_raw(this: *mut Self, val: libc::c_int) { + unsafe { + let val: u32 = ::core::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 3usize]>>::raw_set( + ::core::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 24u8, + val as u64, + ) + } + } + #[inline] + pub fn new_bitfield_1(_flags2: libc::c_int) -> __BindgenBitfieldUnit<[u8; 3usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 24u8, { + let _flags2: u32 = unsafe { ::core::mem::transmute(_flags2) }; + _flags2 as u64 + }); + __bindgen_bitfield_unit + } } -pub type ssize_t = __ssize_t; -extern "C" { +pub type va_list = __gnuc_va_list; +unsafe extern "C" { pub fn vsnprintf( __s: *mut libc::c_char, __maxlen: libc::c_ulong, @@ -376,54 +329,54 @@ pub struct libvlc_instance_t { _unused: [u8; 0], } pub type libvlc_time_t = i64; -extern "C" { +unsafe extern "C" { pub fn libvlc_errmsg() -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_clearerr(); } -extern "C" { +unsafe extern "C" { pub fn libvlc_vprinterr( fmt: *const libc::c_char, ap: *mut __va_list_tag, ) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_printerr(fmt: *const libc::c_char, ...) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_new( argc: libc::c_int, argv: *const *const libc::c_char, ) -> *mut libvlc_instance_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_release(p_instance: *mut libvlc_instance_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_retain(p_instance: *mut libvlc_instance_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_add_intf( p_instance: *mut libvlc_instance_t, name: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_set_exit_handler( p_instance: *mut libvlc_instance_t, cb: ::core::option::Option, opaque: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_set_user_agent( p_instance: *mut libvlc_instance_t, name: *const libc::c_char, http: *const libc::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_set_app_id( p_instance: *mut libvlc_instance_t, id: *const libc::c_char, @@ -431,16 +384,16 @@ extern "C" { icon: *const libc::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_get_version() -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_get_compiler() -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_get_changeset() -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_free(ptr: *mut libc::c_void); } #[repr(C)] @@ -452,7 +405,7 @@ pub type libvlc_event_type_t = libc::c_int; pub type libvlc_callback_t = ::core::option::Option< unsafe extern "C" fn(p_event: *const libvlc_event_t, p_data: *mut libc::c_void), >; -extern "C" { +unsafe extern "C" { pub fn libvlc_event_attach( p_event_manager: *mut libvlc_event_manager_t, i_event_type: libvlc_event_type_t, @@ -460,7 +413,7 @@ extern "C" { user_data: *mut libc::c_void, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_event_detach( p_event_manager: *mut libvlc_event_manager_t, i_event_type: libvlc_event_type_t, @@ -468,7 +421,7 @@ extern "C" { p_user_data: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_event_type_name(event_type: libvlc_event_type_t) -> *const libc::c_char; } pub const libvlc_log_level_LIBVLC_DEBUG: libvlc_log_level = 0; @@ -482,7 +435,7 @@ pub struct vlc_log_t { _unused: [u8; 0], } pub type libvlc_log_t = vlc_log_t; -extern "C" { +unsafe extern "C" { pub fn libvlc_log_get_context( ctx: *const libvlc_log_t, module: *mut *const libc::c_char, @@ -490,7 +443,7 @@ extern "C" { line: *mut libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_get_object( ctx: *const libvlc_log_t, name: *mut *const libc::c_char, @@ -507,17 +460,17 @@ pub type libvlc_log_cb = ::core::option::Option< args: *mut __va_list_tag, ), >; -extern "C" { +unsafe extern "C" { pub fn libvlc_log_unset(p_instance: *mut libvlc_instance_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_set( p_instance: *mut libvlc_instance_t, cb: libvlc_log_cb, data: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_set_file(p_instance: *mut libvlc_instance_t, stream: *mut FILE); } #[repr(C)] @@ -529,95 +482,37 @@ pub struct libvlc_module_description_t { pub psz_help: *mut libc::c_char, pub p_next: *mut libvlc_module_description_t, } -#[test] -fn bindgen_test_layout_libvlc_module_description_t() { - assert_eq!( - ::core::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(libvlc_module_description_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_module_description_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_name as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_module_description_t), - "::", - stringify!(psz_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_shortname as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_module_description_t), - "::", - stringify!(psz_shortname) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_longname as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_module_description_t), - "::", - stringify!(psz_longname) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_help as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libvlc_module_description_t), - "::", - stringify!(psz_help) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).p_next as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libvlc_module_description_t), - "::", - stringify!(p_next) - ) - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_module_description_t"] + [::core::mem::size_of::() - 40usize]; + ["Alignment of libvlc_module_description_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_module_description_t::psz_name"] + [::core::mem::offset_of!(libvlc_module_description_t, psz_name) - 0usize]; + ["Offset of field: libvlc_module_description_t::psz_shortname"] + [::core::mem::offset_of!(libvlc_module_description_t, psz_shortname) - 8usize]; + ["Offset of field: libvlc_module_description_t::psz_longname"] + [::core::mem::offset_of!(libvlc_module_description_t, psz_longname) - 16usize]; + ["Offset of field: libvlc_module_description_t::psz_help"] + [::core::mem::offset_of!(libvlc_module_description_t, psz_help) - 24usize]; + ["Offset of field: libvlc_module_description_t::p_next"] + [::core::mem::offset_of!(libvlc_module_description_t, p_next) - 32usize]; +}; +unsafe extern "C" { pub fn libvlc_module_description_list_release(p_list: *mut libvlc_module_description_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_filter_list_get( p_instance: *mut libvlc_instance_t, ) -> *mut libvlc_module_description_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_filter_list_get( p_instance: *mut libvlc_instance_t, ) -> *mut libvlc_module_description_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_clock() -> i64; } #[repr(C)] @@ -631,101 +526,75 @@ pub struct libvlc_rd_description_t { pub psz_name: *mut libc::c_char, pub psz_longname: *mut libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_rd_description_t() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(libvlc_rd_description_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_rd_description_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_name as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_rd_description_t), - "::", - stringify!(psz_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_longname as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_rd_description_t), - "::", - stringify!(psz_longname) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_rd_description_t"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_rd_description_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_rd_description_t::psz_name"] + [::core::mem::offset_of!(libvlc_rd_description_t, psz_name) - 0usize]; + ["Offset of field: libvlc_rd_description_t::psz_longname"] + [::core::mem::offset_of!(libvlc_rd_description_t, psz_longname) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_renderer_item_t { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_item_hold( p_item: *mut libvlc_renderer_item_t, ) -> *mut libvlc_renderer_item_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_item_release(p_item: *mut libvlc_renderer_item_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_item_name(p_item: *const libvlc_renderer_item_t) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_item_type(p_item: *const libvlc_renderer_item_t) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_item_icon_uri( p_item: *const libvlc_renderer_item_t, ) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_item_flags(p_item: *const libvlc_renderer_item_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_discoverer_new( p_inst: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> *mut libvlc_renderer_discoverer_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_discoverer_release(p_rd: *mut libvlc_renderer_discoverer_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_discoverer_start(p_rd: *mut libvlc_renderer_discoverer_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_discoverer_stop(p_rd: *mut libvlc_renderer_discoverer_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_discoverer_event_manager( p_rd: *mut libvlc_renderer_discoverer_t, ) -> *mut libvlc_event_manager_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_discoverer_list_get( p_inst: *mut libvlc_instance_t, ppp_services: *mut *mut *mut libvlc_rd_description_t, - ) -> size_t; + ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn libvlc_renderer_discoverer_list_release( pp_services: *mut *mut libvlc_rd_description_t, - i_count: size_t, + i_count: usize, ); } #[repr(C)] @@ -769,8 +638,8 @@ pub const libvlc_state_t_libvlc_Stopped: libvlc_state_t = 5; pub const libvlc_state_t_libvlc_Ended: libvlc_state_t = 6; pub const libvlc_state_t_libvlc_Error: libvlc_state_t = 7; pub type libvlc_state_t = libc::c_uint; -pub const libvlc_media_option_trusted: libc::c_uint = 2; -pub const libvlc_media_option_unique: libc::c_uint = 256; +pub const libvlc_media_option_trusted: _bindgen_ty_1 = 2; +pub const libvlc_media_option_unique: _bindgen_ty_1 = 256; pub type _bindgen_ty_1 = libc::c_uint; pub const libvlc_track_type_t_libvlc_track_unknown: libvlc_track_type_t = -1; pub const libvlc_track_type_t_libvlc_track_audio: libvlc_track_type_t = 0; @@ -796,202 +665,41 @@ pub struct libvlc_media_stats_t { pub i_sent_bytes: libc::c_int, pub f_send_bitrate: f32, } -#[test] -fn bindgen_test_layout_libvlc_media_stats_t() { - assert_eq!( - ::core::mem::size_of::(), - 60usize, - concat!("Size of: ", stringify!(libvlc_media_stats_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(libvlc_media_stats_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_read_bytes as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_read_bytes) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).f_input_bitrate as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(f_input_bitrate) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_demux_read_bytes as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_demux_read_bytes) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).f_demux_bitrate as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(f_demux_bitrate) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_demux_corrupted as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_demux_corrupted) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_demux_discontinuity as *const _ - as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_demux_discontinuity) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_decoded_video as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_decoded_video) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_decoded_audio as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_decoded_audio) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_displayed_pictures as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_displayed_pictures) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_lost_pictures as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_lost_pictures) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_played_abuffers as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_played_abuffers) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_lost_abuffers as *const _ as usize - }, - 44usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_lost_abuffers) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_sent_packets as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_sent_packets) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_sent_bytes as *const _ as usize - }, - 52usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(i_sent_bytes) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).f_send_bitrate as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_stats_t), - "::", - stringify!(f_send_bitrate) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_stats_t"][::core::mem::size_of::() - 60usize]; + ["Alignment of libvlc_media_stats_t"][::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_media_stats_t::i_read_bytes"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_read_bytes) - 0usize]; + ["Offset of field: libvlc_media_stats_t::f_input_bitrate"] + [::core::mem::offset_of!(libvlc_media_stats_t, f_input_bitrate) - 4usize]; + ["Offset of field: libvlc_media_stats_t::i_demux_read_bytes"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_demux_read_bytes) - 8usize]; + ["Offset of field: libvlc_media_stats_t::f_demux_bitrate"] + [::core::mem::offset_of!(libvlc_media_stats_t, f_demux_bitrate) - 12usize]; + ["Offset of field: libvlc_media_stats_t::i_demux_corrupted"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_demux_corrupted) - 16usize]; + ["Offset of field: libvlc_media_stats_t::i_demux_discontinuity"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_demux_discontinuity) - 20usize]; + ["Offset of field: libvlc_media_stats_t::i_decoded_video"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_decoded_video) - 24usize]; + ["Offset of field: libvlc_media_stats_t::i_decoded_audio"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_decoded_audio) - 28usize]; + ["Offset of field: libvlc_media_stats_t::i_displayed_pictures"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_displayed_pictures) - 32usize]; + ["Offset of field: libvlc_media_stats_t::i_lost_pictures"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_lost_pictures) - 36usize]; + ["Offset of field: libvlc_media_stats_t::i_played_abuffers"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_played_abuffers) - 40usize]; + ["Offset of field: libvlc_media_stats_t::i_lost_abuffers"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_lost_abuffers) - 44usize]; + ["Offset of field: libvlc_media_stats_t::i_sent_packets"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_sent_packets) - 48usize]; + ["Offset of field: libvlc_media_stats_t::i_sent_bytes"] + [::core::mem::offset_of!(libvlc_media_stats_t, i_sent_bytes) - 52usize]; + ["Offset of field: libvlc_media_stats_t::f_send_bitrate"] + [::core::mem::offset_of!(libvlc_media_stats_t, f_send_bitrate) - 56usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct libvlc_media_track_info_t { @@ -1014,269 +722,89 @@ pub struct libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1 { pub i_channels: libc::c_uint, pub i_rate: libc::c_uint, } -#[test] -fn bindgen_test_layout_libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())) - .i_channels as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(i_channels) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())) - .i_rate as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(i_rate) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1::i_channels"][::core::mem::offset_of!( + libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1, + i_channels + ) + - 0usize]; + ["Offset of field: libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1::i_rate"][::core::mem::offset_of!( + libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_1, + i_rate + ) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2 { pub i_height: libc::c_uint, pub i_width: libc::c_uint, } -#[test] -fn bindgen_test_layout_libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())) - .i_height as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(i_height) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())) - .i_width as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(i_width) - ) - ); -} -#[test] -fn bindgen_test_layout_libvlc_media_track_info_t__bindgen_ty_1() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).audio as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1), - "::", - stringify!(audio) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).video as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t__bindgen_ty_1), - "::", - stringify!(video) - ) - ); -} -#[test] -fn bindgen_test_layout_libvlc_media_track_info_t() { - assert_eq!( - ::core::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(libvlc_media_track_info_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(libvlc_media_track_info_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_codec as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t), - "::", - stringify!(i_codec) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_id as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t), - "::", - stringify!(i_id) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_type as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t), - "::", - stringify!(i_type) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_profile as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t), - "::", - stringify!(i_profile) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_level as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t), - "::", - stringify!(i_level) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).u as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_info_t), - "::", - stringify!(u) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2::i_height"][::core::mem::offset_of!( + libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2, + i_height + ) + - 0usize]; + ["Offset of field: libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2::i_width"][::core::mem::offset_of!( + libvlc_media_track_info_t__bindgen_ty_1__bindgen_ty_2, + i_width + ) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_track_info_t__bindgen_ty_1"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_media_track_info_t__bindgen_ty_1"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_media_track_info_t__bindgen_ty_1::audio"] + [::core::mem::offset_of!(libvlc_media_track_info_t__bindgen_ty_1, audio) - 0usize]; + ["Offset of field: libvlc_media_track_info_t__bindgen_ty_1::video"] + [::core::mem::offset_of!(libvlc_media_track_info_t__bindgen_ty_1, video) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_track_info_t"] + [::core::mem::size_of::() - 28usize]; + ["Alignment of libvlc_media_track_info_t"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_media_track_info_t::i_codec"] + [::core::mem::offset_of!(libvlc_media_track_info_t, i_codec) - 0usize]; + ["Offset of field: libvlc_media_track_info_t::i_id"] + [::core::mem::offset_of!(libvlc_media_track_info_t, i_id) - 4usize]; + ["Offset of field: libvlc_media_track_info_t::i_type"] + [::core::mem::offset_of!(libvlc_media_track_info_t, i_type) - 8usize]; + ["Offset of field: libvlc_media_track_info_t::i_profile"] + [::core::mem::offset_of!(libvlc_media_track_info_t, i_profile) - 12usize]; + ["Offset of field: libvlc_media_track_info_t::i_level"] + [::core::mem::offset_of!(libvlc_media_track_info_t, i_level) - 16usize]; + ["Offset of field: libvlc_media_track_info_t::u"] + [::core::mem::offset_of!(libvlc_media_track_info_t, u) - 20usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_audio_track_t { pub i_channels: libc::c_uint, pub i_rate: libc::c_uint, } -#[test] -fn bindgen_test_layout_libvlc_audio_track_t() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(libvlc_audio_track_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(libvlc_audio_track_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_channels as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_track_t), - "::", - stringify!(i_channels) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_rate as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_track_t), - "::", - stringify!(i_rate) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_audio_track_t"][::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_audio_track_t"][::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_audio_track_t::i_channels"] + [::core::mem::offset_of!(libvlc_audio_track_t, i_channels) - 0usize]; + ["Offset of field: libvlc_audio_track_t::i_rate"] + [::core::mem::offset_of!(libvlc_audio_track_t, i_rate) - 4usize]; +}; pub const libvlc_video_orient_t_libvlc_video_orient_top_left: libvlc_video_orient_t = 0; pub const libvlc_video_orient_t_libvlc_video_orient_top_right: libvlc_video_orient_t = 1; pub const libvlc_video_orient_t_libvlc_video_orient_bottom_left: libvlc_video_orient_t = 2; @@ -1301,66 +829,21 @@ pub struct libvlc_video_viewpoint_t { pub f_roll: f32, pub f_field_of_view: f32, } -#[test] -fn bindgen_test_layout_libvlc_video_viewpoint_t() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(libvlc_video_viewpoint_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(libvlc_video_viewpoint_t)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).f_yaw as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_viewpoint_t), - "::", - stringify!(f_yaw) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).f_pitch as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_viewpoint_t), - "::", - stringify!(f_pitch) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).f_roll as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_viewpoint_t), - "::", - stringify!(f_roll) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).f_field_of_view as *const _ - as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_viewpoint_t), - "::", - stringify!(f_field_of_view) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_video_viewpoint_t"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_video_viewpoint_t"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_video_viewpoint_t::f_yaw"] + [::core::mem::offset_of!(libvlc_video_viewpoint_t, f_yaw) - 0usize]; + ["Offset of field: libvlc_video_viewpoint_t::f_pitch"] + [::core::mem::offset_of!(libvlc_video_viewpoint_t, f_pitch) - 4usize]; + ["Offset of field: libvlc_video_viewpoint_t::f_roll"] + [::core::mem::offset_of!(libvlc_video_viewpoint_t, f_roll) - 8usize]; + ["Offset of field: libvlc_video_viewpoint_t::f_field_of_view"] + [::core::mem::offset_of!(libvlc_video_viewpoint_t, f_field_of_view) - 12usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_video_track_t { @@ -1374,147 +857,42 @@ pub struct libvlc_video_track_t { pub i_projection: libvlc_video_projection_t, pub pose: libvlc_video_viewpoint_t, } -#[test] -fn bindgen_test_layout_libvlc_video_track_t() { - assert_eq!( - ::core::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(libvlc_video_track_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(libvlc_video_track_t)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_height as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_height) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_width as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_width) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_sar_num as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_sar_num) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_sar_den as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_sar_den) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_frame_rate_num as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_frame_rate_num) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_frame_rate_den as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_frame_rate_den) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_orientation as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_orientation) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_projection as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(i_projection) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).pose as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libvlc_video_track_t), - "::", - stringify!(pose) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_video_track_t"][::core::mem::size_of::() - 48usize]; + ["Alignment of libvlc_video_track_t"][::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_video_track_t::i_height"] + [::core::mem::offset_of!(libvlc_video_track_t, i_height) - 0usize]; + ["Offset of field: libvlc_video_track_t::i_width"] + [::core::mem::offset_of!(libvlc_video_track_t, i_width) - 4usize]; + ["Offset of field: libvlc_video_track_t::i_sar_num"] + [::core::mem::offset_of!(libvlc_video_track_t, i_sar_num) - 8usize]; + ["Offset of field: libvlc_video_track_t::i_sar_den"] + [::core::mem::offset_of!(libvlc_video_track_t, i_sar_den) - 12usize]; + ["Offset of field: libvlc_video_track_t::i_frame_rate_num"] + [::core::mem::offset_of!(libvlc_video_track_t, i_frame_rate_num) - 16usize]; + ["Offset of field: libvlc_video_track_t::i_frame_rate_den"] + [::core::mem::offset_of!(libvlc_video_track_t, i_frame_rate_den) - 20usize]; + ["Offset of field: libvlc_video_track_t::i_orientation"] + [::core::mem::offset_of!(libvlc_video_track_t, i_orientation) - 24usize]; + ["Offset of field: libvlc_video_track_t::i_projection"] + [::core::mem::offset_of!(libvlc_video_track_t, i_projection) - 28usize]; + ["Offset of field: libvlc_video_track_t::pose"] + [::core::mem::offset_of!(libvlc_video_track_t, pose) - 32usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_subtitle_track_t { pub psz_encoding: *mut libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_subtitle_track_t() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(libvlc_subtitle_track_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_subtitle_track_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_encoding as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_subtitle_track_t), - "::", - stringify!(psz_encoding) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_subtitle_track_t"][::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_subtitle_track_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_subtitle_track_t::psz_encoding"] + [::core::mem::offset_of!(libvlc_subtitle_track_t, psz_encoding) - 0usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct libvlc_media_track_t { @@ -1536,170 +914,42 @@ pub union libvlc_media_track_t__bindgen_ty_1 { pub video: *mut libvlc_video_track_t, pub subtitle: *mut libvlc_subtitle_track_t, } -#[test] -fn bindgen_test_layout_libvlc_media_track_t__bindgen_ty_1() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(libvlc_media_track_t__bindgen_ty_1)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_media_track_t__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).audio as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t__bindgen_ty_1), - "::", - stringify!(audio) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).video as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t__bindgen_ty_1), - "::", - stringify!(video) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).subtitle as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t__bindgen_ty_1), - "::", - stringify!(subtitle) - ) - ); -} -#[test] -fn bindgen_test_layout_libvlc_media_track_t() { - assert_eq!( - ::core::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(libvlc_media_track_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_media_track_t)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_codec as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(i_codec) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_original_fourcc as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(i_original_fourcc) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_id as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(i_id) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_type as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(i_type) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_profile as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(i_profile) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_level as *const _ as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(i_level) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_bitrate as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(i_bitrate) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_language as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(psz_language) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_description as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_track_t), - "::", - stringify!(psz_description) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_track_t__bindgen_ty_1"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_media_track_t__bindgen_ty_1"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_media_track_t__bindgen_ty_1::audio"] + [::core::mem::offset_of!(libvlc_media_track_t__bindgen_ty_1, audio) - 0usize]; + ["Offset of field: libvlc_media_track_t__bindgen_ty_1::video"] + [::core::mem::offset_of!(libvlc_media_track_t__bindgen_ty_1, video) - 0usize]; + ["Offset of field: libvlc_media_track_t__bindgen_ty_1::subtitle"] + [::core::mem::offset_of!(libvlc_media_track_t__bindgen_ty_1, subtitle) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_track_t"][::core::mem::size_of::() - 56usize]; + ["Alignment of libvlc_media_track_t"][::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_media_track_t::i_codec"] + [::core::mem::offset_of!(libvlc_media_track_t, i_codec) - 0usize]; + ["Offset of field: libvlc_media_track_t::i_original_fourcc"] + [::core::mem::offset_of!(libvlc_media_track_t, i_original_fourcc) - 4usize]; + ["Offset of field: libvlc_media_track_t::i_id"] + [::core::mem::offset_of!(libvlc_media_track_t, i_id) - 8usize]; + ["Offset of field: libvlc_media_track_t::i_type"] + [::core::mem::offset_of!(libvlc_media_track_t, i_type) - 12usize]; + ["Offset of field: libvlc_media_track_t::i_profile"] + [::core::mem::offset_of!(libvlc_media_track_t, i_profile) - 16usize]; + ["Offset of field: libvlc_media_track_t::i_level"] + [::core::mem::offset_of!(libvlc_media_track_t, i_level) - 20usize]; + ["Offset of field: libvlc_media_track_t::i_bitrate"] + [::core::mem::offset_of!(libvlc_media_track_t, i_bitrate) - 32usize]; + ["Offset of field: libvlc_media_track_t::psz_language"] + [::core::mem::offset_of!(libvlc_media_track_t, psz_language) - 40usize]; + ["Offset of field: libvlc_media_track_t::psz_description"] + [::core::mem::offset_of!(libvlc_media_track_t, psz_description) - 48usize]; +}; pub const libvlc_media_type_t_libvlc_media_type_unknown: libvlc_media_type_t = 0; pub const libvlc_media_type_t_libvlc_media_type_file: libvlc_media_type_t = 1; pub const libvlc_media_type_t_libvlc_media_type_directory: libvlc_media_type_t = 2; @@ -1732,51 +982,17 @@ pub struct libvlc_media_slave_t { pub i_type: libvlc_media_slave_type_t, pub i_priority: libc::c_uint, } -#[test] -fn bindgen_test_layout_libvlc_media_slave_t() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(libvlc_media_slave_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_media_slave_t)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).psz_uri as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_slave_t), - "::", - stringify!(psz_uri) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).i_type as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_slave_t), - "::", - stringify!(i_type) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_priority as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_slave_t), - "::", - stringify!(i_priority) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_slave_t"][::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_media_slave_t"][::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_media_slave_t::psz_uri"] + [::core::mem::offset_of!(libvlc_media_slave_t, psz_uri) - 0usize]; + ["Offset of field: libvlc_media_slave_t::i_type"] + [::core::mem::offset_of!(libvlc_media_slave_t, i_type) - 8usize]; + ["Offset of field: libvlc_media_slave_t::i_priority"] + [::core::mem::offset_of!(libvlc_media_slave_t, i_priority) - 12usize]; +}; pub type libvlc_media_open_cb = ::core::option::Option< unsafe extern "C" fn( opaque: *mut libc::c_void, @@ -1785,36 +1001,32 @@ pub type libvlc_media_open_cb = ::core::option::Option< ) -> libc::c_int, >; pub type libvlc_media_read_cb = ::core::option::Option< - unsafe extern "C" fn( - opaque: *mut libc::c_void, - buf: *mut libc::c_uchar, - len: size_t, - ) -> ssize_t, + unsafe extern "C" fn(opaque: *mut libc::c_void, buf: *mut libc::c_uchar, len: usize) -> isize, >; pub type libvlc_media_seek_cb = ::core::option::Option< unsafe extern "C" fn(opaque: *mut libc::c_void, offset: u64) -> libc::c_int, >; pub type libvlc_media_close_cb = ::core::option::Option; -extern "C" { +unsafe extern "C" { pub fn libvlc_media_new_location( p_instance: *mut libvlc_instance_t, psz_mrl: *const libc::c_char, ) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_new_path( p_instance: *mut libvlc_instance_t, path: *const libc::c_char, ) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_new_fd( p_instance: *mut libvlc_instance_t, fd: libc::c_int, ) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_new_callbacks( instance: *mut libvlc_instance_t, open_cb: libvlc_media_open_cb, @@ -1824,54 +1036,54 @@ extern "C" { opaque: *mut libc::c_void, ) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_new_as_node( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_add_option(p_md: *mut libvlc_media_t, psz_options: *const libc::c_char); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_add_option_flag( p_md: *mut libvlc_media_t, psz_options: *const libc::c_char, i_flags: libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_retain(p_md: *mut libvlc_media_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_release(p_md: *mut libvlc_media_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_mrl(p_md: *mut libvlc_media_t) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_duplicate(p_md: *mut libvlc_media_t) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_meta( p_md: *mut libvlc_media_t, e_meta: libvlc_meta_t, ) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_set_meta( p_md: *mut libvlc_media_t, e_meta: libvlc_meta_t, psz_value: *const libc::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_save_meta(p_md: *mut libvlc_media_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_state(p_md: *mut libvlc_media_t) -> libvlc_state_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_stats( p_md: *mut libvlc_media_t, p_stats: *mut libvlc_media_stats_t, @@ -1882,61 +1094,61 @@ extern "C" { pub struct libvlc_media_list_t { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_subitems(p_md: *mut libvlc_media_t) -> *mut libvlc_media_list_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_event_manager(p_md: *mut libvlc_media_t) -> *mut libvlc_event_manager_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_duration(p_md: *mut libvlc_media_t) -> libvlc_time_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_parse_with_options( p_md: *mut libvlc_media_t, parse_flag: libvlc_media_parse_flag_t, timeout: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_parse_stop(p_md: *mut libvlc_media_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_parsed_status( p_md: *mut libvlc_media_t, ) -> libvlc_media_parsed_status_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_set_user_data( p_md: *mut libvlc_media_t, p_new_user_data: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_user_data(p_md: *mut libvlc_media_t) -> *mut libc::c_void; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_tracks_get( p_md: *mut libvlc_media_t, tracks: *mut *mut *mut libvlc_media_track_t, ) -> libc::c_uint; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_codec_description( i_type: libvlc_track_type_t, i_codec: u32, ) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_tracks_release( p_tracks: *mut *mut libvlc_media_track_t, i_count: libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_type(p_md: *mut libvlc_media_t) -> libvlc_media_type_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_slaves_add( p_md: *mut libvlc_media_t, i_type: libvlc_media_slave_type_t, @@ -1944,16 +1156,16 @@ extern "C" { psz_uri: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_slaves_clear(p_md: *mut libvlc_media_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_slaves_get( p_md: *mut libvlc_media_t, ppp_slaves: *mut *mut *mut libvlc_media_slave_t, ) -> libc::c_uint; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_slaves_release( pp_slaves: *mut *mut libvlc_media_slave_t, i_count: libc::c_uint, @@ -1971,57 +1183,21 @@ pub struct libvlc_track_description_t { pub psz_name: *mut libc::c_char, pub p_next: *mut libvlc_track_description_t, } -#[test] -fn bindgen_test_layout_libvlc_track_description_t() { - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(libvlc_track_description_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_track_description_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_id as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_track_description_t), - "::", - stringify!(i_id) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_name as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_track_description_t), - "::", - stringify!(psz_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).p_next as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_track_description_t), - "::", - stringify!(p_next) - ) - ); -} -pub const libvlc_title_menu: libc::c_uint = 1; -pub const libvlc_title_interactive: libc::c_uint = 2; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_track_description_t"] + [::core::mem::size_of::() - 24usize]; + ["Alignment of libvlc_track_description_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_track_description_t::i_id"] + [::core::mem::offset_of!(libvlc_track_description_t, i_id) - 0usize]; + ["Offset of field: libvlc_track_description_t::psz_name"] + [::core::mem::offset_of!(libvlc_track_description_t, psz_name) - 8usize]; + ["Offset of field: libvlc_track_description_t::p_next"] + [::core::mem::offset_of!(libvlc_track_description_t, p_next) - 16usize]; +}; +pub const libvlc_title_menu: _bindgen_ty_2 = 1; +pub const libvlc_title_interactive: _bindgen_ty_2 = 2; pub type _bindgen_ty_2 = libc::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2030,55 +1206,19 @@ pub struct libvlc_title_description_t { pub psz_name: *mut libc::c_char, pub i_flags: libc::c_uint, } -#[test] -fn bindgen_test_layout_libvlc_title_description_t() { - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(libvlc_title_description_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_title_description_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_duration as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_title_description_t), - "::", - stringify!(i_duration) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_name as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_title_description_t), - "::", - stringify!(psz_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_flags as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_title_description_t), - "::", - stringify!(i_flags) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_title_description_t"] + [::core::mem::size_of::() - 24usize]; + ["Alignment of libvlc_title_description_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_title_description_t::i_duration"] + [::core::mem::offset_of!(libvlc_title_description_t, i_duration) - 0usize]; + ["Offset of field: libvlc_title_description_t::psz_name"] + [::core::mem::offset_of!(libvlc_title_description_t, psz_name) - 8usize]; + ["Offset of field: libvlc_title_description_t::i_flags"] + [::core::mem::offset_of!(libvlc_title_description_t, i_flags) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_chapter_description_t { @@ -2086,57 +1226,19 @@ pub struct libvlc_chapter_description_t { pub i_duration: i64, pub psz_name: *mut libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_chapter_description_t() { - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(libvlc_chapter_description_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_chapter_description_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_time_offset as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_chapter_description_t), - "::", - stringify!(i_time_offset) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_duration as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_chapter_description_t), - "::", - stringify!(i_duration) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_name as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_chapter_description_t), - "::", - stringify!(psz_name) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_chapter_description_t"] + [::core::mem::size_of::() - 24usize]; + ["Alignment of libvlc_chapter_description_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_chapter_description_t::i_time_offset"] + [::core::mem::offset_of!(libvlc_chapter_description_t, i_time_offset) - 0usize]; + ["Offset of field: libvlc_chapter_description_t::i_duration"] + [::core::mem::offset_of!(libvlc_chapter_description_t, i_duration) - 8usize]; + ["Offset of field: libvlc_chapter_description_t::psz_name"] + [::core::mem::offset_of!(libvlc_chapter_description_t, psz_name) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_audio_output_t { @@ -2144,51 +1246,18 @@ pub struct libvlc_audio_output_t { pub psz_description: *mut libc::c_char, pub p_next: *mut libvlc_audio_output_t, } -#[test] -fn bindgen_test_layout_libvlc_audio_output_t() { - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(libvlc_audio_output_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_audio_output_t)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).psz_name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_output_t), - "::", - stringify!(psz_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_description as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_output_t), - "::", - stringify!(psz_description) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).p_next as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_output_t), - "::", - stringify!(p_next) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_audio_output_t"][::core::mem::size_of::() - 24usize]; + ["Alignment of libvlc_audio_output_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_audio_output_t::psz_name"] + [::core::mem::offset_of!(libvlc_audio_output_t, psz_name) - 0usize]; + ["Offset of field: libvlc_audio_output_t::psz_description"] + [::core::mem::offset_of!(libvlc_audio_output_t, psz_description) - 8usize]; + ["Offset of field: libvlc_audio_output_t::p_next"] + [::core::mem::offset_of!(libvlc_audio_output_t, p_next) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_audio_output_device_t { @@ -2196,57 +1265,19 @@ pub struct libvlc_audio_output_device_t { pub psz_device: *mut libc::c_char, pub psz_description: *mut libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_audio_output_device_t() { - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(libvlc_audio_output_device_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_audio_output_device_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).p_next as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_output_device_t), - "::", - stringify!(p_next) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_device as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_output_device_t), - "::", - stringify!(psz_device) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_description as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_audio_output_device_t), - "::", - stringify!(psz_description) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_audio_output_device_t"] + [::core::mem::size_of::() - 24usize]; + ["Alignment of libvlc_audio_output_device_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_audio_output_device_t::p_next"] + [::core::mem::offset_of!(libvlc_audio_output_device_t, p_next) - 0usize]; + ["Offset of field: libvlc_audio_output_device_t::psz_device"] + [::core::mem::offset_of!(libvlc_audio_output_device_t, psz_device) - 8usize]; + ["Offset of field: libvlc_audio_output_device_t::psz_description"] + [::core::mem::offset_of!(libvlc_audio_output_device_t, psz_description) - 16usize]; +}; pub const libvlc_video_marquee_option_t_libvlc_marquee_Enable: libvlc_video_marquee_option_t = 0; pub const libvlc_video_marquee_option_t_libvlc_marquee_Text: libvlc_video_marquee_option_t = 1; pub const libvlc_video_marquee_option_t_libvlc_marquee_Color: libvlc_video_marquee_option_t = 2; @@ -2287,52 +1318,52 @@ pub type libvlc_teletext_key_t = libc::c_uint; pub struct libvlc_equalizer_t { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_new( p_libvlc_instance: *mut libvlc_instance_t, ) -> *mut libvlc_media_player_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_new_from_media( p_md: *mut libvlc_media_t, ) -> *mut libvlc_media_player_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_release(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_retain(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_media( p_mi: *mut libvlc_media_player_t, p_md: *mut libvlc_media_t, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_media(p_mi: *mut libvlc_media_player_t) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_event_manager( p_mi: *mut libvlc_media_player_t, ) -> *mut libvlc_event_manager_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_is_playing(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_play(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_pause(mp: *mut libvlc_media_player_t, do_pause: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_pause(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_stop(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_renderer( p_mi: *mut libvlc_media_player_t, p_item: *mut libvlc_renderer_item_t, @@ -2366,7 +1397,7 @@ pub type libvlc_video_format_cb = ::core::option::Option< >; pub type libvlc_video_cleanup_cb = ::core::option::Option; -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_callbacks( mp: *mut libvlc_media_player_t, lock: libvlc_video_lock_cb, @@ -2375,7 +1406,7 @@ extern "C" { opaque: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_format( mp: *mut libvlc_media_player_t, chroma: *const libc::c_char, @@ -2384,44 +1415,44 @@ extern "C" { pitch: libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_format_callbacks( mp: *mut libvlc_media_player_t, setup: libvlc_video_format_cb, cleanup: libvlc_video_cleanup_cb, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_nsobject( p_mi: *mut libvlc_media_player_t, drawable: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_nsobject(p_mi: *mut libvlc_media_player_t) -> *mut libc::c_void; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_xwindow(p_mi: *mut libvlc_media_player_t, drawable: u32); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_xwindow(p_mi: *mut libvlc_media_player_t) -> u32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_hwnd( p_mi: *mut libvlc_media_player_t, drawable: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_hwnd(p_mi: *mut libvlc_media_player_t) -> *mut libc::c_void; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_android_context( p_mi: *mut libvlc_media_player_t, p_awindow_handler: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_evas_object( p_mi: *mut libvlc_media_player_t, p_evas_object: *mut libc::c_void, @@ -2445,7 +1476,7 @@ pub type libvlc_audio_drain_cb = ::core::option::Option; pub type libvlc_audio_set_volume_cb = ::core::option::Option; -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_callbacks( mp: *mut libvlc_media_player_t, play: libvlc_audio_play_cb, @@ -2456,7 +1487,7 @@ extern "C" { opaque: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_volume_callback( mp: *mut libvlc_media_player_t, set_volume: libvlc_audio_set_volume_cb, @@ -2472,14 +1503,14 @@ pub type libvlc_audio_setup_cb = ::core::option::Option< >; pub type libvlc_audio_cleanup_cb = ::core::option::Option; -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_format_callbacks( mp: *mut libvlc_media_player_t, setup: libvlc_audio_setup_cb, cleanup: libvlc_audio_cleanup_cb, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_format( mp: *mut libvlc_media_player_t, format: *const libc::c_char, @@ -2487,93 +1518,93 @@ extern "C" { channels: libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_length(p_mi: *mut libvlc_media_player_t) -> libvlc_time_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_time(p_mi: *mut libvlc_media_player_t) -> libvlc_time_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_time(p_mi: *mut libvlc_media_player_t, i_time: libvlc_time_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_position(p_mi: *mut libvlc_media_player_t) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_position(p_mi: *mut libvlc_media_player_t, f_pos: f32); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_chapter( p_mi: *mut libvlc_media_player_t, i_chapter: libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_chapter(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_chapter_count(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_will_play(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_chapter_count_for_title( p_mi: *mut libvlc_media_player_t, i_title: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_title(p_mi: *mut libvlc_media_player_t, i_title: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_title(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_title_count(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_previous_chapter(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_next_chapter(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_rate(p_mi: *mut libvlc_media_player_t) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_rate(p_mi: *mut libvlc_media_player_t, rate: f32) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_state(p_mi: *mut libvlc_media_player_t) -> libvlc_state_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_has_vout(p_mi: *mut libvlc_media_player_t) -> libc::c_uint; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_is_seekable(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_can_pause(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_program_scrambled(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_next_frame(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_navigate(p_mi: *mut libvlc_media_player_t, navigate: libc::c_uint); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_video_title_display( p_mi: *mut libvlc_media_player_t, position: libvlc_position_t, timeout: libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_add_slave( p_mi: *mut libvlc_media_player_t, i_type: libvlc_media_slave_type_t, @@ -2581,27 +1612,27 @@ extern "C" { b_select: bool, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_track_description_list_release( p_track_description: *mut libvlc_track_description_t, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_toggle_fullscreen(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_set_fullscreen(p_mi: *mut libvlc_media_player_t, b_fullscreen: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn libvlc_get_fullscreen(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_key_input(p_mi: *mut libvlc_media_player_t, on: libc::c_uint); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_mouse_input(p_mi: *mut libvlc_media_player_t, on: libc::c_uint); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_size( p_mi: *mut libvlc_media_player_t, num: libc::c_uint, @@ -2609,7 +1640,7 @@ extern "C" { py: *mut libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_cursor( p_mi: *mut libvlc_media_player_t, num: libc::c_uint, @@ -2617,115 +1648,115 @@ extern "C" { py: *mut libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_scale(p_mi: *mut libvlc_media_player_t) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_scale(p_mi: *mut libvlc_media_player_t, f_factor: f32); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_aspect_ratio(p_mi: *mut libvlc_media_player_t) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_aspect_ratio( p_mi: *mut libvlc_media_player_t, psz_aspect: *const libc::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_new_viewpoint() -> *mut libvlc_video_viewpoint_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_update_viewpoint( p_mi: *mut libvlc_media_player_t, p_viewpoint: *const libvlc_video_viewpoint_t, b_absolute: bool, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_spu(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_spu_count(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_spu_description( p_mi: *mut libvlc_media_player_t, ) -> *mut libvlc_track_description_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_spu( p_mi: *mut libvlc_media_player_t, i_spu: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_spu_delay(p_mi: *mut libvlc_media_player_t) -> i64; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_spu_delay( p_mi: *mut libvlc_media_player_t, i_delay: i64, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_full_title_descriptions( p_mi: *mut libvlc_media_player_t, titles: *mut *mut *mut libvlc_title_description_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_title_descriptions_release( p_titles: *mut *mut libvlc_title_description_t, i_count: libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_full_chapter_descriptions( p_mi: *mut libvlc_media_player_t, i_chapters_of_title: libc::c_int, pp_chapters: *mut *mut *mut libvlc_chapter_description_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_chapter_descriptions_release( p_chapters: *mut *mut libvlc_chapter_description_t, i_count: libc::c_uint, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_crop_geometry(p_mi: *mut libvlc_media_player_t) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_crop_geometry( p_mi: *mut libvlc_media_player_t, psz_geometry: *const libc::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_teletext(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_teletext(p_mi: *mut libvlc_media_player_t, i_page: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_track_count(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_track_description( p_mi: *mut libvlc_media_player_t, ) -> *mut libvlc_track_description_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_track(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_track( p_mi: *mut libvlc_media_player_t, i_track: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_take_snapshot( p_mi: *mut libvlc_media_player_t, num: libc::c_uint, @@ -2734,32 +1765,32 @@ extern "C" { i_height: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_deinterlace( p_mi: *mut libvlc_media_player_t, psz_mode: *const libc::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_marquee_int( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_marquee_string( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, ) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_marquee_int( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, i_val: libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_marquee_string( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, @@ -2775,20 +1806,20 @@ pub const libvlc_video_logo_option_t_libvlc_logo_repeat: libvlc_video_logo_optio pub const libvlc_video_logo_option_t_libvlc_logo_opacity: libvlc_video_logo_option_t = 6; pub const libvlc_video_logo_option_t_libvlc_logo_position: libvlc_video_logo_option_t = 7; pub type libvlc_video_logo_option_t = libc::c_uint; -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_logo_int( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_logo_int( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, value: libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_logo_string( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, @@ -2802,26 +1833,26 @@ pub const libvlc_video_adjust_option_t_libvlc_adjust_Hue: libvlc_video_adjust_op pub const libvlc_video_adjust_option_t_libvlc_adjust_Saturation: libvlc_video_adjust_option_t = 4; pub const libvlc_video_adjust_option_t_libvlc_adjust_Gamma: libvlc_video_adjust_option_t = 5; pub type libvlc_video_adjust_option_t = libc::c_uint; -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_adjust_int( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_adjust_int( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, value: libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_adjust_float( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_adjust_float( p_mi: *mut libvlc_media_player_t, option: libc::c_uint, @@ -2859,139 +1890,139 @@ pub const libvlc_audio_output_channel_t_libvlc_AudioChannel_Right: libvlc_audio_ pub const libvlc_audio_output_channel_t_libvlc_AudioChannel_Dolbys: libvlc_audio_output_channel_t = 5; pub type libvlc_audio_output_channel_t = libc::c_int; -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_list_get( p_instance: *mut libvlc_instance_t, ) -> *mut libvlc_audio_output_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_list_release(p_list: *mut libvlc_audio_output_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_set( p_mi: *mut libvlc_media_player_t, psz_name: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_enum( mp: *mut libvlc_media_player_t, ) -> *mut libvlc_audio_output_device_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_list_get( p_instance: *mut libvlc_instance_t, aout: *const libc::c_char, ) -> *mut libvlc_audio_output_device_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_list_release(p_list: *mut libvlc_audio_output_device_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_set( mp: *mut libvlc_media_player_t, module: *const libc::c_char, device_id: *const libc::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_get(mp: *mut libvlc_media_player_t) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_toggle_mute(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_get_mute(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_mute(p_mi: *mut libvlc_media_player_t, status: libc::c_int); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_get_volume(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_volume( p_mi: *mut libvlc_media_player_t, i_volume: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_get_track_count(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_get_track_description( p_mi: *mut libvlc_media_player_t, ) -> *mut libvlc_track_description_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_get_track(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_track( p_mi: *mut libvlc_media_player_t, i_track: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_get_channel(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_channel( p_mi: *mut libvlc_media_player_t, channel: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_get_delay(p_mi: *mut libvlc_media_player_t) -> i64; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_set_delay(p_mi: *mut libvlc_media_player_t, i_delay: i64) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_get_preset_count() -> libc::c_uint; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_get_preset_name(u_index: libc::c_uint) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_get_band_count() -> libc::c_uint; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_get_band_frequency(u_index: libc::c_uint) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_new() -> *mut libvlc_equalizer_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_new_from_preset(u_index: libc::c_uint) -> *mut libvlc_equalizer_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_release(p_equalizer: *mut libvlc_equalizer_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_set_preamp( p_equalizer: *mut libvlc_equalizer_t, f_preamp: f32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_get_preamp(p_equalizer: *mut libvlc_equalizer_t) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_set_amp_at_index( p_equalizer: *mut libvlc_equalizer_t, f_amp: f32, u_band: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_equalizer_get_amp_at_index( p_equalizer: *mut libvlc_equalizer_t, u_band: libc::c_uint, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_equalizer( p_mi: *mut libvlc_media_player_t, p_equalizer: *mut libvlc_equalizer_t, @@ -3009,74 +2040,74 @@ pub const libvlc_media_player_role_libvlc_role_Accessibility: libvlc_media_playe pub const libvlc_media_player_role_libvlc_role_Test: libvlc_media_player_role = 9; pub type libvlc_media_player_role = libc::c_uint; pub use self::libvlc_media_player_role as libvlc_media_player_role_t; -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_role(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_role( p_mi: *mut libvlc_media_player_t, role: libc::c_uint, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_new(p_instance: *mut libvlc_instance_t) -> *mut libvlc_media_list_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_release(p_ml: *mut libvlc_media_list_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_retain(p_ml: *mut libvlc_media_list_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_set_media(p_ml: *mut libvlc_media_list_t, p_md: *mut libvlc_media_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_media(p_ml: *mut libvlc_media_list_t) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_add_media( p_ml: *mut libvlc_media_list_t, p_md: *mut libvlc_media_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_insert_media( p_ml: *mut libvlc_media_list_t, p_md: *mut libvlc_media_t, i_pos: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_remove_index( p_ml: *mut libvlc_media_list_t, i_pos: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_count(p_ml: *mut libvlc_media_list_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_item_at_index( p_ml: *mut libvlc_media_list_t, i_pos: libc::c_int, ) -> *mut libvlc_media_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_index_of_item( p_ml: *mut libvlc_media_list_t, p_md: *mut libvlc_media_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_is_readonly(p_ml: *mut libvlc_media_list_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_lock(p_ml: *mut libvlc_media_list_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_unlock(p_ml: *mut libvlc_media_list_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_event_manager( p_ml: *mut libvlc_media_list_t, ) -> *mut libvlc_event_manager_t; @@ -3090,84 +2121,84 @@ pub const libvlc_playback_mode_t_libvlc_playback_mode_default: libvlc_playback_m pub const libvlc_playback_mode_t_libvlc_playback_mode_loop: libvlc_playback_mode_t = 1; pub const libvlc_playback_mode_t_libvlc_playback_mode_repeat: libvlc_playback_mode_t = 2; pub type libvlc_playback_mode_t = libc::c_uint; -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_new( p_instance: *mut libvlc_instance_t, ) -> *mut libvlc_media_list_player_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_release(p_mlp: *mut libvlc_media_list_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_retain(p_mlp: *mut libvlc_media_list_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_event_manager( p_mlp: *mut libvlc_media_list_player_t, ) -> *mut libvlc_event_manager_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_set_media_player( p_mlp: *mut libvlc_media_list_player_t, p_mi: *mut libvlc_media_player_t, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_get_media_player( p_mlp: *mut libvlc_media_list_player_t, ) -> *mut libvlc_media_player_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_set_media_list( p_mlp: *mut libvlc_media_list_player_t, p_mlist: *mut libvlc_media_list_t, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_play(p_mlp: *mut libvlc_media_list_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_pause(p_mlp: *mut libvlc_media_list_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_set_pause( p_mlp: *mut libvlc_media_list_player_t, do_pause: libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_is_playing( p_mlp: *mut libvlc_media_list_player_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_get_state( p_mlp: *mut libvlc_media_list_player_t, ) -> libvlc_state_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_play_item_at_index( p_mlp: *mut libvlc_media_list_player_t, i_index: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_play_item( p_mlp: *mut libvlc_media_list_player_t, p_md: *mut libvlc_media_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_stop(p_mlp: *mut libvlc_media_list_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_next(p_mlp: *mut libvlc_media_list_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_previous(p_mlp: *mut libvlc_media_list_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_player_set_playback_mode( p_mlp: *mut libvlc_media_list_player_t, e_mode: libvlc_playback_mode_t, @@ -3178,21 +2209,21 @@ extern "C" { pub struct libvlc_media_library_t { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_library_new( p_instance: *mut libvlc_instance_t, ) -> *mut libvlc_media_library_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_library_release(p_mlib: *mut libvlc_media_library_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_library_retain(p_mlib: *mut libvlc_media_library_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_library_load(p_mlib: *mut libvlc_media_library_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_library_media_list( p_mlib: *mut libvlc_media_library_t, ) -> *mut libvlc_media_list_t; @@ -3213,105 +2244,60 @@ pub struct libvlc_media_discoverer_description_t { pub psz_longname: *mut libc::c_char, pub i_cat: libvlc_media_discoverer_category_t, } -#[test] -fn bindgen_test_layout_libvlc_media_discoverer_description_t() { - assert_eq!( - ::core::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(libvlc_media_discoverer_description_t) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_media_discoverer_description_t) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_name as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_discoverer_description_t), - "::", - stringify!(psz_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_longname - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_discoverer_description_t), - "::", - stringify!(psz_longname) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_cat as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_media_discoverer_description_t), - "::", - stringify!(i_cat) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_media_discoverer_description_t"] + [::core::mem::size_of::() - 24usize]; + ["Alignment of libvlc_media_discoverer_description_t"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_media_discoverer_description_t::psz_name"] + [::core::mem::offset_of!(libvlc_media_discoverer_description_t, psz_name) - 0usize]; + ["Offset of field: libvlc_media_discoverer_description_t::psz_longname"] + [::core::mem::offset_of!(libvlc_media_discoverer_description_t, psz_longname) - 8usize]; + ["Offset of field: libvlc_media_discoverer_description_t::i_cat"] + [::core::mem::offset_of!(libvlc_media_discoverer_description_t, i_cat) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_media_discoverer_t { _unused: [u8; 0], } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_new( p_inst: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> *mut libvlc_media_discoverer_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_start(p_mdis: *mut libvlc_media_discoverer_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_stop(p_mdis: *mut libvlc_media_discoverer_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_release(p_mdis: *mut libvlc_media_discoverer_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_media_list( p_mdis: *mut libvlc_media_discoverer_t, ) -> *mut libvlc_media_list_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_is_running( p_mdis: *mut libvlc_media_discoverer_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_list_get( p_inst: *mut libvlc_instance_t, i_cat: libvlc_media_discoverer_category_t, ppp_services: *mut *mut *mut libvlc_media_discoverer_description_t, - ) -> size_t; + ) -> usize; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_list_release( pp_services: *mut *mut libvlc_media_discoverer_description_t, - i_count: size_t, + i_count: usize, ); } pub const libvlc_event_e_libvlc_MediaMetaChanged: libvlc_event_e = 0; @@ -3425,1641 +2411,558 @@ pub union libvlc_event_t__bindgen_ty_1 { pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_1 { pub meta_type: libvlc_meta_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).meta_type - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(meta_type) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_1"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_1"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_1::meta_type"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_1, meta_type) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_2 { pub new_child: *mut libvlc_media_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_2() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_child - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(new_child) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_2"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_2"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_2::new_child"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_2, new_child) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_3 { pub new_duration: i64, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_3() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_duration - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(new_duration) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_3"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_3"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_3::new_duration"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_3, + new_duration + ) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_4 { pub new_status: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_4() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_4) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_4) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_status - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(new_status) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_4"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_4"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_4::new_status"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_4, new_status) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_5 { pub md: *mut libvlc_media_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_5() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_5) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_5) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).md as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_5), - "::", - stringify!(md) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_5"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_5"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_5::md"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_5, md) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_6 { pub new_state: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_6() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_6) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_6) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_state - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_6), - "::", - stringify!(new_state) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_6"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_6"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_6::new_state"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_6, new_state) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_7 { pub item: *mut libvlc_media_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_7() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_7) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_7) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_7), - "::", - stringify!(item) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_7"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_7"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_7::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_7, item) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_8 { pub new_cache: f32, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_8() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_8) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_8) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_cache - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_8), - "::", - stringify!(new_cache) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_8"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_8"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_8::new_cache"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_8, new_cache) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_9 { pub new_chapter: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_9() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_9) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_9) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_chapter - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_9), - "::", - stringify!(new_chapter) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_9"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_9"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_9::new_chapter"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_9, new_chapter) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_10 { pub new_position: f32, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_10() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_10) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_10) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_position - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_10), - "::", - stringify!(new_position) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_10"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_10"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_10::new_position"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_10, + new_position + ) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_11 { pub new_time: libvlc_time_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_11() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_11) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_11) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_time - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_11), - "::", - stringify!(new_time) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_11"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_11"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_11::new_time"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_11, new_time) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_12 { pub new_title: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_12() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_12) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_12) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_title - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_12), - "::", - stringify!(new_title) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_12"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_12"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_12::new_title"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_12, new_title) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_13 { pub new_seekable: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_13() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_13) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_13) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_seekable - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_13), - "::", - stringify!(new_seekable) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_13"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_13"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_13::new_seekable"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_13, + new_seekable + ) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_14 { pub new_pausable: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_14() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_14) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_14) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_pausable - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_14), - "::", - stringify!(new_pausable) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_14"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_14"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_14::new_pausable"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_14, + new_pausable + ) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_15 { pub new_scrambled: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_15() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_15) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_15) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_scrambled - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_15), - "::", - stringify!(new_scrambled) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_15"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_15"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_15::new_scrambled"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_15, + new_scrambled + ) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_16 { pub new_count: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_16() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_16) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_16) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_count - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_16), - "::", - stringify!(new_count) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_16"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_16"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_16::new_count"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_16, new_count) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_17 { pub item: *mut libvlc_media_t, pub index: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_17() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_17) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_17) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_17), - "::", - stringify!(item) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).index - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_17), - "::", - stringify!(index) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_17"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_17"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_17::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_17, item) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_17::index"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_17, index) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_18 { pub item: *mut libvlc_media_t, pub index: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_18() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_18) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_18) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_18), - "::", - stringify!(item) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).index - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_18), - "::", - stringify!(index) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_18"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_18"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_18::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_18, item) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_18::index"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_18, index) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_19 { pub item: *mut libvlc_media_t, pub index: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_19() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_19) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_19) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_19), - "::", - stringify!(item) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).index - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_19), - "::", - stringify!(index) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_19"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_19"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_19::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_19, item) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_19::index"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_19, index) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_20 { pub item: *mut libvlc_media_t, pub index: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_20() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_20) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_20) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_20), - "::", - stringify!(item) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).index - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_20), - "::", - stringify!(index) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_20"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_20"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_20::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_20, item) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_20::index"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_20, index) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_21 { pub item: *mut libvlc_media_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_21() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_21) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_21) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_21), - "::", - stringify!(item) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_21"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_21"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_21::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_21, item) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_22 { pub psz_filename: *mut libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_22() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_22) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_22) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_filename - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_22), - "::", - stringify!(psz_filename) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_22"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_22"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_22::psz_filename"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_22, + psz_filename + ) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_23 { pub new_length: libvlc_time_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_23() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_23) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_23) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_length - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_23), - "::", - stringify!(new_length) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_23"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_23"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_23::new_length"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_23, new_length) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_24 { pub psz_media_name: *const libc::c_char, pub psz_instance_name: *const libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_24() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_24) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_24) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_media_name - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_24), - "::", - stringify!(psz_media_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())) - .psz_instance_name as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_24), - "::", - stringify!(psz_instance_name) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_24"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_24"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_24::psz_media_name"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_24, + psz_media_name + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_24::psz_instance_name"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1__bindgen_ty_24, + psz_instance_name + ) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_25 { pub new_media: *mut libvlc_media_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_25() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_25) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_25) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).new_media - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_25), - "::", - stringify!(new_media) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_25"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_25"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_25::new_media"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_25, new_media) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_26 { pub i_type: libvlc_track_type_t, pub i_id: libc::c_int, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_26() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_26) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_26) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_type - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_26), - "::", - stringify!(i_type) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_id - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_26), - "::", - stringify!(i_id) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_26"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_26"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_26::i_type"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_26, i_type) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_26::i_id"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_26, i_id) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_27 { pub volume: f32, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_27() { - assert_eq!( - ::core::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_27) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_27) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).volume - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_27), - "::", - stringify!(volume) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_27"] + [::core::mem::size_of::() - 4usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_27"] + [::core::mem::align_of::() - 4usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_27::volume"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_27, volume) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_28 { pub device: *const libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_28() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_28) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_28) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).device - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_28), - "::", - stringify!(device) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_28"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_28"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_28::device"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_28, device) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_29 { pub item: *mut libvlc_renderer_item_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_29() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_29) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_29) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_29), - "::", - stringify!(item) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_29"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_29"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_29::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_29, item) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_event_t__bindgen_ty_1__bindgen_ty_30 { pub item: *mut libvlc_renderer_item_t, } -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1__bindgen_ty_30() { - assert_eq!( - ::core::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_30) - ) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_30) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1__bindgen_ty_30), - "::", - stringify!(item) - ) - ); -} -#[test] -fn bindgen_test_layout_libvlc_event_t__bindgen_ty_1() { - assert_eq!( - ::core::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(libvlc_event_t__bindgen_ty_1)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_event_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_meta_changed as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_meta_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_subitem_added - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_subitem_added) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_duration_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_duration_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_parsed_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_parsed_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_freed as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_freed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_state_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_state_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_subitemtree_added - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_subitemtree_added) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_buffering - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_buffering) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_chapter_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_chapter_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_position_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_position_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_time_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_time_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_title_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_title_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_seekable_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_seekable_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_pausable_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_pausable_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_scrambled_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_scrambled_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_vout as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_vout) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_list_item_added - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_list_item_added) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_list_will_add_item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_list_will_add_item) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_list_item_deleted - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_list_item_deleted) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_list_will_delete_item - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_list_will_delete_item) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())) - .media_list_player_next_item_set as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_list_player_next_item_set) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_snapshot_taken - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_snapshot_taken) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_length_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_length_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).vlm_media_event as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(vlm_media_event) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_media_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_media_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_es_changed - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_es_changed) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_audio_volume - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_audio_volume) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).media_player_audio_device - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(media_player_audio_device) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).renderer_discoverer_item_added - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(renderer_discoverer_item_added) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())) - .renderer_discoverer_item_deleted as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t__bindgen_ty_1), - "::", - stringify!(renderer_discoverer_item_deleted) - ) - ); -} -#[test] -fn bindgen_test_layout_libvlc_event_t() { - assert_eq!( - ::core::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(libvlc_event_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_event_t)) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).p_obj as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t), - "::", - stringify!(p_obj) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).u as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_event_t), - "::", - stringify!(u) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1__bindgen_ty_30"] + [::core::mem::size_of::() - 8usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1__bindgen_ty_30"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1__bindgen_ty_30::item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1__bindgen_ty_30, item) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t__bindgen_ty_1"] + [::core::mem::size_of::() - 16usize]; + ["Alignment of libvlc_event_t__bindgen_ty_1"] + [::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_meta_changed"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_meta_changed) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_subitem_added"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_subitem_added) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_duration_changed"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_duration_changed) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_parsed_changed"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_parsed_changed) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_freed"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_freed) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_state_changed"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_state_changed) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_subitemtree_added"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_subitemtree_added) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_buffering"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_player_buffering) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_chapter_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_chapter_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_position_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_position_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_time_changed"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_player_time_changed) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_title_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_title_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_seekable_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_seekable_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_pausable_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_pausable_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_scrambled_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_scrambled_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_vout"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_player_vout) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_list_item_added"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_list_item_added) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_list_will_add_item"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_list_will_add_item) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_list_item_deleted"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_list_item_deleted) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_list_will_delete_item"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_list_will_delete_item + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_list_player_next_item_set"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_list_player_next_item_set + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_snapshot_taken"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_snapshot_taken + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_length_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_length_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::vlm_media_event"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, vlm_media_event) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_media_changed"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + media_player_media_changed + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_es_changed"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_player_es_changed) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_audio_volume"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_player_audio_volume) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::media_player_audio_device"] + [::core::mem::offset_of!(libvlc_event_t__bindgen_ty_1, media_player_audio_device) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::renderer_discoverer_item_added"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + renderer_discoverer_item_added + ) - 0usize]; + ["Offset of field: libvlc_event_t__bindgen_ty_1::renderer_discoverer_item_deleted"][::core::mem::offset_of!( + libvlc_event_t__bindgen_ty_1, + renderer_discoverer_item_deleted + ) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_event_t"][::core::mem::size_of::() - 32usize]; + ["Alignment of libvlc_event_t"][::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_event_t::type_"] + [::core::mem::offset_of!(libvlc_event_t, type_) - 0usize]; + ["Offset of field: libvlc_event_t::p_obj"] + [::core::mem::offset_of!(libvlc_event_t, p_obj) - 8usize]; + ["Offset of field: libvlc_event_t::u"][::core::mem::offset_of!(libvlc_event_t, u) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct libvlc_dialog_id { @@ -5127,103 +3030,37 @@ pub struct libvlc_dialog_cbs { ), >, } -#[test] -fn bindgen_test_layout_libvlc_dialog_cbs() { - assert_eq!( - ::core::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(libvlc_dialog_cbs)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_dialog_cbs)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).pf_display_error as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_dialog_cbs), - "::", - stringify!(pf_display_error) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).pf_display_login as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_dialog_cbs), - "::", - stringify!(pf_display_login) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).pf_display_question as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_dialog_cbs), - "::", - stringify!(pf_display_question) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).pf_display_progress as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libvlc_dialog_cbs), - "::", - stringify!(pf_display_progress) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).pf_cancel as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libvlc_dialog_cbs), - "::", - stringify!(pf_cancel) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).pf_update_progress as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(libvlc_dialog_cbs), - "::", - stringify!(pf_update_progress) - ) - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_dialog_cbs"][::core::mem::size_of::() - 48usize]; + ["Alignment of libvlc_dialog_cbs"][::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_dialog_cbs::pf_display_error"] + [::core::mem::offset_of!(libvlc_dialog_cbs, pf_display_error) - 0usize]; + ["Offset of field: libvlc_dialog_cbs::pf_display_login"] + [::core::mem::offset_of!(libvlc_dialog_cbs, pf_display_login) - 8usize]; + ["Offset of field: libvlc_dialog_cbs::pf_display_question"] + [::core::mem::offset_of!(libvlc_dialog_cbs, pf_display_question) - 16usize]; + ["Offset of field: libvlc_dialog_cbs::pf_display_progress"] + [::core::mem::offset_of!(libvlc_dialog_cbs, pf_display_progress) - 24usize]; + ["Offset of field: libvlc_dialog_cbs::pf_cancel"] + [::core::mem::offset_of!(libvlc_dialog_cbs, pf_cancel) - 32usize]; + ["Offset of field: libvlc_dialog_cbs::pf_update_progress"] + [::core::mem::offset_of!(libvlc_dialog_cbs, pf_update_progress) - 40usize]; +}; +unsafe extern "C" { pub fn libvlc_dialog_set_callbacks( p_instance: *mut libvlc_instance_t, p_cbs: *const libvlc_dialog_cbs, p_data: *mut libc::c_void, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_dialog_set_context(p_id: *mut libvlc_dialog_id, p_context: *mut libc::c_void); } -extern "C" { +unsafe extern "C" { pub fn libvlc_dialog_get_context(p_id: *mut libvlc_dialog_id) -> *mut libc::c_void; } -extern "C" { +unsafe extern "C" { pub fn libvlc_dialog_post_login( p_id: *mut libvlc_dialog_id, psz_username: *const libc::c_char, @@ -5231,19 +3068,19 @@ extern "C" { b_store: bool, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_dialog_post_action( p_id: *mut libvlc_dialog_id, i_action: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_dialog_dismiss(p_id: *mut libvlc_dialog_id) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_release(p_instance: *mut libvlc_instance_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_add_broadcast( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, @@ -5255,7 +3092,7 @@ extern "C" { b_loop: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_add_vod( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, @@ -5266,55 +3103,55 @@ extern "C" { psz_mux: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_del_media( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_set_enabled( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, b_enabled: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_set_output( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, psz_output: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_set_input( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, psz_input: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_add_input( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, psz_input: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_set_loop( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, b_loop: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_set_mux( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, psz_mux: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_change_media( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, @@ -5326,175 +3163,175 @@ extern "C" { b_loop: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_play_media( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_stop_media( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_pause_media( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_seek_media( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, f_percentage: f32, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_show_media( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> *const libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_get_media_instance_position( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, i_instance: libc::c_int, ) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_get_media_instance_time( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, i_instance: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_get_media_instance_length( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, i_instance: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_get_media_instance_rate( p_instance: *mut libvlc_instance_t, psz_name: *const libc::c_char, i_instance: libc::c_int, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_vlm_get_event_manager( p_instance: *mut libvlc_instance_t, ) -> *mut libvlc_event_manager_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_fps(p_mi: *mut libvlc_media_player_t) -> f32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_set_agl(p_mi: *mut libvlc_media_player_t, drawable: u32); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_player_get_agl(p_mi: *mut libvlc_media_player_t) -> u32; } -extern "C" { +unsafe extern "C" { pub fn libvlc_track_description_release(p_track_description: *mut libvlc_track_description_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_height(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_width(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_title_description( p_mi: *mut libvlc_media_player_t, ) -> *mut libvlc_track_description_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_get_chapter_description( p_mi: *mut libvlc_media_player_t, i_title: libc::c_int, ) -> *mut libvlc_track_description_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_video_set_subtitle_file( p_mi: *mut libvlc_media_player_t, psz_subtitle: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_toggle_teletext(p_mi: *mut libvlc_media_player_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_count( p_instance: *mut libvlc_instance_t, psz_audio_output: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_longname( p_instance: *mut libvlc_instance_t, psz_output: *const libc::c_char, i_device: libc::c_int, ) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_device_id( p_instance: *mut libvlc_instance_t, psz_audio_output: *const libc::c_char, i_device: libc::c_int, ) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_get_device_type(p_mi: *mut libvlc_media_player_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_audio_output_set_device_type( p_mp: *mut libvlc_media_player_t, device_type: libc::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_parse(p_md: *mut libvlc_media_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_parse_async(p_md: *mut libvlc_media_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_is_parsed(p_md: *mut libvlc_media_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_get_tracks_info( p_md: *mut libvlc_media_t, tracks: *mut *mut libvlc_media_track_info_t, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_list_add_file_content( p_ml: *mut libvlc_media_list_t, psz_uri: *const libc::c_char, ) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_new_from_name( p_inst: *mut libvlc_instance_t, psz_name: *const libc::c_char, ) -> *mut libvlc_media_discoverer_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_localized_name( p_mdis: *mut libvlc_media_discoverer_t, ) -> *mut libc::c_char; } -extern "C" { +unsafe extern "C" { pub fn libvlc_media_discoverer_event_manager( p_mdis: *mut libvlc_media_discoverer_t, ) -> *mut libvlc_event_manager_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_wait(p_instance: *mut libvlc_instance_t); } #[repr(C)] @@ -5511,109 +3348,55 @@ pub struct libvlc_log_message_t { pub psz_header: *const libc::c_char, pub psz_message: *const libc::c_char, } -#[test] -fn bindgen_test_layout_libvlc_log_message_t() { - assert_eq!( - ::core::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(libvlc_log_message_t)) - ); - assert_eq!( - ::core::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libvlc_log_message_t)) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).i_severity as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libvlc_log_message_t), - "::", - stringify!(i_severity) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).psz_type as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libvlc_log_message_t), - "::", - stringify!(psz_type) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::())).psz_name as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libvlc_log_message_t), - "::", - stringify!(psz_name) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_header as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libvlc_log_message_t), - "::", - stringify!(psz_header) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::())).psz_message as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libvlc_log_message_t), - "::", - stringify!(psz_message) - ) - ); -} -extern "C" { +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libvlc_log_message_t"][::core::mem::size_of::() - 40usize]; + ["Alignment of libvlc_log_message_t"][::core::mem::align_of::() - 8usize]; + ["Offset of field: libvlc_log_message_t::i_severity"] + [::core::mem::offset_of!(libvlc_log_message_t, i_severity) - 0usize]; + ["Offset of field: libvlc_log_message_t::psz_type"] + [::core::mem::offset_of!(libvlc_log_message_t, psz_type) - 8usize]; + ["Offset of field: libvlc_log_message_t::psz_name"] + [::core::mem::offset_of!(libvlc_log_message_t, psz_name) - 16usize]; + ["Offset of field: libvlc_log_message_t::psz_header"] + [::core::mem::offset_of!(libvlc_log_message_t, psz_header) - 24usize]; + ["Offset of field: libvlc_log_message_t::psz_message"] + [::core::mem::offset_of!(libvlc_log_message_t, psz_message) - 32usize]; +}; +unsafe extern "C" { pub fn libvlc_get_log_verbosity(p_instance: *const libvlc_instance_t) -> libc::c_uint; } -extern "C" { +unsafe extern "C" { pub fn libvlc_set_log_verbosity(p_instance: *mut libvlc_instance_t, level: libc::c_uint); } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_open(p_instance: *mut libvlc_instance_t) -> *mut libvlc_log_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_close(p_log: *mut libvlc_log_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_count(p_log: *const libvlc_log_t) -> libc::c_uint; } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_clear(p_log: *mut libvlc_log_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_get_iterator(p_log: *const libvlc_log_t) -> *mut libvlc_log_iterator_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_iterator_free(p_iter: *mut libvlc_log_iterator_t); } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_iterator_has_next(p_iter: *const libvlc_log_iterator_t) -> libc::c_int; } -extern "C" { +unsafe extern "C" { pub fn libvlc_log_iterator_next( p_iter: *mut libvlc_log_iterator_t, p_buf: *mut libvlc_log_message_t, ) -> *mut libvlc_log_message_t; } -extern "C" { +unsafe extern "C" { pub fn libvlc_playlist_play( p_instance: *mut libvlc_instance_t, i_id: libc::c_int, @@ -5630,58 +3413,16 @@ pub struct __va_list_tag { pub overflow_arg_area: *mut libc::c_void, pub reg_save_area: *mut libc::c_void, } -#[test] -fn bindgen_test_layout___va_list_tag() { - 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::null::<__va_list_tag>())).gp_offset as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { - &(*(::core::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { &(*(::core::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __va_list_tag"][::core::mem::size_of::<__va_list_tag>() - 24usize]; + ["Alignment of __va_list_tag"][::core::mem::align_of::<__va_list_tag>() - 8usize]; + ["Offset of field: __va_list_tag::gp_offset"] + [::core::mem::offset_of!(__va_list_tag, gp_offset) - 0usize]; + ["Offset of field: __va_list_tag::fp_offset"] + [::core::mem::offset_of!(__va_list_tag, fp_offset) - 4usize]; + ["Offset of field: __va_list_tag::overflow_arg_area"] + [::core::mem::offset_of!(__va_list_tag, overflow_arg_area) - 8usize]; + ["Offset of field: __va_list_tag::reg_save_area"] + [::core::mem::offset_of!(__va_list_tag, reg_save_area) - 16usize]; +}; diff --git a/libvlc-sys/build.rs b/libvlc-sys/build.rs index 45e307a..dd3eb63 100644 --- a/libvlc-sys/build.rs +++ b/libvlc-sys/build.rs @@ -1,55 +1,12 @@ -use std::env; -use std::path::PathBuf; -use pkg_config; +//! Build script for `libvlc-sys`, locates and links libvlc. -#[cfg(feature = "bindgen")] -fn generate_bindings() { - println!("cargo:rerun-if-changed=wrapper.h"); +/// Minimum supported libvlc version. +const MIN_LIBVLC_VERSION: &str = "3.0.0"; - let mut bindings = bindgen::Builder::default() - .header("wrapper.h") - // For no_std - .use_core() - // Use libc - .ctypes_prefix("libc") - // Whitelist - .whitelist_type(".*vlc.*") - .whitelist_function(".*vlc.*") - .whitelist_var(".*vlc.*") - .whitelist_function("vsnprintf") - .parse_callbacks(Box::new(bindgen::CargoCallbacks)); - - // Set header include paths - let pkg_config_library = pkg_config::Config::new().probe("libvlc").unwrap(); - for include_path in &pkg_config_library.include_paths { - bindings = bindings.clang_arg(format!("-I{}", include_path.display())); - } - - let bindings = bindings.generate().expect("Unable to generate bindings"); - - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - bindings - .write_to_file(out_path.join("bindings.rs")) - .expect("Couldn't write bindings!"); -} - -#[cfg(not(feature = "bindgen"))] -fn copy_pregenerated_bindings() -{ - use std::fs; - - let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); - let crate_path = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); - fs::copy( - crate_path.join("bindings.rs"), - out_path.join("bindings.rs"), - ) - .expect("Couldn't find pregenerated bindings!"); -} - -fn link_vlc_with_pkgconfig() -> Result { +/// Locate libvlc via pkg-config. +fn probe_libvlc() -> Result { pkg_config::Config::new() - .print_system_libs(false) + .atleast_version(MIN_LIBVLC_VERSION) .probe("libvlc") } @@ -139,8 +96,11 @@ mod windows { } ), ]) - .spawn() - .unwrap(); + .status() + .expect("Failed to run lib.exe") + .success() + .then_some(()) + .expect("lib.exe failed to generate the vlc import library"); } fn vlc_path() -> PathBuf { @@ -163,21 +123,13 @@ mod windows { } fn main() { - // Binding generation - #[cfg(feature = "bindgen")] - generate_bindings(); - - #[cfg(not(feature = "bindgen"))] - copy_pregenerated_bindings(); - - // Link - if let Err(err) = link_vlc_with_pkgconfig() { + // On success pkg-config has already emitted the link directives; only the + // failure path needs handling. + if let Err(err) = probe_libvlc() { #[cfg(target_os = "windows")] windows::link_vlc(); #[cfg(not(target_os = "windows"))] - panic!("libvlc not found: {:?}", err); + panic!("libvlc (>= {}) not found: {:?}", MIN_LIBVLC_VERSION, err); } - - println!("cargo:rustc-link-lib=vlc"); } diff --git a/libvlc-sys/src/lib.rs b/libvlc-sys/src/lib.rs index da4a48d..12b7d82 100644 --- a/libvlc-sys/src/lib.rs +++ b/libvlc-sys/src/lib.rs @@ -3,4 +3,6 @@ #![allow(non_snake_case)] #![no_std] -include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +// The bindings are a committed source file, regenerated out of band with +// `cargo xtask bindgen`. +include!("../bindings.rs"); diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml new file mode 100644 index 0000000..a02dd56 --- /dev/null +++ b/xtask/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "xtask" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies] +bindgen = "0.72" +pkg-config = "0.3" + +# Standalone from the vlc-rs workspace, kept out of the normal build graph. +[workspace] diff --git a/xtask/src/main.rs b/xtask/src/main.rs new file mode 100644 index 0000000..6699e2b --- /dev/null +++ b/xtask/src/main.rs @@ -0,0 +1,70 @@ +//! Maintenance tasks for vlc-rs, invoked via `cargo xtask `. + +use std::path::{Path, PathBuf}; +use std::process::ExitCode; + +/// Minimum libvlc version the bindings target. Keep in sync with +/// `libvlc-sys/build.rs`. +const MIN_LIBVLC_VERSION: &str = "3.0.0"; + +fn main() -> ExitCode { + match std::env::args().nth(1).as_deref() { + Some("bindgen") => { + generate_bindings(); + ExitCode::SUCCESS + } + _ => { + eprintln!("usage: cargo xtask \n"); + eprintln!("tasks:"); + eprintln!(" bindgen regenerate libvlc-sys/bindings.rs from the system libvlc headers"); + ExitCode::FAILURE + } + } +} + +fn generate_bindings() { + let sys_dir = libvlc_sys_dir(); + let header = sys_dir.join("wrapper.h"); + let output = sys_dir.join("bindings.rs"); + + // Enforce the same minimum version the build script requires and pick up any + // header search paths. + let library = pkg_config::Config::new() + .atleast_version(MIN_LIBVLC_VERSION) + .cargo_metadata(false) + .probe("libvlc") + .unwrap_or_else(|e| panic!("libvlc >= {MIN_LIBVLC_VERSION} not found via pkg-config: {e}")); + + let mut bindings = bindgen::Builder::default() + .header(header.to_str().expect("non-UTF-8 header path")) + // For no_std + .use_core() + // Use libc + .ctypes_prefix("libc") + // Allowlist every (lib)vlc symbol. + .allowlist_item("(lib|LIB)?(vlc|VLC)_.*") + // Required by the Windows `legacy_stdio_definitions` link workaround + // (see libvlc-sys/build.rs). + .allowlist_function("vsnprintf"); + + for path in &library.include_paths { + bindings = bindings.clang_arg(format!("-I{}", path.display())); + } + + let generated = bindings + .generate() + .expect("unable to generate bindings") + .to_string(); + + std::fs::write(&output, generated).expect("couldn't write bindings"); + println!("wrote {}", output.display()); +} + +/// Absolute path to the `libvlc-sys` crate directory, derived from this xtask's +/// location so it works regardless of the current working directory. +fn libvlc_sys_dir() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .expect("xtask has no parent directory") + .join("libvlc-sys") +}