ohos_window_sys/native_window/buffer_handle/
buffer_handle_ffi.rs1#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6
7#[repr(C)]
8#[derive(Default)]
9pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
10impl<T> __IncompleteArrayField<T> {
11 #[inline]
12 pub const fn new() -> Self {
13 __IncompleteArrayField(::core::marker::PhantomData, [])
14 }
15 #[inline]
16 pub fn as_ptr(&self) -> *const T {
17 self as *const _ as *const T
18 }
19 #[inline]
20 pub fn as_mut_ptr(&mut self) -> *mut T {
21 self as *mut _ as *mut T
22 }
23 #[inline]
24 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
25 ::core::slice::from_raw_parts(self.as_ptr(), len)
26 }
27 #[inline]
28 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
29 ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
30 }
31}
32impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
33 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
34 fmt.write_str("__IncompleteArrayField")
35 }
36}
37#[repr(C)]
41#[derive(Debug)]
42pub struct BufferHandle {
43 pub fd: i32,
45 pub width: i32,
47 pub stride: i32,
49 pub height: i32,
51 pub size: i32,
52 pub format: i32,
54 pub usage: u64,
56 pub virAddr: *mut ::core::ffi::c_void,
58 pub key: i32,
60 pub phyAddr: u64,
62 pub reserveFds: u32,
64 pub reserveInts: u32,
66 pub reserve: __IncompleteArrayField<i32>,
68}