|
| 1 | +/* automatically generated by rust-bindgen */ |
| 2 | + |
| 3 | + |
| 4 | +#![allow(non_snake_case)] |
| 5 | + |
| 6 | + |
| 7 | +#[repr(C)] |
| 8 | +#[derive(Default)] |
| 9 | +pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>); |
| 10 | +impl <T> __IncompleteArrayField<T> { |
| 11 | + #[inline] |
| 12 | + pub fn new() -> Self { |
| 13 | + __IncompleteArrayField(::std::marker::PhantomData) |
| 14 | + } |
| 15 | + #[inline] |
| 16 | + pub unsafe fn as_ptr(&self) -> *const T { ::std::mem::transmute(self) } |
| 17 | + #[inline] |
| 18 | + pub unsafe fn as_mut_ptr(&mut self) -> *mut T { |
| 19 | + ::std::mem::transmute(self) |
| 20 | + } |
| 21 | + #[inline] |
| 22 | + pub unsafe fn as_slice(&self, len: usize) -> &[T] { |
| 23 | + ::std::slice::from_raw_parts(self.as_ptr(), len) |
| 24 | + } |
| 25 | + #[inline] |
| 26 | + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { |
| 27 | + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) |
| 28 | + } |
| 29 | +} |
| 30 | +impl <T> ::std::fmt::Debug for __IncompleteArrayField<T> { |
| 31 | + fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { |
| 32 | + fmt.write_str("__IncompleteArrayField") |
| 33 | + } |
| 34 | +} |
| 35 | +impl <T> ::std::clone::Clone for __IncompleteArrayField<T> { |
| 36 | + #[inline] |
| 37 | + fn clone(&self) -> Self { Self::new() } |
| 38 | +} |
| 39 | +impl <T> ::std::marker::Copy for __IncompleteArrayField<T> { } |
| 40 | +#[repr(C)] |
| 41 | +#[derive(Debug, Copy)] |
| 42 | +pub struct rte_ring { |
| 43 | + pub memzone: *mut rte_memzone, |
| 44 | + pub prod: rte_ring_prod, |
| 45 | + pub cons: rte_ring_cons, |
| 46 | + pub ring: __IncompleteArrayField<*mut ::std::os::raw::c_void>, |
| 47 | +} |
| 48 | +#[repr(C)] |
| 49 | +#[derive(Debug, Default, Copy)] |
| 50 | +pub struct rte_ring_prod { |
| 51 | + pub watermark: ::std::os::raw::c_uint, |
| 52 | +} |
| 53 | +#[test] |
| 54 | +fn bindgen_test_layout_rte_ring_prod() { |
| 55 | + assert_eq!(::std::mem::size_of::<rte_ring_prod>() , 4usize , concat ! ( |
| 56 | + "Size of: " , stringify ! ( rte_ring_prod ) )); |
| 57 | + assert_eq! (::std::mem::align_of::<rte_ring_prod>() , 4usize , concat ! ( |
| 58 | + "Alignment of " , stringify ! ( rte_ring_prod ) )); |
| 59 | + assert_eq! (unsafe { |
| 60 | + & ( * ( 0 as * const rte_ring_prod ) ) . watermark as * const |
| 61 | + _ as usize } , 0usize , concat ! ( |
| 62 | + "Alignment of field: " , stringify ! ( rte_ring_prod ) , "::" |
| 63 | + , stringify ! ( watermark ) )); |
| 64 | +} |
| 65 | +impl Clone for rte_ring_prod { |
| 66 | + fn clone(&self) -> Self { *self } |
| 67 | +} |
| 68 | +#[repr(C)] |
| 69 | +#[derive(Debug, Default, Copy)] |
| 70 | +pub struct rte_ring_cons { |
| 71 | + pub sc_dequeue: ::std::os::raw::c_uint, |
| 72 | +} |
| 73 | +#[test] |
| 74 | +fn bindgen_test_layout_rte_ring_cons() { |
| 75 | + assert_eq!(::std::mem::size_of::<rte_ring_cons>() , 4usize , concat ! ( |
| 76 | + "Size of: " , stringify ! ( rte_ring_cons ) )); |
| 77 | + assert_eq! (::std::mem::align_of::<rte_ring_cons>() , 4usize , concat ! ( |
| 78 | + "Alignment of " , stringify ! ( rte_ring_cons ) )); |
| 79 | + assert_eq! (unsafe { |
| 80 | + & ( * ( 0 as * const rte_ring_cons ) ) . sc_dequeue as * const |
| 81 | + _ as usize } , 0usize , concat ! ( |
| 82 | + "Alignment of field: " , stringify ! ( rte_ring_cons ) , "::" |
| 83 | + , stringify ! ( sc_dequeue ) )); |
| 84 | +} |
| 85 | +impl Clone for rte_ring_cons { |
| 86 | + fn clone(&self) -> Self { *self } |
| 87 | +} |
| 88 | +#[test] |
| 89 | +fn bindgen_test_layout_rte_ring() { |
| 90 | + assert_eq!(::std::mem::size_of::<rte_ring>() , 16usize , concat ! ( |
| 91 | + "Size of: " , stringify ! ( rte_ring ) )); |
| 92 | + assert_eq! (::std::mem::align_of::<rte_ring>() , 8usize , concat ! ( |
| 93 | + "Alignment of " , stringify ! ( rte_ring ) )); |
| 94 | +} |
| 95 | +impl Clone for rte_ring { |
| 96 | + fn clone(&self) -> Self { *self } |
| 97 | +} |
| 98 | +impl Default for rte_ring { |
| 99 | + fn default() -> Self { unsafe { ::std::mem::zeroed() } } |
| 100 | +} |
| 101 | +#[repr(C)] |
| 102 | +#[derive(Debug, Default, Copy)] |
| 103 | +pub struct rte_memzone { |
| 104 | + pub _address: u8, |
| 105 | +} |
| 106 | +impl Clone for rte_memzone { |
| 107 | + fn clone(&self) -> Self { *self } |
| 108 | +} |
0 commit comments