diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1ba9c28f..63283c20a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # os: [ubuntu-latest, macos-latest, windows-latest] + os: [windows-latest] php: ["8.0", "8.1", "8.2", "8.3", "8.4"] rust: [stable, nightly] clang: ["15", "17"] @@ -95,14 +96,14 @@ jobs: - os: windows-latest rust: stable # setup-php doesn't support thread safe PHP on Linux and macOS. - - os: macos-latest - phpts: ts - - os: ubuntu-latest - phpts: ts - - os: macos-latest - clang: "17" - - os: ubuntu-latest - clang: "15" + # - os: macos-latest + # phpts: ts + # - os: ubuntu-latest + # phpts: ts + # - os: macos-latest + # clang: "17" + # - os: ubuntu-latest + # clang: "15" - os: windows-latest clang: "15" env: diff --git a/Cargo.toml b/Cargo.toml index 6ef2e83d8..e7e6d3660 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ skeptic = "0.13" [build-dependencies] anyhow = "1" -bindgen = "0.68.1" +bindgen = "0.71.0" cc = "1.0" skeptic = "0.13" diff --git a/docsrs_bindings.rs b/docsrs_bindings.rs index 16a3d1169..4e1802c05 100644 --- a/docsrs_bindings.rs +++ b/docsrs_bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.68.1 */ +/* automatically generated by rust-bindgen 0.72.0 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -16,10 +16,7 @@ where Storage: AsRef<[u8]> + AsMut<[u8]>, { #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; + fn extract_bit(byte: u8, index: usize) -> bool { let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { @@ -29,10 +26,23 @@ where byte & mask == mask } #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { + pub fn get_bit(&self, index: usize) -> bool { debug_assert!(index / 8 < self.storage.as_ref().len()); let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; + let 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 { @@ -40,12 +50,28 @@ where }; let mask = 1 << bit_index; if val { - *byte |= mask; + byte | mask } else { - *byte &= !mask; + 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()); @@ -64,6 +90,24 @@ where 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()); @@ -79,6 +123,22 @@ where 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 ZEND_DEBUG: u32 = 1; pub const _ZEND_TYPE_NAME_BIT: u32 = 16777216; @@ -472,7 +532,7 @@ pub struct _zend_reference { pub struct _zend_ast_ref { pub gc: zend_refcounted_h, } -extern "C" { +unsafe extern "C" { pub fn _emalloc( size: usize, __zend_filename: *const ::std::os::raw::c_char, @@ -481,7 +541,7 @@ extern "C" { __zend_orig_lineno: u32, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn _efree( ptr: *mut ::std::os::raw::c_void, __zend_filename: *const ::std::os::raw::c_char, @@ -490,7 +550,7 @@ extern "C" { __zend_orig_lineno: u32, ); } -extern "C" { +unsafe extern "C" { pub fn __zend_malloc(len: usize) -> *mut ::std::os::raw::c_void; } #[repr(C)] @@ -516,13 +576,13 @@ pub struct _zend_llist { } pub type zend_llist = _zend_llist; pub type zend_llist_position = *mut zend_llist_element; -extern "C" { +unsafe extern "C" { pub fn zend_llist_get_next_ex( l: *mut zend_llist, pos: *mut zend_llist_position, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn zend_llist_get_prev_ex( l: *mut zend_llist, pos: *mut zend_llist_position, @@ -535,10 +595,10 @@ pub type zend_string_init_interned_func_t = ::std::option::Option< permanent: bool, ) -> *mut zend_string, >; -extern "C" { +unsafe extern "C" { pub static mut zend_string_init_interned: zend_string_init_interned_func_t; } -extern "C" { +unsafe extern "C" { pub static mut zend_known_strings: *mut *mut zend_string; } pub const _zend_known_string_id_ZEND_STR_FILE: _zend_known_string_id = 0; @@ -615,10 +675,10 @@ pub const _zend_known_string_id_ZEND_STR_SENSITIVEPARAMETER: _zend_known_string_ pub const _zend_known_string_id_ZEND_STR_CONST_EXPR_PLACEHOLDER: _zend_known_string_id = 71; pub const _zend_known_string_id_ZEND_STR_LAST_KNOWN: _zend_known_string_id = 72; pub type _zend_known_string_id = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn zend_hash_clean(ht: *mut HashTable); } -extern "C" { +unsafe extern "C" { pub fn zend_hash_str_update( ht: *mut HashTable, key: *const ::std::os::raw::c_char, @@ -626,78 +686,78 @@ extern "C" { pData: *mut zval, ) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_index_update(ht: *mut HashTable, h: zend_ulong, pData: *mut zval) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_next_index_insert(ht: *mut HashTable, pData: *mut zval) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_str_del( ht: *mut HashTable, key: *const ::std::os::raw::c_char, len: usize, ) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_index_del(ht: *mut HashTable, h: zend_ulong) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_str_find( ht: *const HashTable, key: *const ::std::os::raw::c_char, len: usize, ) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_index_find(ht: *const HashTable, h: zend_ulong) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_find_known_hash(ht: *const HashTable, key: *const zend_string) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_move_forward_ex(ht: *mut HashTable, pos: *mut HashPosition) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_move_backwards_ex(ht: *mut HashTable, pos: *mut HashPosition) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_get_current_key_zval_ex( ht: *const HashTable, key: *mut zval, pos: *const HashPosition, ); } -extern "C" { +unsafe extern "C" { pub fn zend_hash_get_current_key_type_ex( ht: *mut HashTable, pos: *mut HashPosition, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn zend_hash_get_current_data_ex(ht: *mut HashTable, pos: *mut HashPosition) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn _zend_new_array(size: u32) -> *mut HashTable; } -extern "C" { +unsafe extern "C" { pub fn zend_array_count(ht: *mut HashTable) -> u32; } -extern "C" { +unsafe extern "C" { pub fn zend_array_dup(source: *mut HashTable) -> *mut HashTable; } -extern "C" { +unsafe extern "C" { pub fn zend_array_destroy(ht: *mut HashTable); } -extern "C" { +unsafe extern "C" { pub fn zend_hash_str_find_ptr_lc( ht: *const HashTable, str_: *const ::std::os::raw::c_char, len: usize, ) -> *mut ::std::os::raw::c_void; } -extern "C" { +unsafe extern "C" { pub fn gc_possible_root(ref_: *mut zend_refcounted); } #[repr(C)] @@ -707,7 +767,7 @@ pub struct zend_get_gc_buffer { pub end: *mut zval, pub start: *mut zval, } -extern "C" { +unsafe extern "C" { pub fn zval_ptr_dtor(zval_ptr: *mut zval); } pub type zend_object_iterator = _zend_object_iterator; @@ -822,13 +882,13 @@ pub union _zend_file_handle__bindgen_ty_1 { pub stream: zend_stream, } pub type zend_file_handle = _zend_file_handle; -extern "C" { +unsafe extern "C" { pub fn zend_stream_init_filename( handle: *mut zend_file_handle, filename: *const ::std::os::raw::c_char, ); } -extern "C" { +unsafe extern "C" { pub fn zend_destroy_file_handle(file_handle: *mut zend_file_handle); } pub type zend_stat_t = stat; @@ -1035,14 +1095,14 @@ pub struct _zend_class_entry__bindgen_ty_4__bindgen_ty_2 { pub builtin_functions: *const _zend_function_entry, pub module: *mut _zend_module_entry, } -extern "C" { +unsafe extern "C" { pub fn _zend_bailout(filename: *const ::std::os::raw::c_char, lineno: u32) -> !; } -extern "C" { +unsafe extern "C" { pub static mut zend_interrupt_function: ::std::option::Option; } -extern "C" { +unsafe extern "C" { pub static mut zend_standard_class_def: *mut zend_class_entry; } pub const zend_error_handling_t_EH_NORMAL: zend_error_handling_t = 0; @@ -1210,13 +1270,13 @@ pub struct _zend_object_handlers { pub compare: zend_object_compare_t, pub get_properties_for: zend_object_get_properties_for_t, } -extern "C" { +unsafe extern "C" { pub static std_object_handlers: zend_object_handlers; } -extern "C" { +unsafe extern "C" { pub fn zend_std_get_properties(object: *mut zend_object) -> *mut HashTable; } -extern "C" { +unsafe extern "C" { pub fn zend_std_read_property( object: *mut zend_object, member: *mut zend_string, @@ -1225,7 +1285,7 @@ extern "C" { rv: *mut zval, ) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_std_write_property( object: *mut zend_object, member: *mut zend_string, @@ -1233,7 +1293,7 @@ extern "C" { cache_slot: *mut *mut ::std::os::raw::c_void, ) -> *mut zval; } -extern "C" { +unsafe extern "C" { pub fn zend_std_has_property( object: *mut zend_object, member: *mut zend_string, @@ -1241,16 +1301,16 @@ extern "C" { cache_slot: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } -extern "C" { +unsafe extern "C" { pub fn zend_is_identical(op1: *const zval, op2: *const zval) -> bool; } -extern "C" { +unsafe extern "C" { pub fn instanceof_function_slow( instance_ce: *const zend_class_entry, ce: *const zend_class_entry, ) -> bool; } -extern "C" { +unsafe extern "C" { pub fn zend_is_true(op: *const zval) -> ::std::os::raw::c_int; } pub type zend_op_array = _zend_op_array; @@ -1430,16 +1490,16 @@ pub struct __jmp_buf_tag { } pub type jmp_buf = [__jmp_buf_tag; 1usize]; pub type zend_executor_globals = _zend_executor_globals; -extern "C" { +unsafe extern "C" { pub static mut executor_globals: zend_executor_globals; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct zend_atomic_bool_s { - pub value: u8, + pub value: bool, } pub type zend_atomic_bool = zend_atomic_bool_s; -extern "C" { +unsafe extern "C" { pub fn zend_atomic_bool_store(obj: *mut zend_atomic_bool, desired: bool); } #[repr(C)] @@ -1451,16 +1511,16 @@ pub struct _zend_stack { pub elements: *mut ::std::os::raw::c_void, } pub type zend_stack = _zend_stack; -extern "C" { +unsafe extern "C" { pub fn zend_object_std_init(object: *mut zend_object, ce: *mut zend_class_entry); } -extern "C" { +unsafe extern "C" { pub fn zend_objects_new(ce: *mut zend_class_entry) -> *mut zend_object; } -extern "C" { +unsafe extern "C" { pub fn zend_objects_clone_members(new_object: *mut zend_object, old_object: *mut zend_object); } -extern "C" { +unsafe extern "C" { pub fn zend_object_std_dtor(object: *mut zend_object); } #[repr(C)] @@ -1472,7 +1532,7 @@ pub struct _zend_objects_store { pub free_list_head: ::std::os::raw::c_int, } pub type zend_objects_store = _zend_objects_store; -extern "C" { +unsafe extern "C" { pub fn zend_objects_store_del(object: *mut zend_object); } #[repr(C)] @@ -1580,7 +1640,7 @@ pub struct _zend_executor_globals { pub reserved_stack_size: zend_ulong, pub reserved: [*mut ::std::os::raw::c_void; 6usize], } -extern "C" { +unsafe extern "C" { pub fn zend_is_auto_global(name: *mut zend_string) -> bool; } pub type zend_module_entry = _zend_module_entry; @@ -1642,14 +1702,14 @@ pub struct _zend_module_dep { pub version: *const ::std::os::raw::c_char, pub type_: ::std::os::raw::c_uchar, } -extern "C" { +unsafe extern "C" { pub fn zend_lookup_class_ex( name: *mut zend_string, lcname: *mut zend_string, flags: u32, ) -> *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub fn zend_eval_string( str_: *const ::std::os::raw::c_char, retval_ptr: *mut zval, @@ -1663,7 +1723,7 @@ pub struct _zend_vm_stack { pub end: *mut zval, pub prev: zend_vm_stack, } -extern "C" { +unsafe extern "C" { pub fn zend_fetch_function_str( name: *const ::std::os::raw::c_char, len: usize, @@ -1689,23 +1749,23 @@ pub struct _zend_fcall_info_cache { pub closure: *mut zend_object, } pub type zend_fcall_info_cache = _zend_fcall_info_cache; -extern "C" { +unsafe extern "C" { pub fn zend_register_module_ex(module: *mut zend_module_entry) -> *mut zend_module_entry; } -extern "C" { +unsafe extern "C" { pub fn zend_register_internal_class_ex( class_entry: *mut zend_class_entry, parent_ce: *mut zend_class_entry, ) -> *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub fn zend_is_callable( callable: *mut zval, check_flags: u32, callable_name: *mut *mut zend_string, ) -> bool; } -extern "C" { +unsafe extern "C" { pub fn zend_declare_property( ce: *mut zend_class_entry, name: *const ::std::os::raw::c_char, @@ -1714,7 +1774,7 @@ extern "C" { access_type: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn zend_declare_class_constant( ce: *mut zend_class_entry, name: *const ::std::os::raw::c_char, @@ -1722,10 +1782,10 @@ extern "C" { value: *mut zval, ); } -extern "C" { +unsafe extern "C" { pub fn object_properties_init(object: *mut zend_object, class_type: *mut zend_class_entry); } -extern "C" { +unsafe extern "C" { pub fn _call_user_function_impl( object: *mut zval, function_name: *mut zval, @@ -1735,7 +1795,7 @@ extern "C" { named_params: *mut HashTable, ) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn zend_call_known_function( fn_: *mut zend_function, object: *mut zend_object, @@ -1746,7 +1806,7 @@ extern "C" { named_params: *mut HashTable, ); } -extern "C" { +unsafe extern "C" { pub fn zend_is_iterable(iterable: *const zval) -> bool; } pub const _zend_expected_type_Z_EXPECTED_LONG: _zend_expected_type = 0; @@ -1785,13 +1845,13 @@ pub const _zend_expected_type_Z_EXPECTED_OBJECT_OR_STRING: _zend_expected_type = pub const _zend_expected_type_Z_EXPECTED_OBJECT_OR_STRING_OR_NULL: _zend_expected_type = 33; pub const _zend_expected_type_Z_EXPECTED_LAST: _zend_expected_type = 34; pub type _zend_expected_type = ::std::os::raw::c_uint; -extern "C" { +unsafe extern "C" { pub fn zend_wrong_parameters_count_error(min_num_args: u32, max_num_args: u32); } -extern "C" { +unsafe extern "C" { pub fn php_printf(format: *const ::std::os::raw::c_char, ...) -> usize; } -extern "C" { +unsafe extern "C" { pub fn php_error_docref( docref: *const ::std::os::raw::c_char, type_: ::std::os::raw::c_int, @@ -2103,6 +2163,28 @@ impl _php_stream { } } #[inline] + pub unsafe fn is_persistent_raw(this: *const Self) -> u16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_is_persistent_raw(this: *mut Self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn in_free(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 2u8) as u16) } } @@ -2114,6 +2196,28 @@ impl _php_stream { } } #[inline] + pub unsafe fn in_free_raw(this: *const Self) -> u16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 2u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_in_free_raw(this: *mut Self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 2u8, + val as u64, + ) + } + } + #[inline] pub fn eof(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u16) } } @@ -2125,6 +2229,28 @@ impl _php_stream { } } #[inline] + pub unsafe fn eof_raw(this: *const Self) -> u16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_eof_raw(this: *mut Self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn __exposed(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u16) } } @@ -2136,6 +2262,28 @@ impl _php_stream { } } #[inline] + pub unsafe fn __exposed_raw(this: *const Self) -> u16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set___exposed_raw(this: *mut Self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn fclose_stdiocast(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 2u8) as u16) } } @@ -2147,6 +2295,28 @@ impl _php_stream { } } #[inline] + pub unsafe fn fclose_stdiocast_raw(this: *const Self) -> u16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 2u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_fclose_stdiocast_raw(this: *mut Self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 2u8, + val as u64, + ) + } + } + #[inline] pub fn has_buffered_data(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u16) } } @@ -2158,6 +2328,28 @@ impl _php_stream { } } #[inline] + pub unsafe fn has_buffered_data_raw(this: *const Self) -> u16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_has_buffered_data_raw(this: *mut Self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn fclose_stdiocast_flush_in_progress(&self) -> u16 { unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) } } @@ -2169,6 +2361,28 @@ impl _php_stream { } } #[inline] + pub unsafe fn fclose_stdiocast_flush_in_progress_raw(this: *const Self) -> u16 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 2usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 1u8, + ) as u16) + } + } + #[inline] + pub unsafe fn set_fclose_stdiocast_flush_in_progress_raw(this: *mut Self, val: u16) { + unsafe { + let val: u16 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 2usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn new_bitfield_1( is_persistent: u16, in_free: u16, @@ -2211,30 +2425,30 @@ impl _php_stream { __bindgen_bitfield_unit } } -extern "C" { +unsafe extern "C" { pub static mut php_stream_stdio_ops: php_stream_ops; } -extern "C" { +unsafe extern "C" { pub fn php_register_url_stream_wrapper( protocol: *const ::std::os::raw::c_char, wrapper: *const php_stream_wrapper, ) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn php_unregister_url_stream_wrapper( protocol: *const ::std::os::raw::c_char, ) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn php_register_url_stream_wrapper_volatile( protocol: *mut zend_string, wrapper: *mut php_stream_wrapper, ) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn php_unregister_url_stream_wrapper_volatile(protocol: *mut zend_string) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn php_stream_locate_url_wrapper( path: *const ::std::os::raw::c_char, path_for_open: *mut *const ::std::os::raw::c_char, @@ -2322,7 +2536,7 @@ pub struct _php_core_globals { pub syslog_filter: zend_long, pub error_log_mode: zend_long, } -extern "C" { +unsafe extern "C" { pub static mut core_globals: _php_core_globals; } #[repr(C)] @@ -2385,13 +2599,13 @@ pub struct _zend_ini_entry { pub orig_modifiable: u8, pub modified: u8, } -extern "C" { +unsafe extern "C" { pub fn zend_register_ini_entries( ini_entry: *const zend_ini_entry_def, module_number: ::std::os::raw::c_int, ) -> zend_result; } -extern "C" { +unsafe extern "C" { pub fn zend_register_bool_constant( name: *const ::std::os::raw::c_char, name_len: usize, @@ -2400,7 +2614,7 @@ extern "C" { module_number: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn zend_register_long_constant( name: *const ::std::os::raw::c_char, name_len: usize, @@ -2409,7 +2623,7 @@ extern "C" { module_number: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn zend_register_double_constant( name: *const ::std::os::raw::c_char, name_len: usize, @@ -2418,7 +2632,7 @@ extern "C" { module_number: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn zend_register_string_constant( name: *const ::std::os::raw::c_char, name_len: usize, @@ -2427,16 +2641,16 @@ extern "C" { module_number: ::std::os::raw::c_int, ); } -extern "C" { +unsafe extern "C" { pub fn php_info_print_table_header(num_cols: ::std::os::raw::c_int, ...); } -extern "C" { +unsafe extern "C" { pub fn php_info_print_table_row(num_cols: ::std::os::raw::c_int, ...); } -extern "C" { +unsafe extern "C" { pub fn php_info_print_table_start(); } -extern "C" { +unsafe extern "C" { pub fn php_info_print_table_end(); } #[repr(C)] @@ -2467,43 +2681,43 @@ pub struct php_file_globals { pub tmp_host_buf: *mut ::std::os::raw::c_char, pub tmp_host_buf_len: usize, } -extern "C" { +unsafe extern "C" { pub static mut file_globals: php_file_globals; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_throwable: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_exception: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_error_exception: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_compile_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_parse_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_type_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_argument_count_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_value_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_arithmetic_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_division_by_zero_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_unhandled_match_error: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub fn zend_throw_exception_ex( exception_ce: *mut zend_class_entry, code: zend_long, @@ -2511,31 +2725,31 @@ extern "C" { ... ) -> *mut zend_object; } -extern "C" { +unsafe extern "C" { pub fn zend_throw_exception_object(exception: *mut zval); } -extern "C" { +unsafe extern "C" { pub fn zend_do_implement_interface(ce: *mut zend_class_entry, iface: *mut zend_class_entry); } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_traversable: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_aggregate: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_iterator: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_arrayaccess: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_serializable: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_countable: *mut zend_class_entry; } -extern "C" { +unsafe extern "C" { pub static mut zend_ce_stringable: *mut zend_class_entry; } #[repr(C)] @@ -2555,7 +2769,7 @@ pub struct sapi_headers_struct { } pub type sapi_post_entry = _sapi_post_entry; pub type sapi_module_struct = _sapi_module_struct; -extern "C" { +unsafe extern "C" { pub static mut sapi_module: sapi_module_struct; } #[repr(C)] @@ -2605,13 +2819,13 @@ pub struct _sapi_globals_struct { pub fci_cache: zend_fcall_info_cache, } pub type sapi_globals_struct = _sapi_globals_struct; -extern "C" { +unsafe extern "C" { pub static mut sapi_globals: sapi_globals_struct; } -extern "C" { +unsafe extern "C" { pub fn sapi_startup(sf: *mut sapi_module_struct); } -extern "C" { +unsafe extern "C" { pub fn sapi_shutdown(); } pub const sapi_header_op_enum_SAPI_HEADER_REPLACE: sapi_header_op_enum = 0;