/* automatically generated by rust-bindgen */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct __BindgenBitfieldUnit where Storage: AsRef<[u8]> + AsMut<[u8]>, { storage: Storage, align: [Align; 0], } impl __BindgenBitfieldUnit where Storage: AsRef<[u8]> + AsMut<[u8]>, { #[inline] pub fn new(storage: Storage) -> Self { Self { storage, align: [] } } #[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]; 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 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]; 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 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 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); } } } pub const _LIBC_LIMITS_H_: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; pub const _BSD_SOURCE: u32 = 1; pub const _SVID_SOURCE: u32 = 1; pub const __USE_ISOC11: u32 = 1; pub const __USE_ISOC99: u32 = 1; pub const __USE_ISOC95: u32 = 1; pub const __USE_POSIX_IMPLICITLY: u32 = 1; pub const _POSIX_SOURCE: u32 = 1; pub const _POSIX_C_SOURCE: f64 = 200809.0; pub const __USE_POSIX: u32 = 1; pub const __USE_POSIX2: u32 = 1; pub const __USE_POSIX199309: u32 = 1; pub const __USE_POSIX199506: u32 = 1; pub const __USE_XOPEN2K: u32 = 1; pub const __USE_XOPEN2K8: u32 = 1; pub const _ATFILE_SOURCE: u32 = 1; pub const __USE_MISC: u32 = 1; pub const __USE_BSD: u32 = 1; pub const __USE_SVID: u32 = 1; pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_559_COMPLEX__: u32 = 1; pub const __STDC_ISO_10646__: f64 = 201103.0; pub const __STDC_NO_THREADS__: u32 = 1; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; pub const __GLIBC_MINOR__: u32 = 19; pub const _SYS_CDEFS_H: u32 = 1; pub const __WORDSIZE: u32 = 64; pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; pub const __SYSCALL_WORDSIZE: u32 = 64; pub const MB_LEN_MAX: u32 = 16; pub const _BITS_POSIX1_LIM_H: u32 = 1; pub const _POSIX_AIO_LISTIO_MAX: u32 = 2; pub const _POSIX_AIO_MAX: u32 = 1; pub const _POSIX_ARG_MAX: u32 = 4096; pub const _POSIX_CHILD_MAX: u32 = 25; pub const _POSIX_DELAYTIMER_MAX: u32 = 32; pub const _POSIX_HOST_NAME_MAX: u32 = 255; pub const _POSIX_LINK_MAX: u32 = 8; pub const _POSIX_LOGIN_NAME_MAX: u32 = 9; pub const _POSIX_MAX_CANON: u32 = 255; pub const _POSIX_MAX_INPUT: u32 = 255; pub const _POSIX_MQ_OPEN_MAX: u32 = 8; pub const _POSIX_MQ_PRIO_MAX: u32 = 32; pub const _POSIX_NAME_MAX: u32 = 14; pub const _POSIX_NGROUPS_MAX: u32 = 8; pub const _POSIX_OPEN_MAX: u32 = 20; pub const _POSIX_PATH_MAX: u32 = 256; pub const _POSIX_PIPE_BUF: u32 = 512; pub const _POSIX_RE_DUP_MAX: u32 = 255; pub const _POSIX_RTSIG_MAX: u32 = 8; pub const _POSIX_SEM_NSEMS_MAX: u32 = 256; pub const _POSIX_SEM_VALUE_MAX: u32 = 32767; pub const _POSIX_SIGQUEUE_MAX: u32 = 32; pub const _POSIX_SSIZE_MAX: u32 = 32767; pub const _POSIX_STREAM_MAX: u32 = 8; pub const _POSIX_SYMLINK_MAX: u32 = 255; pub const _POSIX_SYMLOOP_MAX: u32 = 8; pub const _POSIX_TIMER_MAX: u32 = 32; pub const _POSIX_TTY_NAME_MAX: u32 = 9; pub const _POSIX_TZNAME_MAX: u32 = 6; pub const _POSIX_CLOCKRES_MIN: u32 = 20000000; pub const NR_OPEN: u32 = 1024; pub const NGROUPS_MAX: u32 = 65536; pub const ARG_MAX: u32 = 131072; pub const LINK_MAX: u32 = 127; pub const MAX_CANON: u32 = 255; pub const MAX_INPUT: u32 = 255; pub const NAME_MAX: u32 = 255; pub const PATH_MAX: u32 = 4096; pub const PIPE_BUF: u32 = 4096; pub const XATTR_NAME_MAX: u32 = 255; pub const XATTR_SIZE_MAX: u32 = 65536; pub const XATTR_LIST_MAX: u32 = 65536; pub const RTSIG_MAX: u32 = 32; pub const _POSIX_THREAD_KEYS_MAX: u32 = 128; pub const PTHREAD_KEYS_MAX: u32 = 1024; pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4; pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4; pub const _POSIX_THREAD_THREADS_MAX: u32 = 64; pub const AIO_PRIO_DELTA_MAX: u32 = 20; pub const PTHREAD_STACK_MIN: u32 = 16384; pub const DELAYTIMER_MAX: u32 = 2147483647; pub const TTY_NAME_MAX: u32 = 32; pub const LOGIN_NAME_MAX: u32 = 256; pub const HOST_NAME_MAX: u32 = 64; pub const MQ_PRIO_MAX: u32 = 32768; pub const SEM_VALUE_MAX: u32 = 2147483647; pub const _BITS_POSIX2_LIM_H: u32 = 1; pub const _POSIX2_BC_BASE_MAX: u32 = 99; pub const _POSIX2_BC_DIM_MAX: u32 = 2048; pub const _POSIX2_BC_SCALE_MAX: u32 = 99; pub const _POSIX2_BC_STRING_MAX: u32 = 1000; pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2; pub const _POSIX2_EXPR_NEST_MAX: u32 = 32; pub const _POSIX2_LINE_MAX: u32 = 2048; pub const _POSIX2_RE_DUP_MAX: u32 = 255; pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14; pub const BC_BASE_MAX: u32 = 99; pub const BC_DIM_MAX: u32 = 2048; pub const BC_SCALE_MAX: u32 = 99; pub const BC_STRING_MAX: u32 = 1000; pub const COLL_WEIGHTS_MAX: u32 = 255; pub const EXPR_NEST_MAX: u32 = 32; pub const LINE_MAX: u32 = 2048; pub const CHARCLASS_NAME_MAX: u32 = 2048; pub const RE_DUP_MAX: u32 = 32767; pub const _STDINT_H: u32 = 1; pub const _BITS_WCHAR_H: u32 = 1; pub const INT8_MIN: i32 = -128; pub const INT16_MIN: i32 = -32768; pub const INT32_MIN: i32 = -2147483648; pub const INT8_MAX: u32 = 127; pub const INT16_MAX: u32 = 32767; pub const INT32_MAX: u32 = 2147483647; pub const UINT8_MAX: u32 = 255; pub const UINT16_MAX: u32 = 65535; pub const UINT32_MAX: u32 = 4294967295; pub const INT_LEAST8_MIN: i32 = -128; pub const INT_LEAST16_MIN: i32 = -32768; pub const INT_LEAST32_MIN: i32 = -2147483648; pub const INT_LEAST8_MAX: u32 = 127; pub const INT_LEAST16_MAX: u32 = 32767; pub const INT_LEAST32_MAX: u32 = 2147483647; pub const UINT_LEAST8_MAX: u32 = 255; pub const UINT_LEAST16_MAX: u32 = 65535; pub const UINT_LEAST32_MAX: u32 = 4294967295; pub const INT_FAST8_MIN: i32 = -128; pub const INT_FAST16_MIN: f64 = -9223372036854776000.0; pub const INT_FAST32_MIN: f64 = -9223372036854776000.0; pub const INT_FAST8_MAX: u32 = 127; pub const INT_FAST16_MAX: f64 = 9223372036854776000.0; pub const INT_FAST32_MAX: f64 = 9223372036854776000.0; pub const UINT_FAST8_MAX: u32 = 255; pub const UINT_FAST16_MAX: i32 = -1; pub const UINT_FAST32_MAX: i32 = -1; pub const INTPTR_MIN: f64 = -9223372036854776000.0; pub const INTPTR_MAX: f64 = 9223372036854776000.0; pub const UINTPTR_MAX: i32 = -1; pub const PTRDIFF_MIN: f64 = -9223372036854776000.0; pub const PTRDIFF_MAX: f64 = 9223372036854776000.0; pub const SIG_ATOMIC_MIN: i32 = -2147483648; pub const SIG_ATOMIC_MAX: u32 = 2147483647; pub const SIZE_MAX: i32 = -1; pub const WINT_MIN: u32 = 0; pub const WINT_MAX: u32 = 4294967295; pub const _STDLIB_H: u32 = 1; pub const WNOHANG: u32 = 1; pub const WUNTRACED: u32 = 2; pub const WSTOPPED: u32 = 2; pub const WEXITED: u32 = 4; pub const WCONTINUED: u32 = 8; pub const WNOWAIT: u32 = 16777216; pub const __WNOTHREAD: u32 = 536870912; pub const __WALL: u32 = 1073741824; pub const __WCLONE: u32 = 2147483648; pub const __ENUM_IDTYPE_T: u32 = 1; pub const __W_CONTINUED: u32 = 65535; pub const __WCOREFLAG: u32 = 128; pub const _ENDIAN_H: u32 = 1; pub const __LITTLE_ENDIAN: u32 = 1234; pub const __BIG_ENDIAN: u32 = 4321; pub const __PDP_ENDIAN: u32 = 3412; pub const __BYTE_ORDER: u32 = 1234; pub const __FLOAT_WORD_ORDER: u32 = 1234; pub const LITTLE_ENDIAN: u32 = 1234; pub const BIG_ENDIAN: u32 = 4321; pub const PDP_ENDIAN: u32 = 3412; pub const BYTE_ORDER: u32 = 1234; pub const _BITS_BYTESWAP_H: u32 = 1; pub const _BITS_TYPES_H: u32 = 1; pub const _BITS_TYPESIZES_H: u32 = 1; pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; pub const __INO_T_MATCHES_INO64_T: u32 = 1; pub const __FD_SETSIZE: u32 = 1024; pub const __ldiv_t_defined: u32 = 1; pub const __lldiv_t_defined: u32 = 1; pub const RAND_MAX: u32 = 2147483647; pub const EXIT_FAILURE: u32 = 1; pub const EXIT_SUCCESS: u32 = 0; pub const _SYS_TYPES_H: u32 = 1; pub const __clock_t_defined: u32 = 1; pub const __time_t_defined: u32 = 1; pub const __clockid_t_defined: u32 = 1; pub const __timer_t_defined: u32 = 1; pub const __BIT_TYPES_DEFINED__: u32 = 1; pub const _SYS_SELECT_H: u32 = 1; pub const __FD_ZERO_STOS: &'static [u8; 6usize] = b"stosq\0"; pub const _SIGSET_H_types: u32 = 1; pub const __timespec_defined: u32 = 1; pub const _STRUCT_TIMEVAL: u32 = 1; pub const FD_SETSIZE: u32 = 1024; pub const _SYS_SYSMACROS_H: u32 = 1; pub const _BITS_PTHREADTYPES_H: u32 = 1; pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; pub const __have_pthread_attr_t: u32 = 1; pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; pub const __PTHREAD_MUTEX_HAVE_ELISION: u32 = 1; pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: u32 = 1; pub const _ALLOCA_H: u32 = 1; pub const true_: u32 = 1; pub const false_: u32 = 0; pub const __bool_true_false_are_defined: u32 = 1; pub type int_least8_t = ::std::os::raw::c_schar; pub type int_least16_t = ::std::os::raw::c_short; pub type int_least32_t = ::std::os::raw::c_int; pub type int_least64_t = ::std::os::raw::c_long; pub type uint_least8_t = ::std::os::raw::c_uchar; pub type uint_least16_t = ::std::os::raw::c_ushort; pub type uint_least32_t = ::std::os::raw::c_uint; pub type uint_least64_t = ::std::os::raw::c_ulong; pub type int_fast8_t = ::std::os::raw::c_schar; pub type int_fast16_t = ::std::os::raw::c_long; pub type int_fast32_t = ::std::os::raw::c_long; pub type int_fast64_t = ::std::os::raw::c_long; pub type uint_fast8_t = ::std::os::raw::c_uchar; pub type uint_fast16_t = ::std::os::raw::c_ulong; pub type uint_fast32_t = ::std::os::raw::c_ulong; pub type uint_fast64_t = ::std::os::raw::c_ulong; pub type intmax_t = ::std::os::raw::c_long; pub type uintmax_t = ::std::os::raw::c_ulong; pub type wchar_t = ::std::os::raw::c_int; pub const idtype_t_P_ALL: idtype_t = 0; pub const idtype_t_P_PID: idtype_t = 1; pub const idtype_t_P_PGID: idtype_t = 2; pub type idtype_t = u32; pub type __u_char = ::std::os::raw::c_uchar; pub type __u_short = ::std::os::raw::c_ushort; pub type __u_int = ::std::os::raw::c_uint; pub type __u_long = ::std::os::raw::c_ulong; pub type __int8_t = ::std::os::raw::c_schar; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __int16_t = ::std::os::raw::c_short; pub type __uint16_t = ::std::os::raw::c_ushort; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; pub type __int64_t = ::std::os::raw::c_long; pub type __uint64_t = ::std::os::raw::c_ulong; pub type __quad_t = ::std::os::raw::c_long; pub type __u_quad_t = ::std::os::raw::c_ulong; pub type __dev_t = ::std::os::raw::c_ulong; pub type __uid_t = ::std::os::raw::c_uint; pub type __gid_t = ::std::os::raw::c_uint; pub type __ino_t = ::std::os::raw::c_ulong; pub type __ino64_t = ::std::os::raw::c_ulong; pub type __mode_t = ::std::os::raw::c_uint; pub type __nlink_t = ::std::os::raw::c_ulong; pub type __off_t = ::std::os::raw::c_long; pub type __off64_t = ::std::os::raw::c_long; pub type __pid_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __fsid_t { pub __val: [::std::os::raw::c_int; 2usize], } #[test] fn bindgen_test_layout___fsid_t() { assert_eq!( ::std::mem::size_of::<__fsid_t>(), 8usize, concat!("Size of: ", stringify!(__fsid_t)) ); assert_eq!( ::std::mem::align_of::<__fsid_t>(), 4usize, concat!("Alignment of ", stringify!(__fsid_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(__fsid_t), "::", stringify!(__val) ) ); } pub type __clock_t = ::std::os::raw::c_long; pub type __rlim_t = ::std::os::raw::c_ulong; pub type __rlim64_t = ::std::os::raw::c_ulong; pub type __id_t = ::std::os::raw::c_uint; pub type __time_t = ::std::os::raw::c_long; pub type __useconds_t = ::std::os::raw::c_uint; pub type __suseconds_t = ::std::os::raw::c_long; pub type __daddr_t = ::std::os::raw::c_int; pub type __key_t = ::std::os::raw::c_int; pub type __clockid_t = ::std::os::raw::c_int; pub type __timer_t = *mut ::std::os::raw::c_void; pub type __blksize_t = ::std::os::raw::c_long; pub type __blkcnt_t = ::std::os::raw::c_long; pub type __blkcnt64_t = ::std::os::raw::c_long; pub type __fsblkcnt_t = ::std::os::raw::c_ulong; pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; pub type __fsfilcnt_t = ::std::os::raw::c_ulong; pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; pub type __fsword_t = ::std::os::raw::c_long; pub type __ssize_t = ::std::os::raw::c_long; pub type __syscall_slong_t = ::std::os::raw::c_long; pub type __syscall_ulong_t = ::std::os::raw::c_ulong; pub type __loff_t = __off64_t; pub type __qaddr_t = *mut __quad_t; pub type __caddr_t = *mut ::std::os::raw::c_char; pub type __intptr_t = ::std::os::raw::c_long; pub type __socklen_t = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] pub union wait { pub w_status: ::std::os::raw::c_int, pub __wait_terminated: wait__bindgen_ty_1, pub __wait_stopped: wait__bindgen_ty_2, _bindgen_union_align: u32, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct wait__bindgen_ty_1 { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, pub __bindgen_align: [u32; 0usize], } #[test] fn bindgen_test_layout_wait__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(wait__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(wait__bindgen_ty_1)) ); } impl wait__bindgen_ty_1 { #[inline] pub fn __w_termsig(&self) -> ::std::os::raw::c_uint { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) } } #[inline] pub fn set___w_termsig(&mut self, val: ::std::os::raw::c_uint) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 7u8, val as u64) } } #[inline] pub fn __w_coredump(&self) -> ::std::os::raw::c_uint { unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } } #[inline] pub fn set___w_coredump(&mut self, val: ::std::os::raw::c_uint) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(7usize, 1u8, val as u64) } } #[inline] pub fn __w_retcode(&self) -> ::std::os::raw::c_uint { unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } } #[inline] pub fn set___w_retcode(&mut self, val: ::std::os::raw::c_uint) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(8usize, 8u8, val as u64) } } #[inline] pub fn new_bitfield_1( __w_termsig: ::std::os::raw::c_uint, __w_coredump: ::std::os::raw::c_uint, __w_retcode: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = Default::default(); __bindgen_bitfield_unit.set(0usize, 7u8, { let __w_termsig: u32 = unsafe { ::std::mem::transmute(__w_termsig) }; __w_termsig as u64 }); __bindgen_bitfield_unit.set(7usize, 1u8, { let __w_coredump: u32 = unsafe { ::std::mem::transmute(__w_coredump) }; __w_coredump as u64 }); __bindgen_bitfield_unit.set(8usize, 8u8, { let __w_retcode: u32 = unsafe { ::std::mem::transmute(__w_retcode) }; __w_retcode as u64 }); __bindgen_bitfield_unit } } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct wait__bindgen_ty_2 { pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize], u8>, pub __bindgen_align: [u32; 0usize], } #[test] fn bindgen_test_layout_wait__bindgen_ty_2() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(wait__bindgen_ty_2)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(wait__bindgen_ty_2)) ); } impl wait__bindgen_ty_2 { #[inline] pub fn __w_stopval(&self) -> ::std::os::raw::c_uint { unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } } #[inline] pub fn set___w_stopval(&mut self, val: ::std::os::raw::c_uint) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 8u8, val as u64) } } #[inline] pub fn __w_stopsig(&self) -> ::std::os::raw::c_uint { unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } } #[inline] pub fn set___w_stopsig(&mut self, val: ::std::os::raw::c_uint) { unsafe { let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(8usize, 8u8, val as u64) } } #[inline] pub fn new_bitfield_1( __w_stopval: ::std::os::raw::c_uint, __w_stopsig: ::std::os::raw::c_uint, ) -> __BindgenBitfieldUnit<[u8; 4usize], u8> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize], u8> = Default::default(); __bindgen_bitfield_unit.set(0usize, 8u8, { let __w_stopval: u32 = unsafe { ::std::mem::transmute(__w_stopval) }; __w_stopval as u64 }); __bindgen_bitfield_unit.set(8usize, 8u8, { let __w_stopsig: u32 = unsafe { ::std::mem::transmute(__w_stopsig) }; __w_stopsig as u64 }); __bindgen_bitfield_unit } } #[test] fn bindgen_test_layout_wait() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(wait)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(wait)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).w_status as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(wait), "::", stringify!(w_status) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__wait_terminated as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(wait), "::", stringify!(__wait_terminated) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__wait_stopped as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(wait), "::", stringify!(__wait_stopped) ) ); } #[repr(C)] #[derive(Copy, Clone)] pub union __WAIT_STATUS { pub __uptr: *mut wait, pub __iptr: *mut ::std::os::raw::c_int, _bindgen_union_align: u64, } #[test] fn bindgen_test_layout___WAIT_STATUS() { assert_eq!( ::std::mem::size_of::<__WAIT_STATUS>(), 8usize, concat!("Size of: ", stringify!(__WAIT_STATUS)) ); assert_eq!( ::std::mem::align_of::<__WAIT_STATUS>(), 8usize, concat!("Alignment of ", stringify!(__WAIT_STATUS)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<__WAIT_STATUS>())).__uptr as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(__WAIT_STATUS), "::", stringify!(__uptr) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<__WAIT_STATUS>())).__iptr as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(__WAIT_STATUS), "::", stringify!(__iptr) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct div_t { pub quot: ::std::os::raw::c_int, pub rem: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_div_t() { assert_eq!( ::std::mem::size_of::(), 8usize, concat!("Size of: ", stringify!(div_t)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(div_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(div_t), "::", stringify!(quot) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(div_t), "::", stringify!(rem) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ldiv_t { pub quot: ::std::os::raw::c_long, pub rem: ::std::os::raw::c_long, } #[test] fn bindgen_test_layout_ldiv_t() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(ldiv_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(ldiv_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(ldiv_t), "::", stringify!(quot) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(ldiv_t), "::", stringify!(rem) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lldiv_t { pub quot: ::std::os::raw::c_longlong, pub rem: ::std::os::raw::c_longlong, } #[test] fn bindgen_test_layout_lldiv_t() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(lldiv_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(lldiv_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(lldiv_t), "::", stringify!(quot) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(lldiv_t), "::", stringify!(rem) ) ); } extern "C" { pub fn __ctype_get_mb_cur_max() -> usize; } extern "C" { pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64; } extern "C" { pub fn atoi(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn atol(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; } extern "C" { pub fn atoll(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; } extern "C" { pub fn strtod( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, ) -> f64; } extern "C" { pub fn strtof( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, ) -> f32; } extern "C" { pub fn strtold( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, ) -> f64; } extern "C" { pub fn strtol( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_long; } extern "C" { pub fn strtoul( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_ulong; } extern "C" { pub fn strtoq( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_longlong; } extern "C" { pub fn strtouq( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_ulonglong; } extern "C" { pub fn strtoll( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_longlong; } extern "C" { pub fn strtoull( __nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_ulonglong; } extern "C" { pub fn l64a(__n: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn a64l(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; } pub type u_char = __u_char; pub type u_short = __u_short; pub type u_int = __u_int; pub type u_long = __u_long; pub type quad_t = __quad_t; pub type u_quad_t = __u_quad_t; pub type fsid_t = __fsid_t; pub type loff_t = __loff_t; pub type ino_t = __ino_t; pub type dev_t = __dev_t; pub type gid_t = __gid_t; pub type mode_t = __mode_t; pub type nlink_t = __nlink_t; pub type uid_t = __uid_t; pub type off_t = __off_t; pub type pid_t = __pid_t; pub type id_t = __id_t; pub type daddr_t = __daddr_t; pub type caddr_t = __caddr_t; pub type key_t = __key_t; pub type clock_t = __clock_t; pub type time_t = __time_t; pub type clockid_t = __clockid_t; pub type timer_t = __timer_t; pub type ulong = ::std::os::raw::c_ulong; pub type ushort = ::std::os::raw::c_ushort; pub type uint = ::std::os::raw::c_uint; pub type u_int8_t = ::std::os::raw::c_uchar; pub type u_int16_t = ::std::os::raw::c_ushort; pub type u_int32_t = ::std::os::raw::c_uint; pub type u_int64_t = ::std::os::raw::c_ulong; pub type register_t = ::std::os::raw::c_long; pub type __sig_atomic_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __sigset_t { pub __val: [::std::os::raw::c_ulong; 16usize], } #[test] fn bindgen_test_layout___sigset_t() { assert_eq!( ::std::mem::size_of::<__sigset_t>(), 128usize, concat!("Size of: ", stringify!(__sigset_t)) ); assert_eq!( ::std::mem::align_of::<__sigset_t>(), 8usize, concat!("Alignment of ", stringify!(__sigset_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<__sigset_t>())).__val as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(__sigset_t), "::", stringify!(__val) ) ); } pub type sigset_t = __sigset_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timespec { pub tv_sec: __time_t, pub tv_nsec: __syscall_slong_t, } #[test] fn bindgen_test_layout_timespec() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(timespec)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(timespec)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(timespec), "::", stringify!(tv_sec) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(timespec), "::", stringify!(tv_nsec) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct timeval { pub tv_sec: __time_t, pub tv_usec: __suseconds_t, } #[test] fn bindgen_test_layout_timeval() { assert_eq!( ::std::mem::size_of::(), 16usize, concat!("Size of: ", stringify!(timeval)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(timeval)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(timeval), "::", stringify!(tv_sec) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).tv_usec as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(timeval), "::", stringify!(tv_usec) ) ); } pub type suseconds_t = __suseconds_t; pub type __fd_mask = ::std::os::raw::c_long; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct fd_set { pub __fds_bits: [__fd_mask; 16usize], } #[test] fn bindgen_test_layout_fd_set() { assert_eq!( ::std::mem::size_of::(), 128usize, concat!("Size of: ", stringify!(fd_set)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(fd_set)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__fds_bits as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(fd_set), "::", stringify!(__fds_bits) ) ); } pub type fd_mask = __fd_mask; extern "C" { pub fn select( __nfds: ::std::os::raw::c_int, __readfds: *mut fd_set, __writefds: *mut fd_set, __exceptfds: *mut fd_set, __timeout: *mut timeval, ) -> ::std::os::raw::c_int; } extern "C" { pub fn pselect( __nfds: ::std::os::raw::c_int, __readfds: *mut fd_set, __writefds: *mut fd_set, __exceptfds: *mut fd_set, __timeout: *const timespec, __sigmask: *const __sigset_t, ) -> ::std::os::raw::c_int; } extern "C" { pub fn gnu_dev_major(__dev: ::std::os::raw::c_ulonglong) -> ::std::os::raw::c_uint; } extern "C" { pub fn gnu_dev_minor(__dev: ::std::os::raw::c_ulonglong) -> ::std::os::raw::c_uint; } extern "C" { pub fn gnu_dev_makedev( __major: ::std::os::raw::c_uint, __minor: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_ulonglong; } pub type blksize_t = __blksize_t; pub type blkcnt_t = __blkcnt_t; pub type fsblkcnt_t = __fsblkcnt_t; pub type fsfilcnt_t = __fsfilcnt_t; pub type pthread_t = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Copy, Clone)] pub union pthread_attr_t { pub __size: [::std::os::raw::c_char; 56usize], pub __align: ::std::os::raw::c_long, _bindgen_union_align: [u64; 7usize], } #[test] fn bindgen_test_layout_pthread_attr_t() { assert_eq!( ::std::mem::size_of::(), 56usize, concat!("Size of: ", stringify!(pthread_attr_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_attr_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_attr_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_attr_t), "::", stringify!(__align) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct __pthread_internal_list { pub __prev: *mut __pthread_internal_list, pub __next: *mut __pthread_internal_list, } #[test] fn bindgen_test_layout___pthread_internal_list() { assert_eq!( ::std::mem::size_of::<__pthread_internal_list>(), 16usize, concat!("Size of: ", stringify!(__pthread_internal_list)) ); assert_eq!( ::std::mem::align_of::<__pthread_internal_list>(), 8usize, concat!("Alignment of ", stringify!(__pthread_internal_list)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__prev as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(__pthread_internal_list), "::", stringify!(__prev) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__next as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(__pthread_internal_list), "::", stringify!(__next) ) ); } pub type __pthread_list_t = __pthread_internal_list; #[repr(C)] #[derive(Copy, Clone)] pub union pthread_mutex_t { pub __data: pthread_mutex_t___pthread_mutex_s, pub __size: [::std::os::raw::c_char; 40usize], pub __align: ::std::os::raw::c_long, _bindgen_union_align: [u64; 5usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pthread_mutex_t___pthread_mutex_s { pub __lock: ::std::os::raw::c_int, pub __count: ::std::os::raw::c_uint, pub __owner: ::std::os::raw::c_int, pub __nusers: ::std::os::raw::c_uint, pub __kind: ::std::os::raw::c_int, pub __spins: ::std::os::raw::c_short, pub __elision: ::std::os::raw::c_short, pub __list: __pthread_list_t, } #[test] fn bindgen_test_layout_pthread_mutex_t___pthread_mutex_s() { assert_eq!( ::std::mem::size_of::(), 40usize, concat!("Size of: ", stringify!(pthread_mutex_t___pthread_mutex_s)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!( "Alignment of ", stringify!(pthread_mutex_t___pthread_mutex_s) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__lock as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__lock) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__count as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__count) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__owner as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__owner) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__nusers as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__nusers) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__kind as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__kind) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__spins as *const _ as usize }, 20usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__spins) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__elision as *const _ as usize }, 22usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__elision) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__list as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t___pthread_mutex_s), "::", stringify!(__list) ) ); } #[test] fn bindgen_test_layout_pthread_mutex_t() { assert_eq!( ::std::mem::size_of::(), 40usize, concat!("Size of: ", stringify!(pthread_mutex_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_mutex_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t), "::", stringify!(__data) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_mutex_t), "::", stringify!(__align) ) ); } #[repr(C)] #[derive(Copy, Clone)] pub union pthread_mutexattr_t { pub __size: [::std::os::raw::c_char; 4usize], pub __align: ::std::os::raw::c_int, _bindgen_union_align: u32, } #[test] fn bindgen_test_layout_pthread_mutexattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(pthread_mutexattr_t)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(pthread_mutexattr_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_mutexattr_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_mutexattr_t), "::", stringify!(__align) ) ); } #[repr(C)] #[derive(Copy, Clone)] pub union pthread_cond_t { pub __data: pthread_cond_t__bindgen_ty_1, pub __size: [::std::os::raw::c_char; 48usize], pub __align: ::std::os::raw::c_longlong, _bindgen_union_align: [u64; 6usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pthread_cond_t__bindgen_ty_1 { pub __lock: ::std::os::raw::c_int, pub __futex: ::std::os::raw::c_uint, pub __total_seq: ::std::os::raw::c_ulonglong, pub __wakeup_seq: ::std::os::raw::c_ulonglong, pub __woken_seq: ::std::os::raw::c_ulonglong, pub __mutex: *mut ::std::os::raw::c_void, pub __nwaiters: ::std::os::raw::c_uint, pub __broadcast_seq: ::std::os::raw::c_uint, } #[test] fn bindgen_test_layout_pthread_cond_t__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 48usize, concat!("Size of: ", stringify!(pthread_cond_t__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_cond_t__bindgen_ty_1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__lock as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__lock) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__futex as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__futex) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__total_seq as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__total_seq) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__wakeup_seq as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__wakeup_seq) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__woken_seq as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__woken_seq) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__mutex as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__mutex) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__nwaiters as *const _ as usize }, 40usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__nwaiters) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__broadcast_seq as *const _ as usize }, 44usize, concat!( "Offset of field: ", stringify!(pthread_cond_t__bindgen_ty_1), "::", stringify!(__broadcast_seq) ) ); } #[test] fn bindgen_test_layout_pthread_cond_t() { assert_eq!( ::std::mem::size_of::(), 48usize, concat!("Size of: ", stringify!(pthread_cond_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_cond_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_cond_t), "::", stringify!(__data) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_cond_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_cond_t), "::", stringify!(__align) ) ); } #[repr(C)] #[derive(Copy, Clone)] pub union pthread_condattr_t { pub __size: [::std::os::raw::c_char; 4usize], pub __align: ::std::os::raw::c_int, _bindgen_union_align: u32, } #[test] fn bindgen_test_layout_pthread_condattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(pthread_condattr_t)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(pthread_condattr_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_condattr_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_condattr_t), "::", stringify!(__align) ) ); } pub type pthread_key_t = ::std::os::raw::c_uint; pub type pthread_once_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Copy, Clone)] pub union pthread_rwlock_t { pub __data: pthread_rwlock_t__bindgen_ty_1, pub __size: [::std::os::raw::c_char; 56usize], pub __align: ::std::os::raw::c_long, _bindgen_union_align: [u64; 7usize], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct pthread_rwlock_t__bindgen_ty_1 { pub __lock: ::std::os::raw::c_int, pub __nr_readers: ::std::os::raw::c_uint, pub __readers_wakeup: ::std::os::raw::c_uint, pub __writer_wakeup: ::std::os::raw::c_uint, pub __nr_readers_queued: ::std::os::raw::c_uint, pub __nr_writers_queued: ::std::os::raw::c_uint, pub __writer: ::std::os::raw::c_int, pub __shared: ::std::os::raw::c_int, pub __pad1: ::std::os::raw::c_ulong, pub __pad2: ::std::os::raw::c_ulong, pub __flags: ::std::os::raw::c_uint, } #[test] fn bindgen_test_layout_pthread_rwlock_t__bindgen_ty_1() { assert_eq!( ::std::mem::size_of::(), 56usize, concat!("Size of: ", stringify!(pthread_rwlock_t__bindgen_ty_1)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_rwlock_t__bindgen_ty_1)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__lock as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__lock) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__nr_readers as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__nr_readers) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__readers_wakeup as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__readers_wakeup) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__writer_wakeup as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__writer_wakeup) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__nr_readers_queued as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__nr_readers_queued) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__nr_writers_queued as *const _ as usize }, 20usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__nr_writers_queued) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__writer as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__writer) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__shared as *const _ as usize }, 28usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__shared) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__pad1 as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__pad1) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__pad2 as *const _ as usize }, 40usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__pad2) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__flags as *const _ as usize }, 48usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t__bindgen_ty_1), "::", stringify!(__flags) ) ); } #[test] fn bindgen_test_layout_pthread_rwlock_t() { assert_eq!( ::std::mem::size_of::(), 56usize, concat!("Size of: ", stringify!(pthread_rwlock_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_rwlock_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__data as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t), "::", stringify!(__data) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_rwlock_t), "::", stringify!(__align) ) ); } #[repr(C)] #[derive(Copy, Clone)] pub union pthread_rwlockattr_t { pub __size: [::std::os::raw::c_char; 8usize], pub __align: ::std::os::raw::c_long, _bindgen_union_align: u64, } #[test] fn bindgen_test_layout_pthread_rwlockattr_t() { assert_eq!( ::std::mem::size_of::(), 8usize, concat!("Size of: ", stringify!(pthread_rwlockattr_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_rwlockattr_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_rwlockattr_t), "::", stringify!(__align) ) ); } pub type pthread_spinlock_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Copy, Clone)] pub union pthread_barrier_t { pub __size: [::std::os::raw::c_char; 32usize], pub __align: ::std::os::raw::c_long, _bindgen_union_align: [u64; 4usize], } #[test] fn bindgen_test_layout_pthread_barrier_t() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(pthread_barrier_t)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(pthread_barrier_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_barrier_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_barrier_t), "::", stringify!(__align) ) ); } #[repr(C)] #[derive(Copy, Clone)] pub union pthread_barrierattr_t { pub __size: [::std::os::raw::c_char; 4usize], pub __align: ::std::os::raw::c_int, _bindgen_union_align: u32, } #[test] fn bindgen_test_layout_pthread_barrierattr_t() { assert_eq!( ::std::mem::size_of::(), 4usize, concat!("Size of: ", stringify!(pthread_barrierattr_t)) ); assert_eq!( ::std::mem::align_of::(), 4usize, concat!("Alignment of ", stringify!(pthread_barrierattr_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__size as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_barrierattr_t), "::", stringify!(__size) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__align as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(pthread_barrierattr_t), "::", stringify!(__align) ) ); } extern "C" { pub fn random() -> ::std::os::raw::c_long; } extern "C" { pub fn srandom(__seed: ::std::os::raw::c_uint); } extern "C" { pub fn initstate( __seed: ::std::os::raw::c_uint, __statebuf: *mut ::std::os::raw::c_char, __statelen: usize, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn setstate(__statebuf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct random_data { pub fptr: *mut i32, pub rptr: *mut i32, pub state: *mut i32, pub rand_type: ::std::os::raw::c_int, pub rand_deg: ::std::os::raw::c_int, pub rand_sep: ::std::os::raw::c_int, pub end_ptr: *mut i32, } #[test] fn bindgen_test_layout_random_data() { assert_eq!( ::std::mem::size_of::(), 48usize, concat!("Size of: ", stringify!(random_data)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(random_data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).fptr as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(random_data), "::", stringify!(fptr) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rptr as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(random_data), "::", stringify!(rptr) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).state as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(random_data), "::", stringify!(state) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rand_type as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(random_data), "::", stringify!(rand_type) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rand_deg as *const _ as usize }, 28usize, concat!( "Offset of field: ", stringify!(random_data), "::", stringify!(rand_deg) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).rand_sep as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(random_data), "::", stringify!(rand_sep) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).end_ptr as *const _ as usize }, 40usize, concat!( "Offset of field: ", stringify!(random_data), "::", stringify!(end_ptr) ) ); } extern "C" { pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::std::os::raw::c_int; } extern "C" { pub fn srandom_r( __seed: ::std::os::raw::c_uint, __buf: *mut random_data, ) -> ::std::os::raw::c_int; } extern "C" { pub fn initstate_r( __seed: ::std::os::raw::c_uint, __statebuf: *mut ::std::os::raw::c_char, __statelen: usize, __buf: *mut random_data, ) -> ::std::os::raw::c_int; } extern "C" { pub fn setstate_r( __statebuf: *mut ::std::os::raw::c_char, __buf: *mut random_data, ) -> ::std::os::raw::c_int; } extern "C" { pub fn rand() -> ::std::os::raw::c_int; } extern "C" { pub fn srand(__seed: ::std::os::raw::c_uint); } extern "C" { pub fn rand_r(__seed: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; } extern "C" { pub fn drand48() -> f64; } extern "C" { pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; } extern "C" { pub fn lrand48() -> ::std::os::raw::c_long; } extern "C" { pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; } extern "C" { pub fn mrand48() -> ::std::os::raw::c_long; } extern "C" { pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; } extern "C" { pub fn srand48(__seedval: ::std::os::raw::c_long); } extern "C" { pub fn seed48(__seed16v: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; } extern "C" { pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct drand48_data { pub __x: [::std::os::raw::c_ushort; 3usize], pub __old_x: [::std::os::raw::c_ushort; 3usize], pub __c: ::std::os::raw::c_ushort, pub __init: ::std::os::raw::c_ushort, pub __a: ::std::os::raw::c_ulonglong, } #[test] fn bindgen_test_layout_drand48_data() { assert_eq!( ::std::mem::size_of::(), 24usize, concat!("Size of: ", stringify!(drand48_data)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(drand48_data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__x as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(drand48_data), "::", stringify!(__x) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__old_x as *const _ as usize }, 6usize, concat!( "Offset of field: ", stringify!(drand48_data), "::", stringify!(__old_x) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__c as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(drand48_data), "::", stringify!(__c) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__init as *const _ as usize }, 14usize, concat!( "Offset of field: ", stringify!(drand48_data), "::", stringify!(__init) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__a as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(drand48_data), "::", stringify!(__a) ) ); } extern "C" { pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::std::os::raw::c_int; } extern "C" { pub fn erand48_r( __xsubi: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, __result: *mut f64, ) -> ::std::os::raw::c_int; } extern "C" { pub fn lrand48_r( __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } extern "C" { pub fn nrand48_r( __xsubi: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } extern "C" { pub fn mrand48_r( __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } extern "C" { pub fn jrand48_r( __xsubi: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long, ) -> ::std::os::raw::c_int; } extern "C" { pub fn srand48_r( __seedval: ::std::os::raw::c_long, __buffer: *mut drand48_data, ) -> ::std::os::raw::c_int; } extern "C" { pub fn seed48_r( __seed16v: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, ) -> ::std::os::raw::c_int; } extern "C" { pub fn lcong48_r( __param: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data, ) -> ::std::os::raw::c_int; } extern "C" { pub fn malloc(__size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn calloc(__nmemb: usize, __size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn realloc( __ptr: *mut ::std::os::raw::c_void, __size: usize, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn free(__ptr: *mut ::std::os::raw::c_void); } extern "C" { pub fn cfree(__ptr: *mut ::std::os::raw::c_void); } extern "C" { pub fn alloca(__size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn valloc(__size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn posix_memalign( __memptr: *mut *mut ::std::os::raw::c_void, __alignment: usize, __size: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn aligned_alloc(__alignment: usize, __size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn abort(); } extern "C" { pub fn atexit(__func: ::std::option::Option) -> ::std::os::raw::c_int; } extern "C" { pub fn at_quick_exit( __func: ::std::option::Option, ) -> ::std::os::raw::c_int; } extern "C" { pub fn on_exit( __func: ::std::option::Option< unsafe extern "C" fn( __status: ::std::os::raw::c_int, __arg: *mut ::std::os::raw::c_void, ), >, __arg: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn exit(__status: ::std::os::raw::c_int); } extern "C" { pub fn quick_exit(__status: ::std::os::raw::c_int); } extern "C" { pub fn _Exit(__status: ::std::os::raw::c_int); } extern "C" { pub fn getenv(__name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn putenv(__string: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn setenv( __name: *const ::std::os::raw::c_char, __value: *const ::std::os::raw::c_char, __replace: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn clearenv() -> ::std::os::raw::c_int; } extern "C" { pub fn mktemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn mkstemps( __template: *mut ::std::os::raw::c_char, __suffixlen: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn mkdtemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn realpath( __name: *const ::std::os::raw::c_char, __resolved: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } pub type __compar_fn_t = ::std::option::Option< unsafe extern "C" fn(arg1: *const ::std::os::raw::c_void, arg2: *const ::std::os::raw::c_void) -> ::std::os::raw::c_int, >; extern "C" { pub fn bsearch( __key: *const ::std::os::raw::c_void, __base: *const ::std::os::raw::c_void, __nmemb: usize, __size: usize, __compar: __compar_fn_t, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn qsort( __base: *mut ::std::os::raw::c_void, __nmemb: usize, __size: usize, __compar: __compar_fn_t, ); } extern "C" { pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; } extern "C" { pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; } extern "C" { pub fn div(__numer: ::std::os::raw::c_int, __denom: ::std::os::raw::c_int) -> div_t; } extern "C" { pub fn ldiv(__numer: ::std::os::raw::c_long, __denom: ::std::os::raw::c_long) -> ldiv_t; } extern "C" { pub fn lldiv( __numer: ::std::os::raw::c_longlong, __denom: ::std::os::raw::c_longlong, ) -> lldiv_t; } extern "C" { pub fn ecvt( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn fcvt( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn gcvt( __value: f64, __ndigit: ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn qecvt( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn qfcvt( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn qgcvt( __value: f64, __ndigit: ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn ecvt_r( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, __len: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn fcvt_r( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, __len: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn qecvt_r( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, __len: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn qfcvt_r( __value: f64, __ndigit: ::std::os::raw::c_int, __decpt: *mut ::std::os::raw::c_int, __sign: *mut ::std::os::raw::c_int, __buf: *mut ::std::os::raw::c_char, __len: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; } extern "C" { pub fn mbtowc( __pwc: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize, ) -> ::std::os::raw::c_int; } extern "C" { pub fn wctomb(__s: *mut ::std::os::raw::c_char, __wchar: wchar_t) -> ::std::os::raw::c_int; } extern "C" { pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize) -> usize; } extern "C" { pub fn wcstombs(__s: *mut ::std::os::raw::c_char, __pwcs: *const wchar_t, __n: usize) -> usize; } extern "C" { pub fn rpmatch(__response: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { pub fn getsubopt( __optionp: *mut *mut ::std::os::raw::c_char, __tokens: *const *mut ::std::os::raw::c_char, __valuep: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { pub fn getloadavg(__loadavg: *mut f64, __nelem: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct max_align_t { pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, pub __bindgen_padding_0: u64, pub __clang_max_align_nonce2: f64, } #[test] fn bindgen_test_layout_max_align_t() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(max_align_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__clang_max_align_nonce1 as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(max_align_t), "::", stringify!(__clang_max_align_nonce1) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).__clang_max_align_nonce2 as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(max_align_t), "::", stringify!(__clang_max_align_nonce2) ) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iio_context { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iio_device { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iio_channel { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iio_buffer { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iio_context_info { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iio_scan_context { _unused: [u8; 0], } pub const iio_chan_type_IIO_VOLTAGE: iio_chan_type = 0; pub const iio_chan_type_IIO_CURRENT: iio_chan_type = 1; pub const iio_chan_type_IIO_POWER: iio_chan_type = 2; pub const iio_chan_type_IIO_ACCEL: iio_chan_type = 3; pub const iio_chan_type_IIO_ANGL_VEL: iio_chan_type = 4; pub const iio_chan_type_IIO_MAGN: iio_chan_type = 5; pub const iio_chan_type_IIO_LIGHT: iio_chan_type = 6; pub const iio_chan_type_IIO_INTENSITY: iio_chan_type = 7; pub const iio_chan_type_IIO_PROXIMITY: iio_chan_type = 8; pub const iio_chan_type_IIO_TEMP: iio_chan_type = 9; pub const iio_chan_type_IIO_INCLI: iio_chan_type = 10; pub const iio_chan_type_IIO_ROT: iio_chan_type = 11; pub const iio_chan_type_IIO_ANGL: iio_chan_type = 12; pub const iio_chan_type_IIO_TIMESTAMP: iio_chan_type = 13; pub const iio_chan_type_IIO_CAPACITANCE: iio_chan_type = 14; pub const iio_chan_type_IIO_ALTVOLTAGE: iio_chan_type = 15; pub const iio_chan_type_IIO_CCT: iio_chan_type = 16; pub const iio_chan_type_IIO_PRESSURE: iio_chan_type = 17; pub const iio_chan_type_IIO_HUMIDITYRELATIVE: iio_chan_type = 18; pub const iio_chan_type_IIO_ACTIVITY: iio_chan_type = 19; pub const iio_chan_type_IIO_STEPS: iio_chan_type = 20; pub const iio_chan_type_IIO_ENERGY: iio_chan_type = 21; pub const iio_chan_type_IIO_DISTANCE: iio_chan_type = 22; pub const iio_chan_type_IIO_VELOCITY: iio_chan_type = 23; pub const iio_chan_type_IIO_CONCENTRATION: iio_chan_type = 24; pub const iio_chan_type_IIO_RESISTANCE: iio_chan_type = 25; pub const iio_chan_type_IIO_PH: iio_chan_type = 26; pub const iio_chan_type_IIO_UVINDEX: iio_chan_type = 27; pub const iio_chan_type_IIO_ELECTRICALCONDUCTIVITY: iio_chan_type = 28; pub const iio_chan_type_IIO_COUNT: iio_chan_type = 29; pub const iio_chan_type_IIO_INDEX: iio_chan_type = 30; pub const iio_chan_type_IIO_GRAVITY: iio_chan_type = 31; pub const iio_chan_type_IIO_CHAN_TYPE_UNKNOWN: iio_chan_type = 2147483647; /// @enum iio_chan_type /// @brief IIO channel type /// /// A IIO channel has a type specifying the type of data associated with the /// channel. pub type iio_chan_type = u32; pub const iio_modifier_IIO_NO_MOD: iio_modifier = 0; pub const iio_modifier_IIO_MOD_X: iio_modifier = 1; pub const iio_modifier_IIO_MOD_Y: iio_modifier = 2; pub const iio_modifier_IIO_MOD_Z: iio_modifier = 3; pub const iio_modifier_IIO_MOD_X_AND_Y: iio_modifier = 4; pub const iio_modifier_IIO_MOD_X_AND_Z: iio_modifier = 5; pub const iio_modifier_IIO_MOD_Y_AND_Z: iio_modifier = 6; pub const iio_modifier_IIO_MOD_X_AND_Y_AND_Z: iio_modifier = 7; pub const iio_modifier_IIO_MOD_X_OR_Y: iio_modifier = 8; pub const iio_modifier_IIO_MOD_X_OR_Z: iio_modifier = 9; pub const iio_modifier_IIO_MOD_Y_OR_Z: iio_modifier = 10; pub const iio_modifier_IIO_MOD_X_OR_Y_OR_Z: iio_modifier = 11; pub const iio_modifier_IIO_MOD_LIGHT_BOTH: iio_modifier = 12; pub const iio_modifier_IIO_MOD_LIGHT_IR: iio_modifier = 13; pub const iio_modifier_IIO_MOD_ROOT_SUM_SQUARED_X_Y: iio_modifier = 14; pub const iio_modifier_IIO_MOD_SUM_SQUARED_X_Y_Z: iio_modifier = 15; pub const iio_modifier_IIO_MOD_LIGHT_CLEAR: iio_modifier = 16; pub const iio_modifier_IIO_MOD_LIGHT_RED: iio_modifier = 17; pub const iio_modifier_IIO_MOD_LIGHT_GREEN: iio_modifier = 18; pub const iio_modifier_IIO_MOD_LIGHT_BLUE: iio_modifier = 19; pub const iio_modifier_IIO_MOD_QUATERNION: iio_modifier = 20; pub const iio_modifier_IIO_MOD_TEMP_AMBIENT: iio_modifier = 21; pub const iio_modifier_IIO_MOD_TEMP_OBJECT: iio_modifier = 22; pub const iio_modifier_IIO_MOD_NORTH_MAGN: iio_modifier = 23; pub const iio_modifier_IIO_MOD_NORTH_TRUE: iio_modifier = 24; pub const iio_modifier_IIO_MOD_NORTH_MAGN_TILT_COMP: iio_modifier = 25; pub const iio_modifier_IIO_MOD_NORTH_TRUE_TILT_COMP: iio_modifier = 26; pub const iio_modifier_IIO_MOD_RUNNING: iio_modifier = 27; pub const iio_modifier_IIO_MOD_JOGGING: iio_modifier = 28; pub const iio_modifier_IIO_MOD_WALKING: iio_modifier = 29; pub const iio_modifier_IIO_MOD_STILL: iio_modifier = 30; pub const iio_modifier_IIO_MOD_ROOT_SUM_SQUARED_X_Y_Z: iio_modifier = 31; pub const iio_modifier_IIO_MOD_I: iio_modifier = 32; pub const iio_modifier_IIO_MOD_Q: iio_modifier = 33; pub const iio_modifier_IIO_MOD_CO2: iio_modifier = 34; pub const iio_modifier_IIO_MOD_VOC: iio_modifier = 35; pub const iio_modifier_IIO_MOD_LIGHT_UV: iio_modifier = 36; /// @enum iio_modifier /// @brief IIO channel modifier /// /// In a addition to a type a IIO channel can optionally have a channel modifier /// further specifying the data type of of the channel. pub type iio_modifier = u32; extern "C" { /// @brief Create a scan context /// @param backend A NULL-terminated string containing the backend to use for /// scanning. If NULL, all the available backends are used. /// @param flags Unused for now. Set to 0. /// @return on success, a pointer to a iio_scan_context structure /// @return On failure, NULL is returned and errno is set appropriately pub fn iio_create_scan_context( backend: *const ::std::os::raw::c_char, flags: ::std::os::raw::c_uint, ) -> *mut iio_scan_context; } extern "C" { /// @brief Destroy the given scan context /// @param ctx A pointer to an iio_scan_context structure /// /// NOTE: After that function, the iio_scan_context pointer shall be invalid. pub fn iio_scan_context_destroy(ctx: *mut iio_scan_context); } extern "C" { /// @brief Enumerate available contexts /// @param ctx A pointer to an iio_scan_context structure /// @param info A pointer to a 'const struct iio_context_info **' typed variable. /// The pointed variable will be initialized on success. /// @returns On success, the number of contexts found. /// @returns On failure, a negative error number. pub fn iio_scan_context_get_info_list( ctx: *mut iio_scan_context, info: *mut *mut *mut iio_context_info, ) -> isize; } extern "C" { /// @brief Free a context info list /// @param info A pointer to a 'const struct iio_context_info *' typed variable pub fn iio_context_info_list_free(info: *mut *mut iio_context_info); } extern "C" { /// @brief Get a description of a discovered context /// @param info A pointer to an iio_context_info structure /// @return A pointer to a static NULL-terminated string pub fn iio_context_info_get_description( info: *const iio_context_info, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Get the URI of a discovered context /// @param info A pointer to an iio_context_info structure /// @return A pointer to a static NULL-terminated string pub fn iio_context_info_get_uri(info: *const iio_context_info) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Get the version of the libiio library /// @param major A pointer to an unsigned integer (NULL accepted) /// @param minor A pointer to an unsigned integer (NULL accepted) /// @param git_tag A pointer to a 8-characters buffer (NULL accepted) pub fn iio_library_get_version( major: *mut ::std::os::raw::c_uint, minor: *mut ::std::os::raw::c_uint, git_tag: *mut ::std::os::raw::c_char, ); } extern "C" { /// @brief Get a string description of an error code /// @param err The error code /// @param dst A pointer to the memory area where the NULL-terminated string /// corresponding to the error message will be stored /// @param len The available length of the memory area, in bytes pub fn iio_strerror(err: ::std::os::raw::c_int, dst: *mut ::std::os::raw::c_char, len: usize); } extern "C" { /// @brief Check if the specified backend is available /// @param backend The name of the backend to query /// @return True if the backend is available, false otherwise /// /// Introduced in version 0.9. pub fn iio_has_backend(backend: *const ::std::os::raw::c_char) -> bool; } extern "C" { /// @brief Get the number of available backends /// @return The number of available backends /// /// Introduced in version 0.9. pub fn iio_get_backends_count() -> ::std::os::raw::c_uint; } extern "C" { /// @brief Retrieve the name of a given backend /// @param index The index corresponding to the attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the index is invalid, NULL is returned /// /// Introduced in version 0.9. pub fn iio_get_backend(index: ::std::os::raw::c_uint) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Create a context from local or remote IIO devices /// @return On success, A pointer to an iio_context structure /// @return On failure, NULL is returned and errno is set appropriately /// /// NOTE: This function will create a network context if the IIOD_REMOTE /// environment variable is set to the hostname where the IIOD server runs. If /// set to an empty string, the server will be discovered using ZeroConf. /// If the environment variable is not set, a local context will be created /// instead. pub fn iio_create_default_context() -> *mut iio_context; } extern "C" { /// @brief Create a context from local IIO devices (Linux only) /// @return On success, A pointer to an iio_context structure /// @return On failure, NULL is returned and errno is set appropriately pub fn iio_create_local_context() -> *mut iio_context; } extern "C" { /// @brief Create a context from a XML file /// @param xml_file Path to the XML file to open /// @return On success, A pointer to an iio_context structure /// @return On failure, NULL is returned and errno is set appropriately /// /// NOTE: The format of the XML must comply to the one returned by /// iio_context_get_xml. pub fn iio_create_xml_context(xml_file: *const ::std::os::raw::c_char) -> *mut iio_context; } extern "C" { /// @brief Create a context from XML data in memory /// @param xml Pointer to the XML data in memory /// @param len Length of the XML string in memory (excluding the final \0) /// @return On success, A pointer to an iio_context structure /// @return On failure, NULL is returned and errno is set appropriately /// /// NOTE: The format of the XML must comply to the one returned by /// iio_context_get_xml pub fn iio_create_xml_context_mem( xml: *const ::std::os::raw::c_char, len: usize, ) -> *mut iio_context; } extern "C" { /// @brief Create a context from the network /// @param host Hostname, IPv4 or IPv6 address where the IIO Daemon is running /// @return On success, a pointer to an iio_context structure /// @return On failure, NULL is returned and errno is set appropriately pub fn iio_create_network_context(host: *const ::std::os::raw::c_char) -> *mut iio_context; } extern "C" { /// @brief Create a context from a URI description /// @param uri A URI describing the context location /// @return On success, a pointer to a iio_context structure /// @return On failure, NULL is returned and errno is set appropriately pub fn iio_create_context_from_uri(uri: *const ::std::os::raw::c_char) -> *mut iio_context; } extern "C" { /// @brief Duplicate a pre-existing IIO context /// @param ctx A pointer to an iio_context structure /// @return On success, A pointer to an iio_context structure /// @return On failure, NULL is returned and errno is set appropriately pub fn iio_context_clone(ctx: *const iio_context) -> *mut iio_context; } extern "C" { /// @brief Destroy the given context /// @param ctx A pointer to an iio_context structure /// /// NOTE: After that function, the iio_context pointer shall be invalid. pub fn iio_context_destroy(ctx: *mut iio_context); } extern "C" { /// @brief Get the version of the backend in use /// @param ctx A pointer to an iio_context structure /// @param major A pointer to an unsigned integer (NULL accepted) /// @param minor A pointer to an unsigned integer (NULL accepted) /// @param git_tag A pointer to a 8-characters buffer (NULL accepted) /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_context_get_version( ctx: *const iio_context, major: *mut ::std::os::raw::c_uint, minor: *mut ::std::os::raw::c_uint, git_tag: *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Obtain a XML representation of the given context /// @param ctx A pointer to an iio_context structure /// @return A pointer to a static NULL-terminated string pub fn iio_context_get_xml(ctx: *const iio_context) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Get the name of the given context /// @param ctx A pointer to an iio_context structure /// @return A pointer to a static NULL-terminated string /// /// NOTE:The returned string will be local, /// xml or network when the context has been /// created with the local, xml and network backends respectively. pub fn iio_context_get_name(ctx: *const iio_context) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Get a description of the given context /// @param ctx A pointer to an iio_context structure /// @return A pointer to a static NULL-terminated string /// /// NOTE:The returned string will contain human-readable information about /// the current context. pub fn iio_context_get_description(ctx: *const iio_context) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Get the number of context-specific attributes /// @param ctx A pointer to an iio_context structure /// @return The number of context-specific attributes /// /// Introduced in version 0.9. pub fn iio_context_get_attrs_count(ctx: *const iio_context) -> ::std::os::raw::c_uint; } extern "C" { /// @brief Retrieve the name and value of a context-specific attribute /// @param ctx A pointer to an iio_context structure /// @param index The index corresponding to the attribute /// @param name A pointer to a const char * pointer (NULL accepted) /// @param value A pointer to a const char * pointer (NULL accepted) /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// Introduced in version 0.9. pub fn iio_context_get_attr( ctx: *const iio_context, index: ::std::os::raw::c_uint, name: *mut *const ::std::os::raw::c_char, value: *mut *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Retrieve the value of a context-specific attribute /// @param ctx A pointer to an iio_context structure /// @param name The name of the context attribute to read /// @return On success, a pointer to a static NULL-terminated string /// @return If the name does not correspond to any attribute, NULL is /// returned /// /// Introduced in version 0.9. pub fn iio_context_get_attr_value( ctx: *const iio_context, name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Enumerate the devices found in the given context /// @param ctx A pointer to an iio_context structure /// @return The number of devices found pub fn iio_context_get_devices_count(ctx: *const iio_context) -> ::std::os::raw::c_uint; } extern "C" { /// @brief Get the device present at the given index /// @param ctx A pointer to an iio_context structure /// @param index The index corresponding to the device /// @return On success, a pointer to an iio_device structure /// @return If the index is invalid, NULL is returned pub fn iio_context_get_device( ctx: *const iio_context, index: ::std::os::raw::c_uint, ) -> *mut iio_device; } extern "C" { /// @brief Try to find a device structure by its name of ID /// @param ctx A pointer to an iio_context structure /// @param name A NULL-terminated string corresponding to the name or the ID of /// the device to search for /// @return On success, a pointer to an iio_device structure /// @return If the name or ID does not correspond to any known device, NULL is /// returned pub fn iio_context_find_device( ctx: *const iio_context, name: *const ::std::os::raw::c_char, ) -> *mut iio_device; } extern "C" { /// @brief Set a timeout for I/O operations /// @param ctx A pointer to an iio_context structure /// @param timeout_ms A positive integer representing the time in milliseconds /// after which a timeout occurs. A value of 0 is used to specify that no /// timeout should occur. /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_context_set_timeout( ctx: *mut iio_context, timeout_ms: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Retrieve a pointer to the iio_context structure /// @param dev A pointer to an iio_device structure /// @return A pointer to an iio_context structure pub fn iio_device_get_context(dev: *const iio_device) -> *const iio_context; } extern "C" { /// @brief Retrieve the device ID (e.g. iio:device0) /// @param dev A pointer to an iio_device structure /// @return A pointer to a static NULL-terminated string pub fn iio_device_get_id(dev: *const iio_device) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Retrieve the device name (e.g. xadc) /// @param dev A pointer to an iio_device structure /// @return A pointer to a static NULL-terminated string /// /// NOTE: if the device has no name, NULL is returned. pub fn iio_device_get_name(dev: *const iio_device) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Enumerate the channels of the given device /// @param dev A pointer to an iio_device structure /// @return The number of channels found pub fn iio_device_get_channels_count(dev: *const iio_device) -> ::std::os::raw::c_uint; } extern "C" { /// @brief Enumerate the device-specific attributes of the given device /// @param dev A pointer to an iio_device structure /// @return The number of device-specific attributes found pub fn iio_device_get_attrs_count(dev: *const iio_device) -> ::std::os::raw::c_uint; } extern "C" { /// @brief Enumerate the buffer-specific attributes of the given device /// @param dev A pointer to an iio_device structure /// @return The number of buffer-specific attributes found pub fn iio_device_get_buffer_attrs_count(dev: *const iio_device) -> ::std::os::raw::c_uint; } extern "C" { /// @brief Get the channel present at the given index /// @param dev A pointer to an iio_device structure /// @param index The index corresponding to the channel /// @return On success, a pointer to an iio_channel structure /// @return If the index is invalid, NULL is returned pub fn iio_device_get_channel( dev: *const iio_device, index: ::std::os::raw::c_uint, ) -> *mut iio_channel; } extern "C" { /// @brief Get the device-specific attribute present at the given index /// @param dev A pointer to an iio_device structure /// @param index The index corresponding to the attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the index is invalid, NULL is returned pub fn iio_device_get_attr( dev: *const iio_device, index: ::std::os::raw::c_uint, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Get the buffer-specific attribute present at the given index /// @param dev A pointer to an iio_device structure /// @param index The index corresponding to the attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the index is invalid, NULL is returned pub fn iio_device_get_buffer_attr( dev: *const iio_device, index: ::std::os::raw::c_uint, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Try to find a channel structure by its name of ID /// @param dev A pointer to an iio_device structure /// @param name A NULL-terminated string corresponding to the name or the ID of /// the channel to search for /// @param output True if the searched channel is output, False otherwise /// @return On success, a pointer to an iio_channel structure /// @return If the name or ID does not correspond to any known channel of the /// given device, NULL is returned pub fn iio_device_find_channel( dev: *const iio_device, name: *const ::std::os::raw::c_char, output: bool, ) -> *mut iio_channel; } extern "C" { /// @brief Try to find a device-specific attribute by its name /// @param dev A pointer to an iio_device structure /// @param name A NULL-terminated string corresponding to the name of the /// attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the name does not correspond to any known attribute of the given /// device, NULL is returned /// /// NOTE: This function is useful to detect the presence of an attribute. /// It can also be used to retrieve the name of an attribute as a pointer to a /// static string from a dynamically allocated string. pub fn iio_device_find_attr( dev: *const iio_device, name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Try to find a buffer-specific attribute by its name /// @param dev A pointer to an iio_device structure /// @param name A NULL-terminated string corresponding to the name of the /// attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the name does not correspond to any known attribute of the given /// device, NULL is returned /// /// NOTE: This function is useful to detect the presence of an attribute. /// It can also be used to retrieve the name of an attribute as a pointer to a /// static string from a dynamically allocated string. pub fn iio_device_find_buffer_attr( dev: *const iio_device, name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Read the content of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param dst A pointer to the memory area where the NULL-terminated string /// corresponding to the value read will be stored /// @param len The available length of the memory area, in bytes /// @return On success, the number of bytes written to the buffer /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to iio_device_attr_read, /// it is now possible to read all of the attributes of a device. /// /// The buffer is filled with one block of data per attribute of the device, /// by the order they appear in the iio_device structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, it corresponds to the errno code that were /// returned when reading the attribute; if positive, it corresponds to the /// length of the data read. In that case, the rest of the block contains /// the data. pub fn iio_device_attr_read( dev: *const iio_device, attr: *const ::std::os::raw::c_char, dst: *mut ::std::os::raw::c_char, len: usize, ) -> isize; } extern "C" { /// @brief Read the content of all device-specific attributes /// @param dev A pointer to an iio_device structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the device-specific attributes are read in one single /// command. pub fn iio_device_attr_read_all( dev: *mut iio_device, cb: ::std::option::Option< unsafe extern "C" fn( dev: *mut iio_device, attr: *const ::std::os::raw::c_char, value: *const ::std::os::raw::c_char, len: usize, d: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a bool variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_attr_read_bool( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a long long variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_attr_read_longlong( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a double variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_attr_read_double( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param src A NULL-terminated string to set the attribute to /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to iio_device_attr_write, /// it is now possible to write all of the attributes of a device. /// /// The buffer must contain one block of data per attribute of the device, /// by the order they appear in the iio_device structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, the attribute is not written; if positive, /// it corresponds to the length of the data to write. In that case, the rest /// of the block must contain the data. pub fn iio_device_attr_write( dev: *const iio_device, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_char, ) -> isize; } extern "C" { /// @brief Set the value of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param src A pointer to the data to be written /// @param len The number of bytes that should be written /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned pub fn iio_device_attr_write_raw( dev: *const iio_device, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_void, len: usize, ) -> isize; } extern "C" { /// @brief Set the values of all device-specific attributes /// @param dev A pointer to an iio_device structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the device-specific attributes are written in one single /// command. pub fn iio_device_attr_write_all( dev: *mut iio_device, cb: ::std::option::Option< unsafe extern "C" fn( dev: *mut iio_device, attr: *const ::std::os::raw::c_char, buf: *mut ::std::os::raw::c_void, len: usize, d: *mut ::std::os::raw::c_void, ) -> isize, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A bool value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_attr_write_bool( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A long long value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_attr_write_longlong( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given device-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A double value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_attr_write_double( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param dst A pointer to the memory area where the NULL-terminated string /// corresponding to the value read will be stored /// @param len The available length of the memory area, in bytes /// @return On success, the number of bytes written to the buffer /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to /// iio_device_buffer_attr_read, it is now possible to read all of the attributes /// of a device. /// /// The buffer is filled with one block of data per attribute of the buffer, /// by the order they appear in the iio_device structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, it corresponds to the errno code that were /// returned when reading the attribute; if positive, it corresponds to the /// length of the data read. In that case, the rest of the block contains /// the data. pub fn iio_device_buffer_attr_read( dev: *const iio_device, attr: *const ::std::os::raw::c_char, dst: *mut ::std::os::raw::c_char, len: usize, ) -> isize; } extern "C" { /// @brief Read the content of all buffer-specific attributes /// @param dev A pointer to an iio_device structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the buffer-specific attributes are read in one single /// command. pub fn iio_device_buffer_attr_read_all( dev: *mut iio_device, cb: ::std::option::Option< unsafe extern "C" fn( dev: *mut iio_device, attr: *const ::std::os::raw::c_char, value: *const ::std::os::raw::c_char, len: usize, d: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a bool variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_buffer_attr_read_bool( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a long long variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_buffer_attr_read_longlong( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a double variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_buffer_attr_read_double( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param src A NULL-terminated string to set the attribute to /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to /// iio_device_buffer_attr_write, it is now possible to write all of the /// attributes of a device. /// /// The buffer must contain one block of data per attribute of the buffer, /// by the order they appear in the iio_device structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, the attribute is not written; if positive, /// it corresponds to the length of the data to write. In that case, the rest /// of the block must contain the data. pub fn iio_device_buffer_attr_write( dev: *const iio_device, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_char, ) -> isize; } extern "C" { /// @brief Set the value of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param src A pointer to the data to be written /// @param len The number of bytes that should be written /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned pub fn iio_device_buffer_attr_write_raw( dev: *const iio_device, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_void, len: usize, ) -> isize; } extern "C" { /// @brief Set the values of all buffer-specific attributes /// @param dev A pointer to an iio_device structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the buffer-specific attributes are written in one single /// command. pub fn iio_device_buffer_attr_write_all( dev: *mut iio_device, cb: ::std::option::Option< unsafe extern "C" fn( dev: *mut iio_device, attr: *const ::std::os::raw::c_char, buf: *mut ::std::os::raw::c_void, len: usize, d: *mut ::std::os::raw::c_void, ) -> isize, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A bool value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_buffer_attr_write_bool( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A long long value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_buffer_attr_write_longlong( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given buffer-specific attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A double value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_buffer_attr_write_double( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Associate a pointer to an iio_device structure /// @param dev A pointer to an iio_device structure /// @param data The pointer to be associated pub fn iio_device_set_data(dev: *mut iio_device, data: *mut ::std::os::raw::c_void); } extern "C" { /// @brief Retrieve a previously associated pointer of an iio_device structure /// @param dev A pointer to an iio_device structure /// @return The pointer previously associated if present, or NULL pub fn iio_device_get_data(dev: *const iio_device) -> *mut ::std::os::raw::c_void; } extern "C" { /// @brief Retrieve the trigger of a given device /// @param dev A pointer to an iio_device structure /// @param trigger a pointer to a pointer of an iio_device structure. The pointed /// pointer will be set to the address of the iio_device structure corresponding /// to the associated trigger device. /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_get_trigger( dev: *const iio_device, trigger: *mut *const iio_device, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Associate a trigger to a given device /// @param dev A pointer to an iio_device structure /// @param trigger a pointer to the iio_device structure corresponding to the /// trigger that should be associated. /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_set_trigger( dev: *const iio_device, trigger: *const iio_device, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Return True if the given device is a trigger /// @param dev A pointer to an iio_device structure /// @return True if the device is a trigger, False otherwise pub fn iio_device_is_trigger(dev: *const iio_device) -> bool; } extern "C" { /// @brief Configure the number of kernel buffers for a device /// /// This function allows to change the number of buffers on kernel side. /// @param dev A pointer to an iio_device structure /// @param nb_buffers The number of buffers /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_set_kernel_buffers_count( dev: *const iio_device, nb_buffers: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Retrieve a pointer to the iio_device structure /// @param chn A pointer to an iio_channel structure /// @return A pointer to an iio_device structure pub fn iio_channel_get_device(chn: *const iio_channel) -> *const iio_device; } extern "C" { /// @brief Retrieve the channel ID (e.g. voltage0) /// @param chn A pointer to an iio_channel structure /// @return A pointer to a static NULL-terminated string pub fn iio_channel_get_id(chn: *const iio_channel) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Retrieve the channel name (e.g. vccint) /// @param chn A pointer to an iio_channel structure /// @return A pointer to a static NULL-terminated string /// /// NOTE: if the channel has no name, NULL is returned. pub fn iio_channel_get_name(chn: *const iio_channel) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Return True if the given channel is an output channel /// @param chn A pointer to an iio_channel structure /// @return True if the channel is an output channel, False otherwise pub fn iio_channel_is_output(chn: *const iio_channel) -> bool; } extern "C" { /// @brief Return True if the given channel is a scan element /// @param chn A pointer to an iio_channel structure /// @return True if the channel is a scan element, False otherwise /// /// NOTE: a channel that is a scan element is a channel that can /// generate samples (for an input channel) or receive samples (for an output /// channel) after being enabled. pub fn iio_channel_is_scan_element(chn: *const iio_channel) -> bool; } extern "C" { /// @brief Enumerate the channel-specific attributes of the given channel /// @param chn A pointer to an iio_channel structure /// @return The number of channel-specific attributes found pub fn iio_channel_get_attrs_count(chn: *const iio_channel) -> ::std::os::raw::c_uint; } extern "C" { /// @brief Get the channel-specific attribute present at the given index /// @param chn A pointer to an iio_channel structure /// @param index The index corresponding to the attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the index is invalid, NULL is returned pub fn iio_channel_get_attr( chn: *const iio_channel, index: ::std::os::raw::c_uint, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Try to find a channel-specific attribute by its name /// @param chn A pointer to an iio_channel structure /// @param name A NULL-terminated string corresponding to the name of the /// attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the name does not correspond to any known attribute of the given /// channel, NULL is returned /// /// NOTE: This function is useful to detect the presence of an attribute. /// It can also be used to retrieve the name of an attribute as a pointer to a /// static string from a dynamically allocated string. pub fn iio_channel_find_attr( chn: *const iio_channel, name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Retrieve the filename of an attribute /// @param chn A pointer to an iio_channel structure /// @param attr a NULL-terminated string corresponding to the name of the /// attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the attribute name is unknown, NULL is returned pub fn iio_channel_attr_get_filename( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Read the content of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param dst A pointer to the memory area where the NULL-terminated string /// corresponding to the value read will be stored /// @param len The available length of the memory area, in bytes /// @return On success, the number of bytes written to the buffer /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to iio_channel_attr_read, /// it is now possible to read all of the attributes of a channel. /// /// The buffer is filled with one block of data per attribute of the channel, /// by the order they appear in the iio_channel structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, it corresponds to the errno code that were /// returned when reading the attribute; if positive, it corresponds to the /// length of the data read. In that case, the rest of the block contains /// the data. pub fn iio_channel_attr_read( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, dst: *mut ::std::os::raw::c_char, len: usize, ) -> isize; } extern "C" { /// @brief Read the content of all channel-specific attributes /// @param chn A pointer to an iio_channel structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the channel-specific attributes are read in one single /// command. pub fn iio_channel_attr_read_all( chn: *mut iio_channel, cb: ::std::option::Option< unsafe extern "C" fn( chn: *mut iio_channel, attr: *const ::std::os::raw::c_char, val: *const ::std::os::raw::c_char, len: usize, d: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a bool variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_channel_attr_read_bool( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, val: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a long long variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_channel_attr_read_longlong( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, val: *mut ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A pointer to a double variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_channel_attr_read_double( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, val: *mut f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param src A NULL-terminated string to set the attribute to /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to iio_channel_attr_write, /// it is now possible to write all of the attributes of a channel. /// /// The buffer must contain one block of data per attribute of the channel, /// by the order they appear in the iio_channel structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, the attribute is not written; if positive, /// it corresponds to the length of the data to write. In that case, the rest /// of the block must contain the data. pub fn iio_channel_attr_write( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_char, ) -> isize; } extern "C" { /// @brief Set the value of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param src A pointer to the data to be written /// @param len The number of bytes that should be written /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned pub fn iio_channel_attr_write_raw( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_void, len: usize, ) -> isize; } extern "C" { /// @brief Set the values of all channel-specific attributes /// @param chn A pointer to an iio_channel structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the channel-specific attributes are written in one single /// command. pub fn iio_channel_attr_write_all( chn: *mut iio_channel, cb: ::std::option::Option< unsafe extern "C" fn( chn: *mut iio_channel, attr: *const ::std::os::raw::c_char, buf: *mut ::std::os::raw::c_void, len: usize, d: *mut ::std::os::raw::c_void, ) -> isize, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A bool value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_channel_attr_write_bool( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, val: bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A long long value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_channel_attr_write_longlong( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, val: ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given channel-specific attribute /// @param chn A pointer to an iio_channel structure /// @param attr A NULL-terminated string corresponding to the name of the /// attribute /// @param val A double value to set the attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_channel_attr_write_double( chn: *const iio_channel, attr: *const ::std::os::raw::c_char, val: f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Enable the given channel /// @param chn A pointer to an iio_channel structure /// /// NOTE:Before creating an iio_buffer structure with /// iio_device_create_buffer, it is required to enable at least one channel of /// the device to read from. pub fn iio_channel_enable(chn: *mut iio_channel); } extern "C" { /// @brief Disable the given channel /// @param chn A pointer to an iio_channel structure pub fn iio_channel_disable(chn: *mut iio_channel); } extern "C" { /// @brief Returns True if the channel is enabled /// @param chn A pointer to an iio_channel structure /// @return True if the channel is enabled, False otherwise pub fn iio_channel_is_enabled(chn: *const iio_channel) -> bool; } extern "C" { /// Demultiplex the samples of a given channel /// @param chn A pointer to an iio_channel structure /// @param buffer A pointer to an iio_buffer structure /// @param dst A pointer to the memory area where the demultiplexed data will be /// stored /// @param len The available length of the memory area, in bytes /// @return The size of the demultiplexed data, in bytes pub fn iio_channel_read_raw( chn: *const iio_channel, buffer: *mut iio_buffer, dst: *mut ::std::os::raw::c_void, len: usize, ) -> usize; } extern "C" { /// Demultiplex and convert the samples of a given channel /// @param chn A pointer to an iio_channel structure /// @param buffer A pointer to an iio_buffer structure /// @param dst A pointer to the memory area where the converted data will be /// stored /// @param len The available length of the memory area, in bytes /// @return The size of the converted data, in bytes pub fn iio_channel_read( chn: *const iio_channel, buffer: *mut iio_buffer, dst: *mut ::std::os::raw::c_void, len: usize, ) -> usize; } extern "C" { /// Multiplex the samples of a given channel /// @param chn A pointer to an iio_channel structure /// @param buffer A pointer to an iio_buffer structure /// @param src A pointer to the memory area where the sequential data will /// be read from /// @param len The length of the memory area, in bytes /// @return The number of bytes actually multiplexed pub fn iio_channel_write_raw( chn: *const iio_channel, buffer: *mut iio_buffer, src: *const ::std::os::raw::c_void, len: usize, ) -> usize; } extern "C" { /// Convert and multiplex the samples of a given channel /// @param chn A pointer to an iio_channel structure /// @param buffer A pointer to an iio_buffer structure /// @param src A pointer to the memory area where the sequential data will /// be read from /// @param len The length of the memory area, in bytes /// @return The number of bytes actually converted and multiplexed pub fn iio_channel_write( chn: *const iio_channel, buffer: *mut iio_buffer, src: *const ::std::os::raw::c_void, len: usize, ) -> usize; } extern "C" { /// @brief Associate a pointer to an iio_channel structure /// @param chn A pointer to an iio_channel structure /// @param data The pointer to be associated pub fn iio_channel_set_data(chn: *mut iio_channel, data: *mut ::std::os::raw::c_void); } extern "C" { /// @brief Retrieve a previously associated pointer of an iio_channel structure /// @param chn A pointer to an iio_channel structure /// @return The pointer previously associated if present, or NULL pub fn iio_channel_get_data(chn: *const iio_channel) -> *mut ::std::os::raw::c_void; } extern "C" { /// @brief Get the type of the given channel /// @param chn A pointer to an iio_channel structure /// @return The type of the channel pub fn iio_channel_get_type(chn: *const iio_channel) -> iio_chan_type; } extern "C" { /// @brief Get the modifier type of the given channel /// @param chn A pointer to an iio_channel structure /// @return The modifier type of the channel pub fn iio_channel_get_modifier(chn: *const iio_channel) -> iio_modifier; } extern "C" { /// @brief Retrieve a pointer to the iio_device structure /// @param buf A pointer to an iio_buffer structure /// @return A pointer to an iio_device structure pub fn iio_buffer_get_device(buf: *const iio_buffer) -> *const iio_device; } extern "C" { /// @brief Create an input or output buffer associated to the given device /// @param dev A pointer to an iio_device structure /// @param samples_count The number of samples that the buffer should contain /// @param cyclic If True, enable cyclic mode /// @return On success, a pointer to an iio_buffer structure /// @return On error, NULL is returned, and errno is set to the error code /// /// NOTE: Channels that have to be written to / read from must be enabled /// before creating the buffer. pub fn iio_device_create_buffer( dev: *const iio_device, samples_count: usize, cyclic: bool, ) -> *mut iio_buffer; } extern "C" { /// @brief Destroy the given buffer /// @param buf A pointer to an iio_buffer structure /// /// NOTE: After that function, the iio_buffer pointer shall be invalid. pub fn iio_buffer_destroy(buf: *mut iio_buffer); } extern "C" { /// @brief Get a pollable file descriptor /// /// Can be used to know when iio_buffer_refill() or iio_buffer_push() can be /// called /// @param buf A pointer to an iio_buffer structure /// @return On success, valid file descriptor /// @return On error, a negative errno code is returned pub fn iio_buffer_get_poll_fd(buf: *mut iio_buffer) -> ::std::os::raw::c_int; } extern "C" { /// @brief Make iio_buffer_refill() and iio_buffer_push() blocking or not /// /// After this function has been called with blocking == false, /// iio_buffer_refill() and iio_buffer_push() will return -EAGAIN if no data is /// ready. /// A device is blocking by default. /// @param buf A pointer to an iio_buffer structure /// @param blocking true if the buffer API should be blocking, else false /// @return On success, 0 /// @return On error, a negative errno code is returned pub fn iio_buffer_set_blocking_mode( buf: *mut iio_buffer, blocking: bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Fetch more samples from the hardware /// @param buf A pointer to an iio_buffer structure /// @return On success, the number of bytes read is returned /// @return On error, a negative errno code is returned /// /// NOTE: Only valid for input buffers pub fn iio_buffer_refill(buf: *mut iio_buffer) -> isize; } extern "C" { /// @brief Send the samples to the hardware /// @param buf A pointer to an iio_buffer structure /// @return On success, the number of bytes written is returned /// @return On error, a negative errno code is returned /// /// NOTE: Only valid for output buffers pub fn iio_buffer_push(buf: *mut iio_buffer) -> isize; } extern "C" { /// @brief Send a given number of samples to the hardware /// @param buf A pointer to an iio_buffer structure /// @param samples_count The number of samples to submit /// @return On success, the number of bytes written is returned /// @return On error, a negative errno code is returned /// /// NOTE: Only valid for output buffers pub fn iio_buffer_push_partial(buf: *mut iio_buffer, samples_count: usize) -> isize; } extern "C" { /// @brief Cancel all buffer operations /// @param buf The buffer for which operations should be canceled /// /// This function cancels all outstanding buffer operations previously scheduled. /// This means any pending iio_buffer_push() or iio_buffer_refill() operation /// will abort and return immediately, any further invocations of these functions /// on the same buffer will return immediately with an error. /// /// Usually iio_buffer_push() and iio_buffer_refill() will block until either all /// data has been transferred or a timeout occurs. This can depending on the /// configuration take a significant amount of time. iio_buffer_cancel() is /// useful to bypass these conditions if the buffer operation is supposed to be /// stopped in response to an external event (e.g. user input). /// /// To be able to capture additional data after calling this function the buffer /// should be destroyed and then re-created. /// /// This function can be called multiple times for the same buffer, but all but /// the first invocation will be without additional effect. /// /// This function is thread-safe, but not signal-safe, i.e. it must not be called /// from a signal handler. pub fn iio_buffer_cancel(buf: *mut iio_buffer); } extern "C" { /// @brief Get the start address of the buffer /// @param buf A pointer to an iio_buffer structure /// @return A pointer corresponding to the start address of the buffer pub fn iio_buffer_start(buf: *const iio_buffer) -> *mut ::std::os::raw::c_void; } extern "C" { /// @brief Find the first sample of a channel in a buffer /// @param buf A pointer to an iio_buffer structure /// @param chn A pointer to an iio_channel structure /// @return A pointer to the first sample found, or to the end of the buffer if /// no sample for the given channel is present in the buffer /// /// NOTE: This fonction, coupled with iio_buffer_step and iio_buffer_end, /// can be used to iterate on all the samples of a given channel present in the /// buffer, doing the following: /// /// @verbatim ///for (void *ptr = iio_buffer_first(buffer, chn); ptr < iio_buffer_end(buffer); ptr += iio_buffer_step(buffer)) { ///.... ///} ///@endverbatim pub fn iio_buffer_first( buf: *const iio_buffer, chn: *const iio_channel, ) -> *mut ::std::os::raw::c_void; } extern "C" { /// @brief Get the step size between two samples of one channel /// @param buf A pointer to an iio_buffer structure /// @return the difference between the addresses of two consecutive samples of /// one same channel pub fn iio_buffer_step(buf: *const iio_buffer) -> isize; } extern "C" { /// @brief Get the address that follows the last sample in a buffer /// @param buf A pointer to an iio_buffer structure /// @return A pointer corresponding to the address that follows the last sample /// present in the buffer pub fn iio_buffer_end(buf: *const iio_buffer) -> *mut ::std::os::raw::c_void; } extern "C" { /// @brief Call the supplied callback for each sample found in a buffer /// @param buf A pointer to an iio_buffer structure /// @param callback A pointer to a function to call for each sample found /// @param data A user-specified pointer that will be passed to the callback /// @return number of bytes processed. /// /// NOTE: The callback receives four arguments: /// * A pointer to the iio_channel structure corresponding to the sample, /// * A pointer to the sample itself, /// * The length of the sample in bytes, /// * The user-specified pointer passed to iio_buffer_foreach_sample. pub fn iio_buffer_foreach_sample( buf: *mut iio_buffer, callback: ::std::option::Option< unsafe extern "C" fn( chn: *const iio_channel, src: *mut ::std::os::raw::c_void, bytes: usize, d: *mut ::std::os::raw::c_void, ) -> isize, >, data: *mut ::std::os::raw::c_void, ) -> isize; } extern "C" { /// @brief Associate a pointer to an iio_buffer structure /// @param buf A pointer to an iio_buffer structure /// @param data The pointer to be associated pub fn iio_buffer_set_data(buf: *mut iio_buffer, data: *mut ::std::os::raw::c_void); } extern "C" { /// @brief Retrieve a previously associated pointer of an iio_buffer structure /// @param buf A pointer to an iio_buffer structure /// @return The pointer previously associated if present, or NULL pub fn iio_buffer_get_data(buf: *const iio_buffer) -> *mut ::std::os::raw::c_void; } /// @defgroup Debug Debug and low-level functions /// @{ /// @struct iio_data_format /// @brief Contains the format of a data sample. /// /// The different fields inform about the correct way to convert one sample from /// its raw format (as read from / generated by the hardware) to its real-world /// value. #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct iio_data_format { /// @brief Total length of the sample, in bits pub length: ::std::os::raw::c_uint, /// @brief Length of valuable data in the sample, in bits pub bits: ::std::os::raw::c_uint, /// @brief Right-shift to apply when converting sample pub shift: ::std::os::raw::c_uint, /// @brief Contains True if the sample is signed pub is_signed: bool, /// @brief Contains True if the sample is fully defined, sign extended, etc. pub is_fully_defined: bool, /// @brief Contains True if the sample is in big-endian format pub is_be: bool, /// @brief Contains True if the sample should be scaled when converted pub with_scale: bool, /// @brief Contains the scale to apply if with_scale is set pub scale: f64, /// @brief Number of times length repeats (added in v0.8) pub repeat: ::std::os::raw::c_uint, } #[test] fn bindgen_test_layout_iio_data_format() { assert_eq!( ::std::mem::size_of::(), 32usize, concat!("Size of: ", stringify!(iio_data_format)) ); assert_eq!( ::std::mem::align_of::(), 8usize, concat!("Alignment of ", stringify!(iio_data_format)) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(length) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).bits as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(bits) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).shift as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(shift) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).is_signed as *const _ as usize }, 12usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(is_signed) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).is_fully_defined as *const _ as usize }, 13usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(is_fully_defined) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).is_be as *const _ as usize }, 14usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(is_be) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).with_scale as *const _ as usize }, 15usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(with_scale) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).scale as *const _ as usize }, 16usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(scale) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::())).repeat as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!(iio_data_format), "::", stringify!(repeat) ) ); } extern "C" { /// @brief Get the current sample size /// @param dev A pointer to an iio_device structure /// @return On success, the sample size in bytes /// @return On error, a negative errno code is returned /// /// NOTE: The sample size is not constant and will change when channels /// get enabled or disabled. pub fn iio_device_get_sample_size(dev: *const iio_device) -> isize; } extern "C" { /// @brief Get the index of the given channel /// @param chn A pointer to an iio_channel structure /// @return On success, the index of the specified channel /// @return On error, a negative errno code is returned pub fn iio_channel_get_index(chn: *const iio_channel) -> ::std::os::raw::c_long; } extern "C" { /// @brief Get a pointer to a channel's data format structure /// @param chn A pointer to an iio_channel structure /// @return A pointer to the channel's iio_data_format structure pub fn iio_channel_get_data_format(chn: *const iio_channel) -> *const iio_data_format; } extern "C" { /// @brief Convert the sample from hardware format to host format /// @param chn A pointer to an iio_channel structure /// @param dst A pointer to the destination buffer where the converted sample /// should be written /// @param src A pointer to the source buffer containing the sample pub fn iio_channel_convert( chn: *const iio_channel, dst: *mut ::std::os::raw::c_void, src: *const ::std::os::raw::c_void, ); } extern "C" { /// @brief Convert the sample from host format to hardware format /// @param chn A pointer to an iio_channel structure /// @param dst A pointer to the destination buffer where the converted sample /// should be written /// @param src A pointer to the source buffer containing the sample pub fn iio_channel_convert_inverse( chn: *const iio_channel, dst: *mut ::std::os::raw::c_void, src: *const ::std::os::raw::c_void, ); } extern "C" { /// @brief Enumerate the debug attributes of the given device /// @param dev A pointer to an iio_device structure /// @return The number of debug attributes found pub fn iio_device_get_debug_attrs_count(dev: *const iio_device) -> ::std::os::raw::c_uint; } extern "C" { /// @brief Get the debug attribute present at the given index /// @param dev A pointer to an iio_device structure /// @param index The index corresponding to the debug attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the index is invalid, NULL is returned pub fn iio_device_get_debug_attr( dev: *const iio_device, index: ::std::os::raw::c_uint, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Try to find a debug attribute by its name /// @param dev A pointer to an iio_device structure /// @param name A NULL-terminated string corresponding to the name of the /// debug attribute /// @return On success, a pointer to a static NULL-terminated string /// @return If the name does not correspond to any known debug attribute of the /// given device, NULL is returned /// /// NOTE: This function is useful to detect the presence of a debug /// attribute. /// It can also be used to retrieve the name of a debug attribute as a pointer /// to a static string from a dynamically allocated string. pub fn iio_device_find_debug_attr( dev: *const iio_device, name: *const ::std::os::raw::c_char, ) -> *const ::std::os::raw::c_char; } extern "C" { /// @brief Read the content of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param dst A pointer to the memory area where the NULL-terminated string /// corresponding to the value read will be stored /// @param len The available length of the memory area, in bytes /// @return On success, the number of bytes written to the buffer /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to /// iio_device_debug_attr_read, it is now possible to read all of the debug /// attributes of a device. /// /// The buffer is filled with one block of data per debug attribute of the /// device, by the order they appear in the iio_device structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, it corresponds to the errno code that were /// returned when reading the debug attribute; if positive, it corresponds /// to the length of the data read. In that case, the rest of the block contains /// the data. pub fn iio_device_debug_attr_read( dev: *const iio_device, attr: *const ::std::os::raw::c_char, dst: *mut ::std::os::raw::c_char, len: usize, ) -> isize; } extern "C" { /// @brief Read the content of all debug attributes /// @param dev A pointer to an iio_device structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the debug attributes are read in one single command. pub fn iio_device_debug_attr_read_all( dev: *mut iio_device, cb: ::std::option::Option< unsafe extern "C" fn( dev: *mut iio_device, attr: *const ::std::os::raw::c_char, value: *const ::std::os::raw::c_char, len: usize, d: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param src A NULL-terminated string to set the debug attribute to /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned /// /// NOTE:By passing NULL as the "attr" argument to /// iio_device_debug_attr_write, it is now possible to write all of the /// debug attributes of a device. /// /// The buffer must contain one block of data per debug attribute of the device, /// by the order they appear in the iio_device structure. /// /// The first four bytes of one block correspond to a 32-bit signed value in /// network order. If negative, the debug attribute is not written; if positive, /// it corresponds to the length of the data to write. In that case, the rest /// of the block must contain the data. pub fn iio_device_debug_attr_write( dev: *const iio_device, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_char, ) -> isize; } extern "C" { /// @brief Set the value of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param src A pointer to the data to be written /// @param len The number of bytes that should be written /// @return On success, the number of bytes written /// @return On error, a negative errno code is returned pub fn iio_device_debug_attr_write_raw( dev: *const iio_device, attr: *const ::std::os::raw::c_char, src: *const ::std::os::raw::c_void, len: usize, ) -> isize; } extern "C" { /// @brief Set the values of all debug attributes /// @param dev A pointer to an iio_device structure /// @param cb A pointer to a callback function /// @param data A pointer that will be passed to the callback function /// @return On success, 0 is returned /// @return On error, a negative errno code is returned /// /// NOTE: This function is especially useful when used with the network /// backend, as all the debug attributes are written in one single command. pub fn iio_device_debug_attr_write_all( dev: *mut iio_device, cb: ::std::option::Option< unsafe extern "C" fn( dev: *mut iio_device, attr: *const ::std::os::raw::c_char, buf: *mut ::std::os::raw::c_void, len: usize, d: *mut ::std::os::raw::c_void, ) -> isize, >, data: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param val A pointer to a bool variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_debug_attr_read_bool( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param val A pointer to a long long variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_debug_attr_read_longlong( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Read the content of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param val A pointer to a double variable where the value should be stored /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_debug_attr_read_double( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: *mut f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param val A bool value to set the debug attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_debug_attr_write_bool( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: bool, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param val A long long value to set the debug attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_debug_attr_write_longlong( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: ::std::os::raw::c_longlong, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of the given debug attribute /// @param dev A pointer to an iio_device structure /// @param attr A NULL-terminated string corresponding to the name of the /// debug attribute /// @param val A double value to set the debug attribute to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_debug_attr_write_double( dev: *const iio_device, attr: *const ::std::os::raw::c_char, val: f64, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Identify the channel or debug attribute corresponding to a filename /// @param dev A pointer to an iio_device structure /// @param filename A NULL-terminated string corresponding to the filename /// @param chn A pointer to a pointer of an iio_channel structure. The pointed /// pointer will be set to the address of the iio_channel structure if the /// filename correspond to the attribute of a channel, or NULL otherwise. /// @param attr A pointer to a NULL-terminated string. The pointer /// pointer will be set to point to the name of the attribute corresponding to /// the filename. /// @return On success, 0 is returned, and *chn and *attr are modified. /// @return On error, a negative errno code is returned. *chn and *attr are not /// modified. pub fn iio_device_identify_filename( dev: *const iio_device, filename: *const ::std::os::raw::c_char, chn: *mut *mut iio_channel, attr: *mut *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Set the value of a hardware register /// @param dev A pointer to an iio_device structure /// @param address The address of the register /// @param value The value to set the register to /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_reg_write( dev: *mut iio_device, address: u32, value: u32, ) -> ::std::os::raw::c_int; } extern "C" { /// @brief Get the value of a hardware register /// @param dev A pointer to an iio_device structure /// @param address The address of the register /// @param value A pointer to the variable where the value will be written /// @return On success, 0 is returned /// @return On error, a negative errno code is returned pub fn iio_device_reg_read( dev: *mut iio_device, address: u32, value: *mut u32, ) -> ::std::os::raw::c_int; }