1 // Copyright 2019 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /* automatically generated by rust-bindgen */
6
7 #[repr(C)]
8 #[derive(Default)]
9 pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>);
10 impl<T> __IncompleteArrayField<T> {
11 #[inline]
new() -> Self12 pub fn new() -> Self {
13 __IncompleteArrayField(::std::marker::PhantomData)
14 }
15 #[inline]
as_ptr(&self) -> *const T16 pub unsafe fn as_ptr(&self) -> *const T {
17 ::std::mem::transmute(self)
18 }
19 #[inline]
as_mut_ptr(&mut self) -> *mut T20 pub unsafe fn as_mut_ptr(&mut self) -> *mut T {
21 ::std::mem::transmute(self)
22 }
23 #[inline]
as_slice(&self, len: usize) -> &[T]24 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
25 ::std::slice::from_raw_parts(self.as_ptr(), len)
26 }
27 #[inline]
as_mut_slice(&mut self, len: usize) -> &mut [T]28 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
29 ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
30 }
31 }
32 impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result33 fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
34 fmt.write_str("__IncompleteArrayField")
35 }
36 }
37 impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
38 #[inline]
clone(&self) -> Self39 fn clone(&self) -> Self {
40 Self::new()
41 }
42 }
43 impl<T> ::std::marker::Copy for __IncompleteArrayField<T> {}
44 pub const _STDINT_H: u32 = 1;
45 pub const _FEATURES_H: u32 = 1;
46 pub const _DEFAULT_SOURCE: u32 = 1;
47 pub const __USE_ISOC11: u32 = 1;
48 pub const __USE_ISOC99: u32 = 1;
49 pub const __USE_ISOC95: u32 = 1;
50 pub const __USE_POSIX_IMPLICITLY: u32 = 1;
51 pub const _POSIX_SOURCE: u32 = 1;
52 pub const _POSIX_C_SOURCE: u32 = 200809;
53 pub const __USE_POSIX: u32 = 1;
54 pub const __USE_POSIX2: u32 = 1;
55 pub const __USE_POSIX199309: u32 = 1;
56 pub const __USE_POSIX199506: u32 = 1;
57 pub const __USE_XOPEN2K: u32 = 1;
58 pub const __USE_XOPEN2K8: u32 = 1;
59 pub const _ATFILE_SOURCE: u32 = 1;
60 pub const __USE_MISC: u32 = 1;
61 pub const __USE_ATFILE: u32 = 1;
62 pub const __USE_FORTIFY_LEVEL: u32 = 0;
63 pub const _STDC_PREDEF_H: u32 = 1;
64 pub const __STDC_IEC_559__: u32 = 1;
65 pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
66 pub const __STDC_ISO_10646__: u32 = 201605;
67 pub const __STDC_NO_THREADS__: u32 = 1;
68 pub const __GNU_LIBRARY__: u32 = 6;
69 pub const __GLIBC__: u32 = 2;
70 pub const __GLIBC_MINOR__: u32 = 24;
71 pub const _SYS_CDEFS_H: u32 = 1;
72 pub const __WORDSIZE: u32 = 64;
73 pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
74 pub const __SYSCALL_WORDSIZE: u32 = 64;
75 pub const _BITS_WCHAR_H: u32 = 1;
76 pub const INT8_MIN: i32 = -128;
77 pub const INT16_MIN: i32 = -32768;
78 pub const INT32_MIN: i32 = -2147483648;
79 pub const INT8_MAX: u32 = 127;
80 pub const INT16_MAX: u32 = 32767;
81 pub const INT32_MAX: u32 = 2147483647;
82 pub const UINT8_MAX: u32 = 255;
83 pub const UINT16_MAX: u32 = 65535;
84 pub const UINT32_MAX: u32 = 4294967295;
85 pub const INT_LEAST8_MIN: i32 = -128;
86 pub const INT_LEAST16_MIN: i32 = -32768;
87 pub const INT_LEAST32_MIN: i32 = -2147483648;
88 pub const INT_LEAST8_MAX: u32 = 127;
89 pub const INT_LEAST16_MAX: u32 = 32767;
90 pub const INT_LEAST32_MAX: u32 = 2147483647;
91 pub const UINT_LEAST8_MAX: u32 = 255;
92 pub const UINT_LEAST16_MAX: u32 = 65535;
93 pub const UINT_LEAST32_MAX: u32 = 4294967295;
94 pub const INT_FAST8_MIN: i32 = -128;
95 pub const INT_FAST16_MIN: i64 = -9223372036854775808;
96 pub const INT_FAST32_MIN: i64 = -9223372036854775808;
97 pub const INT_FAST8_MAX: u32 = 127;
98 pub const INT_FAST16_MAX: u64 = 9223372036854775807;
99 pub const INT_FAST32_MAX: u64 = 9223372036854775807;
100 pub const UINT_FAST8_MAX: u32 = 255;
101 pub const UINT_FAST16_MAX: i32 = -1;
102 pub const UINT_FAST32_MAX: i32 = -1;
103 pub const INTPTR_MIN: i64 = -9223372036854775808;
104 pub const INTPTR_MAX: u64 = 9223372036854775807;
105 pub const UINTPTR_MAX: i32 = -1;
106 pub const PTRDIFF_MIN: i64 = -9223372036854775808;
107 pub const PTRDIFF_MAX: u64 = 9223372036854775807;
108 pub const SIG_ATOMIC_MIN: i32 = -2147483648;
109 pub const SIG_ATOMIC_MAX: u32 = 2147483647;
110 pub const SIZE_MAX: i32 = -1;
111 pub const WINT_MIN: u32 = 0;
112 pub const WINT_MAX: u32 = 4294967295;
113 pub const _SYS_TYPES_H: u32 = 1;
114 pub const _BITS_TYPES_H: u32 = 1;
115 pub const _BITS_TYPESIZES_H: u32 = 1;
116 pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
117 pub const __INO_T_MATCHES_INO64_T: u32 = 1;
118 pub const __FD_SETSIZE: u32 = 1024;
119 pub const __clock_t_defined: u32 = 1;
120 pub const __time_t_defined: u32 = 1;
121 pub const __clockid_t_defined: u32 = 1;
122 pub const __timer_t_defined: u32 = 1;
123 pub const __BIT_TYPES_DEFINED__: u32 = 1;
124 pub const _ENDIAN_H: u32 = 1;
125 pub const __LITTLE_ENDIAN: u32 = 1234;
126 pub const __BIG_ENDIAN: u32 = 4321;
127 pub const __PDP_ENDIAN: u32 = 3412;
128 pub const __BYTE_ORDER: u32 = 1234;
129 pub const __FLOAT_WORD_ORDER: u32 = 1234;
130 pub const LITTLE_ENDIAN: u32 = 1234;
131 pub const BIG_ENDIAN: u32 = 4321;
132 pub const PDP_ENDIAN: u32 = 3412;
133 pub const BYTE_ORDER: u32 = 1234;
134 pub const _BITS_BYTESWAP_H: u32 = 1;
135 pub const _SYS_SELECT_H: u32 = 1;
136 pub const __FD_ZERO_STOS: &'static [u8; 6usize] = b"stosq\0";
137 pub const _SIGSET_H_types: u32 = 1;
138 pub const __timespec_defined: u32 = 1;
139 pub const _STRUCT_TIMEVAL: u32 = 1;
140 pub const FD_SETSIZE: u32 = 1024;
141 pub const _SYS_SYSMACROS_H: u32 = 1;
142 pub const _BITS_PTHREADTYPES_H: u32 = 1;
143 pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56;
144 pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40;
145 pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4;
146 pub const __SIZEOF_PTHREAD_COND_T: u32 = 48;
147 pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4;
148 pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56;
149 pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8;
150 pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32;
151 pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4;
152 pub const __have_pthread_attr_t: u32 = 1;
153 pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1;
154 pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: u32 = 1;
155 pub const _SYS_TIME_H: u32 = 1;
156 pub const _TIME_H: u32 = 1;
157 pub const _BITS_TIME_H: u32 = 1;
158 pub const CLOCK_REALTIME: u32 = 0;
159 pub const CLOCK_MONOTONIC: u32 = 1;
160 pub const CLOCK_PROCESS_CPUTIME_ID: u32 = 2;
161 pub const CLOCK_THREAD_CPUTIME_ID: u32 = 3;
162 pub const CLOCK_MONOTONIC_RAW: u32 = 4;
163 pub const CLOCK_REALTIME_COARSE: u32 = 5;
164 pub const CLOCK_MONOTONIC_COARSE: u32 = 6;
165 pub const CLOCK_BOOTTIME: u32 = 7;
166 pub const CLOCK_REALTIME_ALARM: u32 = 8;
167 pub const CLOCK_BOOTTIME_ALARM: u32 = 9;
168 pub const CLOCK_TAI: u32 = 11;
169 pub const TIMER_ABSTIME: u32 = 1;
170 pub const TIME_UTC: u32 = 1;
171 pub const _XLOCALE_H: u32 = 1;
172 pub const _LIBC_LIMITS_H_: u32 = 1;
173 pub const MB_LEN_MAX: u32 = 16;
174 pub const _BITS_POSIX1_LIM_H: u32 = 1;
175 pub const _POSIX_AIO_LISTIO_MAX: u32 = 2;
176 pub const _POSIX_AIO_MAX: u32 = 1;
177 pub const _POSIX_ARG_MAX: u32 = 4096;
178 pub const _POSIX_CHILD_MAX: u32 = 25;
179 pub const _POSIX_DELAYTIMER_MAX: u32 = 32;
180 pub const _POSIX_HOST_NAME_MAX: u32 = 255;
181 pub const _POSIX_LINK_MAX: u32 = 8;
182 pub const _POSIX_LOGIN_NAME_MAX: u32 = 9;
183 pub const _POSIX_MAX_CANON: u32 = 255;
184 pub const _POSIX_MAX_INPUT: u32 = 255;
185 pub const _POSIX_MQ_OPEN_MAX: u32 = 8;
186 pub const _POSIX_MQ_PRIO_MAX: u32 = 32;
187 pub const _POSIX_NAME_MAX: u32 = 14;
188 pub const _POSIX_NGROUPS_MAX: u32 = 8;
189 pub const _POSIX_OPEN_MAX: u32 = 20;
190 pub const _POSIX_PATH_MAX: u32 = 256;
191 pub const _POSIX_PIPE_BUF: u32 = 512;
192 pub const _POSIX_RE_DUP_MAX: u32 = 255;
193 pub const _POSIX_RTSIG_MAX: u32 = 8;
194 pub const _POSIX_SEM_NSEMS_MAX: u32 = 256;
195 pub const _POSIX_SEM_VALUE_MAX: u32 = 32767;
196 pub const _POSIX_SIGQUEUE_MAX: u32 = 32;
197 pub const _POSIX_SSIZE_MAX: u32 = 32767;
198 pub const _POSIX_STREAM_MAX: u32 = 8;
199 pub const _POSIX_SYMLINK_MAX: u32 = 255;
200 pub const _POSIX_SYMLOOP_MAX: u32 = 8;
201 pub const _POSIX_TIMER_MAX: u32 = 32;
202 pub const _POSIX_TTY_NAME_MAX: u32 = 9;
203 pub const _POSIX_TZNAME_MAX: u32 = 6;
204 pub const _POSIX_CLOCKRES_MIN: u32 = 20000000;
205 pub const NR_OPEN: u32 = 1024;
206 pub const NGROUPS_MAX: u32 = 65536;
207 pub const ARG_MAX: u32 = 131072;
208 pub const LINK_MAX: u32 = 127;
209 pub const MAX_CANON: u32 = 255;
210 pub const MAX_INPUT: u32 = 255;
211 pub const NAME_MAX: u32 = 255;
212 pub const PATH_MAX: u32 = 4096;
213 pub const PIPE_BUF: u32 = 4096;
214 pub const XATTR_NAME_MAX: u32 = 255;
215 pub const XATTR_SIZE_MAX: u32 = 65536;
216 pub const XATTR_LIST_MAX: u32 = 65536;
217 pub const RTSIG_MAX: u32 = 32;
218 pub const _POSIX_THREAD_KEYS_MAX: u32 = 128;
219 pub const PTHREAD_KEYS_MAX: u32 = 1024;
220 pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
221 pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
222 pub const _POSIX_THREAD_THREADS_MAX: u32 = 64;
223 pub const AIO_PRIO_DELTA_MAX: u32 = 20;
224 pub const PTHREAD_STACK_MIN: u32 = 16384;
225 pub const DELAYTIMER_MAX: u32 = 2147483647;
226 pub const TTY_NAME_MAX: u32 = 32;
227 pub const LOGIN_NAME_MAX: u32 = 256;
228 pub const HOST_NAME_MAX: u32 = 64;
229 pub const MQ_PRIO_MAX: u32 = 32768;
230 pub const SEM_VALUE_MAX: u32 = 2147483647;
231 pub const _BITS_POSIX2_LIM_H: u32 = 1;
232 pub const _POSIX2_BC_BASE_MAX: u32 = 99;
233 pub const _POSIX2_BC_DIM_MAX: u32 = 2048;
234 pub const _POSIX2_BC_SCALE_MAX: u32 = 99;
235 pub const _POSIX2_BC_STRING_MAX: u32 = 1000;
236 pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2;
237 pub const _POSIX2_EXPR_NEST_MAX: u32 = 32;
238 pub const _POSIX2_LINE_MAX: u32 = 2048;
239 pub const _POSIX2_RE_DUP_MAX: u32 = 255;
240 pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14;
241 pub const BC_BASE_MAX: u32 = 99;
242 pub const BC_DIM_MAX: u32 = 2048;
243 pub const BC_SCALE_MAX: u32 = 99;
244 pub const BC_STRING_MAX: u32 = 1000;
245 pub const COLL_WEIGHTS_MAX: u32 = 255;
246 pub const EXPR_NEST_MAX: u32 = 32;
247 pub const LINE_MAX: u32 = 2048;
248 pub const CHARCLASS_NAME_MAX: u32 = 2048;
249 pub const RE_DUP_MAX: u32 = 32767;
250 pub const LIBUSB_API_VERSION: u32 = 16777477;
251 pub const LIBUSBX_API_VERSION: u32 = 16777477;
252 pub const LIBUSB_DT_DEVICE_SIZE: u32 = 18;
253 pub const LIBUSB_DT_CONFIG_SIZE: u32 = 9;
254 pub const LIBUSB_DT_INTERFACE_SIZE: u32 = 9;
255 pub const LIBUSB_DT_ENDPOINT_SIZE: u32 = 7;
256 pub const LIBUSB_DT_ENDPOINT_AUDIO_SIZE: u32 = 9;
257 pub const LIBUSB_DT_HUB_NONVAR_SIZE: u32 = 7;
258 pub const LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE: u32 = 6;
259 pub const LIBUSB_DT_BOS_SIZE: u32 = 5;
260 pub const LIBUSB_DT_DEVICE_CAPABILITY_SIZE: u32 = 3;
261 pub const LIBUSB_BT_USB_2_0_EXTENSION_SIZE: u32 = 7;
262 pub const LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE: u32 = 10;
263 pub const LIBUSB_BT_CONTAINER_ID_SIZE: u32 = 20;
264 pub const LIBUSB_DT_BOS_MAX_SIZE: u32 = 42;
265 pub const LIBUSB_ENDPOINT_ADDRESS_MASK: u32 = 15;
266 pub const LIBUSB_ENDPOINT_DIR_MASK: u32 = 128;
267 pub const LIBUSB_TRANSFER_TYPE_MASK: u32 = 3;
268 pub const LIBUSB_ISO_SYNC_TYPE_MASK: u32 = 12;
269 pub const LIBUSB_ISO_USAGE_TYPE_MASK: u32 = 48;
270 pub const LIBUSB_ERROR_COUNT: u32 = 14;
271 pub const LIBUSB_HOTPLUG_MATCH_ANY: i32 = -1;
272 pub type int_least8_t = ::std::os::raw::c_schar;
273 pub type int_least16_t = ::std::os::raw::c_short;
274 pub type int_least32_t = ::std::os::raw::c_int;
275 pub type int_least64_t = ::std::os::raw::c_long;
276 pub type uint_least8_t = ::std::os::raw::c_uchar;
277 pub type uint_least16_t = ::std::os::raw::c_ushort;
278 pub type uint_least32_t = ::std::os::raw::c_uint;
279 pub type uint_least64_t = ::std::os::raw::c_ulong;
280 pub type int_fast8_t = ::std::os::raw::c_schar;
281 pub type int_fast16_t = ::std::os::raw::c_long;
282 pub type int_fast32_t = ::std::os::raw::c_long;
283 pub type int_fast64_t = ::std::os::raw::c_long;
284 pub type uint_fast8_t = ::std::os::raw::c_uchar;
285 pub type uint_fast16_t = ::std::os::raw::c_ulong;
286 pub type uint_fast32_t = ::std::os::raw::c_ulong;
287 pub type uint_fast64_t = ::std::os::raw::c_ulong;
288 pub type intmax_t = ::std::os::raw::c_long;
289 pub type uintmax_t = ::std::os::raw::c_ulong;
290 pub type __u_char = ::std::os::raw::c_uchar;
291 pub type __u_short = ::std::os::raw::c_ushort;
292 pub type __u_int = ::std::os::raw::c_uint;
293 pub type __u_long = ::std::os::raw::c_ulong;
294 pub type __int8_t = ::std::os::raw::c_schar;
295 pub type __uint8_t = ::std::os::raw::c_uchar;
296 pub type __int16_t = ::std::os::raw::c_short;
297 pub type __uint16_t = ::std::os::raw::c_ushort;
298 pub type __int32_t = ::std::os::raw::c_int;
299 pub type __uint32_t = ::std::os::raw::c_uint;
300 pub type __int64_t = ::std::os::raw::c_long;
301 pub type __uint64_t = ::std::os::raw::c_ulong;
302 pub type __quad_t = ::std::os::raw::c_long;
303 pub type __u_quad_t = ::std::os::raw::c_ulong;
304 pub type __dev_t = ::std::os::raw::c_ulong;
305 pub type __uid_t = ::std::os::raw::c_uint;
306 pub type __gid_t = ::std::os::raw::c_uint;
307 pub type __ino_t = ::std::os::raw::c_ulong;
308 pub type __ino64_t = ::std::os::raw::c_ulong;
309 pub type __mode_t = ::std::os::raw::c_uint;
310 pub type __nlink_t = ::std::os::raw::c_ulong;
311 pub type __off_t = ::std::os::raw::c_long;
312 pub type __off64_t = ::std::os::raw::c_long;
313 pub type __pid_t = ::std::os::raw::c_int;
314 #[repr(C)]
315 #[derive(Debug, Copy, Clone)]
316 pub struct __fsid_t {
317 pub __val: [::std::os::raw::c_int; 2usize],
318 }
319 #[test]
bindgen_test_layout___fsid_t()320 fn bindgen_test_layout___fsid_t() {
321 assert_eq!(
322 ::std::mem::size_of::<__fsid_t>(),
323 8usize,
324 concat!("Size of: ", stringify!(__fsid_t))
325 );
326 assert_eq!(
327 ::std::mem::align_of::<__fsid_t>(),
328 4usize,
329 concat!("Alignment of ", stringify!(__fsid_t))
330 );
331 assert_eq!(
332 unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize },
333 0usize,
334 concat!(
335 "Offset of field: ",
336 stringify!(__fsid_t),
337 "::",
338 stringify!(__val)
339 )
340 );
341 }
342 pub type __clock_t = ::std::os::raw::c_long;
343 pub type __rlim_t = ::std::os::raw::c_ulong;
344 pub type __rlim64_t = ::std::os::raw::c_ulong;
345 pub type __id_t = ::std::os::raw::c_uint;
346 pub type __time_t = ::std::os::raw::c_long;
347 pub type __useconds_t = ::std::os::raw::c_uint;
348 pub type __suseconds_t = ::std::os::raw::c_long;
349 pub type __daddr_t = ::std::os::raw::c_int;
350 pub type __key_t = ::std::os::raw::c_int;
351 pub type __clockid_t = ::std::os::raw::c_int;
352 pub type __timer_t = *mut ::std::os::raw::c_void;
353 pub type __blksize_t = ::std::os::raw::c_long;
354 pub type __blkcnt_t = ::std::os::raw::c_long;
355 pub type __blkcnt64_t = ::std::os::raw::c_long;
356 pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
357 pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
358 pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
359 pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
360 pub type __fsword_t = ::std::os::raw::c_long;
361 pub type __ssize_t = ::std::os::raw::c_long;
362 pub type __syscall_slong_t = ::std::os::raw::c_long;
363 pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
364 pub type __loff_t = __off64_t;
365 pub type __qaddr_t = *mut __quad_t;
366 pub type __caddr_t = *mut ::std::os::raw::c_char;
367 pub type __intptr_t = ::std::os::raw::c_long;
368 pub type __socklen_t = ::std::os::raw::c_uint;
369 pub type u_char = __u_char;
370 pub type u_short = __u_short;
371 pub type u_int = __u_int;
372 pub type u_long = __u_long;
373 pub type quad_t = __quad_t;
374 pub type u_quad_t = __u_quad_t;
375 pub type fsid_t = __fsid_t;
376 pub type loff_t = __loff_t;
377 pub type ino_t = __ino_t;
378 pub type dev_t = __dev_t;
379 pub type gid_t = __gid_t;
380 pub type mode_t = __mode_t;
381 pub type nlink_t = __nlink_t;
382 pub type uid_t = __uid_t;
383 pub type off_t = __off_t;
384 pub type pid_t = __pid_t;
385 pub type id_t = __id_t;
386 pub type daddr_t = __daddr_t;
387 pub type caddr_t = __caddr_t;
388 pub type key_t = __key_t;
389 pub type clock_t = __clock_t;
390 pub type time_t = __time_t;
391 pub type clockid_t = __clockid_t;
392 pub type timer_t = __timer_t;
393 pub type ulong = ::std::os::raw::c_ulong;
394 pub type ushort = ::std::os::raw::c_ushort;
395 pub type uint = ::std::os::raw::c_uint;
396 pub type u_int8_t = ::std::os::raw::c_uchar;
397 pub type u_int16_t = ::std::os::raw::c_ushort;
398 pub type u_int32_t = ::std::os::raw::c_uint;
399 pub type u_int64_t = ::std::os::raw::c_ulong;
400 pub type register_t = ::std::os::raw::c_long;
401 pub type __sig_atomic_t = ::std::os::raw::c_int;
402 #[repr(C)]
403 #[derive(Debug, Copy, Clone)]
404 pub struct __sigset_t {
405 pub __val: [::std::os::raw::c_ulong; 16usize],
406 }
407 #[test]
bindgen_test_layout___sigset_t()408 fn bindgen_test_layout___sigset_t() {
409 assert_eq!(
410 ::std::mem::size_of::<__sigset_t>(),
411 128usize,
412 concat!("Size of: ", stringify!(__sigset_t))
413 );
414 assert_eq!(
415 ::std::mem::align_of::<__sigset_t>(),
416 8usize,
417 concat!("Alignment of ", stringify!(__sigset_t))
418 );
419 assert_eq!(
420 unsafe { &(*(::std::ptr::null::<__sigset_t>())).__val as *const _ as usize },
421 0usize,
422 concat!(
423 "Offset of field: ",
424 stringify!(__sigset_t),
425 "::",
426 stringify!(__val)
427 )
428 );
429 }
430 pub type sigset_t = __sigset_t;
431 #[repr(C)]
432 #[derive(Debug, Copy, Clone)]
433 pub struct timespec {
434 pub tv_sec: __time_t,
435 pub tv_nsec: __syscall_slong_t,
436 }
437 #[test]
bindgen_test_layout_timespec()438 fn bindgen_test_layout_timespec() {
439 assert_eq!(
440 ::std::mem::size_of::<timespec>(),
441 16usize,
442 concat!("Size of: ", stringify!(timespec))
443 );
444 assert_eq!(
445 ::std::mem::align_of::<timespec>(),
446 8usize,
447 concat!("Alignment of ", stringify!(timespec))
448 );
449 assert_eq!(
450 unsafe { &(*(::std::ptr::null::<timespec>())).tv_sec as *const _ as usize },
451 0usize,
452 concat!(
453 "Offset of field: ",
454 stringify!(timespec),
455 "::",
456 stringify!(tv_sec)
457 )
458 );
459 assert_eq!(
460 unsafe { &(*(::std::ptr::null::<timespec>())).tv_nsec as *const _ as usize },
461 8usize,
462 concat!(
463 "Offset of field: ",
464 stringify!(timespec),
465 "::",
466 stringify!(tv_nsec)
467 )
468 );
469 }
470 #[repr(C)]
471 #[derive(Debug, Copy, Clone)]
472 pub struct timeval {
473 pub tv_sec: __time_t,
474 pub tv_usec: __suseconds_t,
475 }
476 #[test]
bindgen_test_layout_timeval()477 fn bindgen_test_layout_timeval() {
478 assert_eq!(
479 ::std::mem::size_of::<timeval>(),
480 16usize,
481 concat!("Size of: ", stringify!(timeval))
482 );
483 assert_eq!(
484 ::std::mem::align_of::<timeval>(),
485 8usize,
486 concat!("Alignment of ", stringify!(timeval))
487 );
488 assert_eq!(
489 unsafe { &(*(::std::ptr::null::<timeval>())).tv_sec as *const _ as usize },
490 0usize,
491 concat!(
492 "Offset of field: ",
493 stringify!(timeval),
494 "::",
495 stringify!(tv_sec)
496 )
497 );
498 assert_eq!(
499 unsafe { &(*(::std::ptr::null::<timeval>())).tv_usec as *const _ as usize },
500 8usize,
501 concat!(
502 "Offset of field: ",
503 stringify!(timeval),
504 "::",
505 stringify!(tv_usec)
506 )
507 );
508 }
509 pub type suseconds_t = __suseconds_t;
510 pub type __fd_mask = ::std::os::raw::c_long;
511 #[repr(C)]
512 #[derive(Debug, Copy, Clone)]
513 pub struct fd_set {
514 pub __fds_bits: [__fd_mask; 16usize],
515 }
516 #[test]
bindgen_test_layout_fd_set()517 fn bindgen_test_layout_fd_set() {
518 assert_eq!(
519 ::std::mem::size_of::<fd_set>(),
520 128usize,
521 concat!("Size of: ", stringify!(fd_set))
522 );
523 assert_eq!(
524 ::std::mem::align_of::<fd_set>(),
525 8usize,
526 concat!("Alignment of ", stringify!(fd_set))
527 );
528 assert_eq!(
529 unsafe { &(*(::std::ptr::null::<fd_set>())).__fds_bits as *const _ as usize },
530 0usize,
531 concat!(
532 "Offset of field: ",
533 stringify!(fd_set),
534 "::",
535 stringify!(__fds_bits)
536 )
537 );
538 }
539 pub type fd_mask = __fd_mask;
540 extern "C" {
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_int541 pub fn select(
542 __nfds: ::std::os::raw::c_int,
543 __readfds: *mut fd_set,
544 __writefds: *mut fd_set,
545 __exceptfds: *mut fd_set,
546 __timeout: *mut timeval,
547 ) -> ::std::os::raw::c_int;
548 }
549 extern "C" {
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_int550 pub fn pselect(
551 __nfds: ::std::os::raw::c_int,
552 __readfds: *mut fd_set,
553 __writefds: *mut fd_set,
554 __exceptfds: *mut fd_set,
555 __timeout: *const timespec,
556 __sigmask: *const __sigset_t,
557 ) -> ::std::os::raw::c_int;
558 }
559 extern "C" {
gnu_dev_major(__dev: ::std::os::raw::c_ulonglong) -> ::std::os::raw::c_uint560 pub fn gnu_dev_major(__dev: ::std::os::raw::c_ulonglong) -> ::std::os::raw::c_uint;
561 }
562 extern "C" {
gnu_dev_minor(__dev: ::std::os::raw::c_ulonglong) -> ::std::os::raw::c_uint563 pub fn gnu_dev_minor(__dev: ::std::os::raw::c_ulonglong) -> ::std::os::raw::c_uint;
564 }
565 extern "C" {
gnu_dev_makedev( __major: ::std::os::raw::c_uint, __minor: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_ulonglong566 pub fn gnu_dev_makedev(
567 __major: ::std::os::raw::c_uint,
568 __minor: ::std::os::raw::c_uint,
569 ) -> ::std::os::raw::c_ulonglong;
570 }
571 pub type blksize_t = __blksize_t;
572 pub type blkcnt_t = __blkcnt_t;
573 pub type fsblkcnt_t = __fsblkcnt_t;
574 pub type fsfilcnt_t = __fsfilcnt_t;
575 pub type pthread_t = ::std::os::raw::c_ulong;
576 #[repr(C)]
577 #[derive(Copy, Clone)]
578 pub union pthread_attr_t {
579 pub __size: [::std::os::raw::c_char; 56usize],
580 pub __align: ::std::os::raw::c_long,
581 _bindgen_union_align: [u64; 7usize],
582 }
583 #[test]
bindgen_test_layout_pthread_attr_t()584 fn bindgen_test_layout_pthread_attr_t() {
585 assert_eq!(
586 ::std::mem::size_of::<pthread_attr_t>(),
587 56usize,
588 concat!("Size of: ", stringify!(pthread_attr_t))
589 );
590 assert_eq!(
591 ::std::mem::align_of::<pthread_attr_t>(),
592 8usize,
593 concat!("Alignment of ", stringify!(pthread_attr_t))
594 );
595 assert_eq!(
596 unsafe { &(*(::std::ptr::null::<pthread_attr_t>())).__size as *const _ as usize },
597 0usize,
598 concat!(
599 "Offset of field: ",
600 stringify!(pthread_attr_t),
601 "::",
602 stringify!(__size)
603 )
604 );
605 assert_eq!(
606 unsafe { &(*(::std::ptr::null::<pthread_attr_t>())).__align as *const _ as usize },
607 0usize,
608 concat!(
609 "Offset of field: ",
610 stringify!(pthread_attr_t),
611 "::",
612 stringify!(__align)
613 )
614 );
615 }
616 #[repr(C)]
617 #[derive(Debug, Copy, Clone)]
618 pub struct __pthread_internal_list {
619 pub __prev: *mut __pthread_internal_list,
620 pub __next: *mut __pthread_internal_list,
621 }
622 #[test]
bindgen_test_layout___pthread_internal_list()623 fn bindgen_test_layout___pthread_internal_list() {
624 assert_eq!(
625 ::std::mem::size_of::<__pthread_internal_list>(),
626 16usize,
627 concat!("Size of: ", stringify!(__pthread_internal_list))
628 );
629 assert_eq!(
630 ::std::mem::align_of::<__pthread_internal_list>(),
631 8usize,
632 concat!("Alignment of ", stringify!(__pthread_internal_list))
633 );
634 assert_eq!(
635 unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__prev as *const _ as usize },
636 0usize,
637 concat!(
638 "Offset of field: ",
639 stringify!(__pthread_internal_list),
640 "::",
641 stringify!(__prev)
642 )
643 );
644 assert_eq!(
645 unsafe { &(*(::std::ptr::null::<__pthread_internal_list>())).__next as *const _ as usize },
646 8usize,
647 concat!(
648 "Offset of field: ",
649 stringify!(__pthread_internal_list),
650 "::",
651 stringify!(__next)
652 )
653 );
654 }
655 pub type __pthread_list_t = __pthread_internal_list;
656 #[repr(C)]
657 #[derive(Copy, Clone)]
658 pub union pthread_mutex_t {
659 pub __data: pthread_mutex_t___pthread_mutex_s,
660 pub __size: [::std::os::raw::c_char; 40usize],
661 pub __align: ::std::os::raw::c_long,
662 _bindgen_union_align: [u64; 5usize],
663 }
664 #[repr(C)]
665 #[derive(Debug, Copy, Clone)]
666 pub struct pthread_mutex_t___pthread_mutex_s {
667 pub __lock: ::std::os::raw::c_int,
668 pub __count: ::std::os::raw::c_uint,
669 pub __owner: ::std::os::raw::c_int,
670 pub __nusers: ::std::os::raw::c_uint,
671 pub __kind: ::std::os::raw::c_int,
672 pub __spins: ::std::os::raw::c_short,
673 pub __elision: ::std::os::raw::c_short,
674 pub __list: __pthread_list_t,
675 }
676 #[test]
bindgen_test_layout_pthread_mutex_t___pthread_mutex_s()677 fn bindgen_test_layout_pthread_mutex_t___pthread_mutex_s() {
678 assert_eq!(
679 ::std::mem::size_of::<pthread_mutex_t___pthread_mutex_s>(),
680 40usize,
681 concat!("Size of: ", stringify!(pthread_mutex_t___pthread_mutex_s))
682 );
683 assert_eq!(
684 ::std::mem::align_of::<pthread_mutex_t___pthread_mutex_s>(),
685 8usize,
686 concat!(
687 "Alignment of ",
688 stringify!(pthread_mutex_t___pthread_mutex_s)
689 )
690 );
691 assert_eq!(
692 unsafe {
693 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__lock as *const _
694 as usize
695 },
696 0usize,
697 concat!(
698 "Offset of field: ",
699 stringify!(pthread_mutex_t___pthread_mutex_s),
700 "::",
701 stringify!(__lock)
702 )
703 );
704 assert_eq!(
705 unsafe {
706 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__count as *const _
707 as usize
708 },
709 4usize,
710 concat!(
711 "Offset of field: ",
712 stringify!(pthread_mutex_t___pthread_mutex_s),
713 "::",
714 stringify!(__count)
715 )
716 );
717 assert_eq!(
718 unsafe {
719 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__owner as *const _
720 as usize
721 },
722 8usize,
723 concat!(
724 "Offset of field: ",
725 stringify!(pthread_mutex_t___pthread_mutex_s),
726 "::",
727 stringify!(__owner)
728 )
729 );
730 assert_eq!(
731 unsafe {
732 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__nusers as *const _
733 as usize
734 },
735 12usize,
736 concat!(
737 "Offset of field: ",
738 stringify!(pthread_mutex_t___pthread_mutex_s),
739 "::",
740 stringify!(__nusers)
741 )
742 );
743 assert_eq!(
744 unsafe {
745 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__kind as *const _
746 as usize
747 },
748 16usize,
749 concat!(
750 "Offset of field: ",
751 stringify!(pthread_mutex_t___pthread_mutex_s),
752 "::",
753 stringify!(__kind)
754 )
755 );
756 assert_eq!(
757 unsafe {
758 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__spins as *const _
759 as usize
760 },
761 20usize,
762 concat!(
763 "Offset of field: ",
764 stringify!(pthread_mutex_t___pthread_mutex_s),
765 "::",
766 stringify!(__spins)
767 )
768 );
769 assert_eq!(
770 unsafe {
771 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__elision as *const _
772 as usize
773 },
774 22usize,
775 concat!(
776 "Offset of field: ",
777 stringify!(pthread_mutex_t___pthread_mutex_s),
778 "::",
779 stringify!(__elision)
780 )
781 );
782 assert_eq!(
783 unsafe {
784 &(*(::std::ptr::null::<pthread_mutex_t___pthread_mutex_s>())).__list as *const _
785 as usize
786 },
787 24usize,
788 concat!(
789 "Offset of field: ",
790 stringify!(pthread_mutex_t___pthread_mutex_s),
791 "::",
792 stringify!(__list)
793 )
794 );
795 }
796 #[test]
bindgen_test_layout_pthread_mutex_t()797 fn bindgen_test_layout_pthread_mutex_t() {
798 assert_eq!(
799 ::std::mem::size_of::<pthread_mutex_t>(),
800 40usize,
801 concat!("Size of: ", stringify!(pthread_mutex_t))
802 );
803 assert_eq!(
804 ::std::mem::align_of::<pthread_mutex_t>(),
805 8usize,
806 concat!("Alignment of ", stringify!(pthread_mutex_t))
807 );
808 assert_eq!(
809 unsafe { &(*(::std::ptr::null::<pthread_mutex_t>())).__data as *const _ as usize },
810 0usize,
811 concat!(
812 "Offset of field: ",
813 stringify!(pthread_mutex_t),
814 "::",
815 stringify!(__data)
816 )
817 );
818 assert_eq!(
819 unsafe { &(*(::std::ptr::null::<pthread_mutex_t>())).__size as *const _ as usize },
820 0usize,
821 concat!(
822 "Offset of field: ",
823 stringify!(pthread_mutex_t),
824 "::",
825 stringify!(__size)
826 )
827 );
828 assert_eq!(
829 unsafe { &(*(::std::ptr::null::<pthread_mutex_t>())).__align as *const _ as usize },
830 0usize,
831 concat!(
832 "Offset of field: ",
833 stringify!(pthread_mutex_t),
834 "::",
835 stringify!(__align)
836 )
837 );
838 }
839 #[repr(C)]
840 #[derive(Copy, Clone)]
841 pub union pthread_mutexattr_t {
842 pub __size: [::std::os::raw::c_char; 4usize],
843 pub __align: ::std::os::raw::c_int,
844 _bindgen_union_align: u32,
845 }
846 #[test]
bindgen_test_layout_pthread_mutexattr_t()847 fn bindgen_test_layout_pthread_mutexattr_t() {
848 assert_eq!(
849 ::std::mem::size_of::<pthread_mutexattr_t>(),
850 4usize,
851 concat!("Size of: ", stringify!(pthread_mutexattr_t))
852 );
853 assert_eq!(
854 ::std::mem::align_of::<pthread_mutexattr_t>(),
855 4usize,
856 concat!("Alignment of ", stringify!(pthread_mutexattr_t))
857 );
858 assert_eq!(
859 unsafe { &(*(::std::ptr::null::<pthread_mutexattr_t>())).__size as *const _ as usize },
860 0usize,
861 concat!(
862 "Offset of field: ",
863 stringify!(pthread_mutexattr_t),
864 "::",
865 stringify!(__size)
866 )
867 );
868 assert_eq!(
869 unsafe { &(*(::std::ptr::null::<pthread_mutexattr_t>())).__align as *const _ as usize },
870 0usize,
871 concat!(
872 "Offset of field: ",
873 stringify!(pthread_mutexattr_t),
874 "::",
875 stringify!(__align)
876 )
877 );
878 }
879 #[repr(C)]
880 #[derive(Copy, Clone)]
881 pub union pthread_cond_t {
882 pub __data: pthread_cond_t__bindgen_ty_1,
883 pub __size: [::std::os::raw::c_char; 48usize],
884 pub __align: ::std::os::raw::c_longlong,
885 _bindgen_union_align: [u64; 6usize],
886 }
887 #[repr(C)]
888 #[derive(Debug, Copy, Clone)]
889 pub struct pthread_cond_t__bindgen_ty_1 {
890 pub __lock: ::std::os::raw::c_int,
891 pub __futex: ::std::os::raw::c_uint,
892 pub __total_seq: ::std::os::raw::c_ulonglong,
893 pub __wakeup_seq: ::std::os::raw::c_ulonglong,
894 pub __woken_seq: ::std::os::raw::c_ulonglong,
895 pub __mutex: *mut ::std::os::raw::c_void,
896 pub __nwaiters: ::std::os::raw::c_uint,
897 pub __broadcast_seq: ::std::os::raw::c_uint,
898 }
899 #[test]
bindgen_test_layout_pthread_cond_t__bindgen_ty_1()900 fn bindgen_test_layout_pthread_cond_t__bindgen_ty_1() {
901 assert_eq!(
902 ::std::mem::size_of::<pthread_cond_t__bindgen_ty_1>(),
903 48usize,
904 concat!("Size of: ", stringify!(pthread_cond_t__bindgen_ty_1))
905 );
906 assert_eq!(
907 ::std::mem::align_of::<pthread_cond_t__bindgen_ty_1>(),
908 8usize,
909 concat!("Alignment of ", stringify!(pthread_cond_t__bindgen_ty_1))
910 );
911 assert_eq!(
912 unsafe {
913 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__lock as *const _ as usize
914 },
915 0usize,
916 concat!(
917 "Offset of field: ",
918 stringify!(pthread_cond_t__bindgen_ty_1),
919 "::",
920 stringify!(__lock)
921 )
922 );
923 assert_eq!(
924 unsafe {
925 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__futex as *const _ as usize
926 },
927 4usize,
928 concat!(
929 "Offset of field: ",
930 stringify!(pthread_cond_t__bindgen_ty_1),
931 "::",
932 stringify!(__futex)
933 )
934 );
935 assert_eq!(
936 unsafe {
937 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__total_seq as *const _
938 as usize
939 },
940 8usize,
941 concat!(
942 "Offset of field: ",
943 stringify!(pthread_cond_t__bindgen_ty_1),
944 "::",
945 stringify!(__total_seq)
946 )
947 );
948 assert_eq!(
949 unsafe {
950 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__wakeup_seq as *const _
951 as usize
952 },
953 16usize,
954 concat!(
955 "Offset of field: ",
956 stringify!(pthread_cond_t__bindgen_ty_1),
957 "::",
958 stringify!(__wakeup_seq)
959 )
960 );
961 assert_eq!(
962 unsafe {
963 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__woken_seq as *const _
964 as usize
965 },
966 24usize,
967 concat!(
968 "Offset of field: ",
969 stringify!(pthread_cond_t__bindgen_ty_1),
970 "::",
971 stringify!(__woken_seq)
972 )
973 );
974 assert_eq!(
975 unsafe {
976 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__mutex as *const _ as usize
977 },
978 32usize,
979 concat!(
980 "Offset of field: ",
981 stringify!(pthread_cond_t__bindgen_ty_1),
982 "::",
983 stringify!(__mutex)
984 )
985 );
986 assert_eq!(
987 unsafe {
988 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__nwaiters as *const _ as usize
989 },
990 40usize,
991 concat!(
992 "Offset of field: ",
993 stringify!(pthread_cond_t__bindgen_ty_1),
994 "::",
995 stringify!(__nwaiters)
996 )
997 );
998 assert_eq!(
999 unsafe {
1000 &(*(::std::ptr::null::<pthread_cond_t__bindgen_ty_1>())).__broadcast_seq as *const _
1001 as usize
1002 },
1003 44usize,
1004 concat!(
1005 "Offset of field: ",
1006 stringify!(pthread_cond_t__bindgen_ty_1),
1007 "::",
1008 stringify!(__broadcast_seq)
1009 )
1010 );
1011 }
1012 #[test]
bindgen_test_layout_pthread_cond_t()1013 fn bindgen_test_layout_pthread_cond_t() {
1014 assert_eq!(
1015 ::std::mem::size_of::<pthread_cond_t>(),
1016 48usize,
1017 concat!("Size of: ", stringify!(pthread_cond_t))
1018 );
1019 assert_eq!(
1020 ::std::mem::align_of::<pthread_cond_t>(),
1021 8usize,
1022 concat!("Alignment of ", stringify!(pthread_cond_t))
1023 );
1024 assert_eq!(
1025 unsafe { &(*(::std::ptr::null::<pthread_cond_t>())).__data as *const _ as usize },
1026 0usize,
1027 concat!(
1028 "Offset of field: ",
1029 stringify!(pthread_cond_t),
1030 "::",
1031 stringify!(__data)
1032 )
1033 );
1034 assert_eq!(
1035 unsafe { &(*(::std::ptr::null::<pthread_cond_t>())).__size as *const _ as usize },
1036 0usize,
1037 concat!(
1038 "Offset of field: ",
1039 stringify!(pthread_cond_t),
1040 "::",
1041 stringify!(__size)
1042 )
1043 );
1044 assert_eq!(
1045 unsafe { &(*(::std::ptr::null::<pthread_cond_t>())).__align as *const _ as usize },
1046 0usize,
1047 concat!(
1048 "Offset of field: ",
1049 stringify!(pthread_cond_t),
1050 "::",
1051 stringify!(__align)
1052 )
1053 );
1054 }
1055 #[repr(C)]
1056 #[derive(Copy, Clone)]
1057 pub union pthread_condattr_t {
1058 pub __size: [::std::os::raw::c_char; 4usize],
1059 pub __align: ::std::os::raw::c_int,
1060 _bindgen_union_align: u32,
1061 }
1062 #[test]
bindgen_test_layout_pthread_condattr_t()1063 fn bindgen_test_layout_pthread_condattr_t() {
1064 assert_eq!(
1065 ::std::mem::size_of::<pthread_condattr_t>(),
1066 4usize,
1067 concat!("Size of: ", stringify!(pthread_condattr_t))
1068 );
1069 assert_eq!(
1070 ::std::mem::align_of::<pthread_condattr_t>(),
1071 4usize,
1072 concat!("Alignment of ", stringify!(pthread_condattr_t))
1073 );
1074 assert_eq!(
1075 unsafe { &(*(::std::ptr::null::<pthread_condattr_t>())).__size as *const _ as usize },
1076 0usize,
1077 concat!(
1078 "Offset of field: ",
1079 stringify!(pthread_condattr_t),
1080 "::",
1081 stringify!(__size)
1082 )
1083 );
1084 assert_eq!(
1085 unsafe { &(*(::std::ptr::null::<pthread_condattr_t>())).__align as *const _ as usize },
1086 0usize,
1087 concat!(
1088 "Offset of field: ",
1089 stringify!(pthread_condattr_t),
1090 "::",
1091 stringify!(__align)
1092 )
1093 );
1094 }
1095 pub type pthread_key_t = ::std::os::raw::c_uint;
1096 pub type pthread_once_t = ::std::os::raw::c_int;
1097 #[repr(C)]
1098 #[derive(Copy, Clone)]
1099 pub union pthread_rwlock_t {
1100 pub __data: pthread_rwlock_t__bindgen_ty_1,
1101 pub __size: [::std::os::raw::c_char; 56usize],
1102 pub __align: ::std::os::raw::c_long,
1103 _bindgen_union_align: [u64; 7usize],
1104 }
1105 #[repr(C)]
1106 #[derive(Debug, Copy, Clone)]
1107 pub struct pthread_rwlock_t__bindgen_ty_1 {
1108 pub __lock: ::std::os::raw::c_int,
1109 pub __nr_readers: ::std::os::raw::c_uint,
1110 pub __readers_wakeup: ::std::os::raw::c_uint,
1111 pub __writer_wakeup: ::std::os::raw::c_uint,
1112 pub __nr_readers_queued: ::std::os::raw::c_uint,
1113 pub __nr_writers_queued: ::std::os::raw::c_uint,
1114 pub __writer: ::std::os::raw::c_int,
1115 pub __shared: ::std::os::raw::c_int,
1116 pub __rwelision: ::std::os::raw::c_schar,
1117 pub __pad1: [::std::os::raw::c_uchar; 7usize],
1118 pub __pad2: ::std::os::raw::c_ulong,
1119 pub __flags: ::std::os::raw::c_uint,
1120 }
1121 #[test]
bindgen_test_layout_pthread_rwlock_t__bindgen_ty_1()1122 fn bindgen_test_layout_pthread_rwlock_t__bindgen_ty_1() {
1123 assert_eq!(
1124 ::std::mem::size_of::<pthread_rwlock_t__bindgen_ty_1>(),
1125 56usize,
1126 concat!("Size of: ", stringify!(pthread_rwlock_t__bindgen_ty_1))
1127 );
1128 assert_eq!(
1129 ::std::mem::align_of::<pthread_rwlock_t__bindgen_ty_1>(),
1130 8usize,
1131 concat!("Alignment of ", stringify!(pthread_rwlock_t__bindgen_ty_1))
1132 );
1133 assert_eq!(
1134 unsafe {
1135 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__lock as *const _ as usize
1136 },
1137 0usize,
1138 concat!(
1139 "Offset of field: ",
1140 stringify!(pthread_rwlock_t__bindgen_ty_1),
1141 "::",
1142 stringify!(__lock)
1143 )
1144 );
1145 assert_eq!(
1146 unsafe {
1147 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__nr_readers as *const _
1148 as usize
1149 },
1150 4usize,
1151 concat!(
1152 "Offset of field: ",
1153 stringify!(pthread_rwlock_t__bindgen_ty_1),
1154 "::",
1155 stringify!(__nr_readers)
1156 )
1157 );
1158 assert_eq!(
1159 unsafe {
1160 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__readers_wakeup as *const _
1161 as usize
1162 },
1163 8usize,
1164 concat!(
1165 "Offset of field: ",
1166 stringify!(pthread_rwlock_t__bindgen_ty_1),
1167 "::",
1168 stringify!(__readers_wakeup)
1169 )
1170 );
1171 assert_eq!(
1172 unsafe {
1173 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__writer_wakeup as *const _
1174 as usize
1175 },
1176 12usize,
1177 concat!(
1178 "Offset of field: ",
1179 stringify!(pthread_rwlock_t__bindgen_ty_1),
1180 "::",
1181 stringify!(__writer_wakeup)
1182 )
1183 );
1184 assert_eq!(
1185 unsafe {
1186 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__nr_readers_queued
1187 as *const _ as usize
1188 },
1189 16usize,
1190 concat!(
1191 "Offset of field: ",
1192 stringify!(pthread_rwlock_t__bindgen_ty_1),
1193 "::",
1194 stringify!(__nr_readers_queued)
1195 )
1196 );
1197 assert_eq!(
1198 unsafe {
1199 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__nr_writers_queued
1200 as *const _ as usize
1201 },
1202 20usize,
1203 concat!(
1204 "Offset of field: ",
1205 stringify!(pthread_rwlock_t__bindgen_ty_1),
1206 "::",
1207 stringify!(__nr_writers_queued)
1208 )
1209 );
1210 assert_eq!(
1211 unsafe {
1212 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__writer as *const _ as usize
1213 },
1214 24usize,
1215 concat!(
1216 "Offset of field: ",
1217 stringify!(pthread_rwlock_t__bindgen_ty_1),
1218 "::",
1219 stringify!(__writer)
1220 )
1221 );
1222 assert_eq!(
1223 unsafe {
1224 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__shared as *const _ as usize
1225 },
1226 28usize,
1227 concat!(
1228 "Offset of field: ",
1229 stringify!(pthread_rwlock_t__bindgen_ty_1),
1230 "::",
1231 stringify!(__shared)
1232 )
1233 );
1234 assert_eq!(
1235 unsafe {
1236 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__rwelision as *const _
1237 as usize
1238 },
1239 32usize,
1240 concat!(
1241 "Offset of field: ",
1242 stringify!(pthread_rwlock_t__bindgen_ty_1),
1243 "::",
1244 stringify!(__rwelision)
1245 )
1246 );
1247 assert_eq!(
1248 unsafe {
1249 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__pad1 as *const _ as usize
1250 },
1251 33usize,
1252 concat!(
1253 "Offset of field: ",
1254 stringify!(pthread_rwlock_t__bindgen_ty_1),
1255 "::",
1256 stringify!(__pad1)
1257 )
1258 );
1259 assert_eq!(
1260 unsafe {
1261 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__pad2 as *const _ as usize
1262 },
1263 40usize,
1264 concat!(
1265 "Offset of field: ",
1266 stringify!(pthread_rwlock_t__bindgen_ty_1),
1267 "::",
1268 stringify!(__pad2)
1269 )
1270 );
1271 assert_eq!(
1272 unsafe {
1273 &(*(::std::ptr::null::<pthread_rwlock_t__bindgen_ty_1>())).__flags as *const _ as usize
1274 },
1275 48usize,
1276 concat!(
1277 "Offset of field: ",
1278 stringify!(pthread_rwlock_t__bindgen_ty_1),
1279 "::",
1280 stringify!(__flags)
1281 )
1282 );
1283 }
1284 #[test]
bindgen_test_layout_pthread_rwlock_t()1285 fn bindgen_test_layout_pthread_rwlock_t() {
1286 assert_eq!(
1287 ::std::mem::size_of::<pthread_rwlock_t>(),
1288 56usize,
1289 concat!("Size of: ", stringify!(pthread_rwlock_t))
1290 );
1291 assert_eq!(
1292 ::std::mem::align_of::<pthread_rwlock_t>(),
1293 8usize,
1294 concat!("Alignment of ", stringify!(pthread_rwlock_t))
1295 );
1296 assert_eq!(
1297 unsafe { &(*(::std::ptr::null::<pthread_rwlock_t>())).__data as *const _ as usize },
1298 0usize,
1299 concat!(
1300 "Offset of field: ",
1301 stringify!(pthread_rwlock_t),
1302 "::",
1303 stringify!(__data)
1304 )
1305 );
1306 assert_eq!(
1307 unsafe { &(*(::std::ptr::null::<pthread_rwlock_t>())).__size as *const _ as usize },
1308 0usize,
1309 concat!(
1310 "Offset of field: ",
1311 stringify!(pthread_rwlock_t),
1312 "::",
1313 stringify!(__size)
1314 )
1315 );
1316 assert_eq!(
1317 unsafe { &(*(::std::ptr::null::<pthread_rwlock_t>())).__align as *const _ as usize },
1318 0usize,
1319 concat!(
1320 "Offset of field: ",
1321 stringify!(pthread_rwlock_t),
1322 "::",
1323 stringify!(__align)
1324 )
1325 );
1326 }
1327 #[repr(C)]
1328 #[derive(Copy, Clone)]
1329 pub union pthread_rwlockattr_t {
1330 pub __size: [::std::os::raw::c_char; 8usize],
1331 pub __align: ::std::os::raw::c_long,
1332 _bindgen_union_align: u64,
1333 }
1334 #[test]
bindgen_test_layout_pthread_rwlockattr_t()1335 fn bindgen_test_layout_pthread_rwlockattr_t() {
1336 assert_eq!(
1337 ::std::mem::size_of::<pthread_rwlockattr_t>(),
1338 8usize,
1339 concat!("Size of: ", stringify!(pthread_rwlockattr_t))
1340 );
1341 assert_eq!(
1342 ::std::mem::align_of::<pthread_rwlockattr_t>(),
1343 8usize,
1344 concat!("Alignment of ", stringify!(pthread_rwlockattr_t))
1345 );
1346 assert_eq!(
1347 unsafe { &(*(::std::ptr::null::<pthread_rwlockattr_t>())).__size as *const _ as usize },
1348 0usize,
1349 concat!(
1350 "Offset of field: ",
1351 stringify!(pthread_rwlockattr_t),
1352 "::",
1353 stringify!(__size)
1354 )
1355 );
1356 assert_eq!(
1357 unsafe { &(*(::std::ptr::null::<pthread_rwlockattr_t>())).__align as *const _ as usize },
1358 0usize,
1359 concat!(
1360 "Offset of field: ",
1361 stringify!(pthread_rwlockattr_t),
1362 "::",
1363 stringify!(__align)
1364 )
1365 );
1366 }
1367 pub type pthread_spinlock_t = ::std::os::raw::c_int;
1368 #[repr(C)]
1369 #[derive(Copy, Clone)]
1370 pub union pthread_barrier_t {
1371 pub __size: [::std::os::raw::c_char; 32usize],
1372 pub __align: ::std::os::raw::c_long,
1373 _bindgen_union_align: [u64; 4usize],
1374 }
1375 #[test]
bindgen_test_layout_pthread_barrier_t()1376 fn bindgen_test_layout_pthread_barrier_t() {
1377 assert_eq!(
1378 ::std::mem::size_of::<pthread_barrier_t>(),
1379 32usize,
1380 concat!("Size of: ", stringify!(pthread_barrier_t))
1381 );
1382 assert_eq!(
1383 ::std::mem::align_of::<pthread_barrier_t>(),
1384 8usize,
1385 concat!("Alignment of ", stringify!(pthread_barrier_t))
1386 );
1387 assert_eq!(
1388 unsafe { &(*(::std::ptr::null::<pthread_barrier_t>())).__size as *const _ as usize },
1389 0usize,
1390 concat!(
1391 "Offset of field: ",
1392 stringify!(pthread_barrier_t),
1393 "::",
1394 stringify!(__size)
1395 )
1396 );
1397 assert_eq!(
1398 unsafe { &(*(::std::ptr::null::<pthread_barrier_t>())).__align as *const _ as usize },
1399 0usize,
1400 concat!(
1401 "Offset of field: ",
1402 stringify!(pthread_barrier_t),
1403 "::",
1404 stringify!(__align)
1405 )
1406 );
1407 }
1408 #[repr(C)]
1409 #[derive(Copy, Clone)]
1410 pub union pthread_barrierattr_t {
1411 pub __size: [::std::os::raw::c_char; 4usize],
1412 pub __align: ::std::os::raw::c_int,
1413 _bindgen_union_align: u32,
1414 }
1415 #[test]
bindgen_test_layout_pthread_barrierattr_t()1416 fn bindgen_test_layout_pthread_barrierattr_t() {
1417 assert_eq!(
1418 ::std::mem::size_of::<pthread_barrierattr_t>(),
1419 4usize,
1420 concat!("Size of: ", stringify!(pthread_barrierattr_t))
1421 );
1422 assert_eq!(
1423 ::std::mem::align_of::<pthread_barrierattr_t>(),
1424 4usize,
1425 concat!("Alignment of ", stringify!(pthread_barrierattr_t))
1426 );
1427 assert_eq!(
1428 unsafe { &(*(::std::ptr::null::<pthread_barrierattr_t>())).__size as *const _ as usize },
1429 0usize,
1430 concat!(
1431 "Offset of field: ",
1432 stringify!(pthread_barrierattr_t),
1433 "::",
1434 stringify!(__size)
1435 )
1436 );
1437 assert_eq!(
1438 unsafe { &(*(::std::ptr::null::<pthread_barrierattr_t>())).__align as *const _ as usize },
1439 0usize,
1440 concat!(
1441 "Offset of field: ",
1442 stringify!(pthread_barrierattr_t),
1443 "::",
1444 stringify!(__align)
1445 )
1446 );
1447 }
1448 #[repr(C)]
1449 #[derive(Debug, Copy, Clone)]
1450 pub struct timezone {
1451 pub tz_minuteswest: ::std::os::raw::c_int,
1452 pub tz_dsttime: ::std::os::raw::c_int,
1453 }
1454 #[test]
bindgen_test_layout_timezone()1455 fn bindgen_test_layout_timezone() {
1456 assert_eq!(
1457 ::std::mem::size_of::<timezone>(),
1458 8usize,
1459 concat!("Size of: ", stringify!(timezone))
1460 );
1461 assert_eq!(
1462 ::std::mem::align_of::<timezone>(),
1463 4usize,
1464 concat!("Alignment of ", stringify!(timezone))
1465 );
1466 assert_eq!(
1467 unsafe { &(*(::std::ptr::null::<timezone>())).tz_minuteswest as *const _ as usize },
1468 0usize,
1469 concat!(
1470 "Offset of field: ",
1471 stringify!(timezone),
1472 "::",
1473 stringify!(tz_minuteswest)
1474 )
1475 );
1476 assert_eq!(
1477 unsafe { &(*(::std::ptr::null::<timezone>())).tz_dsttime as *const _ as usize },
1478 4usize,
1479 concat!(
1480 "Offset of field: ",
1481 stringify!(timezone),
1482 "::",
1483 stringify!(tz_dsttime)
1484 )
1485 );
1486 }
1487 pub type __timezone_ptr_t = *mut timezone;
1488 extern "C" {
gettimeofday(__tv: *mut timeval, __tz: __timezone_ptr_t) -> ::std::os::raw::c_int1489 pub fn gettimeofday(__tv: *mut timeval, __tz: __timezone_ptr_t) -> ::std::os::raw::c_int;
1490 }
1491 extern "C" {
settimeofday(__tv: *const timeval, __tz: *const timezone) -> ::std::os::raw::c_int1492 pub fn settimeofday(__tv: *const timeval, __tz: *const timezone) -> ::std::os::raw::c_int;
1493 }
1494 extern "C" {
adjtime(__delta: *const timeval, __olddelta: *mut timeval) -> ::std::os::raw::c_int1495 pub fn adjtime(__delta: *const timeval, __olddelta: *mut timeval) -> ::std::os::raw::c_int;
1496 }
1497 pub const ITIMER_REAL: __itimer_which = 0;
1498 pub const ITIMER_VIRTUAL: __itimer_which = 1;
1499 pub const ITIMER_PROF: __itimer_which = 2;
1500 pub type __itimer_which = u32;
1501 #[repr(C)]
1502 #[derive(Debug, Copy, Clone)]
1503 pub struct itimerval {
1504 pub it_interval: timeval,
1505 pub it_value: timeval,
1506 }
1507 #[test]
bindgen_test_layout_itimerval()1508 fn bindgen_test_layout_itimerval() {
1509 assert_eq!(
1510 ::std::mem::size_of::<itimerval>(),
1511 32usize,
1512 concat!("Size of: ", stringify!(itimerval))
1513 );
1514 assert_eq!(
1515 ::std::mem::align_of::<itimerval>(),
1516 8usize,
1517 concat!("Alignment of ", stringify!(itimerval))
1518 );
1519 assert_eq!(
1520 unsafe { &(*(::std::ptr::null::<itimerval>())).it_interval as *const _ as usize },
1521 0usize,
1522 concat!(
1523 "Offset of field: ",
1524 stringify!(itimerval),
1525 "::",
1526 stringify!(it_interval)
1527 )
1528 );
1529 assert_eq!(
1530 unsafe { &(*(::std::ptr::null::<itimerval>())).it_value as *const _ as usize },
1531 16usize,
1532 concat!(
1533 "Offset of field: ",
1534 stringify!(itimerval),
1535 "::",
1536 stringify!(it_value)
1537 )
1538 );
1539 }
1540 pub type __itimer_which_t = ::std::os::raw::c_int;
1541 extern "C" {
getitimer(__which: __itimer_which_t, __value: *mut itimerval) -> ::std::os::raw::c_int1542 pub fn getitimer(__which: __itimer_which_t, __value: *mut itimerval) -> ::std::os::raw::c_int;
1543 }
1544 extern "C" {
setitimer( __which: __itimer_which_t, __new: *const itimerval, __old: *mut itimerval, ) -> ::std::os::raw::c_int1545 pub fn setitimer(
1546 __which: __itimer_which_t,
1547 __new: *const itimerval,
1548 __old: *mut itimerval,
1549 ) -> ::std::os::raw::c_int;
1550 }
1551 extern "C" {
utimes( __file: *const ::std::os::raw::c_char, __tvp: *const timeval, ) -> ::std::os::raw::c_int1552 pub fn utimes(
1553 __file: *const ::std::os::raw::c_char,
1554 __tvp: *const timeval,
1555 ) -> ::std::os::raw::c_int;
1556 }
1557 extern "C" {
lutimes( __file: *const ::std::os::raw::c_char, __tvp: *const timeval, ) -> ::std::os::raw::c_int1558 pub fn lutimes(
1559 __file: *const ::std::os::raw::c_char,
1560 __tvp: *const timeval,
1561 ) -> ::std::os::raw::c_int;
1562 }
1563 extern "C" {
futimes(__fd: ::std::os::raw::c_int, __tvp: *const timeval) -> ::std::os::raw::c_int1564 pub fn futimes(__fd: ::std::os::raw::c_int, __tvp: *const timeval) -> ::std::os::raw::c_int;
1565 }
1566 #[repr(C)]
1567 #[derive(Debug, Copy, Clone)]
1568 pub struct tm {
1569 pub tm_sec: ::std::os::raw::c_int,
1570 pub tm_min: ::std::os::raw::c_int,
1571 pub tm_hour: ::std::os::raw::c_int,
1572 pub tm_mday: ::std::os::raw::c_int,
1573 pub tm_mon: ::std::os::raw::c_int,
1574 pub tm_year: ::std::os::raw::c_int,
1575 pub tm_wday: ::std::os::raw::c_int,
1576 pub tm_yday: ::std::os::raw::c_int,
1577 pub tm_isdst: ::std::os::raw::c_int,
1578 pub tm_gmtoff: ::std::os::raw::c_long,
1579 pub tm_zone: *const ::std::os::raw::c_char,
1580 }
1581 #[test]
bindgen_test_layout_tm()1582 fn bindgen_test_layout_tm() {
1583 assert_eq!(
1584 ::std::mem::size_of::<tm>(),
1585 56usize,
1586 concat!("Size of: ", stringify!(tm))
1587 );
1588 assert_eq!(
1589 ::std::mem::align_of::<tm>(),
1590 8usize,
1591 concat!("Alignment of ", stringify!(tm))
1592 );
1593 assert_eq!(
1594 unsafe { &(*(::std::ptr::null::<tm>())).tm_sec as *const _ as usize },
1595 0usize,
1596 concat!(
1597 "Offset of field: ",
1598 stringify!(tm),
1599 "::",
1600 stringify!(tm_sec)
1601 )
1602 );
1603 assert_eq!(
1604 unsafe { &(*(::std::ptr::null::<tm>())).tm_min as *const _ as usize },
1605 4usize,
1606 concat!(
1607 "Offset of field: ",
1608 stringify!(tm),
1609 "::",
1610 stringify!(tm_min)
1611 )
1612 );
1613 assert_eq!(
1614 unsafe { &(*(::std::ptr::null::<tm>())).tm_hour as *const _ as usize },
1615 8usize,
1616 concat!(
1617 "Offset of field: ",
1618 stringify!(tm),
1619 "::",
1620 stringify!(tm_hour)
1621 )
1622 );
1623 assert_eq!(
1624 unsafe { &(*(::std::ptr::null::<tm>())).tm_mday as *const _ as usize },
1625 12usize,
1626 concat!(
1627 "Offset of field: ",
1628 stringify!(tm),
1629 "::",
1630 stringify!(tm_mday)
1631 )
1632 );
1633 assert_eq!(
1634 unsafe { &(*(::std::ptr::null::<tm>())).tm_mon as *const _ as usize },
1635 16usize,
1636 concat!(
1637 "Offset of field: ",
1638 stringify!(tm),
1639 "::",
1640 stringify!(tm_mon)
1641 )
1642 );
1643 assert_eq!(
1644 unsafe { &(*(::std::ptr::null::<tm>())).tm_year as *const _ as usize },
1645 20usize,
1646 concat!(
1647 "Offset of field: ",
1648 stringify!(tm),
1649 "::",
1650 stringify!(tm_year)
1651 )
1652 );
1653 assert_eq!(
1654 unsafe { &(*(::std::ptr::null::<tm>())).tm_wday as *const _ as usize },
1655 24usize,
1656 concat!(
1657 "Offset of field: ",
1658 stringify!(tm),
1659 "::",
1660 stringify!(tm_wday)
1661 )
1662 );
1663 assert_eq!(
1664 unsafe { &(*(::std::ptr::null::<tm>())).tm_yday as *const _ as usize },
1665 28usize,
1666 concat!(
1667 "Offset of field: ",
1668 stringify!(tm),
1669 "::",
1670 stringify!(tm_yday)
1671 )
1672 );
1673 assert_eq!(
1674 unsafe { &(*(::std::ptr::null::<tm>())).tm_isdst as *const _ as usize },
1675 32usize,
1676 concat!(
1677 "Offset of field: ",
1678 stringify!(tm),
1679 "::",
1680 stringify!(tm_isdst)
1681 )
1682 );
1683 assert_eq!(
1684 unsafe { &(*(::std::ptr::null::<tm>())).tm_gmtoff as *const _ as usize },
1685 40usize,
1686 concat!(
1687 "Offset of field: ",
1688 stringify!(tm),
1689 "::",
1690 stringify!(tm_gmtoff)
1691 )
1692 );
1693 assert_eq!(
1694 unsafe { &(*(::std::ptr::null::<tm>())).tm_zone as *const _ as usize },
1695 48usize,
1696 concat!(
1697 "Offset of field: ",
1698 stringify!(tm),
1699 "::",
1700 stringify!(tm_zone)
1701 )
1702 );
1703 }
1704 #[repr(C)]
1705 #[derive(Debug, Copy, Clone)]
1706 pub struct itimerspec {
1707 pub it_interval: timespec,
1708 pub it_value: timespec,
1709 }
1710 #[test]
bindgen_test_layout_itimerspec()1711 fn bindgen_test_layout_itimerspec() {
1712 assert_eq!(
1713 ::std::mem::size_of::<itimerspec>(),
1714 32usize,
1715 concat!("Size of: ", stringify!(itimerspec))
1716 );
1717 assert_eq!(
1718 ::std::mem::align_of::<itimerspec>(),
1719 8usize,
1720 concat!("Alignment of ", stringify!(itimerspec))
1721 );
1722 assert_eq!(
1723 unsafe { &(*(::std::ptr::null::<itimerspec>())).it_interval as *const _ as usize },
1724 0usize,
1725 concat!(
1726 "Offset of field: ",
1727 stringify!(itimerspec),
1728 "::",
1729 stringify!(it_interval)
1730 )
1731 );
1732 assert_eq!(
1733 unsafe { &(*(::std::ptr::null::<itimerspec>())).it_value as *const _ as usize },
1734 16usize,
1735 concat!(
1736 "Offset of field: ",
1737 stringify!(itimerspec),
1738 "::",
1739 stringify!(it_value)
1740 )
1741 );
1742 }
1743 #[repr(C)]
1744 #[derive(Debug, Copy, Clone)]
1745 pub struct sigevent {
1746 _unused: [u8; 0],
1747 }
1748 extern "C" {
clock() -> clock_t1749 pub fn clock() -> clock_t;
1750 }
1751 extern "C" {
time(__timer: *mut time_t) -> time_t1752 pub fn time(__timer: *mut time_t) -> time_t;
1753 }
1754 extern "C" {
difftime(__time1: time_t, __time0: time_t) -> f641755 pub fn difftime(__time1: time_t, __time0: time_t) -> f64;
1756 }
1757 extern "C" {
mktime(__tp: *mut tm) -> time_t1758 pub fn mktime(__tp: *mut tm) -> time_t;
1759 }
1760 extern "C" {
strftime( __s: *mut ::std::os::raw::c_char, __maxsize: usize, __format: *const ::std::os::raw::c_char, __tp: *const tm, ) -> usize1761 pub fn strftime(
1762 __s: *mut ::std::os::raw::c_char,
1763 __maxsize: usize,
1764 __format: *const ::std::os::raw::c_char,
1765 __tp: *const tm,
1766 ) -> usize;
1767 }
1768 #[repr(C)]
1769 #[derive(Debug, Copy, Clone)]
1770 pub struct __locale_struct {
1771 pub __locales: [*mut __locale_data; 13usize],
1772 pub __ctype_b: *const ::std::os::raw::c_ushort,
1773 pub __ctype_tolower: *const ::std::os::raw::c_int,
1774 pub __ctype_toupper: *const ::std::os::raw::c_int,
1775 pub __names: [*const ::std::os::raw::c_char; 13usize],
1776 }
1777 #[test]
bindgen_test_layout___locale_struct()1778 fn bindgen_test_layout___locale_struct() {
1779 assert_eq!(
1780 ::std::mem::size_of::<__locale_struct>(),
1781 232usize,
1782 concat!("Size of: ", stringify!(__locale_struct))
1783 );
1784 assert_eq!(
1785 ::std::mem::align_of::<__locale_struct>(),
1786 8usize,
1787 concat!("Alignment of ", stringify!(__locale_struct))
1788 );
1789 assert_eq!(
1790 unsafe { &(*(::std::ptr::null::<__locale_struct>())).__locales as *const _ as usize },
1791 0usize,
1792 concat!(
1793 "Offset of field: ",
1794 stringify!(__locale_struct),
1795 "::",
1796 stringify!(__locales)
1797 )
1798 );
1799 assert_eq!(
1800 unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_b as *const _ as usize },
1801 104usize,
1802 concat!(
1803 "Offset of field: ",
1804 stringify!(__locale_struct),
1805 "::",
1806 stringify!(__ctype_b)
1807 )
1808 );
1809 assert_eq!(
1810 unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_tolower as *const _ as usize },
1811 112usize,
1812 concat!(
1813 "Offset of field: ",
1814 stringify!(__locale_struct),
1815 "::",
1816 stringify!(__ctype_tolower)
1817 )
1818 );
1819 assert_eq!(
1820 unsafe { &(*(::std::ptr::null::<__locale_struct>())).__ctype_toupper as *const _ as usize },
1821 120usize,
1822 concat!(
1823 "Offset of field: ",
1824 stringify!(__locale_struct),
1825 "::",
1826 stringify!(__ctype_toupper)
1827 )
1828 );
1829 assert_eq!(
1830 unsafe { &(*(::std::ptr::null::<__locale_struct>())).__names as *const _ as usize },
1831 128usize,
1832 concat!(
1833 "Offset of field: ",
1834 stringify!(__locale_struct),
1835 "::",
1836 stringify!(__names)
1837 )
1838 );
1839 }
1840 pub type __locale_t = *mut __locale_struct;
1841 pub type locale_t = __locale_t;
1842 extern "C" {
strftime_l( __s: *mut ::std::os::raw::c_char, __maxsize: usize, __format: *const ::std::os::raw::c_char, __tp: *const tm, __loc: __locale_t, ) -> usize1843 pub fn strftime_l(
1844 __s: *mut ::std::os::raw::c_char,
1845 __maxsize: usize,
1846 __format: *const ::std::os::raw::c_char,
1847 __tp: *const tm,
1848 __loc: __locale_t,
1849 ) -> usize;
1850 }
1851 extern "C" {
gmtime(__timer: *const time_t) -> *mut tm1852 pub fn gmtime(__timer: *const time_t) -> *mut tm;
1853 }
1854 extern "C" {
localtime(__timer: *const time_t) -> *mut tm1855 pub fn localtime(__timer: *const time_t) -> *mut tm;
1856 }
1857 extern "C" {
gmtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm1858 pub fn gmtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm;
1859 }
1860 extern "C" {
localtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm1861 pub fn localtime_r(__timer: *const time_t, __tp: *mut tm) -> *mut tm;
1862 }
1863 extern "C" {
asctime(__tp: *const tm) -> *mut ::std::os::raw::c_char1864 pub fn asctime(__tp: *const tm) -> *mut ::std::os::raw::c_char;
1865 }
1866 extern "C" {
ctime(__timer: *const time_t) -> *mut ::std::os::raw::c_char1867 pub fn ctime(__timer: *const time_t) -> *mut ::std::os::raw::c_char;
1868 }
1869 extern "C" {
asctime_r( __tp: *const tm, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char1870 pub fn asctime_r(
1871 __tp: *const tm,
1872 __buf: *mut ::std::os::raw::c_char,
1873 ) -> *mut ::std::os::raw::c_char;
1874 }
1875 extern "C" {
ctime_r( __timer: *const time_t, __buf: *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char1876 pub fn ctime_r(
1877 __timer: *const time_t,
1878 __buf: *mut ::std::os::raw::c_char,
1879 ) -> *mut ::std::os::raw::c_char;
1880 }
1881 extern "C" {
1882 #[link_name = "\u{1}__tzname"]
1883 pub static mut __tzname: [*mut ::std::os::raw::c_char; 2usize];
1884 }
1885 extern "C" {
1886 #[link_name = "\u{1}__daylight"]
1887 pub static mut __daylight: ::std::os::raw::c_int;
1888 }
1889 extern "C" {
1890 #[link_name = "\u{1}__timezone"]
1891 pub static mut __timezone: ::std::os::raw::c_long;
1892 }
1893 extern "C" {
1894 #[link_name = "\u{1}tzname"]
1895 pub static mut tzname: [*mut ::std::os::raw::c_char; 2usize];
1896 }
1897 extern "C" {
tzset()1898 pub fn tzset();
1899 }
1900 extern "C" {
1901 #[link_name = "\u{1}daylight"]
1902 pub static mut daylight: ::std::os::raw::c_int;
1903 }
1904 extern "C" {
1905 #[link_name = "\u{1}timezone"]
1906 pub static mut timezone: ::std::os::raw::c_long;
1907 }
1908 extern "C" {
stime(__when: *const time_t) -> ::std::os::raw::c_int1909 pub fn stime(__when: *const time_t) -> ::std::os::raw::c_int;
1910 }
1911 extern "C" {
timegm(__tp: *mut tm) -> time_t1912 pub fn timegm(__tp: *mut tm) -> time_t;
1913 }
1914 extern "C" {
timelocal(__tp: *mut tm) -> time_t1915 pub fn timelocal(__tp: *mut tm) -> time_t;
1916 }
1917 extern "C" {
dysize(__year: ::std::os::raw::c_int) -> ::std::os::raw::c_int1918 pub fn dysize(__year: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
1919 }
1920 extern "C" {
nanosleep( __requested_time: *const timespec, __remaining: *mut timespec, ) -> ::std::os::raw::c_int1921 pub fn nanosleep(
1922 __requested_time: *const timespec,
1923 __remaining: *mut timespec,
1924 ) -> ::std::os::raw::c_int;
1925 }
1926 extern "C" {
clock_getres(__clock_id: clockid_t, __res: *mut timespec) -> ::std::os::raw::c_int1927 pub fn clock_getres(__clock_id: clockid_t, __res: *mut timespec) -> ::std::os::raw::c_int;
1928 }
1929 extern "C" {
clock_gettime(__clock_id: clockid_t, __tp: *mut timespec) -> ::std::os::raw::c_int1930 pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut timespec) -> ::std::os::raw::c_int;
1931 }
1932 extern "C" {
clock_settime(__clock_id: clockid_t, __tp: *const timespec) -> ::std::os::raw::c_int1933 pub fn clock_settime(__clock_id: clockid_t, __tp: *const timespec) -> ::std::os::raw::c_int;
1934 }
1935 extern "C" {
clock_nanosleep( __clock_id: clockid_t, __flags: ::std::os::raw::c_int, __req: *const timespec, __rem: *mut timespec, ) -> ::std::os::raw::c_int1936 pub fn clock_nanosleep(
1937 __clock_id: clockid_t,
1938 __flags: ::std::os::raw::c_int,
1939 __req: *const timespec,
1940 __rem: *mut timespec,
1941 ) -> ::std::os::raw::c_int;
1942 }
1943 extern "C" {
clock_getcpuclockid(__pid: pid_t, __clock_id: *mut clockid_t) -> ::std::os::raw::c_int1944 pub fn clock_getcpuclockid(__pid: pid_t, __clock_id: *mut clockid_t) -> ::std::os::raw::c_int;
1945 }
1946 extern "C" {
timer_create( __clock_id: clockid_t, __evp: *mut sigevent, __timerid: *mut timer_t, ) -> ::std::os::raw::c_int1947 pub fn timer_create(
1948 __clock_id: clockid_t,
1949 __evp: *mut sigevent,
1950 __timerid: *mut timer_t,
1951 ) -> ::std::os::raw::c_int;
1952 }
1953 extern "C" {
timer_delete(__timerid: timer_t) -> ::std::os::raw::c_int1954 pub fn timer_delete(__timerid: timer_t) -> ::std::os::raw::c_int;
1955 }
1956 extern "C" {
timer_settime( __timerid: timer_t, __flags: ::std::os::raw::c_int, __value: *const itimerspec, __ovalue: *mut itimerspec, ) -> ::std::os::raw::c_int1957 pub fn timer_settime(
1958 __timerid: timer_t,
1959 __flags: ::std::os::raw::c_int,
1960 __value: *const itimerspec,
1961 __ovalue: *mut itimerspec,
1962 ) -> ::std::os::raw::c_int;
1963 }
1964 extern "C" {
timer_gettime(__timerid: timer_t, __value: *mut itimerspec) -> ::std::os::raw::c_int1965 pub fn timer_gettime(__timerid: timer_t, __value: *mut itimerspec) -> ::std::os::raw::c_int;
1966 }
1967 extern "C" {
timer_getoverrun(__timerid: timer_t) -> ::std::os::raw::c_int1968 pub fn timer_getoverrun(__timerid: timer_t) -> ::std::os::raw::c_int;
1969 }
1970 extern "C" {
timespec_get( __ts: *mut timespec, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int1971 pub fn timespec_get(
1972 __ts: *mut timespec,
1973 __base: ::std::os::raw::c_int,
1974 ) -> ::std::os::raw::c_int;
1975 }
1976 /// In the context of a \ref libusb_device_descriptor "device descriptor",
1977 /// this bDeviceClass value indicates that each interface specifies its
1978 /// own class information and all interfaces operate independently.
1979 pub const LIBUSB_CLASS_PER_INTERFACE: libusb_class_code = 0;
1980 /// Audio class
1981 pub const LIBUSB_CLASS_AUDIO: libusb_class_code = 1;
1982 /// Communications class
1983 pub const LIBUSB_CLASS_COMM: libusb_class_code = 2;
1984 /// Human Interface Device class
1985 pub const LIBUSB_CLASS_HID: libusb_class_code = 3;
1986 /// Physical
1987 pub const LIBUSB_CLASS_PHYSICAL: libusb_class_code = 5;
1988 /// Printer class
1989 pub const LIBUSB_CLASS_PRINTER: libusb_class_code = 7;
1990 /// Image class
1991 pub const LIBUSB_CLASS_PTP: libusb_class_code = 6;
1992 /// Image class
1993 pub const LIBUSB_CLASS_IMAGE: libusb_class_code = 6;
1994 /// Mass storage class
1995 pub const LIBUSB_CLASS_MASS_STORAGE: libusb_class_code = 8;
1996 /// Hub class
1997 pub const LIBUSB_CLASS_HUB: libusb_class_code = 9;
1998 /// Data class
1999 pub const LIBUSB_CLASS_DATA: libusb_class_code = 10;
2000 /// Smart Card
2001 pub const LIBUSB_CLASS_SMART_CARD: libusb_class_code = 11;
2002 /// Content Security
2003 pub const LIBUSB_CLASS_CONTENT_SECURITY: libusb_class_code = 13;
2004 /// Video
2005 pub const LIBUSB_CLASS_VIDEO: libusb_class_code = 14;
2006 /// Personal Healthcare
2007 pub const LIBUSB_CLASS_PERSONAL_HEALTHCARE: libusb_class_code = 15;
2008 /// Diagnostic Device
2009 pub const LIBUSB_CLASS_DIAGNOSTIC_DEVICE: libusb_class_code = 220;
2010 /// Wireless class
2011 pub const LIBUSB_CLASS_WIRELESS: libusb_class_code = 224;
2012 /// Application class
2013 pub const LIBUSB_CLASS_APPLICATION: libusb_class_code = 254;
2014 /// Class is vendor-specific
2015 pub const LIBUSB_CLASS_VENDOR_SPEC: libusb_class_code = 255;
2016 /// \ingroup libusb_desc
2017 /// Device and/or Interface Class codes
2018 pub type libusb_class_code = u32;
2019 /// Device descriptor. See libusb_device_descriptor.
2020 pub const LIBUSB_DT_DEVICE: libusb_descriptor_type = 1;
2021 /// Configuration descriptor. See libusb_config_descriptor.
2022 pub const LIBUSB_DT_CONFIG: libusb_descriptor_type = 2;
2023 /// String descriptor
2024 pub const LIBUSB_DT_STRING: libusb_descriptor_type = 3;
2025 /// Interface descriptor. See libusb_interface_descriptor.
2026 pub const LIBUSB_DT_INTERFACE: libusb_descriptor_type = 4;
2027 /// Endpoint descriptor. See libusb_endpoint_descriptor.
2028 pub const LIBUSB_DT_ENDPOINT: libusb_descriptor_type = 5;
2029 /// BOS descriptor
2030 pub const LIBUSB_DT_BOS: libusb_descriptor_type = 15;
2031 /// Device Capability descriptor
2032 pub const LIBUSB_DT_DEVICE_CAPABILITY: libusb_descriptor_type = 16;
2033 /// HID descriptor
2034 pub const LIBUSB_DT_HID: libusb_descriptor_type = 33;
2035 /// HID report descriptor
2036 pub const LIBUSB_DT_REPORT: libusb_descriptor_type = 34;
2037 /// Physical descriptor
2038 pub const LIBUSB_DT_PHYSICAL: libusb_descriptor_type = 35;
2039 /// Hub descriptor
2040 pub const LIBUSB_DT_HUB: libusb_descriptor_type = 41;
2041 /// SuperSpeed Hub descriptor
2042 pub const LIBUSB_DT_SUPERSPEED_HUB: libusb_descriptor_type = 42;
2043 /// SuperSpeed Endpoint Companion descriptor
2044 pub const LIBUSB_DT_SS_ENDPOINT_COMPANION: libusb_descriptor_type = 48;
2045 /// \ingroup libusb_desc
2046 /// Descriptor types as defined by the USB specification.
2047 pub type libusb_descriptor_type = u32;
2048 /// In: device-to-host
2049 pub const LIBUSB_ENDPOINT_IN: libusb_endpoint_direction = 128;
2050 /// Out: host-to-device
2051 pub const LIBUSB_ENDPOINT_OUT: libusb_endpoint_direction = 0;
2052 /// \ingroup libusb_desc
2053 /// Endpoint direction. Values for bit 7 of the
2054 /// \ref libusb_endpoint_descriptor::bEndpointAddress "endpoint address" scheme.
2055 pub type libusb_endpoint_direction = u32;
2056 /// Control endpoint
2057 pub const LIBUSB_TRANSFER_TYPE_CONTROL: libusb_transfer_type = 0;
2058 /// Isochronous endpoint
2059 pub const LIBUSB_TRANSFER_TYPE_ISOCHRONOUS: libusb_transfer_type = 1;
2060 /// Bulk endpoint
2061 pub const LIBUSB_TRANSFER_TYPE_BULK: libusb_transfer_type = 2;
2062 /// Interrupt endpoint
2063 pub const LIBUSB_TRANSFER_TYPE_INTERRUPT: libusb_transfer_type = 3;
2064 /// Stream endpoint
2065 pub const LIBUSB_TRANSFER_TYPE_BULK_STREAM: libusb_transfer_type = 4;
2066 /// \ingroup libusb_desc
2067 /// Endpoint transfer type. Values for bits 0:1 of the
2068 /// \ref libusb_endpoint_descriptor::bmAttributes "endpoint attributes" field.
2069 pub type libusb_transfer_type = u32;
2070 /// Request status of the specific recipient
2071 pub const LIBUSB_REQUEST_GET_STATUS: libusb_standard_request = 0;
2072 /// Clear or disable a specific feature
2073 pub const LIBUSB_REQUEST_CLEAR_FEATURE: libusb_standard_request = 1;
2074 /// Set or enable a specific feature
2075 pub const LIBUSB_REQUEST_SET_FEATURE: libusb_standard_request = 3;
2076 /// Set device address for all future accesses
2077 pub const LIBUSB_REQUEST_SET_ADDRESS: libusb_standard_request = 5;
2078 /// Get the specified descriptor
2079 pub const LIBUSB_REQUEST_GET_DESCRIPTOR: libusb_standard_request = 6;
2080 /// Used to update existing descriptors or add new descriptors
2081 pub const LIBUSB_REQUEST_SET_DESCRIPTOR: libusb_standard_request = 7;
2082 /// Get the current device configuration value
2083 pub const LIBUSB_REQUEST_GET_CONFIGURATION: libusb_standard_request = 8;
2084 /// Set device configuration
2085 pub const LIBUSB_REQUEST_SET_CONFIGURATION: libusb_standard_request = 9;
2086 /// Return the selected alternate setting for the specified interface
2087 pub const LIBUSB_REQUEST_GET_INTERFACE: libusb_standard_request = 10;
2088 /// Select an alternate interface for the specified interface
2089 pub const LIBUSB_REQUEST_SET_INTERFACE: libusb_standard_request = 11;
2090 /// Set then report an endpoint's synchronization frame
2091 pub const LIBUSB_REQUEST_SYNCH_FRAME: libusb_standard_request = 12;
2092 /// Sets both the U1 and U2 Exit Latency
2093 pub const LIBUSB_REQUEST_SET_SEL: libusb_standard_request = 48;
2094 /// Delay from the time a host transmits a packet to the time it is
2095 /// received by the device.
2096 pub const LIBUSB_SET_ISOCH_DELAY: libusb_standard_request = 49;
2097 /// \ingroup libusb_misc
2098 /// Standard requests, as defined in table 9-5 of the USB 3.0 specifications
2099 pub type libusb_standard_request = u32;
2100 /// Standard
2101 pub const LIBUSB_REQUEST_TYPE_STANDARD: libusb_request_type = 0;
2102 /// Class
2103 pub const LIBUSB_REQUEST_TYPE_CLASS: libusb_request_type = 32;
2104 /// Vendor
2105 pub const LIBUSB_REQUEST_TYPE_VENDOR: libusb_request_type = 64;
2106 /// Reserved
2107 pub const LIBUSB_REQUEST_TYPE_RESERVED: libusb_request_type = 96;
2108 /// \ingroup libusb_misc
2109 /// Request type bits of the
2110 /// \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
2111 /// transfers.
2112 pub type libusb_request_type = u32;
2113 /// Device
2114 pub const LIBUSB_RECIPIENT_DEVICE: libusb_request_recipient = 0;
2115 /// Interface
2116 pub const LIBUSB_RECIPIENT_INTERFACE: libusb_request_recipient = 1;
2117 /// Endpoint
2118 pub const LIBUSB_RECIPIENT_ENDPOINT: libusb_request_recipient = 2;
2119 /// Other
2120 pub const LIBUSB_RECIPIENT_OTHER: libusb_request_recipient = 3;
2121 /// \ingroup libusb_misc
2122 /// Recipient bits of the
2123 /// \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
2124 /// transfers. Values 4 through 31 are reserved.
2125 pub type libusb_request_recipient = u32;
2126 /// No synchronization
2127 pub const LIBUSB_ISO_SYNC_TYPE_NONE: libusb_iso_sync_type = 0;
2128 /// Asynchronous
2129 pub const LIBUSB_ISO_SYNC_TYPE_ASYNC: libusb_iso_sync_type = 1;
2130 /// Adaptive
2131 pub const LIBUSB_ISO_SYNC_TYPE_ADAPTIVE: libusb_iso_sync_type = 2;
2132 /// Synchronous
2133 pub const LIBUSB_ISO_SYNC_TYPE_SYNC: libusb_iso_sync_type = 3;
2134 /// \ingroup libusb_desc
2135 /// Synchronization type for isochronous endpoints. Values for bits 2:3 of the
2136 /// \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in
2137 /// libusb_endpoint_descriptor.
2138 pub type libusb_iso_sync_type = u32;
2139 /// Data endpoint
2140 pub const LIBUSB_ISO_USAGE_TYPE_DATA: libusb_iso_usage_type = 0;
2141 /// Feedback endpoint
2142 pub const LIBUSB_ISO_USAGE_TYPE_FEEDBACK: libusb_iso_usage_type = 1;
2143 /// Implicit feedback Data endpoint
2144 pub const LIBUSB_ISO_USAGE_TYPE_IMPLICIT: libusb_iso_usage_type = 2;
2145 /// \ingroup libusb_desc
2146 /// Usage type for isochronous endpoints. Values for bits 4:5 of the
2147 /// \ref libusb_endpoint_descriptor::bmAttributes "bmAttributes" field in
2148 /// libusb_endpoint_descriptor.
2149 pub type libusb_iso_usage_type = u32;
2150 /// \ingroup libusb_desc
2151 /// A structure representing the standard USB device descriptor. This
2152 /// descriptor is documented in section 9.6.1 of the USB 3.0 specification.
2153 /// All multiple-byte fields are represented in host-endian format.
2154 #[repr(C)]
2155 #[derive(Default, Debug, Copy, Clone)]
2156 pub struct libusb_device_descriptor {
2157 /// Size of this descriptor (in bytes)
2158 pub bLength: u8,
2159 /// Descriptor type. Will have value
2160 /// \ref libusb_descriptor_type::LIBUSB_DT_DEVICE LIBUSB_DT_DEVICE in this
2161 /// context.
2162 pub bDescriptorType: u8,
2163 /// USB specification release number in binary-coded decimal. A value of
2164 /// 0x0200 indicates USB 2.0, 0x0110 indicates USB 1.1, etc.
2165 pub bcdUSB: u16,
2166 /// USB-IF class code for the device. See \ref libusb_class_code.
2167 pub bDeviceClass: u8,
2168 /// USB-IF subclass code for the device, qualified by the bDeviceClass
2169 /// value
2170 pub bDeviceSubClass: u8,
2171 /// USB-IF protocol code for the device, qualified by the bDeviceClass and
2172 /// bDeviceSubClass values
2173 pub bDeviceProtocol: u8,
2174 /// Maximum packet size for endpoint 0
2175 pub bMaxPacketSize0: u8,
2176 /// USB-IF vendor ID
2177 pub idVendor: u16,
2178 /// USB-IF product ID
2179 pub idProduct: u16,
2180 /// Device release number in binary-coded decimal
2181 pub bcdDevice: u16,
2182 /// Index of string descriptor describing manufacturer
2183 pub iManufacturer: u8,
2184 /// Index of string descriptor describing product
2185 pub iProduct: u8,
2186 /// Index of string descriptor containing device serial number
2187 pub iSerialNumber: u8,
2188 /// Number of possible configurations
2189 pub bNumConfigurations: u8,
2190 }
2191 #[test]
bindgen_test_layout_libusb_device_descriptor()2192 fn bindgen_test_layout_libusb_device_descriptor() {
2193 assert_eq!(
2194 ::std::mem::size_of::<libusb_device_descriptor>(),
2195 18usize,
2196 concat!("Size of: ", stringify!(libusb_device_descriptor))
2197 );
2198 assert_eq!(
2199 ::std::mem::align_of::<libusb_device_descriptor>(),
2200 2usize,
2201 concat!("Alignment of ", stringify!(libusb_device_descriptor))
2202 );
2203 assert_eq!(
2204 unsafe {
2205 &(*(::std::ptr::null::<libusb_device_descriptor>())).bLength as *const _ as usize
2206 },
2207 0usize,
2208 concat!(
2209 "Offset of field: ",
2210 stringify!(libusb_device_descriptor),
2211 "::",
2212 stringify!(bLength)
2213 )
2214 );
2215 assert_eq!(
2216 unsafe {
2217 &(*(::std::ptr::null::<libusb_device_descriptor>())).bDescriptorType as *const _
2218 as usize
2219 },
2220 1usize,
2221 concat!(
2222 "Offset of field: ",
2223 stringify!(libusb_device_descriptor),
2224 "::",
2225 stringify!(bDescriptorType)
2226 )
2227 );
2228 assert_eq!(
2229 unsafe { &(*(::std::ptr::null::<libusb_device_descriptor>())).bcdUSB as *const _ as usize },
2230 2usize,
2231 concat!(
2232 "Offset of field: ",
2233 stringify!(libusb_device_descriptor),
2234 "::",
2235 stringify!(bcdUSB)
2236 )
2237 );
2238 assert_eq!(
2239 unsafe {
2240 &(*(::std::ptr::null::<libusb_device_descriptor>())).bDeviceClass as *const _ as usize
2241 },
2242 4usize,
2243 concat!(
2244 "Offset of field: ",
2245 stringify!(libusb_device_descriptor),
2246 "::",
2247 stringify!(bDeviceClass)
2248 )
2249 );
2250 assert_eq!(
2251 unsafe {
2252 &(*(::std::ptr::null::<libusb_device_descriptor>())).bDeviceSubClass as *const _
2253 as usize
2254 },
2255 5usize,
2256 concat!(
2257 "Offset of field: ",
2258 stringify!(libusb_device_descriptor),
2259 "::",
2260 stringify!(bDeviceSubClass)
2261 )
2262 );
2263 assert_eq!(
2264 unsafe {
2265 &(*(::std::ptr::null::<libusb_device_descriptor>())).bDeviceProtocol as *const _
2266 as usize
2267 },
2268 6usize,
2269 concat!(
2270 "Offset of field: ",
2271 stringify!(libusb_device_descriptor),
2272 "::",
2273 stringify!(bDeviceProtocol)
2274 )
2275 );
2276 assert_eq!(
2277 unsafe {
2278 &(*(::std::ptr::null::<libusb_device_descriptor>())).bMaxPacketSize0 as *const _
2279 as usize
2280 },
2281 7usize,
2282 concat!(
2283 "Offset of field: ",
2284 stringify!(libusb_device_descriptor),
2285 "::",
2286 stringify!(bMaxPacketSize0)
2287 )
2288 );
2289 assert_eq!(
2290 unsafe {
2291 &(*(::std::ptr::null::<libusb_device_descriptor>())).idVendor as *const _ as usize
2292 },
2293 8usize,
2294 concat!(
2295 "Offset of field: ",
2296 stringify!(libusb_device_descriptor),
2297 "::",
2298 stringify!(idVendor)
2299 )
2300 );
2301 assert_eq!(
2302 unsafe {
2303 &(*(::std::ptr::null::<libusb_device_descriptor>())).idProduct as *const _ as usize
2304 },
2305 10usize,
2306 concat!(
2307 "Offset of field: ",
2308 stringify!(libusb_device_descriptor),
2309 "::",
2310 stringify!(idProduct)
2311 )
2312 );
2313 assert_eq!(
2314 unsafe {
2315 &(*(::std::ptr::null::<libusb_device_descriptor>())).bcdDevice as *const _ as usize
2316 },
2317 12usize,
2318 concat!(
2319 "Offset of field: ",
2320 stringify!(libusb_device_descriptor),
2321 "::",
2322 stringify!(bcdDevice)
2323 )
2324 );
2325 assert_eq!(
2326 unsafe {
2327 &(*(::std::ptr::null::<libusb_device_descriptor>())).iManufacturer as *const _ as usize
2328 },
2329 14usize,
2330 concat!(
2331 "Offset of field: ",
2332 stringify!(libusb_device_descriptor),
2333 "::",
2334 stringify!(iManufacturer)
2335 )
2336 );
2337 assert_eq!(
2338 unsafe {
2339 &(*(::std::ptr::null::<libusb_device_descriptor>())).iProduct as *const _ as usize
2340 },
2341 15usize,
2342 concat!(
2343 "Offset of field: ",
2344 stringify!(libusb_device_descriptor),
2345 "::",
2346 stringify!(iProduct)
2347 )
2348 );
2349 assert_eq!(
2350 unsafe {
2351 &(*(::std::ptr::null::<libusb_device_descriptor>())).iSerialNumber as *const _ as usize
2352 },
2353 16usize,
2354 concat!(
2355 "Offset of field: ",
2356 stringify!(libusb_device_descriptor),
2357 "::",
2358 stringify!(iSerialNumber)
2359 )
2360 );
2361 assert_eq!(
2362 unsafe {
2363 &(*(::std::ptr::null::<libusb_device_descriptor>())).bNumConfigurations as *const _
2364 as usize
2365 },
2366 17usize,
2367 concat!(
2368 "Offset of field: ",
2369 stringify!(libusb_device_descriptor),
2370 "::",
2371 stringify!(bNumConfigurations)
2372 )
2373 );
2374 }
2375 /// \ingroup libusb_desc
2376 /// A structure representing the standard USB endpoint descriptor. This
2377 /// descriptor is documented in section 9.6.6 of the USB 3.0 specification.
2378 /// All multiple-byte fields are represented in host-endian format.
2379 #[repr(C)]
2380 #[derive(Debug, Copy, Clone)]
2381 pub struct libusb_endpoint_descriptor {
2382 /// Size of this descriptor (in bytes)
2383 pub bLength: u8,
2384 /// Descriptor type. Will have value
2385 /// \ref libusb_descriptor_type::LIBUSB_DT_ENDPOINT LIBUSB_DT_ENDPOINT in
2386 /// this context.
2387 pub bDescriptorType: u8,
2388 /// The address of the endpoint described by this descriptor. Bits 0:3 are
2389 /// the endpoint number. Bits 4:6 are reserved. Bit 7 indicates direction,
2390 /// see \ref libusb_endpoint_direction.
2391 pub bEndpointAddress: u8,
2392 /// Attributes which apply to the endpoint when it is configured using
2393 /// the bConfigurationValue. Bits 0:1 determine the transfer type and
2394 /// correspond to \ref libusb_transfer_type. Bits 2:3 are only used for
2395 /// isochronous endpoints and correspond to \ref libusb_iso_sync_type.
2396 /// Bits 4:5 are also only used for isochronous endpoints and correspond to
2397 /// \ref libusb_iso_usage_type. Bits 6:7 are reserved.
2398 pub bmAttributes: u8,
2399 /// Maximum packet size this endpoint is capable of sending/receiving.
2400 pub wMaxPacketSize: u16,
2401 /// Interval for polling endpoint for data transfers.
2402 pub bInterval: u8,
2403 /// For audio devices only: the rate at which synchronization feedback
2404 /// is provided.
2405 pub bRefresh: u8,
2406 /// For audio devices only: the address if the synch endpoint
2407 pub bSynchAddress: u8,
2408 /// Extra descriptors. If libusb encounters unknown endpoint descriptors,
2409 /// it will store them here, should you wish to parse them.
2410 pub extra: *const ::std::os::raw::c_uchar,
2411 /// Length of the extra descriptors, in bytes.
2412 pub extra_length: ::std::os::raw::c_int,
2413 }
2414 #[test]
bindgen_test_layout_libusb_endpoint_descriptor()2415 fn bindgen_test_layout_libusb_endpoint_descriptor() {
2416 assert_eq!(
2417 ::std::mem::size_of::<libusb_endpoint_descriptor>(),
2418 32usize,
2419 concat!("Size of: ", stringify!(libusb_endpoint_descriptor))
2420 );
2421 assert_eq!(
2422 ::std::mem::align_of::<libusb_endpoint_descriptor>(),
2423 8usize,
2424 concat!("Alignment of ", stringify!(libusb_endpoint_descriptor))
2425 );
2426 assert_eq!(
2427 unsafe {
2428 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).bLength as *const _ as usize
2429 },
2430 0usize,
2431 concat!(
2432 "Offset of field: ",
2433 stringify!(libusb_endpoint_descriptor),
2434 "::",
2435 stringify!(bLength)
2436 )
2437 );
2438 assert_eq!(
2439 unsafe {
2440 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).bDescriptorType as *const _
2441 as usize
2442 },
2443 1usize,
2444 concat!(
2445 "Offset of field: ",
2446 stringify!(libusb_endpoint_descriptor),
2447 "::",
2448 stringify!(bDescriptorType)
2449 )
2450 );
2451 assert_eq!(
2452 unsafe {
2453 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).bEndpointAddress as *const _
2454 as usize
2455 },
2456 2usize,
2457 concat!(
2458 "Offset of field: ",
2459 stringify!(libusb_endpoint_descriptor),
2460 "::",
2461 stringify!(bEndpointAddress)
2462 )
2463 );
2464 assert_eq!(
2465 unsafe {
2466 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).bmAttributes as *const _ as usize
2467 },
2468 3usize,
2469 concat!(
2470 "Offset of field: ",
2471 stringify!(libusb_endpoint_descriptor),
2472 "::",
2473 stringify!(bmAttributes)
2474 )
2475 );
2476 assert_eq!(
2477 unsafe {
2478 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).wMaxPacketSize as *const _
2479 as usize
2480 },
2481 4usize,
2482 concat!(
2483 "Offset of field: ",
2484 stringify!(libusb_endpoint_descriptor),
2485 "::",
2486 stringify!(wMaxPacketSize)
2487 )
2488 );
2489 assert_eq!(
2490 unsafe {
2491 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).bInterval as *const _ as usize
2492 },
2493 6usize,
2494 concat!(
2495 "Offset of field: ",
2496 stringify!(libusb_endpoint_descriptor),
2497 "::",
2498 stringify!(bInterval)
2499 )
2500 );
2501 assert_eq!(
2502 unsafe {
2503 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).bRefresh as *const _ as usize
2504 },
2505 7usize,
2506 concat!(
2507 "Offset of field: ",
2508 stringify!(libusb_endpoint_descriptor),
2509 "::",
2510 stringify!(bRefresh)
2511 )
2512 );
2513 assert_eq!(
2514 unsafe {
2515 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).bSynchAddress as *const _
2516 as usize
2517 },
2518 8usize,
2519 concat!(
2520 "Offset of field: ",
2521 stringify!(libusb_endpoint_descriptor),
2522 "::",
2523 stringify!(bSynchAddress)
2524 )
2525 );
2526 assert_eq!(
2527 unsafe {
2528 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).extra as *const _ as usize
2529 },
2530 16usize,
2531 concat!(
2532 "Offset of field: ",
2533 stringify!(libusb_endpoint_descriptor),
2534 "::",
2535 stringify!(extra)
2536 )
2537 );
2538 assert_eq!(
2539 unsafe {
2540 &(*(::std::ptr::null::<libusb_endpoint_descriptor>())).extra_length as *const _ as usize
2541 },
2542 24usize,
2543 concat!(
2544 "Offset of field: ",
2545 stringify!(libusb_endpoint_descriptor),
2546 "::",
2547 stringify!(extra_length)
2548 )
2549 );
2550 }
2551 /// \ingroup libusb_desc
2552 /// A structure representing the standard USB interface descriptor. This
2553 /// descriptor is documented in section 9.6.5 of the USB 3.0 specification.
2554 /// All multiple-byte fields are represented in host-endian format.
2555 #[repr(C)]
2556 #[derive(Debug, Copy, Clone)]
2557 pub struct libusb_interface_descriptor {
2558 /// Size of this descriptor (in bytes)
2559 pub bLength: u8,
2560 /// Descriptor type. Will have value
2561 /// \ref libusb_descriptor_type::LIBUSB_DT_INTERFACE LIBUSB_DT_INTERFACE
2562 /// in this context.
2563 pub bDescriptorType: u8,
2564 /// Number of this interface
2565 pub bInterfaceNumber: u8,
2566 /// Value used to select this alternate setting for this interface
2567 pub bAlternateSetting: u8,
2568 /// Number of endpoints used by this interface (excluding the control
2569 /// endpoint).
2570 pub bNumEndpoints: u8,
2571 /// USB-IF class code for this interface. See \ref libusb_class_code.
2572 pub bInterfaceClass: u8,
2573 /// USB-IF subclass code for this interface, qualified by the
2574 /// bInterfaceClass value
2575 pub bInterfaceSubClass: u8,
2576 /// USB-IF protocol code for this interface, qualified by the
2577 /// bInterfaceClass and bInterfaceSubClass values
2578 pub bInterfaceProtocol: u8,
2579 /// Index of string descriptor describing this interface
2580 pub iInterface: u8,
2581 /// Array of endpoint descriptors. This length of this array is determined
2582 /// by the bNumEndpoints field.
2583 pub endpoint: *const libusb_endpoint_descriptor,
2584 /// Extra descriptors. If libusb encounters unknown interface descriptors,
2585 /// it will store them here, should you wish to parse them.
2586 pub extra: *const ::std::os::raw::c_uchar,
2587 /// Length of the extra descriptors, in bytes.
2588 pub extra_length: ::std::os::raw::c_int,
2589 }
2590 #[test]
bindgen_test_layout_libusb_interface_descriptor()2591 fn bindgen_test_layout_libusb_interface_descriptor() {
2592 assert_eq!(
2593 ::std::mem::size_of::<libusb_interface_descriptor>(),
2594 40usize,
2595 concat!("Size of: ", stringify!(libusb_interface_descriptor))
2596 );
2597 assert_eq!(
2598 ::std::mem::align_of::<libusb_interface_descriptor>(),
2599 8usize,
2600 concat!("Alignment of ", stringify!(libusb_interface_descriptor))
2601 );
2602 assert_eq!(
2603 unsafe {
2604 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bLength as *const _ as usize
2605 },
2606 0usize,
2607 concat!(
2608 "Offset of field: ",
2609 stringify!(libusb_interface_descriptor),
2610 "::",
2611 stringify!(bLength)
2612 )
2613 );
2614 assert_eq!(
2615 unsafe {
2616 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bDescriptorType as *const _
2617 as usize
2618 },
2619 1usize,
2620 concat!(
2621 "Offset of field: ",
2622 stringify!(libusb_interface_descriptor),
2623 "::",
2624 stringify!(bDescriptorType)
2625 )
2626 );
2627 assert_eq!(
2628 unsafe {
2629 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bInterfaceNumber as *const _
2630 as usize
2631 },
2632 2usize,
2633 concat!(
2634 "Offset of field: ",
2635 stringify!(libusb_interface_descriptor),
2636 "::",
2637 stringify!(bInterfaceNumber)
2638 )
2639 );
2640 assert_eq!(
2641 unsafe {
2642 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bAlternateSetting as *const _
2643 as usize
2644 },
2645 3usize,
2646 concat!(
2647 "Offset of field: ",
2648 stringify!(libusb_interface_descriptor),
2649 "::",
2650 stringify!(bAlternateSetting)
2651 )
2652 );
2653 assert_eq!(
2654 unsafe {
2655 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bNumEndpoints as *const _
2656 as usize
2657 },
2658 4usize,
2659 concat!(
2660 "Offset of field: ",
2661 stringify!(libusb_interface_descriptor),
2662 "::",
2663 stringify!(bNumEndpoints)
2664 )
2665 );
2666 assert_eq!(
2667 unsafe {
2668 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bInterfaceClass as *const _
2669 as usize
2670 },
2671 5usize,
2672 concat!(
2673 "Offset of field: ",
2674 stringify!(libusb_interface_descriptor),
2675 "::",
2676 stringify!(bInterfaceClass)
2677 )
2678 );
2679 assert_eq!(
2680 unsafe {
2681 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bInterfaceSubClass as *const _
2682 as usize
2683 },
2684 6usize,
2685 concat!(
2686 "Offset of field: ",
2687 stringify!(libusb_interface_descriptor),
2688 "::",
2689 stringify!(bInterfaceSubClass)
2690 )
2691 );
2692 assert_eq!(
2693 unsafe {
2694 &(*(::std::ptr::null::<libusb_interface_descriptor>())).bInterfaceProtocol as *const _
2695 as usize
2696 },
2697 7usize,
2698 concat!(
2699 "Offset of field: ",
2700 stringify!(libusb_interface_descriptor),
2701 "::",
2702 stringify!(bInterfaceProtocol)
2703 )
2704 );
2705 assert_eq!(
2706 unsafe {
2707 &(*(::std::ptr::null::<libusb_interface_descriptor>())).iInterface as *const _ as usize
2708 },
2709 8usize,
2710 concat!(
2711 "Offset of field: ",
2712 stringify!(libusb_interface_descriptor),
2713 "::",
2714 stringify!(iInterface)
2715 )
2716 );
2717 assert_eq!(
2718 unsafe {
2719 &(*(::std::ptr::null::<libusb_interface_descriptor>())).endpoint as *const _ as usize
2720 },
2721 16usize,
2722 concat!(
2723 "Offset of field: ",
2724 stringify!(libusb_interface_descriptor),
2725 "::",
2726 stringify!(endpoint)
2727 )
2728 );
2729 assert_eq!(
2730 unsafe {
2731 &(*(::std::ptr::null::<libusb_interface_descriptor>())).extra as *const _ as usize
2732 },
2733 24usize,
2734 concat!(
2735 "Offset of field: ",
2736 stringify!(libusb_interface_descriptor),
2737 "::",
2738 stringify!(extra)
2739 )
2740 );
2741 assert_eq!(
2742 unsafe {
2743 &(*(::std::ptr::null::<libusb_interface_descriptor>())).extra_length as *const _
2744 as usize
2745 },
2746 32usize,
2747 concat!(
2748 "Offset of field: ",
2749 stringify!(libusb_interface_descriptor),
2750 "::",
2751 stringify!(extra_length)
2752 )
2753 );
2754 }
2755 /// \ingroup libusb_desc
2756 /// A collection of alternate settings for a particular USB interface.
2757 #[repr(C)]
2758 #[derive(Debug, Copy, Clone)]
2759 pub struct libusb_interface {
2760 /// Array of interface descriptors. The length of this array is determined
2761 /// by the num_altsetting field.
2762 pub altsetting: *const libusb_interface_descriptor,
2763 /// The number of alternate settings that belong to this interface
2764 pub num_altsetting: ::std::os::raw::c_int,
2765 }
2766 #[test]
bindgen_test_layout_libusb_interface()2767 fn bindgen_test_layout_libusb_interface() {
2768 assert_eq!(
2769 ::std::mem::size_of::<libusb_interface>(),
2770 16usize,
2771 concat!("Size of: ", stringify!(libusb_interface))
2772 );
2773 assert_eq!(
2774 ::std::mem::align_of::<libusb_interface>(),
2775 8usize,
2776 concat!("Alignment of ", stringify!(libusb_interface))
2777 );
2778 assert_eq!(
2779 unsafe { &(*(::std::ptr::null::<libusb_interface>())).altsetting as *const _ as usize },
2780 0usize,
2781 concat!(
2782 "Offset of field: ",
2783 stringify!(libusb_interface),
2784 "::",
2785 stringify!(altsetting)
2786 )
2787 );
2788 assert_eq!(
2789 unsafe { &(*(::std::ptr::null::<libusb_interface>())).num_altsetting as *const _ as usize },
2790 8usize,
2791 concat!(
2792 "Offset of field: ",
2793 stringify!(libusb_interface),
2794 "::",
2795 stringify!(num_altsetting)
2796 )
2797 );
2798 }
2799 /// \ingroup libusb_desc
2800 /// A structure representing the standard USB configuration descriptor. This
2801 /// descriptor is documented in section 9.6.3 of the USB 3.0 specification.
2802 /// All multiple-byte fields are represented in host-endian format.
2803 #[repr(C)]
2804 #[derive(Debug, Copy, Clone)]
2805 pub struct libusb_config_descriptor {
2806 /// Size of this descriptor (in bytes)
2807 pub bLength: u8,
2808 /// Descriptor type. Will have value
2809 /// \ref libusb_descriptor_type::LIBUSB_DT_CONFIG LIBUSB_DT_CONFIG
2810 /// in this context.
2811 pub bDescriptorType: u8,
2812 /// Total length of data returned for this configuration
2813 pub wTotalLength: u16,
2814 /// Number of interfaces supported by this configuration
2815 pub bNumInterfaces: u8,
2816 /// Identifier value for this configuration
2817 pub bConfigurationValue: u8,
2818 /// Index of string descriptor describing this configuration
2819 pub iConfiguration: u8,
2820 /// Configuration characteristics
2821 pub bmAttributes: u8,
2822 /// Maximum power consumption of the USB device from this bus in this
2823 /// configuration when the device is fully operation. Expressed in units
2824 /// of 2 mA when the device is operating in high-speed mode and in units
2825 /// of 8 mA when the device is operating in super-speed mode.
2826 pub MaxPower: u8,
2827 /// Array of interfaces supported by this configuration. The length of
2828 /// this array is determined by the bNumInterfaces field.
2829 pub interface: *const libusb_interface,
2830 /// Extra descriptors. If libusb encounters unknown configuration
2831 /// descriptors, it will store them here, should you wish to parse them.
2832 pub extra: *const ::std::os::raw::c_uchar,
2833 /// Length of the extra descriptors, in bytes.
2834 pub extra_length: ::std::os::raw::c_int,
2835 }
2836 #[test]
bindgen_test_layout_libusb_config_descriptor()2837 fn bindgen_test_layout_libusb_config_descriptor() {
2838 assert_eq!(
2839 ::std::mem::size_of::<libusb_config_descriptor>(),
2840 40usize,
2841 concat!("Size of: ", stringify!(libusb_config_descriptor))
2842 );
2843 assert_eq!(
2844 ::std::mem::align_of::<libusb_config_descriptor>(),
2845 8usize,
2846 concat!("Alignment of ", stringify!(libusb_config_descriptor))
2847 );
2848 assert_eq!(
2849 unsafe {
2850 &(*(::std::ptr::null::<libusb_config_descriptor>())).bLength as *const _ as usize
2851 },
2852 0usize,
2853 concat!(
2854 "Offset of field: ",
2855 stringify!(libusb_config_descriptor),
2856 "::",
2857 stringify!(bLength)
2858 )
2859 );
2860 assert_eq!(
2861 unsafe {
2862 &(*(::std::ptr::null::<libusb_config_descriptor>())).bDescriptorType as *const _
2863 as usize
2864 },
2865 1usize,
2866 concat!(
2867 "Offset of field: ",
2868 stringify!(libusb_config_descriptor),
2869 "::",
2870 stringify!(bDescriptorType)
2871 )
2872 );
2873 assert_eq!(
2874 unsafe {
2875 &(*(::std::ptr::null::<libusb_config_descriptor>())).wTotalLength as *const _ as usize
2876 },
2877 2usize,
2878 concat!(
2879 "Offset of field: ",
2880 stringify!(libusb_config_descriptor),
2881 "::",
2882 stringify!(wTotalLength)
2883 )
2884 );
2885 assert_eq!(
2886 unsafe {
2887 &(*(::std::ptr::null::<libusb_config_descriptor>())).bNumInterfaces as *const _ as usize
2888 },
2889 4usize,
2890 concat!(
2891 "Offset of field: ",
2892 stringify!(libusb_config_descriptor),
2893 "::",
2894 stringify!(bNumInterfaces)
2895 )
2896 );
2897 assert_eq!(
2898 unsafe {
2899 &(*(::std::ptr::null::<libusb_config_descriptor>())).bConfigurationValue as *const _
2900 as usize
2901 },
2902 5usize,
2903 concat!(
2904 "Offset of field: ",
2905 stringify!(libusb_config_descriptor),
2906 "::",
2907 stringify!(bConfigurationValue)
2908 )
2909 );
2910 assert_eq!(
2911 unsafe {
2912 &(*(::std::ptr::null::<libusb_config_descriptor>())).iConfiguration as *const _ as usize
2913 },
2914 6usize,
2915 concat!(
2916 "Offset of field: ",
2917 stringify!(libusb_config_descriptor),
2918 "::",
2919 stringify!(iConfiguration)
2920 )
2921 );
2922 assert_eq!(
2923 unsafe {
2924 &(*(::std::ptr::null::<libusb_config_descriptor>())).bmAttributes as *const _ as usize
2925 },
2926 7usize,
2927 concat!(
2928 "Offset of field: ",
2929 stringify!(libusb_config_descriptor),
2930 "::",
2931 stringify!(bmAttributes)
2932 )
2933 );
2934 assert_eq!(
2935 unsafe {
2936 &(*(::std::ptr::null::<libusb_config_descriptor>())).MaxPower as *const _ as usize
2937 },
2938 8usize,
2939 concat!(
2940 "Offset of field: ",
2941 stringify!(libusb_config_descriptor),
2942 "::",
2943 stringify!(MaxPower)
2944 )
2945 );
2946 assert_eq!(
2947 unsafe {
2948 &(*(::std::ptr::null::<libusb_config_descriptor>())).interface as *const _ as usize
2949 },
2950 16usize,
2951 concat!(
2952 "Offset of field: ",
2953 stringify!(libusb_config_descriptor),
2954 "::",
2955 stringify!(interface)
2956 )
2957 );
2958 assert_eq!(
2959 unsafe { &(*(::std::ptr::null::<libusb_config_descriptor>())).extra as *const _ as usize },
2960 24usize,
2961 concat!(
2962 "Offset of field: ",
2963 stringify!(libusb_config_descriptor),
2964 "::",
2965 stringify!(extra)
2966 )
2967 );
2968 assert_eq!(
2969 unsafe {
2970 &(*(::std::ptr::null::<libusb_config_descriptor>())).extra_length as *const _ as usize
2971 },
2972 32usize,
2973 concat!(
2974 "Offset of field: ",
2975 stringify!(libusb_config_descriptor),
2976 "::",
2977 stringify!(extra_length)
2978 )
2979 );
2980 }
2981 /// \ingroup libusb_desc
2982 /// A structure representing the superspeed endpoint companion
2983 /// descriptor. This descriptor is documented in section 9.6.7 of
2984 /// the USB 3.0 specification. All multiple-byte fields are represented in
2985 /// host-endian format.
2986 #[repr(C)]
2987 #[derive(Debug, Copy, Clone)]
2988 pub struct libusb_ss_endpoint_companion_descriptor {
2989 /// Size of this descriptor (in bytes)
2990 pub bLength: u8,
2991 /// Descriptor type. Will have value
2992 /// \ref libusb_descriptor_type::LIBUSB_DT_SS_ENDPOINT_COMPANION in
2993 /// this context.
2994 pub bDescriptorType: u8,
2995 /// The maximum number of packets the endpoint can send or
2996 /// receive as part of a burst.
2997 pub bMaxBurst: u8,
2998 /// In bulk EP: bits 4:0 represents the maximum number of
2999 /// streams the EP supports. In isochronous EP: bits 1:0
3000 /// represents the Mult - a zero based value that determines
3001 /// the maximum number of packets within a service interval
3002 pub bmAttributes: u8,
3003 /// The total number of bytes this EP will transfer every
3004 /// service interval. valid only for periodic EPs.
3005 pub wBytesPerInterval: u16,
3006 }
3007 #[test]
bindgen_test_layout_libusb_ss_endpoint_companion_descriptor()3008 fn bindgen_test_layout_libusb_ss_endpoint_companion_descriptor() {
3009 assert_eq!(
3010 ::std::mem::size_of::<libusb_ss_endpoint_companion_descriptor>(),
3011 6usize,
3012 concat!(
3013 "Size of: ",
3014 stringify!(libusb_ss_endpoint_companion_descriptor)
3015 )
3016 );
3017 assert_eq!(
3018 ::std::mem::align_of::<libusb_ss_endpoint_companion_descriptor>(),
3019 2usize,
3020 concat!(
3021 "Alignment of ",
3022 stringify!(libusb_ss_endpoint_companion_descriptor)
3023 )
3024 );
3025 assert_eq!(
3026 unsafe {
3027 &(*(::std::ptr::null::<libusb_ss_endpoint_companion_descriptor>())).bLength as *const _
3028 as usize
3029 },
3030 0usize,
3031 concat!(
3032 "Offset of field: ",
3033 stringify!(libusb_ss_endpoint_companion_descriptor),
3034 "::",
3035 stringify!(bLength)
3036 )
3037 );
3038 assert_eq!(
3039 unsafe {
3040 &(*(::std::ptr::null::<libusb_ss_endpoint_companion_descriptor>())).bDescriptorType
3041 as *const _ as usize
3042 },
3043 1usize,
3044 concat!(
3045 "Offset of field: ",
3046 stringify!(libusb_ss_endpoint_companion_descriptor),
3047 "::",
3048 stringify!(bDescriptorType)
3049 )
3050 );
3051 assert_eq!(
3052 unsafe {
3053 &(*(::std::ptr::null::<libusb_ss_endpoint_companion_descriptor>())).bMaxBurst
3054 as *const _ as usize
3055 },
3056 2usize,
3057 concat!(
3058 "Offset of field: ",
3059 stringify!(libusb_ss_endpoint_companion_descriptor),
3060 "::",
3061 stringify!(bMaxBurst)
3062 )
3063 );
3064 assert_eq!(
3065 unsafe {
3066 &(*(::std::ptr::null::<libusb_ss_endpoint_companion_descriptor>())).bmAttributes
3067 as *const _ as usize
3068 },
3069 3usize,
3070 concat!(
3071 "Offset of field: ",
3072 stringify!(libusb_ss_endpoint_companion_descriptor),
3073 "::",
3074 stringify!(bmAttributes)
3075 )
3076 );
3077 assert_eq!(
3078 unsafe {
3079 &(*(::std::ptr::null::<libusb_ss_endpoint_companion_descriptor>())).wBytesPerInterval
3080 as *const _ as usize
3081 },
3082 4usize,
3083 concat!(
3084 "Offset of field: ",
3085 stringify!(libusb_ss_endpoint_companion_descriptor),
3086 "::",
3087 stringify!(wBytesPerInterval)
3088 )
3089 );
3090 }
3091 /// \ingroup libusb_desc
3092 /// A generic representation of a BOS Device Capability descriptor. It is
3093 /// advised to check bDevCapabilityType and call the matching
3094 /// libusb_get_*_descriptor function to get a structure fully matching the type.
3095 #[repr(C)]
3096 #[derive(Debug)]
3097 pub struct libusb_bos_dev_capability_descriptor {
3098 /// Size of this descriptor (in bytes)
3099 pub bLength: u8,
3100 /// Descriptor type. Will have value
3101 /// \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
3102 /// LIBUSB_DT_DEVICE_CAPABILITY in this context.
3103 pub bDescriptorType: u8,
3104 /// Device Capability type
3105 pub bDevCapabilityType: u8,
3106 /// Device Capability data (bLength - 3 bytes)
3107 pub dev_capability_data: __IncompleteArrayField<u8>,
3108 }
3109 #[test]
bindgen_test_layout_libusb_bos_dev_capability_descriptor()3110 fn bindgen_test_layout_libusb_bos_dev_capability_descriptor() {
3111 assert_eq!(
3112 ::std::mem::size_of::<libusb_bos_dev_capability_descriptor>(),
3113 3usize,
3114 concat!(
3115 "Size of: ",
3116 stringify!(libusb_bos_dev_capability_descriptor)
3117 )
3118 );
3119 assert_eq!(
3120 ::std::mem::align_of::<libusb_bos_dev_capability_descriptor>(),
3121 1usize,
3122 concat!(
3123 "Alignment of ",
3124 stringify!(libusb_bos_dev_capability_descriptor)
3125 )
3126 );
3127 }
3128 /// \ingroup libusb_desc
3129 /// A structure representing the Binary Device Object Store (BOS) descriptor.
3130 /// This descriptor is documented in section 9.6.2 of the USB 3.0 specification.
3131 /// All multiple-byte fields are represented in host-endian format.
3132 #[repr(C)]
3133 #[derive(Debug)]
3134 pub struct libusb_bos_descriptor {
3135 /// Size of this descriptor (in bytes)
3136 pub bLength: u8,
3137 /// Descriptor type. Will have value
3138 /// \ref libusb_descriptor_type::LIBUSB_DT_BOS LIBUSB_DT_BOS
3139 /// in this context.
3140 pub bDescriptorType: u8,
3141 /// Length of this descriptor and all of its sub descriptors
3142 pub wTotalLength: u16,
3143 /// The number of separate device capability descriptors in
3144 /// the BOS
3145 pub bNumDeviceCaps: u8,
3146 /// bNumDeviceCap Device Capability Descriptors
3147 pub dev_capability: __IncompleteArrayField<*mut libusb_bos_dev_capability_descriptor>,
3148 pub __bindgen_align: [u64; 0usize],
3149 }
3150 #[test]
bindgen_test_layout_libusb_bos_descriptor()3151 fn bindgen_test_layout_libusb_bos_descriptor() {
3152 assert_eq!(
3153 ::std::mem::size_of::<libusb_bos_descriptor>(),
3154 8usize,
3155 concat!("Size of: ", stringify!(libusb_bos_descriptor))
3156 );
3157 assert_eq!(
3158 ::std::mem::align_of::<libusb_bos_descriptor>(),
3159 8usize,
3160 concat!("Alignment of ", stringify!(libusb_bos_descriptor))
3161 );
3162 }
3163 /// \ingroup libusb_desc
3164 /// A structure representing the USB 2.0 Extension descriptor
3165 /// This descriptor is documented in section 9.6.2.1 of the USB 3.0 specification.
3166 /// All multiple-byte fields are represented in host-endian format.
3167 #[repr(C)]
3168 #[derive(Debug, Copy, Clone)]
3169 pub struct libusb_usb_2_0_extension_descriptor {
3170 /// Size of this descriptor (in bytes)
3171 pub bLength: u8,
3172 /// Descriptor type. Will have value
3173 /// \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
3174 /// LIBUSB_DT_DEVICE_CAPABILITY in this context.
3175 pub bDescriptorType: u8,
3176 /// Capability type. Will have value
3177 /// \ref libusb_capability_type::LIBUSB_BT_USB_2_0_EXTENSION
3178 /// LIBUSB_BT_USB_2_0_EXTENSION in this context.
3179 pub bDevCapabilityType: u8,
3180 /// Bitmap encoding of supported device level features.
3181 /// A value of one in a bit location indicates a feature is
3182 /// supported; a value of zero indicates it is not supported.
3183 /// See \ref libusb_usb_2_0_extension_attributes.
3184 pub bmAttributes: u32,
3185 }
3186 #[test]
bindgen_test_layout_libusb_usb_2_0_extension_descriptor()3187 fn bindgen_test_layout_libusb_usb_2_0_extension_descriptor() {
3188 assert_eq!(
3189 ::std::mem::size_of::<libusb_usb_2_0_extension_descriptor>(),
3190 8usize,
3191 concat!("Size of: ", stringify!(libusb_usb_2_0_extension_descriptor))
3192 );
3193 assert_eq!(
3194 ::std::mem::align_of::<libusb_usb_2_0_extension_descriptor>(),
3195 4usize,
3196 concat!(
3197 "Alignment of ",
3198 stringify!(libusb_usb_2_0_extension_descriptor)
3199 )
3200 );
3201 assert_eq!(
3202 unsafe {
3203 &(*(::std::ptr::null::<libusb_usb_2_0_extension_descriptor>())).bLength as *const _
3204 as usize
3205 },
3206 0usize,
3207 concat!(
3208 "Offset of field: ",
3209 stringify!(libusb_usb_2_0_extension_descriptor),
3210 "::",
3211 stringify!(bLength)
3212 )
3213 );
3214 assert_eq!(
3215 unsafe {
3216 &(*(::std::ptr::null::<libusb_usb_2_0_extension_descriptor>())).bDescriptorType
3217 as *const _ as usize
3218 },
3219 1usize,
3220 concat!(
3221 "Offset of field: ",
3222 stringify!(libusb_usb_2_0_extension_descriptor),
3223 "::",
3224 stringify!(bDescriptorType)
3225 )
3226 );
3227 assert_eq!(
3228 unsafe {
3229 &(*(::std::ptr::null::<libusb_usb_2_0_extension_descriptor>())).bDevCapabilityType
3230 as *const _ as usize
3231 },
3232 2usize,
3233 concat!(
3234 "Offset of field: ",
3235 stringify!(libusb_usb_2_0_extension_descriptor),
3236 "::",
3237 stringify!(bDevCapabilityType)
3238 )
3239 );
3240 assert_eq!(
3241 unsafe {
3242 &(*(::std::ptr::null::<libusb_usb_2_0_extension_descriptor>())).bmAttributes as *const _
3243 as usize
3244 },
3245 4usize,
3246 concat!(
3247 "Offset of field: ",
3248 stringify!(libusb_usb_2_0_extension_descriptor),
3249 "::",
3250 stringify!(bmAttributes)
3251 )
3252 );
3253 }
3254 /// \ingroup libusb_desc
3255 /// A structure representing the SuperSpeed USB Device Capability descriptor
3256 /// This descriptor is documented in section 9.6.2.2 of the USB 3.0 specification.
3257 /// All multiple-byte fields are represented in host-endian format.
3258 #[repr(C)]
3259 #[derive(Debug, Copy, Clone)]
3260 pub struct libusb_ss_usb_device_capability_descriptor {
3261 /// Size of this descriptor (in bytes)
3262 pub bLength: u8,
3263 /// Descriptor type. Will have value
3264 /// \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
3265 /// LIBUSB_DT_DEVICE_CAPABILITY in this context.
3266 pub bDescriptorType: u8,
3267 /// Capability type. Will have value
3268 /// \ref libusb_capability_type::LIBUSB_BT_SS_USB_DEVICE_CAPABILITY
3269 /// LIBUSB_BT_SS_USB_DEVICE_CAPABILITY in this context.
3270 pub bDevCapabilityType: u8,
3271 /// Bitmap encoding of supported device level features.
3272 /// A value of one in a bit location indicates a feature is
3273 /// supported; a value of zero indicates it is not supported.
3274 /// See \ref libusb_ss_usb_device_capability_attributes.
3275 pub bmAttributes: u8,
3276 /// Bitmap encoding of the speed supported by this device when
3277 /// operating in SuperSpeed mode. See \ref libusb_supported_speed.
3278 pub wSpeedSupported: u16,
3279 /// The lowest speed at which all the functionality supported
3280 /// by the device is available to the user. For example if the
3281 /// device supports all its functionality when connected at
3282 /// full speed and above then it sets this value to 1.
3283 pub bFunctionalitySupport: u8,
3284 /// U1 Device Exit Latency.
3285 pub bU1DevExitLat: u8,
3286 /// U2 Device Exit Latency.
3287 pub bU2DevExitLat: u16,
3288 }
3289 #[test]
bindgen_test_layout_libusb_ss_usb_device_capability_descriptor()3290 fn bindgen_test_layout_libusb_ss_usb_device_capability_descriptor() {
3291 assert_eq!(
3292 ::std::mem::size_of::<libusb_ss_usb_device_capability_descriptor>(),
3293 10usize,
3294 concat!(
3295 "Size of: ",
3296 stringify!(libusb_ss_usb_device_capability_descriptor)
3297 )
3298 );
3299 assert_eq!(
3300 ::std::mem::align_of::<libusb_ss_usb_device_capability_descriptor>(),
3301 2usize,
3302 concat!(
3303 "Alignment of ",
3304 stringify!(libusb_ss_usb_device_capability_descriptor)
3305 )
3306 );
3307 assert_eq!(
3308 unsafe {
3309 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>())).bLength
3310 as *const _ as usize
3311 },
3312 0usize,
3313 concat!(
3314 "Offset of field: ",
3315 stringify!(libusb_ss_usb_device_capability_descriptor),
3316 "::",
3317 stringify!(bLength)
3318 )
3319 );
3320 assert_eq!(
3321 unsafe {
3322 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>())).bDescriptorType
3323 as *const _ as usize
3324 },
3325 1usize,
3326 concat!(
3327 "Offset of field: ",
3328 stringify!(libusb_ss_usb_device_capability_descriptor),
3329 "::",
3330 stringify!(bDescriptorType)
3331 )
3332 );
3333 assert_eq!(
3334 unsafe {
3335 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>()))
3336 .bDevCapabilityType as *const _ as usize
3337 },
3338 2usize,
3339 concat!(
3340 "Offset of field: ",
3341 stringify!(libusb_ss_usb_device_capability_descriptor),
3342 "::",
3343 stringify!(bDevCapabilityType)
3344 )
3345 );
3346 assert_eq!(
3347 unsafe {
3348 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>())).bmAttributes
3349 as *const _ as usize
3350 },
3351 3usize,
3352 concat!(
3353 "Offset of field: ",
3354 stringify!(libusb_ss_usb_device_capability_descriptor),
3355 "::",
3356 stringify!(bmAttributes)
3357 )
3358 );
3359 assert_eq!(
3360 unsafe {
3361 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>())).wSpeedSupported
3362 as *const _ as usize
3363 },
3364 4usize,
3365 concat!(
3366 "Offset of field: ",
3367 stringify!(libusb_ss_usb_device_capability_descriptor),
3368 "::",
3369 stringify!(wSpeedSupported)
3370 )
3371 );
3372 assert_eq!(
3373 unsafe {
3374 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>()))
3375 .bFunctionalitySupport as *const _ as usize
3376 },
3377 6usize,
3378 concat!(
3379 "Offset of field: ",
3380 stringify!(libusb_ss_usb_device_capability_descriptor),
3381 "::",
3382 stringify!(bFunctionalitySupport)
3383 )
3384 );
3385 assert_eq!(
3386 unsafe {
3387 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>())).bU1DevExitLat
3388 as *const _ as usize
3389 },
3390 7usize,
3391 concat!(
3392 "Offset of field: ",
3393 stringify!(libusb_ss_usb_device_capability_descriptor),
3394 "::",
3395 stringify!(bU1DevExitLat)
3396 )
3397 );
3398 assert_eq!(
3399 unsafe {
3400 &(*(::std::ptr::null::<libusb_ss_usb_device_capability_descriptor>())).bU2DevExitLat
3401 as *const _ as usize
3402 },
3403 8usize,
3404 concat!(
3405 "Offset of field: ",
3406 stringify!(libusb_ss_usb_device_capability_descriptor),
3407 "::",
3408 stringify!(bU2DevExitLat)
3409 )
3410 );
3411 }
3412 /// \ingroup libusb_desc
3413 /// A structure representing the Container ID descriptor.
3414 /// This descriptor is documented in section 9.6.2.3 of the USB 3.0 specification.
3415 /// All multiple-byte fields, except UUIDs, are represented in host-endian format.
3416 #[repr(C)]
3417 #[derive(Debug, Copy, Clone)]
3418 pub struct libusb_container_id_descriptor {
3419 /// Size of this descriptor (in bytes)
3420 pub bLength: u8,
3421 /// Descriptor type. Will have value
3422 /// \ref libusb_descriptor_type::LIBUSB_DT_DEVICE_CAPABILITY
3423 /// LIBUSB_DT_DEVICE_CAPABILITY in this context.
3424 pub bDescriptorType: u8,
3425 /// Capability type. Will have value
3426 /// \ref libusb_capability_type::LIBUSB_BT_CONTAINER_ID
3427 /// LIBUSB_BT_CONTAINER_ID in this context.
3428 pub bDevCapabilityType: u8,
3429 /// Reserved field
3430 pub bReserved: u8,
3431 /// 128 bit UUID
3432 pub ContainerID: [u8; 16usize],
3433 }
3434 #[test]
bindgen_test_layout_libusb_container_id_descriptor()3435 fn bindgen_test_layout_libusb_container_id_descriptor() {
3436 assert_eq!(
3437 ::std::mem::size_of::<libusb_container_id_descriptor>(),
3438 20usize,
3439 concat!("Size of: ", stringify!(libusb_container_id_descriptor))
3440 );
3441 assert_eq!(
3442 ::std::mem::align_of::<libusb_container_id_descriptor>(),
3443 1usize,
3444 concat!("Alignment of ", stringify!(libusb_container_id_descriptor))
3445 );
3446 assert_eq!(
3447 unsafe {
3448 &(*(::std::ptr::null::<libusb_container_id_descriptor>())).bLength as *const _ as usize
3449 },
3450 0usize,
3451 concat!(
3452 "Offset of field: ",
3453 stringify!(libusb_container_id_descriptor),
3454 "::",
3455 stringify!(bLength)
3456 )
3457 );
3458 assert_eq!(
3459 unsafe {
3460 &(*(::std::ptr::null::<libusb_container_id_descriptor>())).bDescriptorType as *const _
3461 as usize
3462 },
3463 1usize,
3464 concat!(
3465 "Offset of field: ",
3466 stringify!(libusb_container_id_descriptor),
3467 "::",
3468 stringify!(bDescriptorType)
3469 )
3470 );
3471 assert_eq!(
3472 unsafe {
3473 &(*(::std::ptr::null::<libusb_container_id_descriptor>())).bDevCapabilityType
3474 as *const _ as usize
3475 },
3476 2usize,
3477 concat!(
3478 "Offset of field: ",
3479 stringify!(libusb_container_id_descriptor),
3480 "::",
3481 stringify!(bDevCapabilityType)
3482 )
3483 );
3484 assert_eq!(
3485 unsafe {
3486 &(*(::std::ptr::null::<libusb_container_id_descriptor>())).bReserved as *const _
3487 as usize
3488 },
3489 3usize,
3490 concat!(
3491 "Offset of field: ",
3492 stringify!(libusb_container_id_descriptor),
3493 "::",
3494 stringify!(bReserved)
3495 )
3496 );
3497 assert_eq!(
3498 unsafe {
3499 &(*(::std::ptr::null::<libusb_container_id_descriptor>())).ContainerID as *const _
3500 as usize
3501 },
3502 4usize,
3503 concat!(
3504 "Offset of field: ",
3505 stringify!(libusb_container_id_descriptor),
3506 "::",
3507 stringify!(ContainerID)
3508 )
3509 );
3510 }
3511 /// \ingroup libusb_asyncio
3512 /// Setup packet for control transfers.
3513 #[repr(C)]
3514 #[derive(Debug, Copy, Clone)]
3515 pub struct libusb_control_setup {
3516 /// Request type. Bits 0:4 determine recipient, see
3517 /// \ref libusb_request_recipient. Bits 5:6 determine type, see
3518 /// \ref libusb_request_type. Bit 7 determines data transfer direction, see
3519 /// \ref libusb_endpoint_direction.
3520 pub bmRequestType: u8,
3521 /// Request. If the type bits of bmRequestType are equal to
3522 /// \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD
3523 /// "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to
3524 /// \ref libusb_standard_request. For other cases, use of this field is
3525 /// application-specific.
3526 pub bRequest: u8,
3527 /// Value. Varies according to request
3528 pub wValue: u16,
3529 /// Index. Varies according to request, typically used to pass an index
3530 /// or offset
3531 pub wIndex: u16,
3532 /// Number of bytes to transfer
3533 pub wLength: u16,
3534 }
3535 #[test]
bindgen_test_layout_libusb_control_setup()3536 fn bindgen_test_layout_libusb_control_setup() {
3537 assert_eq!(
3538 ::std::mem::size_of::<libusb_control_setup>(),
3539 8usize,
3540 concat!("Size of: ", stringify!(libusb_control_setup))
3541 );
3542 assert_eq!(
3543 ::std::mem::align_of::<libusb_control_setup>(),
3544 2usize,
3545 concat!("Alignment of ", stringify!(libusb_control_setup))
3546 );
3547 assert_eq!(
3548 unsafe {
3549 &(*(::std::ptr::null::<libusb_control_setup>())).bmRequestType as *const _ as usize
3550 },
3551 0usize,
3552 concat!(
3553 "Offset of field: ",
3554 stringify!(libusb_control_setup),
3555 "::",
3556 stringify!(bmRequestType)
3557 )
3558 );
3559 assert_eq!(
3560 unsafe { &(*(::std::ptr::null::<libusb_control_setup>())).bRequest as *const _ as usize },
3561 1usize,
3562 concat!(
3563 "Offset of field: ",
3564 stringify!(libusb_control_setup),
3565 "::",
3566 stringify!(bRequest)
3567 )
3568 );
3569 assert_eq!(
3570 unsafe { &(*(::std::ptr::null::<libusb_control_setup>())).wValue as *const _ as usize },
3571 2usize,
3572 concat!(
3573 "Offset of field: ",
3574 stringify!(libusb_control_setup),
3575 "::",
3576 stringify!(wValue)
3577 )
3578 );
3579 assert_eq!(
3580 unsafe { &(*(::std::ptr::null::<libusb_control_setup>())).wIndex as *const _ as usize },
3581 4usize,
3582 concat!(
3583 "Offset of field: ",
3584 stringify!(libusb_control_setup),
3585 "::",
3586 stringify!(wIndex)
3587 )
3588 );
3589 assert_eq!(
3590 unsafe { &(*(::std::ptr::null::<libusb_control_setup>())).wLength as *const _ as usize },
3591 6usize,
3592 concat!(
3593 "Offset of field: ",
3594 stringify!(libusb_control_setup),
3595 "::",
3596 stringify!(wLength)
3597 )
3598 );
3599 }
3600 #[repr(C)]
3601 #[derive(Debug, Copy, Clone)]
3602 pub struct libusb_context {
3603 _unused: [u8; 0],
3604 }
3605 #[repr(C)]
3606 #[derive(Debug, Copy, Clone)]
3607 pub struct libusb_device {
3608 _unused: [u8; 0],
3609 }
3610 #[repr(C)]
3611 #[derive(Debug, Copy, Clone)]
3612 pub struct libusb_device_handle {
3613 _unused: [u8; 0],
3614 }
3615 /// \ingroup libusb_lib
3616 /// Structure providing the version of the libusb runtime
3617 #[repr(C)]
3618 #[derive(Debug, Copy, Clone)]
3619 pub struct libusb_version {
3620 /// Library major version.
3621 pub major: u16,
3622 /// Library minor version.
3623 pub minor: u16,
3624 /// Library micro version.
3625 pub micro: u16,
3626 /// Library nano version.
3627 pub nano: u16,
3628 /// Library release candidate suffix string, e.g. "-rc4".
3629 pub rc: *const ::std::os::raw::c_char,
3630 /// For ABI compatibility only.
3631 pub describe: *const ::std::os::raw::c_char,
3632 }
3633 #[test]
bindgen_test_layout_libusb_version()3634 fn bindgen_test_layout_libusb_version() {
3635 assert_eq!(
3636 ::std::mem::size_of::<libusb_version>(),
3637 24usize,
3638 concat!("Size of: ", stringify!(libusb_version))
3639 );
3640 assert_eq!(
3641 ::std::mem::align_of::<libusb_version>(),
3642 8usize,
3643 concat!("Alignment of ", stringify!(libusb_version))
3644 );
3645 assert_eq!(
3646 unsafe { &(*(::std::ptr::null::<libusb_version>())).major as *const _ as usize },
3647 0usize,
3648 concat!(
3649 "Offset of field: ",
3650 stringify!(libusb_version),
3651 "::",
3652 stringify!(major)
3653 )
3654 );
3655 assert_eq!(
3656 unsafe { &(*(::std::ptr::null::<libusb_version>())).minor as *const _ as usize },
3657 2usize,
3658 concat!(
3659 "Offset of field: ",
3660 stringify!(libusb_version),
3661 "::",
3662 stringify!(minor)
3663 )
3664 );
3665 assert_eq!(
3666 unsafe { &(*(::std::ptr::null::<libusb_version>())).micro as *const _ as usize },
3667 4usize,
3668 concat!(
3669 "Offset of field: ",
3670 stringify!(libusb_version),
3671 "::",
3672 stringify!(micro)
3673 )
3674 );
3675 assert_eq!(
3676 unsafe { &(*(::std::ptr::null::<libusb_version>())).nano as *const _ as usize },
3677 6usize,
3678 concat!(
3679 "Offset of field: ",
3680 stringify!(libusb_version),
3681 "::",
3682 stringify!(nano)
3683 )
3684 );
3685 assert_eq!(
3686 unsafe { &(*(::std::ptr::null::<libusb_version>())).rc as *const _ as usize },
3687 8usize,
3688 concat!(
3689 "Offset of field: ",
3690 stringify!(libusb_version),
3691 "::",
3692 stringify!(rc)
3693 )
3694 );
3695 assert_eq!(
3696 unsafe { &(*(::std::ptr::null::<libusb_version>())).describe as *const _ as usize },
3697 16usize,
3698 concat!(
3699 "Offset of field: ",
3700 stringify!(libusb_version),
3701 "::",
3702 stringify!(describe)
3703 )
3704 );
3705 }
3706 /// The OS doesn't report or know the device speed.
3707 pub const LIBUSB_SPEED_UNKNOWN: libusb_speed = 0;
3708 /// The device is operating at low speed (1.5MBit/s).
3709 pub const LIBUSB_SPEED_LOW: libusb_speed = 1;
3710 /// The device is operating at full speed (12MBit/s).
3711 pub const LIBUSB_SPEED_FULL: libusb_speed = 2;
3712 /// The device is operating at high speed (480MBit/s).
3713 pub const LIBUSB_SPEED_HIGH: libusb_speed = 3;
3714 /// The device is operating at super speed (5000MBit/s).
3715 pub const LIBUSB_SPEED_SUPER: libusb_speed = 4;
3716 /// \ingroup libusb_dev
3717 /// Speed codes. Indicates the speed at which the device is operating.
3718 pub type libusb_speed = u32;
3719 /// Low speed operation supported (1.5MBit/s).
3720 pub const LIBUSB_LOW_SPEED_OPERATION: libusb_supported_speed = 1;
3721 /// Full speed operation supported (12MBit/s).
3722 pub const LIBUSB_FULL_SPEED_OPERATION: libusb_supported_speed = 2;
3723 /// High speed operation supported (480MBit/s).
3724 pub const LIBUSB_HIGH_SPEED_OPERATION: libusb_supported_speed = 4;
3725 /// Superspeed operation supported (5000MBit/s).
3726 pub const LIBUSB_SUPER_SPEED_OPERATION: libusb_supported_speed = 8;
3727 /// \ingroup libusb_dev
3728 /// Supported speeds (wSpeedSupported) bitfield. Indicates what
3729 /// speeds the device supports.
3730 pub type libusb_supported_speed = u32;
3731 /// Supports Link Power Management (LPM)
3732 pub const LIBUSB_BM_LPM_SUPPORT: libusb_usb_2_0_extension_attributes = 2;
3733 /// \ingroup libusb_dev
3734 /// Masks for the bits of the
3735 /// \ref libusb_usb_2_0_extension_descriptor::bmAttributes "bmAttributes" field
3736 /// of the USB 2.0 Extension descriptor.
3737 pub type libusb_usb_2_0_extension_attributes = u32;
3738 /// Supports Latency Tolerance Messages (LTM)
3739 pub const LIBUSB_BM_LTM_SUPPORT: libusb_ss_usb_device_capability_attributes = 2;
3740 /// \ingroup libusb_dev
3741 /// Masks for the bits of the
3742 /// \ref libusb_ss_usb_device_capability_descriptor::bmAttributes "bmAttributes" field
3743 /// field of the SuperSpeed USB Device Capability descriptor.
3744 pub type libusb_ss_usb_device_capability_attributes = u32;
3745 /// Wireless USB device capability
3746 pub const LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY: libusb_bos_type = 1;
3747 /// USB 2.0 extensions
3748 pub const LIBUSB_BT_USB_2_0_EXTENSION: libusb_bos_type = 2;
3749 /// SuperSpeed USB device capability
3750 pub const LIBUSB_BT_SS_USB_DEVICE_CAPABILITY: libusb_bos_type = 3;
3751 /// Container ID type
3752 pub const LIBUSB_BT_CONTAINER_ID: libusb_bos_type = 4;
3753 /// \ingroup libusb_dev
3754 /// USB capability types
3755 pub type libusb_bos_type = u32;
3756 /// Success (no error)
3757 pub const LIBUSB_SUCCESS: libusb_error = 0;
3758 /// Input/output error
3759 pub const LIBUSB_ERROR_IO: libusb_error = -1;
3760 /// Invalid parameter
3761 pub const LIBUSB_ERROR_INVALID_PARAM: libusb_error = -2;
3762 /// Access denied (insufficient permissions)
3763 pub const LIBUSB_ERROR_ACCESS: libusb_error = -3;
3764 /// No such device (it may have been disconnected)
3765 pub const LIBUSB_ERROR_NO_DEVICE: libusb_error = -4;
3766 /// Entity not found
3767 pub const LIBUSB_ERROR_NOT_FOUND: libusb_error = -5;
3768 /// Resource busy
3769 pub const LIBUSB_ERROR_BUSY: libusb_error = -6;
3770 /// Operation timed out
3771 pub const LIBUSB_ERROR_TIMEOUT: libusb_error = -7;
3772 /// Overflow
3773 pub const LIBUSB_ERROR_OVERFLOW: libusb_error = -8;
3774 /// Pipe error
3775 pub const LIBUSB_ERROR_PIPE: libusb_error = -9;
3776 /// System call interrupted (perhaps due to signal)
3777 pub const LIBUSB_ERROR_INTERRUPTED: libusb_error = -10;
3778 /// Insufficient memory
3779 pub const LIBUSB_ERROR_NO_MEM: libusb_error = -11;
3780 /// Operation not supported or unimplemented on this platform
3781 pub const LIBUSB_ERROR_NOT_SUPPORTED: libusb_error = -12;
3782 /// Other error
3783 pub const LIBUSB_ERROR_OTHER: libusb_error = -99;
3784 /// \ingroup libusb_misc
3785 /// Error codes. Most libusb functions return 0 on success or one of these
3786 /// codes on failure.
3787 /// You can call libusb_error_name() to retrieve a string representation of an
3788 /// error code or libusb_strerror() to get an end-user suitable description of
3789 /// an error code.
3790 pub type libusb_error = i32;
3791 /// Transfer completed without error. Note that this does not indicate
3792 /// that the entire amount of requested data was transferred.
3793 pub const LIBUSB_TRANSFER_COMPLETED: libusb_transfer_status = 0;
3794 /// Transfer failed
3795 pub const LIBUSB_TRANSFER_ERROR: libusb_transfer_status = 1;
3796 /// Transfer timed out
3797 pub const LIBUSB_TRANSFER_TIMED_OUT: libusb_transfer_status = 2;
3798 /// Transfer was cancelled
3799 pub const LIBUSB_TRANSFER_CANCELLED: libusb_transfer_status = 3;
3800 /// For bulk/interrupt endpoints: halt condition detected (endpoint
3801 /// stalled). For control endpoints: control request not supported.
3802 pub const LIBUSB_TRANSFER_STALL: libusb_transfer_status = 4;
3803 /// Device was disconnected
3804 pub const LIBUSB_TRANSFER_NO_DEVICE: libusb_transfer_status = 5;
3805 /// Device sent more data than requested
3806 pub const LIBUSB_TRANSFER_OVERFLOW: libusb_transfer_status = 6;
3807 /// \ingroup libusb_asyncio
3808 /// Transfer status codes
3809 pub type libusb_transfer_status = u32;
3810 /// Report short frames as errors
3811 pub const LIBUSB_TRANSFER_SHORT_NOT_OK: libusb_transfer_flags = 1;
3812 /// Automatically free() transfer buffer during libusb_free_transfer().
3813 /// Note that buffers allocated with libusb_dev_mem_alloc() should not
3814 /// be attempted freed in this way, since free() is not an appropriate
3815 /// way to release such memory.
3816 pub const LIBUSB_TRANSFER_FREE_BUFFER: libusb_transfer_flags = 2;
3817 /// Automatically call libusb_free_transfer() after callback returns.
3818 /// If this flag is set, it is illegal to call libusb_free_transfer()
3819 /// from your transfer callback, as this will result in a double-free
3820 /// when this flag is acted upon.
3821 pub const LIBUSB_TRANSFER_FREE_TRANSFER: libusb_transfer_flags = 4;
3822 /// Terminate transfers that are a multiple of the endpoint's
3823 /// wMaxPacketSize with an extra zero length packet. This is useful
3824 /// when a device protocol mandates that each logical request is
3825 /// terminated by an incomplete packet (i.e. the logical requests are
3826 /// not separated by other means).
3827 ///
3828 /// This flag only affects host-to-device transfers to bulk and interrupt
3829 /// endpoints. In other situations, it is ignored.
3830 ///
3831 /// This flag only affects transfers with a length that is a multiple of
3832 /// the endpoint's wMaxPacketSize. On transfers of other lengths, this
3833 /// flag has no effect. Therefore, if you are working with a device that
3834 /// needs a ZLP whenever the end of the logical request falls on a packet
3835 /// boundary, then it is sensible to set this flag on <em>every</em>
3836 /// transfer (you do not have to worry about only setting it on transfers
3837 /// that end on the boundary).
3838 ///
3839 /// This flag is currently only supported on Linux.
3840 /// On other systems, libusb_submit_transfer() will return
3841 /// LIBUSB_ERROR_NOT_SUPPORTED for every transfer where this flag is set.
3842 ///
3843 /// Available since libusb-1.0.9.
3844 pub const LIBUSB_TRANSFER_ADD_ZERO_PACKET: libusb_transfer_flags = 8;
3845 /// \ingroup libusb_asyncio
3846 /// libusb_transfer.flags values
3847 pub type libusb_transfer_flags = u32;
3848 /// \ingroup libusb_asyncio
3849 /// Isochronous packet descriptor.
3850 #[repr(C)]
3851 #[derive(Debug, Copy, Clone)]
3852 pub struct libusb_iso_packet_descriptor {
3853 /// Length of data to request in this packet
3854 pub length: ::std::os::raw::c_uint,
3855 /// Amount of data that was actually transferred
3856 pub actual_length: ::std::os::raw::c_uint,
3857 /// Status code for this packet
3858 pub status: libusb_transfer_status,
3859 }
3860 #[test]
bindgen_test_layout_libusb_iso_packet_descriptor()3861 fn bindgen_test_layout_libusb_iso_packet_descriptor() {
3862 assert_eq!(
3863 ::std::mem::size_of::<libusb_iso_packet_descriptor>(),
3864 12usize,
3865 concat!("Size of: ", stringify!(libusb_iso_packet_descriptor))
3866 );
3867 assert_eq!(
3868 ::std::mem::align_of::<libusb_iso_packet_descriptor>(),
3869 4usize,
3870 concat!("Alignment of ", stringify!(libusb_iso_packet_descriptor))
3871 );
3872 assert_eq!(
3873 unsafe {
3874 &(*(::std::ptr::null::<libusb_iso_packet_descriptor>())).length as *const _ as usize
3875 },
3876 0usize,
3877 concat!(
3878 "Offset of field: ",
3879 stringify!(libusb_iso_packet_descriptor),
3880 "::",
3881 stringify!(length)
3882 )
3883 );
3884 assert_eq!(
3885 unsafe {
3886 &(*(::std::ptr::null::<libusb_iso_packet_descriptor>())).actual_length as *const _
3887 as usize
3888 },
3889 4usize,
3890 concat!(
3891 "Offset of field: ",
3892 stringify!(libusb_iso_packet_descriptor),
3893 "::",
3894 stringify!(actual_length)
3895 )
3896 );
3897 assert_eq!(
3898 unsafe {
3899 &(*(::std::ptr::null::<libusb_iso_packet_descriptor>())).status as *const _ as usize
3900 },
3901 8usize,
3902 concat!(
3903 "Offset of field: ",
3904 stringify!(libusb_iso_packet_descriptor),
3905 "::",
3906 stringify!(status)
3907 )
3908 );
3909 }
3910 /// \ingroup libusb_asyncio
3911 /// Asynchronous transfer callback function type. When submitting asynchronous
3912 /// transfers, you pass a pointer to a callback function of this type via the
3913 /// \ref libusb_transfer::callback "callback" member of the libusb_transfer
3914 /// structure. libusb will call this function later, when the transfer has
3915 /// completed or failed. See \ref libusb_asyncio for more information.
3916 /// \param transfer The libusb_transfer struct the callback function is being
3917 /// notified about.
3918 pub type libusb_transfer_cb_fn =
3919 ::std::option::Option<unsafe extern "C" fn(transfer: *mut libusb_transfer)>;
3920 /// \ingroup libusb_asyncio
3921 /// The generic USB transfer structure. The user populates this structure and
3922 /// then submits it in order to request a transfer. After the transfer has
3923 /// completed, the library populates the transfer with the results and passes
3924 /// it back to the user.
3925 #[repr(C)]
3926 #[derive(Debug)]
3927 pub struct libusb_transfer {
3928 /// Handle of the device that this transfer will be submitted to
3929 pub dev_handle: *mut libusb_device_handle,
3930 /// A bitwise OR combination of \ref libusb_transfer_flags.
3931 pub flags: u8,
3932 /// Address of the endpoint where this transfer will be sent.
3933 pub endpoint: ::std::os::raw::c_uchar,
3934 /// Type of the endpoint from \ref libusb_transfer_type
3935 pub type_: ::std::os::raw::c_uchar,
3936 /// Timeout for this transfer in millseconds. A value of 0 indicates no
3937 /// timeout.
3938 pub timeout: ::std::os::raw::c_uint,
3939 /// The status of the transfer. Read-only, and only for use within
3940 /// transfer callback function.
3941 ///
3942 /// If this is an isochronous transfer, this field may read COMPLETED even
3943 /// if there were errors in the frames. Use the
3944 /// \ref libusb_iso_packet_descriptor::status "status" field in each packet
3945 /// to determine if errors occurred.
3946 pub status: libusb_transfer_status,
3947 /// Length of the data buffer
3948 pub length: ::std::os::raw::c_int,
3949 /// Actual length of data that was transferred. Read-only, and only for
3950 /// use within transfer callback function. Not valid for isochronous
3951 /// endpoint transfers.
3952 pub actual_length: ::std::os::raw::c_int,
3953 /// Callback function. This will be invoked when the transfer completes,
3954 /// fails, or is cancelled.
3955 pub callback: libusb_transfer_cb_fn,
3956 /// User context data to pass to the callback function.
3957 pub user_data: *mut ::std::os::raw::c_void,
3958 /// Data buffer
3959 pub buffer: *mut ::std::os::raw::c_uchar,
3960 /// Number of isochronous packets. Only used for I/O with isochronous
3961 /// endpoints.
3962 pub num_iso_packets: ::std::os::raw::c_int,
3963 /// Isochronous packet descriptors, for isochronous transfers only.
3964 pub iso_packet_desc: __IncompleteArrayField<libusb_iso_packet_descriptor>,
3965 }
3966 #[test]
bindgen_test_layout_libusb_transfer()3967 fn bindgen_test_layout_libusb_transfer() {
3968 assert_eq!(
3969 ::std::mem::size_of::<libusb_transfer>(),
3970 64usize,
3971 concat!("Size of: ", stringify!(libusb_transfer))
3972 );
3973 assert_eq!(
3974 ::std::mem::align_of::<libusb_transfer>(),
3975 8usize,
3976 concat!("Alignment of ", stringify!(libusb_transfer))
3977 );
3978 }
3979 /// The libusb_has_capability() API is available.
3980 pub const LIBUSB_CAP_HAS_CAPABILITY: libusb_capability = 0;
3981 /// Hotplug support is available on this platform.
3982 pub const LIBUSB_CAP_HAS_HOTPLUG: libusb_capability = 1;
3983 /// The library can access HID devices without requiring user intervention.
3984 /// Note that before being able to actually access an HID device, you may
3985 /// still have to call additional libusb functions such as
3986 /// \ref libusb_detach_kernel_driver().
3987 pub const LIBUSB_CAP_HAS_HID_ACCESS: libusb_capability = 256;
3988 /// The library supports detaching of the default USB driver, using
3989 /// \ref libusb_detach_kernel_driver(), if one is set by the OS kernel
3990 pub const LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER: libusb_capability = 257;
3991 /// \ingroup libusb_misc
3992 /// Capabilities supported by an instance of libusb on the current running
3993 /// platform. Test if the loaded library supports a given capability by calling
3994 /// \ref libusb_has_capability().
3995 pub type libusb_capability = u32;
3996 pub const LIBUSB_LOG_LEVEL_NONE: libusb_log_level = 0;
3997 pub const LIBUSB_LOG_LEVEL_ERROR: libusb_log_level = 1;
3998 pub const LIBUSB_LOG_LEVEL_WARNING: libusb_log_level = 2;
3999 pub const LIBUSB_LOG_LEVEL_INFO: libusb_log_level = 3;
4000 pub const LIBUSB_LOG_LEVEL_DEBUG: libusb_log_level = 4;
4001 /// \ingroup libusb_lib
4002 /// Log message levels.
4003 /// - LIBUSB_LOG_LEVEL_NONE (0) : no messages ever printed by the library (default)
4004 /// - LIBUSB_LOG_LEVEL_ERROR (1) : error messages are printed to stderr
4005 /// - LIBUSB_LOG_LEVEL_WARNING (2) : warning and error messages are printed to stderr
4006 /// - LIBUSB_LOG_LEVEL_INFO (3) : informational messages are printed to stdout, warning
4007 /// and error messages are printed to stderr
4008 /// - LIBUSB_LOG_LEVEL_DEBUG (4) : debug and informational messages are printed to stdout,
4009 /// warnings and errors to stderr
4010 pub type libusb_log_level = u32;
4011 extern "C" {
libusb_init(ctx: *mut *mut libusb_context) -> ::std::os::raw::c_int4012 pub fn libusb_init(ctx: *mut *mut libusb_context) -> ::std::os::raw::c_int;
4013 }
4014 extern "C" {
libusb_init_jailed(ctx: *mut *mut libusb_context) -> ::std::os::raw::c_int4015 pub fn libusb_init_jailed(ctx: *mut *mut libusb_context) -> ::std::os::raw::c_int;
4016 }
4017 extern "C" {
libusb_exit(ctx: *mut libusb_context)4018 pub fn libusb_exit(ctx: *mut libusb_context);
4019 }
4020 extern "C" {
libusb_get_device_from_fd( ctx: *mut libusb_context, fd: ::std::os::raw::c_int, device: *mut *mut libusb_device, ) -> ::std::os::raw::c_int4021 pub fn libusb_get_device_from_fd(
4022 ctx: *mut libusb_context,
4023 fd: ::std::os::raw::c_int,
4024 device: *mut *mut libusb_device,
4025 ) -> ::std::os::raw::c_int;
4026 }
4027 extern "C" {
libusb_set_debug(ctx: *mut libusb_context, level: ::std::os::raw::c_int)4028 pub fn libusb_set_debug(ctx: *mut libusb_context, level: ::std::os::raw::c_int);
4029 }
4030 extern "C" {
libusb_get_version() -> *const libusb_version4031 pub fn libusb_get_version() -> *const libusb_version;
4032 }
4033 extern "C" {
libusb_has_capability(capability: u32) -> ::std::os::raw::c_int4034 pub fn libusb_has_capability(capability: u32) -> ::std::os::raw::c_int;
4035 }
4036 extern "C" {
libusb_error_name(errcode: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char4037 pub fn libusb_error_name(errcode: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
4038 }
4039 extern "C" {
libusb_setlocale(locale: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int4040 pub fn libusb_setlocale(locale: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
4041 }
4042 extern "C" {
libusb_strerror(errcode: libusb_error) -> *const ::std::os::raw::c_char4043 pub fn libusb_strerror(errcode: libusb_error) -> *const ::std::os::raw::c_char;
4044 }
4045 extern "C" {
libusb_get_device_list( ctx: *mut libusb_context, list: *mut *mut *mut libusb_device, ) -> isize4046 pub fn libusb_get_device_list(
4047 ctx: *mut libusb_context,
4048 list: *mut *mut *mut libusb_device,
4049 ) -> isize;
4050 }
4051 extern "C" {
libusb_free_device_list( list: *mut *mut libusb_device, unref_devices: ::std::os::raw::c_int, )4052 pub fn libusb_free_device_list(
4053 list: *mut *mut libusb_device,
4054 unref_devices: ::std::os::raw::c_int,
4055 );
4056 }
4057 extern "C" {
libusb_ref_device(dev: *mut libusb_device) -> *mut libusb_device4058 pub fn libusb_ref_device(dev: *mut libusb_device) -> *mut libusb_device;
4059 }
4060 extern "C" {
libusb_unref_device(dev: *mut libusb_device)4061 pub fn libusb_unref_device(dev: *mut libusb_device);
4062 }
4063 extern "C" {
libusb_get_configuration( dev: *mut libusb_device_handle, config: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4064 pub fn libusb_get_configuration(
4065 dev: *mut libusb_device_handle,
4066 config: *mut ::std::os::raw::c_int,
4067 ) -> ::std::os::raw::c_int;
4068 }
4069 extern "C" {
libusb_get_device_descriptor( dev: *mut libusb_device, desc: *mut libusb_device_descriptor, ) -> ::std::os::raw::c_int4070 pub fn libusb_get_device_descriptor(
4071 dev: *mut libusb_device,
4072 desc: *mut libusb_device_descriptor,
4073 ) -> ::std::os::raw::c_int;
4074 }
4075 extern "C" {
libusb_get_active_config_descriptor( dev: *mut libusb_device, config: *mut *mut libusb_config_descriptor, ) -> ::std::os::raw::c_int4076 pub fn libusb_get_active_config_descriptor(
4077 dev: *mut libusb_device,
4078 config: *mut *mut libusb_config_descriptor,
4079 ) -> ::std::os::raw::c_int;
4080 }
4081 extern "C" {
libusb_get_config_descriptor( dev: *mut libusb_device, config_index: u8, config: *mut *mut libusb_config_descriptor, ) -> ::std::os::raw::c_int4082 pub fn libusb_get_config_descriptor(
4083 dev: *mut libusb_device,
4084 config_index: u8,
4085 config: *mut *mut libusb_config_descriptor,
4086 ) -> ::std::os::raw::c_int;
4087 }
4088 extern "C" {
libusb_get_config_descriptor_by_value( dev: *mut libusb_device, bConfigurationValue: u8, config: *mut *mut libusb_config_descriptor, ) -> ::std::os::raw::c_int4089 pub fn libusb_get_config_descriptor_by_value(
4090 dev: *mut libusb_device,
4091 bConfigurationValue: u8,
4092 config: *mut *mut libusb_config_descriptor,
4093 ) -> ::std::os::raw::c_int;
4094 }
4095 extern "C" {
libusb_free_config_descriptor(config: *mut libusb_config_descriptor)4096 pub fn libusb_free_config_descriptor(config: *mut libusb_config_descriptor);
4097 }
4098 extern "C" {
libusb_get_ss_endpoint_companion_descriptor( ctx: *mut libusb_context, endpoint: *const libusb_endpoint_descriptor, ep_comp: *mut *mut libusb_ss_endpoint_companion_descriptor, ) -> ::std::os::raw::c_int4099 pub fn libusb_get_ss_endpoint_companion_descriptor(
4100 ctx: *mut libusb_context,
4101 endpoint: *const libusb_endpoint_descriptor,
4102 ep_comp: *mut *mut libusb_ss_endpoint_companion_descriptor,
4103 ) -> ::std::os::raw::c_int;
4104 }
4105 extern "C" {
libusb_free_ss_endpoint_companion_descriptor( ep_comp: *mut libusb_ss_endpoint_companion_descriptor, )4106 pub fn libusb_free_ss_endpoint_companion_descriptor(
4107 ep_comp: *mut libusb_ss_endpoint_companion_descriptor,
4108 );
4109 }
4110 extern "C" {
libusb_get_bos_descriptor( dev_handle: *mut libusb_device_handle, bos: *mut *mut libusb_bos_descriptor, ) -> ::std::os::raw::c_int4111 pub fn libusb_get_bos_descriptor(
4112 dev_handle: *mut libusb_device_handle,
4113 bos: *mut *mut libusb_bos_descriptor,
4114 ) -> ::std::os::raw::c_int;
4115 }
4116 extern "C" {
libusb_free_bos_descriptor(bos: *mut libusb_bos_descriptor)4117 pub fn libusb_free_bos_descriptor(bos: *mut libusb_bos_descriptor);
4118 }
4119 extern "C" {
libusb_get_usb_2_0_extension_descriptor( ctx: *mut libusb_context, dev_cap: *mut libusb_bos_dev_capability_descriptor, usb_2_0_extension: *mut *mut libusb_usb_2_0_extension_descriptor, ) -> ::std::os::raw::c_int4120 pub fn libusb_get_usb_2_0_extension_descriptor(
4121 ctx: *mut libusb_context,
4122 dev_cap: *mut libusb_bos_dev_capability_descriptor,
4123 usb_2_0_extension: *mut *mut libusb_usb_2_0_extension_descriptor,
4124 ) -> ::std::os::raw::c_int;
4125 }
4126 extern "C" {
libusb_free_usb_2_0_extension_descriptor( usb_2_0_extension: *mut libusb_usb_2_0_extension_descriptor, )4127 pub fn libusb_free_usb_2_0_extension_descriptor(
4128 usb_2_0_extension: *mut libusb_usb_2_0_extension_descriptor,
4129 );
4130 }
4131 extern "C" {
libusb_get_ss_usb_device_capability_descriptor( ctx: *mut libusb_context, dev_cap: *mut libusb_bos_dev_capability_descriptor, ss_usb_device_cap: *mut *mut libusb_ss_usb_device_capability_descriptor, ) -> ::std::os::raw::c_int4132 pub fn libusb_get_ss_usb_device_capability_descriptor(
4133 ctx: *mut libusb_context,
4134 dev_cap: *mut libusb_bos_dev_capability_descriptor,
4135 ss_usb_device_cap: *mut *mut libusb_ss_usb_device_capability_descriptor,
4136 ) -> ::std::os::raw::c_int;
4137 }
4138 extern "C" {
libusb_free_ss_usb_device_capability_descriptor( ss_usb_device_cap: *mut libusb_ss_usb_device_capability_descriptor, )4139 pub fn libusb_free_ss_usb_device_capability_descriptor(
4140 ss_usb_device_cap: *mut libusb_ss_usb_device_capability_descriptor,
4141 );
4142 }
4143 extern "C" {
libusb_get_container_id_descriptor( ctx: *mut libusb_context, dev_cap: *mut libusb_bos_dev_capability_descriptor, container_id: *mut *mut libusb_container_id_descriptor, ) -> ::std::os::raw::c_int4144 pub fn libusb_get_container_id_descriptor(
4145 ctx: *mut libusb_context,
4146 dev_cap: *mut libusb_bos_dev_capability_descriptor,
4147 container_id: *mut *mut libusb_container_id_descriptor,
4148 ) -> ::std::os::raw::c_int;
4149 }
4150 extern "C" {
libusb_free_container_id_descriptor(container_id: *mut libusb_container_id_descriptor)4151 pub fn libusb_free_container_id_descriptor(container_id: *mut libusb_container_id_descriptor);
4152 }
4153 extern "C" {
libusb_get_bus_number(dev: *mut libusb_device) -> u84154 pub fn libusb_get_bus_number(dev: *mut libusb_device) -> u8;
4155 }
4156 extern "C" {
libusb_get_port_number(dev: *mut libusb_device) -> u84157 pub fn libusb_get_port_number(dev: *mut libusb_device) -> u8;
4158 }
4159 extern "C" {
libusb_get_port_numbers( dev: *mut libusb_device, port_numbers: *mut u8, port_numbers_len: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4160 pub fn libusb_get_port_numbers(
4161 dev: *mut libusb_device,
4162 port_numbers: *mut u8,
4163 port_numbers_len: ::std::os::raw::c_int,
4164 ) -> ::std::os::raw::c_int;
4165 }
4166 extern "C" {
libusb_get_port_path( ctx: *mut libusb_context, dev: *mut libusb_device, path: *mut u8, path_length: u8, ) -> ::std::os::raw::c_int4167 pub fn libusb_get_port_path(
4168 ctx: *mut libusb_context,
4169 dev: *mut libusb_device,
4170 path: *mut u8,
4171 path_length: u8,
4172 ) -> ::std::os::raw::c_int;
4173 }
4174 extern "C" {
libusb_get_parent(dev: *mut libusb_device) -> *mut libusb_device4175 pub fn libusb_get_parent(dev: *mut libusb_device) -> *mut libusb_device;
4176 }
4177 extern "C" {
libusb_get_device_address(dev: *mut libusb_device) -> u84178 pub fn libusb_get_device_address(dev: *mut libusb_device) -> u8;
4179 }
4180 extern "C" {
libusb_get_device_speed(dev: *mut libusb_device) -> ::std::os::raw::c_int4181 pub fn libusb_get_device_speed(dev: *mut libusb_device) -> ::std::os::raw::c_int;
4182 }
4183 extern "C" {
libusb_get_max_packet_size( dev: *mut libusb_device, endpoint: ::std::os::raw::c_uchar, ) -> ::std::os::raw::c_int4184 pub fn libusb_get_max_packet_size(
4185 dev: *mut libusb_device,
4186 endpoint: ::std::os::raw::c_uchar,
4187 ) -> ::std::os::raw::c_int;
4188 }
4189 extern "C" {
libusb_get_max_iso_packet_size( dev: *mut libusb_device, endpoint: ::std::os::raw::c_uchar, ) -> ::std::os::raw::c_int4190 pub fn libusb_get_max_iso_packet_size(
4191 dev: *mut libusb_device,
4192 endpoint: ::std::os::raw::c_uchar,
4193 ) -> ::std::os::raw::c_int;
4194 }
4195 extern "C" {
libusb_open( dev: *mut libusb_device, dev_handle: *mut *mut libusb_device_handle, ) -> ::std::os::raw::c_int4196 pub fn libusb_open(
4197 dev: *mut libusb_device,
4198 dev_handle: *mut *mut libusb_device_handle,
4199 ) -> ::std::os::raw::c_int;
4200 }
4201 extern "C" {
libusb_open_fd( dev: *mut libusb_device, fd: ::std::os::raw::c_int, handle: *mut *mut libusb_device_handle, ) -> ::std::os::raw::c_int4202 pub fn libusb_open_fd(
4203 dev: *mut libusb_device,
4204 fd: ::std::os::raw::c_int,
4205 handle: *mut *mut libusb_device_handle,
4206 ) -> ::std::os::raw::c_int;
4207 }
4208 extern "C" {
libusb_close(dev_handle: *mut libusb_device_handle)4209 pub fn libusb_close(dev_handle: *mut libusb_device_handle);
4210 }
4211 extern "C" {
libusb_get_device(dev_handle: *mut libusb_device_handle) -> *mut libusb_device4212 pub fn libusb_get_device(dev_handle: *mut libusb_device_handle) -> *mut libusb_device;
4213 }
4214 extern "C" {
libusb_set_configuration( dev_handle: *mut libusb_device_handle, configuration: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4215 pub fn libusb_set_configuration(
4216 dev_handle: *mut libusb_device_handle,
4217 configuration: ::std::os::raw::c_int,
4218 ) -> ::std::os::raw::c_int;
4219 }
4220 extern "C" {
libusb_claim_interface( dev_handle: *mut libusb_device_handle, interface_number: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4221 pub fn libusb_claim_interface(
4222 dev_handle: *mut libusb_device_handle,
4223 interface_number: ::std::os::raw::c_int,
4224 ) -> ::std::os::raw::c_int;
4225 }
4226 extern "C" {
libusb_release_interface( dev_handle: *mut libusb_device_handle, interface_number: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4227 pub fn libusb_release_interface(
4228 dev_handle: *mut libusb_device_handle,
4229 interface_number: ::std::os::raw::c_int,
4230 ) -> ::std::os::raw::c_int;
4231 }
4232 extern "C" {
libusb_open_device_with_vid_pid( ctx: *mut libusb_context, vendor_id: u16, product_id: u16, ) -> *mut libusb_device_handle4233 pub fn libusb_open_device_with_vid_pid(
4234 ctx: *mut libusb_context,
4235 vendor_id: u16,
4236 product_id: u16,
4237 ) -> *mut libusb_device_handle;
4238 }
4239 extern "C" {
libusb_set_interface_alt_setting( dev_handle: *mut libusb_device_handle, interface_number: ::std::os::raw::c_int, alternate_setting: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4240 pub fn libusb_set_interface_alt_setting(
4241 dev_handle: *mut libusb_device_handle,
4242 interface_number: ::std::os::raw::c_int,
4243 alternate_setting: ::std::os::raw::c_int,
4244 ) -> ::std::os::raw::c_int;
4245 }
4246 extern "C" {
libusb_clear_halt( dev_handle: *mut libusb_device_handle, endpoint: ::std::os::raw::c_uchar, ) -> ::std::os::raw::c_int4247 pub fn libusb_clear_halt(
4248 dev_handle: *mut libusb_device_handle,
4249 endpoint: ::std::os::raw::c_uchar,
4250 ) -> ::std::os::raw::c_int;
4251 }
4252 extern "C" {
libusb_reset_device(dev_handle: *mut libusb_device_handle) -> ::std::os::raw::c_int4253 pub fn libusb_reset_device(dev_handle: *mut libusb_device_handle) -> ::std::os::raw::c_int;
4254 }
4255 extern "C" {
libusb_alloc_streams( dev_handle: *mut libusb_device_handle, num_streams: u32, endpoints: *mut ::std::os::raw::c_uchar, num_endpoints: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4256 pub fn libusb_alloc_streams(
4257 dev_handle: *mut libusb_device_handle,
4258 num_streams: u32,
4259 endpoints: *mut ::std::os::raw::c_uchar,
4260 num_endpoints: ::std::os::raw::c_int,
4261 ) -> ::std::os::raw::c_int;
4262 }
4263 extern "C" {
libusb_free_streams( dev_handle: *mut libusb_device_handle, endpoints: *mut ::std::os::raw::c_uchar, num_endpoints: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4264 pub fn libusb_free_streams(
4265 dev_handle: *mut libusb_device_handle,
4266 endpoints: *mut ::std::os::raw::c_uchar,
4267 num_endpoints: ::std::os::raw::c_int,
4268 ) -> ::std::os::raw::c_int;
4269 }
4270 extern "C" {
libusb_dev_mem_alloc( dev_handle: *mut libusb_device_handle, length: usize, ) -> *mut ::std::os::raw::c_uchar4271 pub fn libusb_dev_mem_alloc(
4272 dev_handle: *mut libusb_device_handle,
4273 length: usize,
4274 ) -> *mut ::std::os::raw::c_uchar;
4275 }
4276 extern "C" {
libusb_dev_mem_free( dev_handle: *mut libusb_device_handle, buffer: *mut ::std::os::raw::c_uchar, length: usize, ) -> ::std::os::raw::c_int4277 pub fn libusb_dev_mem_free(
4278 dev_handle: *mut libusb_device_handle,
4279 buffer: *mut ::std::os::raw::c_uchar,
4280 length: usize,
4281 ) -> ::std::os::raw::c_int;
4282 }
4283 extern "C" {
libusb_kernel_driver_active( dev_handle: *mut libusb_device_handle, interface_number: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4284 pub fn libusb_kernel_driver_active(
4285 dev_handle: *mut libusb_device_handle,
4286 interface_number: ::std::os::raw::c_int,
4287 ) -> ::std::os::raw::c_int;
4288 }
4289 extern "C" {
libusb_detach_kernel_driver( dev_handle: *mut libusb_device_handle, interface_number: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4290 pub fn libusb_detach_kernel_driver(
4291 dev_handle: *mut libusb_device_handle,
4292 interface_number: ::std::os::raw::c_int,
4293 ) -> ::std::os::raw::c_int;
4294 }
4295 extern "C" {
libusb_attach_kernel_driver( dev_handle: *mut libusb_device_handle, interface_number: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4296 pub fn libusb_attach_kernel_driver(
4297 dev_handle: *mut libusb_device_handle,
4298 interface_number: ::std::os::raw::c_int,
4299 ) -> ::std::os::raw::c_int;
4300 }
4301 extern "C" {
libusb_set_auto_detach_kernel_driver( dev_handle: *mut libusb_device_handle, enable: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4302 pub fn libusb_set_auto_detach_kernel_driver(
4303 dev_handle: *mut libusb_device_handle,
4304 enable: ::std::os::raw::c_int,
4305 ) -> ::std::os::raw::c_int;
4306 }
4307 extern "C" {
libusb_alloc_transfer(iso_packets: ::std::os::raw::c_int) -> *mut libusb_transfer4308 pub fn libusb_alloc_transfer(iso_packets: ::std::os::raw::c_int) -> *mut libusb_transfer;
4309 }
4310 extern "C" {
libusb_submit_transfer(transfer: *mut libusb_transfer) -> ::std::os::raw::c_int4311 pub fn libusb_submit_transfer(transfer: *mut libusb_transfer) -> ::std::os::raw::c_int;
4312 }
4313 extern "C" {
libusb_cancel_transfer(transfer: *mut libusb_transfer) -> ::std::os::raw::c_int4314 pub fn libusb_cancel_transfer(transfer: *mut libusb_transfer) -> ::std::os::raw::c_int;
4315 }
4316 extern "C" {
libusb_free_transfer(transfer: *mut libusb_transfer)4317 pub fn libusb_free_transfer(transfer: *mut libusb_transfer);
4318 }
4319 extern "C" {
libusb_transfer_set_stream_id(transfer: *mut libusb_transfer, stream_id: u32)4320 pub fn libusb_transfer_set_stream_id(transfer: *mut libusb_transfer, stream_id: u32);
4321 }
4322 extern "C" {
libusb_transfer_get_stream_id(transfer: *mut libusb_transfer) -> u324323 pub fn libusb_transfer_get_stream_id(transfer: *mut libusb_transfer) -> u32;
4324 }
4325 extern "C" {
libusb_control_transfer( dev_handle: *mut libusb_device_handle, request_type: u8, bRequest: u8, wValue: u16, wIndex: u16, data: *mut ::std::os::raw::c_uchar, wLength: u16, timeout: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int4326 pub fn libusb_control_transfer(
4327 dev_handle: *mut libusb_device_handle,
4328 request_type: u8,
4329 bRequest: u8,
4330 wValue: u16,
4331 wIndex: u16,
4332 data: *mut ::std::os::raw::c_uchar,
4333 wLength: u16,
4334 timeout: ::std::os::raw::c_uint,
4335 ) -> ::std::os::raw::c_int;
4336 }
4337 extern "C" {
libusb_bulk_transfer( dev_handle: *mut libusb_device_handle, endpoint: ::std::os::raw::c_uchar, data: *mut ::std::os::raw::c_uchar, length: ::std::os::raw::c_int, actual_length: *mut ::std::os::raw::c_int, timeout: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int4338 pub fn libusb_bulk_transfer(
4339 dev_handle: *mut libusb_device_handle,
4340 endpoint: ::std::os::raw::c_uchar,
4341 data: *mut ::std::os::raw::c_uchar,
4342 length: ::std::os::raw::c_int,
4343 actual_length: *mut ::std::os::raw::c_int,
4344 timeout: ::std::os::raw::c_uint,
4345 ) -> ::std::os::raw::c_int;
4346 }
4347 extern "C" {
libusb_interrupt_transfer( dev_handle: *mut libusb_device_handle, endpoint: ::std::os::raw::c_uchar, data: *mut ::std::os::raw::c_uchar, length: ::std::os::raw::c_int, actual_length: *mut ::std::os::raw::c_int, timeout: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int4348 pub fn libusb_interrupt_transfer(
4349 dev_handle: *mut libusb_device_handle,
4350 endpoint: ::std::os::raw::c_uchar,
4351 data: *mut ::std::os::raw::c_uchar,
4352 length: ::std::os::raw::c_int,
4353 actual_length: *mut ::std::os::raw::c_int,
4354 timeout: ::std::os::raw::c_uint,
4355 ) -> ::std::os::raw::c_int;
4356 }
4357 extern "C" {
libusb_get_string_descriptor_ascii( dev_handle: *mut libusb_device_handle, desc_index: u8, data: *mut ::std::os::raw::c_uchar, length: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4358 pub fn libusb_get_string_descriptor_ascii(
4359 dev_handle: *mut libusb_device_handle,
4360 desc_index: u8,
4361 data: *mut ::std::os::raw::c_uchar,
4362 length: ::std::os::raw::c_int,
4363 ) -> ::std::os::raw::c_int;
4364 }
4365 extern "C" {
libusb_try_lock_events(ctx: *mut libusb_context) -> ::std::os::raw::c_int4366 pub fn libusb_try_lock_events(ctx: *mut libusb_context) -> ::std::os::raw::c_int;
4367 }
4368 extern "C" {
libusb_lock_events(ctx: *mut libusb_context)4369 pub fn libusb_lock_events(ctx: *mut libusb_context);
4370 }
4371 extern "C" {
libusb_unlock_events(ctx: *mut libusb_context)4372 pub fn libusb_unlock_events(ctx: *mut libusb_context);
4373 }
4374 extern "C" {
libusb_event_handling_ok(ctx: *mut libusb_context) -> ::std::os::raw::c_int4375 pub fn libusb_event_handling_ok(ctx: *mut libusb_context) -> ::std::os::raw::c_int;
4376 }
4377 extern "C" {
libusb_event_handler_active(ctx: *mut libusb_context) -> ::std::os::raw::c_int4378 pub fn libusb_event_handler_active(ctx: *mut libusb_context) -> ::std::os::raw::c_int;
4379 }
4380 extern "C" {
libusb_interrupt_event_handler(ctx: *mut libusb_context)4381 pub fn libusb_interrupt_event_handler(ctx: *mut libusb_context);
4382 }
4383 extern "C" {
libusb_lock_event_waiters(ctx: *mut libusb_context)4384 pub fn libusb_lock_event_waiters(ctx: *mut libusb_context);
4385 }
4386 extern "C" {
libusb_unlock_event_waiters(ctx: *mut libusb_context)4387 pub fn libusb_unlock_event_waiters(ctx: *mut libusb_context);
4388 }
4389 extern "C" {
libusb_wait_for_event( ctx: *mut libusb_context, tv: *mut timeval, ) -> ::std::os::raw::c_int4390 pub fn libusb_wait_for_event(
4391 ctx: *mut libusb_context,
4392 tv: *mut timeval,
4393 ) -> ::std::os::raw::c_int;
4394 }
4395 extern "C" {
libusb_handle_events_timeout( ctx: *mut libusb_context, tv: *mut timeval, ) -> ::std::os::raw::c_int4396 pub fn libusb_handle_events_timeout(
4397 ctx: *mut libusb_context,
4398 tv: *mut timeval,
4399 ) -> ::std::os::raw::c_int;
4400 }
4401 extern "C" {
libusb_handle_events_timeout_completed( ctx: *mut libusb_context, tv: *mut timeval, completed: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4402 pub fn libusb_handle_events_timeout_completed(
4403 ctx: *mut libusb_context,
4404 tv: *mut timeval,
4405 completed: *mut ::std::os::raw::c_int,
4406 ) -> ::std::os::raw::c_int;
4407 }
4408 extern "C" {
libusb_handle_events(ctx: *mut libusb_context) -> ::std::os::raw::c_int4409 pub fn libusb_handle_events(ctx: *mut libusb_context) -> ::std::os::raw::c_int;
4410 }
4411 extern "C" {
libusb_handle_events_completed( ctx: *mut libusb_context, completed: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int4412 pub fn libusb_handle_events_completed(
4413 ctx: *mut libusb_context,
4414 completed: *mut ::std::os::raw::c_int,
4415 ) -> ::std::os::raw::c_int;
4416 }
4417 extern "C" {
libusb_handle_events_locked( ctx: *mut libusb_context, tv: *mut timeval, ) -> ::std::os::raw::c_int4418 pub fn libusb_handle_events_locked(
4419 ctx: *mut libusb_context,
4420 tv: *mut timeval,
4421 ) -> ::std::os::raw::c_int;
4422 }
4423 extern "C" {
libusb_pollfds_handle_timeouts(ctx: *mut libusb_context) -> ::std::os::raw::c_int4424 pub fn libusb_pollfds_handle_timeouts(ctx: *mut libusb_context) -> ::std::os::raw::c_int;
4425 }
4426 extern "C" {
libusb_get_next_timeout( ctx: *mut libusb_context, tv: *mut timeval, ) -> ::std::os::raw::c_int4427 pub fn libusb_get_next_timeout(
4428 ctx: *mut libusb_context,
4429 tv: *mut timeval,
4430 ) -> ::std::os::raw::c_int;
4431 }
4432 /// \ingroup libusb_poll
4433 /// File descriptor for polling
4434 #[repr(C)]
4435 #[derive(Debug, Copy, Clone)]
4436 pub struct libusb_pollfd {
4437 /// Numeric file descriptor
4438 pub fd: ::std::os::raw::c_int,
4439 /// Event flags to poll for from <poll.h>. POLLIN indicates that you
4440 /// should monitor this file descriptor for becoming ready to read from,
4441 /// and POLLOUT indicates that you should monitor this file descriptor for
4442 /// nonblocking write readiness.
4443 pub events: ::std::os::raw::c_short,
4444 }
4445 #[test]
bindgen_test_layout_libusb_pollfd()4446 fn bindgen_test_layout_libusb_pollfd() {
4447 assert_eq!(
4448 ::std::mem::size_of::<libusb_pollfd>(),
4449 8usize,
4450 concat!("Size of: ", stringify!(libusb_pollfd))
4451 );
4452 assert_eq!(
4453 ::std::mem::align_of::<libusb_pollfd>(),
4454 4usize,
4455 concat!("Alignment of ", stringify!(libusb_pollfd))
4456 );
4457 assert_eq!(
4458 unsafe { &(*(::std::ptr::null::<libusb_pollfd>())).fd as *const _ as usize },
4459 0usize,
4460 concat!(
4461 "Offset of field: ",
4462 stringify!(libusb_pollfd),
4463 "::",
4464 stringify!(fd)
4465 )
4466 );
4467 assert_eq!(
4468 unsafe { &(*(::std::ptr::null::<libusb_pollfd>())).events as *const _ as usize },
4469 4usize,
4470 concat!(
4471 "Offset of field: ",
4472 stringify!(libusb_pollfd),
4473 "::",
4474 stringify!(events)
4475 )
4476 );
4477 }
4478 /// \ingroup libusb_poll
4479 /// Callback function, invoked when a new file descriptor should be added
4480 /// to the set of file descriptors monitored for events.
4481 /// \param fd the new file descriptor
4482 /// \param events events to monitor for, see \ref libusb_pollfd for a
4483 /// description
4484 /// \param user_data User data pointer specified in
4485 /// libusb_set_pollfd_notifiers() call
4486 /// \see libusb_set_pollfd_notifiers()
4487 pub type libusb_pollfd_added_cb = ::std::option::Option<
4488 unsafe extern "C" fn(
4489 fd: ::std::os::raw::c_int,
4490 events: ::std::os::raw::c_short,
4491 user_data: *mut ::std::os::raw::c_void,
4492 ),
4493 >;
4494 /// \ingroup libusb_poll
4495 /// Callback function, invoked when a file descriptor should be removed from
4496 /// the set of file descriptors being monitored for events. After returning
4497 /// from this callback, do not use that file descriptor again.
4498 /// \param fd the file descriptor to stop monitoring
4499 /// \param user_data User data pointer specified in
4500 /// libusb_set_pollfd_notifiers() call
4501 /// \see libusb_set_pollfd_notifiers()
4502 pub type libusb_pollfd_removed_cb = ::std::option::Option<
4503 unsafe extern "C" fn(fd: ::std::os::raw::c_int, user_data: *mut ::std::os::raw::c_void),
4504 >;
4505 extern "C" {
libusb_get_pollfds(ctx: *mut libusb_context) -> *mut *const libusb_pollfd4506 pub fn libusb_get_pollfds(ctx: *mut libusb_context) -> *mut *const libusb_pollfd;
4507 }
4508 extern "C" {
libusb_free_pollfds(pollfds: *mut *const libusb_pollfd)4509 pub fn libusb_free_pollfds(pollfds: *mut *const libusb_pollfd);
4510 }
4511 extern "C" {
libusb_set_pollfd_notifiers( ctx: *mut libusb_context, added_cb: libusb_pollfd_added_cb, removed_cb: libusb_pollfd_removed_cb, user_data: *mut ::std::os::raw::c_void, )4512 pub fn libusb_set_pollfd_notifiers(
4513 ctx: *mut libusb_context,
4514 added_cb: libusb_pollfd_added_cb,
4515 removed_cb: libusb_pollfd_removed_cb,
4516 user_data: *mut ::std::os::raw::c_void,
4517 );
4518 }
4519 /// \ingroup libusb_hotplug
4520 /// Callback handle.
4521 ///
4522 /// Callbacks handles are generated by libusb_hotplug_register_callback()
4523 /// and can be used to deregister callbacks. Callback handles are unique
4524 /// per libusb_context and it is safe to call libusb_hotplug_deregister_callback()
4525 /// on an already deregisted callback.
4526 ///
4527 /// Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
4528 ///
4529 /// For more information, see \ref libusb_hotplug.
4530 pub type libusb_hotplug_callback_handle = ::std::os::raw::c_int;
4531 /// Default value when not using any flags.
4532 pub const LIBUSB_HOTPLUG_NO_FLAGS: libusb_hotplug_flag = 0;
4533 /// Arm the callback and fire it for all matching currently attached devices.
4534 pub const LIBUSB_HOTPLUG_ENUMERATE: libusb_hotplug_flag = 1;
4535 /// \ingroup libusb_hotplug
4536 ///
4537 /// Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
4538 ///
4539 /// Flags for hotplug events
4540 pub type libusb_hotplug_flag = u32;
4541 /// A device has been plugged in and is ready to use
4542 pub const LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: libusb_hotplug_event = 1;
4543 /// A device has left and is no longer available.
4544 /// It is the user's responsibility to call libusb_close on any handle associated with a disconnected device.
4545 /// It is safe to call libusb_get_device_descriptor on a device that has left
4546 pub const LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: libusb_hotplug_event = 2;
4547 /// \ingroup libusb_hotplug
4548 ///
4549 /// Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
4550 ///
4551 /// Hotplug events
4552 pub type libusb_hotplug_event = u32;
4553 /// \ingroup libusb_hotplug
4554 /// Hotplug callback function type. When requesting hotplug event notifications,
4555 /// you pass a pointer to a callback function of this type.
4556 ///
4557 /// This callback may be called by an internal event thread and as such it is
4558 /// recommended the callback do minimal processing before returning.
4559 ///
4560 /// libusb will call this function later, when a matching event had happened on
4561 /// a matching device. See \ref libusb_hotplug for more information.
4562 ///
4563 /// It is safe to call either libusb_hotplug_register_callback() or
4564 /// libusb_hotplug_deregister_callback() from within a callback function.
4565 ///
4566 /// Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
4567 ///
4568 /// \param ctx context of this notification
4569 /// \param device libusb_device this event occurred on
4570 /// \param event event that occurred
4571 /// \param user_data user data provided when this callback was registered
4572 /// \returns bool whether this callback is finished processing events.
4573 /// returning 1 will cause this callback to be deregistered
4574 pub type libusb_hotplug_callback_fn = ::std::option::Option<
4575 unsafe extern "C" fn(
4576 ctx: *mut libusb_context,
4577 device: *mut libusb_device,
4578 event: libusb_hotplug_event,
4579 user_data: *mut ::std::os::raw::c_void,
4580 ) -> ::std::os::raw::c_int,
4581 >;
4582 extern "C" {
4583 /// \ingroup libusb_hotplug
4584 /// Register a hotplug callback function
4585 ///
4586 /// Register a callback with the libusb_context. The callback will fire
4587 /// when a matching event occurs on a matching device. The callback is
4588 /// armed until either it is deregistered with libusb_hotplug_deregister_callback()
4589 /// or the supplied callback returns 1 to indicate it is finished processing events.
4590 ///
4591 /// If the \ref LIBUSB_HOTPLUG_ENUMERATE is passed the callback will be
4592 /// called with a \ref LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED for all devices
4593 /// already plugged into the machine. Note that libusb modifies its internal
4594 /// device list from a separate thread, while calling hotplug callbacks from
4595 /// libusb_handle_events(), so it is possible for a device to already be present
4596 /// on, or removed from, its internal device list, while the hotplug callbacks
4597 /// still need to be dispatched. This means that when using \ref
4598 /// LIBUSB_HOTPLUG_ENUMERATE, your callback may be called twice for the arrival
4599 /// of the same device, once from libusb_hotplug_register_callback() and once
4600 /// from libusb_handle_events(); and/or your callback may be called for the
4601 /// removal of a device for which an arrived call was never made.
4602 ///
4603 /// Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
4604 ///
4605 /// \param[in] ctx context to register this callback with
4606 /// \param[in] events bitwise or of events that will trigger this callback. See \ref
4607 /// libusb_hotplug_event
4608 /// \param[in] flags hotplug callback flags. See \ref libusb_hotplug_flag
4609 /// \param[in] vendor_id the vendor id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY
4610 /// \param[in] product_id the product id to match or \ref LIBUSB_HOTPLUG_MATCH_ANY
4611 /// \param[in] dev_class the device class to match or \ref LIBUSB_HOTPLUG_MATCH_ANY
4612 /// \param[in] cb_fn the function to be invoked on a matching event/device
4613 /// \param[in] user_data user data to pass to the callback function
4614 /// \param[out] callback_handle pointer to store the handle of the allocated callback (can be NULL)
4615 /// \returns LIBUSB_SUCCESS on success LIBUSB_ERROR code on failure
libusb_hotplug_register_callback( ctx: *mut libusb_context, events: libusb_hotplug_event, flags: libusb_hotplug_flag, vendor_id: ::std::os::raw::c_int, product_id: ::std::os::raw::c_int, dev_class: ::std::os::raw::c_int, cb_fn: libusb_hotplug_callback_fn, user_data: *mut ::std::os::raw::c_void, callback_handle: *mut libusb_hotplug_callback_handle, ) -> ::std::os::raw::c_int4616 pub fn libusb_hotplug_register_callback(
4617 ctx: *mut libusb_context,
4618 events: libusb_hotplug_event,
4619 flags: libusb_hotplug_flag,
4620 vendor_id: ::std::os::raw::c_int,
4621 product_id: ::std::os::raw::c_int,
4622 dev_class: ::std::os::raw::c_int,
4623 cb_fn: libusb_hotplug_callback_fn,
4624 user_data: *mut ::std::os::raw::c_void,
4625 callback_handle: *mut libusb_hotplug_callback_handle,
4626 ) -> ::std::os::raw::c_int;
4627 }
4628 extern "C" {
4629 /// \ingroup libusb_hotplug
4630 /// Deregisters a hotplug callback.
4631 ///
4632 /// Deregister a callback from a libusb_context. This function is safe to call from within
4633 /// a hotplug callback.
4634 ///
4635 /// Since version 1.0.16, \ref LIBUSB_API_VERSION >= 0x01000102
4636 ///
4637 /// \param[in] ctx context this callback is registered with
4638 /// \param[in] callback_handle the handle of the callback to deregister
libusb_hotplug_deregister_callback( ctx: *mut libusb_context, callback_handle: libusb_hotplug_callback_handle, )4639 pub fn libusb_hotplug_deregister_callback(
4640 ctx: *mut libusb_context,
4641 callback_handle: libusb_hotplug_callback_handle,
4642 );
4643 }
4644 #[repr(C)]
4645 #[derive(Debug, Copy, Clone)]
4646 pub struct __locale_data {
4647 pub _address: u8,
4648 }
4649