1#[repr(C)]
4#[derive(Default)]
5pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
6impl<T> __IncompleteArrayField<T> {
7 #[inline]
8 pub const fn new() -> Self {
9 __IncompleteArrayField(::std::marker::PhantomData, [])
10 }
11 #[inline]
12 pub fn as_ptr(&self) -> *const T {
13 self as *const _ as *const T
14 }
15 #[inline]
16 pub fn as_mut_ptr(&mut self) -> *mut T {
17 self as *mut _ as *mut T
18 }
19 #[inline]
20 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
21 ::std::slice::from_raw_parts(self.as_ptr(), len)
22 }
23 #[inline]
24 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
25 ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
26 }
27}
28impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
29 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
30 fmt.write_str("__IncompleteArrayField")
31 }
32}
33pub const RTAPI_NAME_LEN: u32 = 31;
34pub const __GNUC_VA_LIST: u32 = 1;
35pub const RTAPI_NO_FP: u32 = 0;
36pub const RTAPI_USES_FP: u32 = 1;
37pub const LINUX_VERSION_CODE: u32 = 0;
38pub const _SPAWN_H: u32 = 1;
39pub const _FEATURES_H: u32 = 1;
40pub const _DEFAULT_SOURCE: u32 = 1;
41pub const __GLIBC_USE_ISOC2X: u32 = 0;
42pub const __USE_ISOC11: u32 = 1;
43pub const __USE_ISOC99: u32 = 1;
44pub const __USE_ISOC95: u32 = 1;
45pub const __USE_POSIX_IMPLICITLY: u32 = 1;
46pub const _POSIX_SOURCE: u32 = 1;
47pub const _POSIX_C_SOURCE: u32 = 200809;
48pub const __USE_POSIX: u32 = 1;
49pub const __USE_POSIX2: u32 = 1;
50pub const __USE_POSIX199309: u32 = 1;
51pub const __USE_POSIX199506: u32 = 1;
52pub const __USE_XOPEN2K: u32 = 1;
53pub const __USE_XOPEN2K8: u32 = 1;
54pub const _ATFILE_SOURCE: u32 = 1;
55pub const __USE_MISC: u32 = 1;
56pub const __USE_ATFILE: u32 = 1;
57pub const __USE_FORTIFY_LEVEL: u32 = 0;
58pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
59pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
60pub const _STDC_PREDEF_H: u32 = 1;
61pub const __STDC_IEC_559__: u32 = 1;
62pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
63pub const __STDC_ISO_10646__: u32 = 201706;
64pub const __GNU_LIBRARY__: u32 = 6;
65pub const __GLIBC__: u32 = 2;
66pub const __GLIBC_MINOR__: u32 = 31;
67pub const _SYS_CDEFS_H: u32 = 1;
68pub const __glibc_c99_flexarr_available: u32 = 1;
69pub const __WORDSIZE: u32 = 64;
70pub const __WORDSIZE_TIME64_COMPAT32: u32 = 0;
71pub const __LONG_DOUBLE_USES_FLOAT128: u32 = 0;
72pub const __HAVE_GENERIC_SELECTION: u32 = 1;
73pub const _SCHED_H: u32 = 1;
74pub const _BITS_TYPES_H: u32 = 1;
75pub const __TIMESIZE: u32 = 64;
76pub const _BITS_TYPESIZES_H: u32 = 1;
77pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
78pub const __INO_T_MATCHES_INO64_T: u32 = 1;
79pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
80pub const __STATFS_MATCHES_STATFS64: u32 = 1;
81pub const __FD_SETSIZE: u32 = 1024;
82pub const _BITS_TIME64_H: u32 = 1;
83pub const __time_t_defined: u32 = 1;
84pub const _STRUCT_TIMESPEC: u32 = 1;
85pub const _BITS_ENDIAN_H: u32 = 1;
86pub const __LITTLE_ENDIAN: u32 = 1234;
87pub const __BIG_ENDIAN: u32 = 4321;
88pub const __PDP_ENDIAN: u32 = 3412;
89pub const _BITS_ENDIANNESS_H: u32 = 1;
90pub const __BYTE_ORDER: u32 = 1234;
91pub const __FLOAT_WORD_ORDER: u32 = 1234;
92pub const _BITS_SCHED_H: u32 = 1;
93pub const SCHED_OTHER: u32 = 0;
94pub const SCHED_FIFO: u32 = 1;
95pub const SCHED_RR: u32 = 2;
96pub const _BITS_TYPES_STRUCT_SCHED_PARAM: u32 = 1;
97pub const _BITS_CPU_SET_H: u32 = 1;
98pub const __CPU_SETSIZE: u32 = 1024;
99pub const _SYS_TYPES_H: u32 = 1;
100pub const __clock_t_defined: u32 = 1;
101pub const __clockid_t_defined: u32 = 1;
102pub const __timer_t_defined: u32 = 1;
103pub const _BITS_STDINT_INTN_H: u32 = 1;
104pub const __BIT_TYPES_DEFINED__: u32 = 1;
105pub const _ENDIAN_H: u32 = 1;
106pub const LITTLE_ENDIAN: u32 = 1234;
107pub const BIG_ENDIAN: u32 = 4321;
108pub const PDP_ENDIAN: u32 = 3412;
109pub const BYTE_ORDER: u32 = 1234;
110pub const _BITS_BYTESWAP_H: u32 = 1;
111pub const _BITS_UINTN_IDENTITY_H: u32 = 1;
112pub const _SYS_SELECT_H: u32 = 1;
113pub const __sigset_t_defined: u32 = 1;
114pub const __timeval_defined: u32 = 1;
115pub const FD_SETSIZE: u32 = 1024;
116pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1;
117pub const _THREAD_SHARED_TYPES_H: u32 = 1;
118pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1;
119pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 64;
120pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 48;
121pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 8;
122pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 8;
123pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56;
124pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32;
125pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 8;
126pub const __SIZEOF_PTHREAD_COND_T: u32 = 48;
127pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8;
128pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1;
129pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1;
130pub const __have_pthread_attr_t: u32 = 1;
131pub const POSIX_SPAWN_RESETIDS: u32 = 1;
132pub const POSIX_SPAWN_SETPGROUP: u32 = 2;
133pub const POSIX_SPAWN_SETSIGDEF: u32 = 4;
134pub const POSIX_SPAWN_SETSIGMASK: u32 = 8;
135pub const POSIX_SPAWN_SETSCHEDPARAM: u32 = 16;
136pub const POSIX_SPAWN_SETSCHEDULER: u32 = 32;
137pub const _ERRNO_H: u32 = 1;
138pub const _BITS_ERRNO_H: u32 = 1;
139pub const EPERM: u32 = 1;
140pub const ENOENT: u32 = 2;
141pub const ESRCH: u32 = 3;
142pub const EINTR: u32 = 4;
143pub const EIO: u32 = 5;
144pub const ENXIO: u32 = 6;
145pub const E2BIG: u32 = 7;
146pub const ENOEXEC: u32 = 8;
147pub const EBADF: u32 = 9;
148pub const ECHILD: u32 = 10;
149pub const EAGAIN: u32 = 11;
150pub const ENOMEM: u32 = 12;
151pub const EACCES: u32 = 13;
152pub const EFAULT: u32 = 14;
153pub const ENOTBLK: u32 = 15;
154pub const EBUSY: u32 = 16;
155pub const EEXIST: u32 = 17;
156pub const EXDEV: u32 = 18;
157pub const ENODEV: u32 = 19;
158pub const ENOTDIR: u32 = 20;
159pub const EISDIR: u32 = 21;
160pub const EINVAL: u32 = 22;
161pub const ENFILE: u32 = 23;
162pub const EMFILE: u32 = 24;
163pub const ENOTTY: u32 = 25;
164pub const ETXTBSY: u32 = 26;
165pub const EFBIG: u32 = 27;
166pub const ENOSPC: u32 = 28;
167pub const ESPIPE: u32 = 29;
168pub const EROFS: u32 = 30;
169pub const EMLINK: u32 = 31;
170pub const EPIPE: u32 = 32;
171pub const EDOM: u32 = 33;
172pub const ERANGE: u32 = 34;
173pub const EDEADLK: u32 = 35;
174pub const ENAMETOOLONG: u32 = 36;
175pub const ENOLCK: u32 = 37;
176pub const ENOSYS: u32 = 38;
177pub const ENOTEMPTY: u32 = 39;
178pub const ELOOP: u32 = 40;
179pub const EWOULDBLOCK: u32 = 11;
180pub const ENOMSG: u32 = 42;
181pub const EIDRM: u32 = 43;
182pub const ECHRNG: u32 = 44;
183pub const EL2NSYNC: u32 = 45;
184pub const EL3HLT: u32 = 46;
185pub const EL3RST: u32 = 47;
186pub const ELNRNG: u32 = 48;
187pub const EUNATCH: u32 = 49;
188pub const ENOCSI: u32 = 50;
189pub const EL2HLT: u32 = 51;
190pub const EBADE: u32 = 52;
191pub const EBADR: u32 = 53;
192pub const EXFULL: u32 = 54;
193pub const ENOANO: u32 = 55;
194pub const EBADRQC: u32 = 56;
195pub const EBADSLT: u32 = 57;
196pub const EDEADLOCK: u32 = 35;
197pub const EBFONT: u32 = 59;
198pub const ENOSTR: u32 = 60;
199pub const ENODATA: u32 = 61;
200pub const ETIME: u32 = 62;
201pub const ENOSR: u32 = 63;
202pub const ENONET: u32 = 64;
203pub const ENOPKG: u32 = 65;
204pub const EREMOTE: u32 = 66;
205pub const ENOLINK: u32 = 67;
206pub const EADV: u32 = 68;
207pub const ESRMNT: u32 = 69;
208pub const ECOMM: u32 = 70;
209pub const EPROTO: u32 = 71;
210pub const EMULTIHOP: u32 = 72;
211pub const EDOTDOT: u32 = 73;
212pub const EBADMSG: u32 = 74;
213pub const EOVERFLOW: u32 = 75;
214pub const ENOTUNIQ: u32 = 76;
215pub const EBADFD: u32 = 77;
216pub const EREMCHG: u32 = 78;
217pub const ELIBACC: u32 = 79;
218pub const ELIBBAD: u32 = 80;
219pub const ELIBSCN: u32 = 81;
220pub const ELIBMAX: u32 = 82;
221pub const ELIBEXEC: u32 = 83;
222pub const EILSEQ: u32 = 84;
223pub const ERESTART: u32 = 85;
224pub const ESTRPIPE: u32 = 86;
225pub const EUSERS: u32 = 87;
226pub const ENOTSOCK: u32 = 88;
227pub const EDESTADDRREQ: u32 = 89;
228pub const EMSGSIZE: u32 = 90;
229pub const EPROTOTYPE: u32 = 91;
230pub const ENOPROTOOPT: u32 = 92;
231pub const EPROTONOSUPPORT: u32 = 93;
232pub const ESOCKTNOSUPPORT: u32 = 94;
233pub const EOPNOTSUPP: u32 = 95;
234pub const EPFNOSUPPORT: u32 = 96;
235pub const EAFNOSUPPORT: u32 = 97;
236pub const EADDRINUSE: u32 = 98;
237pub const EADDRNOTAVAIL: u32 = 99;
238pub const ENETDOWN: u32 = 100;
239pub const ENETUNREACH: u32 = 101;
240pub const ENETRESET: u32 = 102;
241pub const ECONNABORTED: u32 = 103;
242pub const ECONNRESET: u32 = 104;
243pub const ENOBUFS: u32 = 105;
244pub const EISCONN: u32 = 106;
245pub const ENOTCONN: u32 = 107;
246pub const ESHUTDOWN: u32 = 108;
247pub const ETOOMANYREFS: u32 = 109;
248pub const ETIMEDOUT: u32 = 110;
249pub const ECONNREFUSED: u32 = 111;
250pub const EHOSTDOWN: u32 = 112;
251pub const EHOSTUNREACH: u32 = 113;
252pub const EALREADY: u32 = 114;
253pub const EINPROGRESS: u32 = 115;
254pub const ESTALE: u32 = 116;
255pub const EUCLEAN: u32 = 117;
256pub const ENOTNAM: u32 = 118;
257pub const ENAVAIL: u32 = 119;
258pub const EISNAM: u32 = 120;
259pub const EREMOTEIO: u32 = 121;
260pub const EDQUOT: u32 = 122;
261pub const ENOMEDIUM: u32 = 123;
262pub const EMEDIUMTYPE: u32 = 124;
263pub const ECANCELED: u32 = 125;
264pub const ENOKEY: u32 = 126;
265pub const EKEYEXPIRED: u32 = 127;
266pub const EKEYREVOKED: u32 = 128;
267pub const EKEYREJECTED: u32 = 129;
268pub const EOWNERDEAD: u32 = 130;
269pub const ENOTRECOVERABLE: u32 = 131;
270pub const ERFKILL: u32 = 132;
271pub const EHWPOISON: u32 = 133;
272pub const ENOTSUP: u32 = 95;
273pub const HAL_NAME_LEN: u32 = 47;
274pub const HAL_LOCK_NONE: u32 = 0;
275pub const HAL_LOCK_LOAD: u32 = 1;
276pub const HAL_LOCK_CONFIG: u32 = 2;
277pub const HAL_LOCK_PARAMS: u32 = 4;
278pub const HAL_LOCK_RUN: u32 = 8;
279pub const HAL_LOCK_TUNE: u32 = 3;
280pub const HAL_LOCK_ALL: u32 = 255;
281pub const true_: u32 = 1;
282pub const false_: u32 = 0;
283pub const __bool_true_false_are_defined: u32 = 1;
284pub const _INTTYPES_H: u32 = 1;
285pub const _STDINT_H: u32 = 1;
286pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
287pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
288pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
289pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
290pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
291pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
292pub const _BITS_WCHAR_H: u32 = 1;
293pub const _BITS_STDINT_UINTN_H: u32 = 1;
294pub const INT8_MIN: i32 = -128;
295pub const INT16_MIN: i32 = -32768;
296pub const INT32_MIN: i32 = -2147483648;
297pub const INT8_MAX: u32 = 127;
298pub const INT16_MAX: u32 = 32767;
299pub const INT32_MAX: u32 = 2147483647;
300pub const UINT8_MAX: u32 = 255;
301pub const UINT16_MAX: u32 = 65535;
302pub const UINT32_MAX: u32 = 4294967295;
303pub const INT_LEAST8_MIN: i32 = -128;
304pub const INT_LEAST16_MIN: i32 = -32768;
305pub const INT_LEAST32_MIN: i32 = -2147483648;
306pub const INT_LEAST8_MAX: u32 = 127;
307pub const INT_LEAST16_MAX: u32 = 32767;
308pub const INT_LEAST32_MAX: u32 = 2147483647;
309pub const UINT_LEAST8_MAX: u32 = 255;
310pub const UINT_LEAST16_MAX: u32 = 65535;
311pub const UINT_LEAST32_MAX: u32 = 4294967295;
312pub const INT_FAST8_MIN: i32 = -128;
313pub const INT_FAST16_MIN: i64 = -9223372036854775808;
314pub const INT_FAST32_MIN: i64 = -9223372036854775808;
315pub const INT_FAST8_MAX: u32 = 127;
316pub const INT_FAST16_MAX: u64 = 9223372036854775807;
317pub const INT_FAST32_MAX: u64 = 9223372036854775807;
318pub const UINT_FAST8_MAX: u32 = 255;
319pub const UINT_FAST16_MAX: i32 = -1;
320pub const UINT_FAST32_MAX: i32 = -1;
321pub const INTPTR_MIN: i64 = -9223372036854775808;
322pub const INTPTR_MAX: u64 = 9223372036854775807;
323pub const UINTPTR_MAX: i32 = -1;
324pub const PTRDIFF_MIN: i64 = -9223372036854775808;
325pub const PTRDIFF_MAX: u64 = 9223372036854775807;
326pub const SIG_ATOMIC_MIN: i32 = -2147483648;
327pub const SIG_ATOMIC_MAX: u32 = 2147483647;
328pub const SIZE_MAX: i32 = -1;
329pub const WINT_MIN: u32 = 0;
330pub const WINT_MAX: u32 = 4294967295;
331pub const ____gwchar_t_defined: u32 = 1;
332pub const __PRI64_PREFIX: &[u8; 2usize] = b"l\0";
333pub const __PRIPTR_PREFIX: &[u8; 2usize] = b"l\0";
334pub const PRId8: &[u8; 2usize] = b"d\0";
335pub const PRId16: &[u8; 2usize] = b"d\0";
336pub const PRId32: &[u8; 2usize] = b"d\0";
337pub const PRId64: &[u8; 3usize] = b"ld\0";
338pub const PRIdLEAST8: &[u8; 2usize] = b"d\0";
339pub const PRIdLEAST16: &[u8; 2usize] = b"d\0";
340pub const PRIdLEAST32: &[u8; 2usize] = b"d\0";
341pub const PRIdLEAST64: &[u8; 3usize] = b"ld\0";
342pub const PRIdFAST8: &[u8; 2usize] = b"d\0";
343pub const PRIdFAST16: &[u8; 3usize] = b"ld\0";
344pub const PRIdFAST32: &[u8; 3usize] = b"ld\0";
345pub const PRIdFAST64: &[u8; 3usize] = b"ld\0";
346pub const PRIi8: &[u8; 2usize] = b"i\0";
347pub const PRIi16: &[u8; 2usize] = b"i\0";
348pub const PRIi32: &[u8; 2usize] = b"i\0";
349pub const PRIi64: &[u8; 3usize] = b"li\0";
350pub const PRIiLEAST8: &[u8; 2usize] = b"i\0";
351pub const PRIiLEAST16: &[u8; 2usize] = b"i\0";
352pub const PRIiLEAST32: &[u8; 2usize] = b"i\0";
353pub const PRIiLEAST64: &[u8; 3usize] = b"li\0";
354pub const PRIiFAST8: &[u8; 2usize] = b"i\0";
355pub const PRIiFAST16: &[u8; 3usize] = b"li\0";
356pub const PRIiFAST32: &[u8; 3usize] = b"li\0";
357pub const PRIiFAST64: &[u8; 3usize] = b"li\0";
358pub const PRIo8: &[u8; 2usize] = b"o\0";
359pub const PRIo16: &[u8; 2usize] = b"o\0";
360pub const PRIo32: &[u8; 2usize] = b"o\0";
361pub const PRIo64: &[u8; 3usize] = b"lo\0";
362pub const PRIoLEAST8: &[u8; 2usize] = b"o\0";
363pub const PRIoLEAST16: &[u8; 2usize] = b"o\0";
364pub const PRIoLEAST32: &[u8; 2usize] = b"o\0";
365pub const PRIoLEAST64: &[u8; 3usize] = b"lo\0";
366pub const PRIoFAST8: &[u8; 2usize] = b"o\0";
367pub const PRIoFAST16: &[u8; 3usize] = b"lo\0";
368pub const PRIoFAST32: &[u8; 3usize] = b"lo\0";
369pub const PRIoFAST64: &[u8; 3usize] = b"lo\0";
370pub const PRIu8: &[u8; 2usize] = b"u\0";
371pub const PRIu16: &[u8; 2usize] = b"u\0";
372pub const PRIu32: &[u8; 2usize] = b"u\0";
373pub const PRIu64: &[u8; 3usize] = b"lu\0";
374pub const PRIuLEAST8: &[u8; 2usize] = b"u\0";
375pub const PRIuLEAST16: &[u8; 2usize] = b"u\0";
376pub const PRIuLEAST32: &[u8; 2usize] = b"u\0";
377pub const PRIuLEAST64: &[u8; 3usize] = b"lu\0";
378pub const PRIuFAST8: &[u8; 2usize] = b"u\0";
379pub const PRIuFAST16: &[u8; 3usize] = b"lu\0";
380pub const PRIuFAST32: &[u8; 3usize] = b"lu\0";
381pub const PRIuFAST64: &[u8; 3usize] = b"lu\0";
382pub const PRIx8: &[u8; 2usize] = b"x\0";
383pub const PRIx16: &[u8; 2usize] = b"x\0";
384pub const PRIx32: &[u8; 2usize] = b"x\0";
385pub const PRIx64: &[u8; 3usize] = b"lx\0";
386pub const PRIxLEAST8: &[u8; 2usize] = b"x\0";
387pub const PRIxLEAST16: &[u8; 2usize] = b"x\0";
388pub const PRIxLEAST32: &[u8; 2usize] = b"x\0";
389pub const PRIxLEAST64: &[u8; 3usize] = b"lx\0";
390pub const PRIxFAST8: &[u8; 2usize] = b"x\0";
391pub const PRIxFAST16: &[u8; 3usize] = b"lx\0";
392pub const PRIxFAST32: &[u8; 3usize] = b"lx\0";
393pub const PRIxFAST64: &[u8; 3usize] = b"lx\0";
394pub const PRIX8: &[u8; 2usize] = b"X\0";
395pub const PRIX16: &[u8; 2usize] = b"X\0";
396pub const PRIX32: &[u8; 2usize] = b"X\0";
397pub const PRIX64: &[u8; 3usize] = b"lX\0";
398pub const PRIXLEAST8: &[u8; 2usize] = b"X\0";
399pub const PRIXLEAST16: &[u8; 2usize] = b"X\0";
400pub const PRIXLEAST32: &[u8; 2usize] = b"X\0";
401pub const PRIXLEAST64: &[u8; 3usize] = b"lX\0";
402pub const PRIXFAST8: &[u8; 2usize] = b"X\0";
403pub const PRIXFAST16: &[u8; 3usize] = b"lX\0";
404pub const PRIXFAST32: &[u8; 3usize] = b"lX\0";
405pub const PRIXFAST64: &[u8; 3usize] = b"lX\0";
406pub const PRIdMAX: &[u8; 3usize] = b"ld\0";
407pub const PRIiMAX: &[u8; 3usize] = b"li\0";
408pub const PRIoMAX: &[u8; 3usize] = b"lo\0";
409pub const PRIuMAX: &[u8; 3usize] = b"lu\0";
410pub const PRIxMAX: &[u8; 3usize] = b"lx\0";
411pub const PRIXMAX: &[u8; 3usize] = b"lX\0";
412pub const PRIdPTR: &[u8; 3usize] = b"ld\0";
413pub const PRIiPTR: &[u8; 3usize] = b"li\0";
414pub const PRIoPTR: &[u8; 3usize] = b"lo\0";
415pub const PRIuPTR: &[u8; 3usize] = b"lu\0";
416pub const PRIxPTR: &[u8; 3usize] = b"lx\0";
417pub const PRIXPTR: &[u8; 3usize] = b"lX\0";
418pub const SCNd8: &[u8; 4usize] = b"hhd\0";
419pub const SCNd16: &[u8; 3usize] = b"hd\0";
420pub const SCNd32: &[u8; 2usize] = b"d\0";
421pub const SCNd64: &[u8; 3usize] = b"ld\0";
422pub const SCNdLEAST8: &[u8; 4usize] = b"hhd\0";
423pub const SCNdLEAST16: &[u8; 3usize] = b"hd\0";
424pub const SCNdLEAST32: &[u8; 2usize] = b"d\0";
425pub const SCNdLEAST64: &[u8; 3usize] = b"ld\0";
426pub const SCNdFAST8: &[u8; 4usize] = b"hhd\0";
427pub const SCNdFAST16: &[u8; 3usize] = b"ld\0";
428pub const SCNdFAST32: &[u8; 3usize] = b"ld\0";
429pub const SCNdFAST64: &[u8; 3usize] = b"ld\0";
430pub const SCNi8: &[u8; 4usize] = b"hhi\0";
431pub const SCNi16: &[u8; 3usize] = b"hi\0";
432pub const SCNi32: &[u8; 2usize] = b"i\0";
433pub const SCNi64: &[u8; 3usize] = b"li\0";
434pub const SCNiLEAST8: &[u8; 4usize] = b"hhi\0";
435pub const SCNiLEAST16: &[u8; 3usize] = b"hi\0";
436pub const SCNiLEAST32: &[u8; 2usize] = b"i\0";
437pub const SCNiLEAST64: &[u8; 3usize] = b"li\0";
438pub const SCNiFAST8: &[u8; 4usize] = b"hhi\0";
439pub const SCNiFAST16: &[u8; 3usize] = b"li\0";
440pub const SCNiFAST32: &[u8; 3usize] = b"li\0";
441pub const SCNiFAST64: &[u8; 3usize] = b"li\0";
442pub const SCNu8: &[u8; 4usize] = b"hhu\0";
443pub const SCNu16: &[u8; 3usize] = b"hu\0";
444pub const SCNu32: &[u8; 2usize] = b"u\0";
445pub const SCNu64: &[u8; 3usize] = b"lu\0";
446pub const SCNuLEAST8: &[u8; 4usize] = b"hhu\0";
447pub const SCNuLEAST16: &[u8; 3usize] = b"hu\0";
448pub const SCNuLEAST32: &[u8; 2usize] = b"u\0";
449pub const SCNuLEAST64: &[u8; 3usize] = b"lu\0";
450pub const SCNuFAST8: &[u8; 4usize] = b"hhu\0";
451pub const SCNuFAST16: &[u8; 3usize] = b"lu\0";
452pub const SCNuFAST32: &[u8; 3usize] = b"lu\0";
453pub const SCNuFAST64: &[u8; 3usize] = b"lu\0";
454pub const SCNo8: &[u8; 4usize] = b"hho\0";
455pub const SCNo16: &[u8; 3usize] = b"ho\0";
456pub const SCNo32: &[u8; 2usize] = b"o\0";
457pub const SCNo64: &[u8; 3usize] = b"lo\0";
458pub const SCNoLEAST8: &[u8; 4usize] = b"hho\0";
459pub const SCNoLEAST16: &[u8; 3usize] = b"ho\0";
460pub const SCNoLEAST32: &[u8; 2usize] = b"o\0";
461pub const SCNoLEAST64: &[u8; 3usize] = b"lo\0";
462pub const SCNoFAST8: &[u8; 4usize] = b"hho\0";
463pub const SCNoFAST16: &[u8; 3usize] = b"lo\0";
464pub const SCNoFAST32: &[u8; 3usize] = b"lo\0";
465pub const SCNoFAST64: &[u8; 3usize] = b"lo\0";
466pub const SCNx8: &[u8; 4usize] = b"hhx\0";
467pub const SCNx16: &[u8; 3usize] = b"hx\0";
468pub const SCNx32: &[u8; 2usize] = b"x\0";
469pub const SCNx64: &[u8; 3usize] = b"lx\0";
470pub const SCNxLEAST8: &[u8; 4usize] = b"hhx\0";
471pub const SCNxLEAST16: &[u8; 3usize] = b"hx\0";
472pub const SCNxLEAST32: &[u8; 2usize] = b"x\0";
473pub const SCNxLEAST64: &[u8; 3usize] = b"lx\0";
474pub const SCNxFAST8: &[u8; 4usize] = b"hhx\0";
475pub const SCNxFAST16: &[u8; 3usize] = b"lx\0";
476pub const SCNxFAST32: &[u8; 3usize] = b"lx\0";
477pub const SCNxFAST64: &[u8; 3usize] = b"lx\0";
478pub const SCNdMAX: &[u8; 3usize] = b"ld\0";
479pub const SCNiMAX: &[u8; 3usize] = b"li\0";
480pub const SCNoMAX: &[u8; 3usize] = b"lo\0";
481pub const SCNuMAX: &[u8; 3usize] = b"lu\0";
482pub const SCNxMAX: &[u8; 3usize] = b"lx\0";
483pub const SCNdPTR: &[u8; 3usize] = b"ld\0";
484pub const SCNiPTR: &[u8; 3usize] = b"li\0";
485pub const SCNoPTR: &[u8; 3usize] = b"lo\0";
486pub const SCNuPTR: &[u8; 3usize] = b"lu\0";
487pub const SCNxPTR: &[u8; 3usize] = b"lx\0";
488pub const RTAPI_INT8_MAX: u32 = 127;
489pub const RTAPI_INT8_MIN: i32 = -128;
490pub const RTAPI_UINT8_MAX: u32 = 255;
491pub const RTAPI_INT16_MAX: u32 = 32767;
492pub const RTAPI_INT16_MIN: i32 = -32768;
493pub const RTAPI_UINT16_MAX: u32 = 65535;
494pub const RTAPI_INT32_MAX: u32 = 2147483647;
495pub const RTAPI_INT32_MIN: i32 = -2147483648;
496pub const RTAPI_UINT32_MAX: u32 = 4294967295;
497pub const HAL_STREAM_MAX_PINS: u32 = 21;
498pub type wchar_t = ::std::os::raw::c_uint;
499#[repr(C)]
500#[repr(align(16))]
501#[derive(Debug, Copy, Clone)]
502pub struct max_align_t {
503 pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
504 pub __bindgen_padding_0: u64,
505 pub __clang_max_align_nonce2: u128,
506}
507#[test]
508fn bindgen_test_layout_max_align_t() {
509 const UNINIT: ::std::mem::MaybeUninit<max_align_t> = ::std::mem::MaybeUninit::uninit();
510 let ptr = UNINIT.as_ptr();
511 assert_eq!(
512 ::std::mem::size_of::<max_align_t>(),
513 32usize,
514 concat!("Size of: ", stringify!(max_align_t))
515 );
516 assert_eq!(
517 ::std::mem::align_of::<max_align_t>(),
518 16usize,
519 concat!("Alignment of ", stringify!(max_align_t))
520 );
521 assert_eq!(
522 unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize },
523 0usize,
524 concat!(
525 "Offset of field: ",
526 stringify!(max_align_t),
527 "::",
528 stringify!(__clang_max_align_nonce1)
529 )
530 );
531 assert_eq!(
532 unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize },
533 16usize,
534 concat!(
535 "Offset of field: ",
536 stringify!(max_align_t),
537 "::",
538 stringify!(__clang_max_align_nonce2)
539 )
540 );
541}
542extern "C" {
543 #[doc = " 'rtapi_init() sets up the RTAPI. It must be called by any"]
544 #[doc = "module that intends to use the API, before any other RTAPI"]
545 #[doc = "calls."]
546 #[doc = "'modname' can optionally point to a string that identifies"]
547 #[doc = "the module. The string will be truncated at RTAPI_NAME_LEN"]
548 #[doc = "characters. If 'modname' is NULL, the system will assign a"]
549 #[doc = "name."]
550 #[doc = "On success, returns a positive integer module ID, which is"]
551 #[doc = "used for subsequent calls to rtapi_xxx_new, rtapi_xxx_delete,"]
552 #[doc = "and rtapi_exit. On failure, returns an error code as defined"]
553 #[doc = "above. Call only from within user or init/cleanup code, not"]
554 #[doc = "from realtime tasks."]
555 pub fn rtapi_init(modname: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
556}
557extern "C" {
558 #[doc = " 'rtapi_exit()' shuts down and cleans up the RTAPI. It must be"]
559 #[doc = "called prior to exit by any module that called rtapi_init."]
560 #[doc = "'module_id' is the ID code returned when that module called"]
561 #[doc = "rtapi_init()."]
562 #[doc = "Returns a status code. rtapi_exit() may attempt to clean up"]
563 #[doc = "any tasks, shared memory, and other resources allocated by the"]
564 #[doc = "module, but should not be relied on to replace proper cleanup"]
565 #[doc = "code within the module. Call only from within user or"]
566 #[doc = "init/cleanup code, not from realtime tasks."]
567 pub fn rtapi_exit(module_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
568}
569extern "C" {
570 #[doc = " 'rtapi_snprintf()' works like 'snprintf()' from the normal"]
571 #[doc = "C library, except that it may not handle long longs."]
572 #[doc = "It is provided here because some RTOS kernels don't provide"]
573 #[doc = "a realtime safe version of the function, and those that do don't provide"]
574 #[doc = "support for printing doubles. On systems with a"]
575 #[doc = "good kernel snprintf(), or in user space, this function"]
576 #[doc = "simply calls the normal snprintf(). May be called from user,"]
577 #[doc = "init/cleanup, and realtime code."]
578 pub fn rtapi_snprintf(
579 buf: *mut ::std::os::raw::c_char,
580 size: ::std::os::raw::c_ulong,
581 fmt: *const ::std::os::raw::c_char,
582 ...
583 ) -> ::std::os::raw::c_int;
584}
585pub type va_list = [u64; 4usize];
586pub type __gnuc_va_list = [u64; 4usize];
587extern "C" {
588 pub fn rtapi_vsnprintf(
589 buf: *mut ::std::os::raw::c_char,
590 size: ::std::os::raw::c_ulong,
591 fmt: *const ::std::os::raw::c_char,
592 ap: va_list,
593 ) -> ::std::os::raw::c_int;
594}
595extern "C" {
596 #[doc = " 'rtapi_print()' prints a printf style message. Depending on the"]
597 #[doc = "RTOS and whether the program is being compiled for user space"]
598 #[doc = "or realtime, the message may be printed to stdout, stderr, or"]
599 #[doc = "to a kernel message log, etc. The calling syntax and format"]
600 #[doc = "string is similar to printf except that floating point and"]
601 #[doc = "longlongs are NOT supported in realtime and may not be supported"]
602 #[doc = "in user space. For some RTOS's, a 80 byte buffer is used, so the"]
603 #[doc = "format line and arguments should not produce a line more than"]
604 #[doc = "80 bytes long. (The buffer is protected against overflow.)"]
605 #[doc = "Does not block, but can take a fairly long time, depending on"]
606 #[doc = "the format string and OS. May be called from user, init/cleanup,"]
607 #[doc = "and realtime code."]
608 pub fn rtapi_print(fmt: *const ::std::os::raw::c_char, ...);
609}
610pub const msg_level_t_RTAPI_MSG_NONE: msg_level_t = 0;
611pub const msg_level_t_RTAPI_MSG_ERR: msg_level_t = 1;
612pub const msg_level_t_RTAPI_MSG_WARN: msg_level_t = 2;
613pub const msg_level_t_RTAPI_MSG_INFO: msg_level_t = 3;
614pub const msg_level_t_RTAPI_MSG_DBG: msg_level_t = 4;
615pub const msg_level_t_RTAPI_MSG_ALL: msg_level_t = 5;
616#[doc = " 'rtapi_print_msg()' prints a printf-style message when the level"]
617#[doc = "is less than or equal to the current message level set by"]
618#[doc = "rtapi_set_msg_level(). May be called from user, init/cleanup,"]
619#[doc = "and realtime code."]
620pub type msg_level_t = ::std::os::raw::c_uint;
621extern "C" {
622 pub fn rtapi_print_msg(level: msg_level_t, fmt: *const ::std::os::raw::c_char, ...);
623}
624extern "C" {
625 #[doc = " Set the maximum level of message to print. In userspace code,"]
626 #[doc = "each component has its own independent message level. In realtime"]
627 #[doc = "code, all components share a single message level. Returns 0 for"]
628 #[doc = "success or -EINVAL if the level is out of range."]
629 pub fn rtapi_set_msg_level(level: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
630}
631extern "C" {
632 #[doc = " Retrieve the message level set by the last call to rtapi_set_msg_level"]
633 pub fn rtapi_get_msg_level() -> ::std::os::raw::c_int;
634}
635#[doc = " 'rtapi_get_msg_handler' and 'rtapi_set_msg_handler' access the function"]
636#[doc = "pointer used by rtapi_print and rtapi_print_msg. By default, messages"]
637#[doc = "appear in the kernel log, but by replacing the handler a user of the rtapi"]
638#[doc = "library can send the messages to another destination. Calling"]
639#[doc = "rtapi_set_msg_handler with NULL restores the default handler. Call from"]
640#[doc = "real-time init/cleanup code only. When called from rtapi_print(),"]
641#[doc = "'level' is RTAPI_MSG_ALL, a level which should not normally be used"]
642#[doc = "with rtapi_print_msg()."]
643pub type rtapi_msg_handler_t = ::std::option::Option<
644 unsafe extern "C" fn(level: msg_level_t, fmt: *const ::std::os::raw::c_char, ap: va_list),
645>;
646extern "C" {
647 pub fn rtapi_set_msg_handler(handler: rtapi_msg_handler_t);
648}
649extern "C" {
650 pub fn rtapi_get_msg_handler() -> rtapi_msg_handler_t;
651}
652extern "C" {
653 #[doc = " 'rtapi_clock_set_period() sets the basic time interval for realtime"]
654 #[doc = "tasks. All periodic tasks will run at an integer multiple of this"]
655 #[doc = "period. The first call to 'rtapi_clock_set_period() with 'nsecs'"]
656 #[doc = "greater than zero will start the clock, using 'nsecs' as the clock"]
657 #[doc = "period in nano-seconds. Due to hardware and RTOS limitations, the"]
658 #[doc = "actual period may not be exactly what was requested. On success,"]
659 #[doc = "the function will return the actual clock period if it is available,"]
660 #[doc = "otherwise it returns the requested period. If the requested period"]
661 #[doc = "is outside the limits imposed by the hardware or RTOS, it returns"]
662 #[doc = "-EINVAL and does not start the clock. Once the clock is started,"]
663 #[doc = "subsequent calls with non-zero 'nsecs' return -EINVAL and have"]
664 #[doc = "no effect. Calling 'rtapi_clock_set_period() with 'nsecs' set to"]
665 #[doc = "zero queries the clock, returning the current clock period, or zero"]
666 #[doc = "if the clock has not yet been started. Call only from within"]
667 #[doc = "init/cleanup code, not from realtime tasks. This function is not"]
668 #[doc = "available from user (non-realtime) code."]
669 pub fn rtapi_clock_set_period(nsecs: ::std::os::raw::c_long) -> ::std::os::raw::c_long;
670}
671extern "C" {
672 #[doc = " rtapi_delay() is a simple delay. It is intended only for short"]
673 #[doc = "delays, since it simply loops, wasting CPU cycles. 'nsec' is the"]
674 #[doc = "desired delay, in nano-seconds. 'rtapi_delay_max() returns the"]
675 #[doc = "max delay permitted (usually approximately 1/4 of the clock period)."]
676 #[doc = "Any call to 'rtapi_delay()' requesting a delay longer than the max"]
677 #[doc = "will delay for the max time only. 'rtapi_delay_max()' should be"]
678 #[doc = "called before using 'rtapi_delay()' to make sure the required delays"]
679 #[doc = "can be achieved. The actual resolution of the delay may be as good"]
680 #[doc = "as one nano-second, or as bad as a several microseconds. May be"]
681 #[doc = "called from init/cleanup code, and from within realtime tasks."]
682 pub fn rtapi_delay(nsec: ::std::os::raw::c_long);
683}
684extern "C" {
685 pub fn rtapi_delay_max() -> ::std::os::raw::c_long;
686}
687extern "C" {
688 #[doc = " rtapi_get_time returns the current time in nanoseconds. Depending"]
689 #[doc = "on the RTOS, this may be time since boot, or time since the clock"]
690 #[doc = "period was set, or some other time. Its absolute value means"]
691 #[doc = "nothing, but it is monotonically increasing and can be used to"]
692 #[doc = "schedule future events, or to time the duration of some activity."]
693 #[doc = "Returns a 64 bit value. The resolution of the returned value may"]
694 #[doc = "be as good as one nano-second, or as poor as several microseconds."]
695 #[doc = "May be called from init/cleanup code, and from within realtime tasks."]
696 #[doc = ""]
697 #[doc = "Experience has shown that the implementation of this function in"]
698 #[doc = "some RTOS/Kernel combinations is horrible. It can take up to"]
699 #[doc = "several microseconds, which is at least 100 times longer than it"]
700 #[doc = "should, and perhaps a thousand times longer. Use it only if you"]
701 #[doc = "MUST have results in seconds instead of clocks, and use it sparingly."]
702 #[doc = "See rtapi_get_clocks() instead."]
703 #[doc = ""]
704 #[doc = "Note that longlong math may be poorly supported on some platforms,"]
705 #[doc = "especially in kernel space. Also note that rtapi_print() will NOT"]
706 #[doc = "print longlongs. Most time measurements are relative, and should"]
707 #[doc = "be done like this: deltat = (long int)(end_time - start_time);"]
708 #[doc = "where end_time and start_time are longlong values returned from"]
709 #[doc = "rtapi_get_time, and deltat is an ordinary long int (32 bits)."]
710 #[doc = "This will work for times up to about 2 seconds."]
711 pub fn rtapi_get_time() -> ::std::os::raw::c_longlong;
712}
713extern "C" {
714 #[doc = " rtapi_get_clocks returns the current time in CPU clocks. It is"]
715 #[doc = "fast, since it just reads the TSC in the CPU instead of calling a"]
716 #[doc = "kernel or RTOS function. Of course, times measured in CPU clocks"]
717 #[doc = "are not as convenient, but for relative measurements this works"]
718 #[doc = "fine. Its absolute value means nothing, but it is monotonically"]
719 #[doc = "increasing* and can be used to schedule future events, or to time"]
720 #[doc = "the duration of some activity. (* on SMP machines, the two TSC's"]
721 #[doc = "may get out of sync, so if a task reads the TSC, gets swapped to"]
722 #[doc = "the other CPU, and reads again, the value may decrease. RTAPI"]
723 #[doc = "tries to force all RT tasks to run on one CPU.)"]
724 #[doc = "Returns a 64 bit value. The resolution of the returned value is"]
725 #[doc = "one CPU clock, which is usually a few nanoseconds to a fraction of"]
726 #[doc = "a nanosecond."]
727 #[doc = "May be called from init/cleanup code, and from within realtime tasks."]
728 #[doc = ""]
729 #[doc = "Note that longlong math may be poorly supported on some platforms,"]
730 #[doc = "especially in kernel space. Also note that rtapi_print() will NOT"]
731 #[doc = "print longlongs. Most time measurements are relative, and should"]
732 #[doc = "be done like this: deltat = (long int)(end_time - start_time);"]
733 #[doc = "where end_time and start_time are longlong values returned from"]
734 #[doc = "rtapi_get_time, and deltat is an ordinary long int (32 bits)."]
735 #[doc = "This will work for times up to a second or so, depending on the"]
736 #[doc = "CPU clock frequency. It is best used for millisecond and"]
737 #[doc = "microsecond scale measurements though."]
738 pub fn rtapi_get_clocks() -> ::std::os::raw::c_longlong;
739}
740extern "C" {
741 #[doc = " The 'rtapi_prio_xxxx()' functions provide a portable way to set"]
742 #[doc = "task priority. The mapping of actual priority to priority number"]
743 #[doc = "depends on the RTOS. Priorities range from 'rtapi_prio_lowest()'"]
744 #[doc = "to 'rtapi_prio_highest()', inclusive. To use this API, use one of"]
745 #[doc = "two methods:"]
746 #[doc = ""]
747 #[doc = "1) Set your lowest priority task to 'rtapi_prio_lowest()', and for"]
748 #[doc = "each task of the next lowest priority, set their priorities to"]
749 #[doc = "'rtapi_prio_next_higher(previous)'."]
750 #[doc = ""]
751 #[doc = "2) Set your highest priority task to 'rtapi_prio_highest()', and"]
752 #[doc = "for each task of the next highest priority, set their priorities"]
753 #[doc = "to 'rtapi_prio_next_lower(previous)'."]
754 #[doc = ""]
755 #[doc = "A high priority task will preempt a lower priority task. The linux kernel"]
756 #[doc = "and userspace are always a lower priority than all rtapi tasks."]
757 #[doc = ""]
758 #[doc = "Call these functions only from within init/cleanup code, not from"]
759 #[doc = "realtime tasks."]
760 pub fn rtapi_prio_highest() -> ::std::os::raw::c_int;
761}
762extern "C" {
763 pub fn rtapi_prio_lowest() -> ::std::os::raw::c_int;
764}
765extern "C" {
766 pub fn rtapi_prio_next_higher(prio: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
767}
768extern "C" {
769 pub fn rtapi_prio_next_lower(prio: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
770}
771extern "C" {
772 pub fn rtapi_task_new(
773 taskcode: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
774 arg: *mut ::std::os::raw::c_void,
775 prio: ::std::os::raw::c_int,
776 owner: ::std::os::raw::c_int,
777 stacksize: ::std::os::raw::c_ulong,
778 uses_fp: ::std::os::raw::c_int,
779 ) -> ::std::os::raw::c_int;
780}
781extern "C" {
782 #[doc = " 'rtapi_task_delete()' deletes a task. 'task_id' is a task ID"]
783 #[doc = "from a previous call to rtapi_task_new(). It frees memory"]
784 #[doc = "associated with 'task', and does any other cleanup needed. If"]
785 #[doc = "the task has been started, you should pause it before deleting"]
786 #[doc = "it. Returns a status code. Call only from within init/cleanup"]
787 #[doc = "code, not from realtime tasks."]
788 pub fn rtapi_task_delete(task_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
789}
790extern "C" {
791 #[doc = " 'rtapi_task_start()' starts a task in periodic mode. 'task_id' is"]
792 #[doc = "a task ID from a call to rtapi_task_new(). The task must be in"]
793 #[doc = "the \"paused\" state, or it will return -EINVAL."]
794 #[doc = "'period_nsec' is the task period in nanoseconds, which will be"]
795 #[doc = "rounded to the nearest multiple of the global clock period. A"]
796 #[doc = "task period less than the clock period (including zero) will be"]
797 #[doc = "set equal to the clock period."]
798 #[doc = "Call only from within init/cleanup code, not from realtime tasks."]
799 pub fn rtapi_task_start(
800 task_id: ::std::os::raw::c_int,
801 period_nsec: ::std::os::raw::c_ulong,
802 ) -> ::std::os::raw::c_int;
803}
804extern "C" {
805 #[doc = " 'rtapi_wait()' suspends execution of the current task until the"]
806 #[doc = "next period. The task must be periodic, if not, the result is"]
807 #[doc = "undefined. The function will return at the beginning of the"]
808 #[doc = "next period. Call only from within a realtime task."]
809 pub fn rtapi_wait();
810}
811extern "C" {
812 #[doc = " 'rtapi_task_resume() starts a task in free-running mode. 'task_id'"]
813 #[doc = "is a task ID from a call to rtapi_task_new(). The task must be in"]
814 #[doc = "the \"paused\" state, or it will return -EINVAL."]
815 #[doc = "A free running task runs continuously until either:"]
816 #[doc = "1) It is prempted by a higher priority task. It will resume as"]
817 #[doc = "soon as the higher priority task releases the CPU."]
818 #[doc = "2) It calls a blocking function, like rtapi_sem_take(). It will"]
819 #[doc = "resume when the function unblocks."]
820 #[doc = "3) it is returned to the \"paused\" state by rtapi_task_pause()."]
821 #[doc = "May be called from init/cleanup code, and from within realtime tasks."]
822 pub fn rtapi_task_resume(task_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
823}
824extern "C" {
825 #[doc = " 'rtapi_task_pause() causes 'task_id' to stop execution and change"]
826 #[doc = "to the \"paused\" state. 'task_id' can be free-running or periodic."]
827 #[doc = "Note that rtapi_task_pause() may called from any task, or from init"]
828 #[doc = "or cleanup code, not just from the task that is to be paused."]
829 #[doc = "The task will resume execution when either rtapi_task_resume() or"]
830 #[doc = "rtapi_task_start() is called. May be called from init/cleanup code,"]
831 #[doc = "and from within realtime tasks."]
832 pub fn rtapi_task_pause(task_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
833}
834extern "C" {
835 #[doc = " 'rtapi_task_self()' returns the task ID of the current task or -EINVAL."]
836 #[doc = "May be called from init/cleanup code, and from within realtime tasks."]
837 pub fn rtapi_task_self() -> ::std::os::raw::c_int;
838}
839extern "C" {
840 #[doc = " 'rtapi_shmem_new()' allocates a block of shared memory. 'key'"]
841 #[doc = "identifies the memory block, and must be non-zero. All modules"]
842 #[doc = "wishing to access the same memory must use the same key."]
843 #[doc = "'module_id' is the ID of the module that is making the call (see"]
844 #[doc = "rtapi_init). The block will be at least 'size' bytes, and may"]
845 #[doc = "be rounded up. Allocating many small blocks may be very wasteful."]
846 #[doc = "When a particular block is allocated for the first time, all"]
847 #[doc = "bytes are zeroed. Subsequent allocations of the same block"]
848 #[doc = "by other modules or processes will not touch the contents of the"]
849 #[doc = "block."]
850 #[doc = "On success, it returns a positive integer ID, which is used for"]
851 #[doc = "all subsequent calls dealing with the block. On failure it"]
852 #[doc = "returns a negative error code. Call only from within user or"]
853 #[doc = "init/cleanup code, not from realtime tasks."]
854 pub fn rtapi_shmem_new(
855 key: ::std::os::raw::c_int,
856 module_id: ::std::os::raw::c_int,
857 size: ::std::os::raw::c_ulong,
858 ) -> ::std::os::raw::c_int;
859}
860extern "C" {
861 #[doc = " 'rtapi_shmem_delete()' frees the shared memory block associated"]
862 #[doc = "with 'shmem_id'. 'module_id' is the ID of the calling module."]
863 #[doc = "Returns a status code. Call only from within user or init/cleanup"]
864 #[doc = "code, not from realtime tasks."]
865 pub fn rtapi_shmem_delete(
866 shmem_id: ::std::os::raw::c_int,
867 module_id: ::std::os::raw::c_int,
868 ) -> ::std::os::raw::c_int;
869}
870extern "C" {
871 #[doc = " 'rtapi_shmem_getptr()' sets '*ptr' to point to shared memory block"]
872 #[doc = "associated with 'shmem_id'. Returns a status code. May be called"]
873 #[doc = "from user code, init/cleanup code, or realtime tasks."]
874 pub fn rtapi_shmem_getptr(
875 shmem_id: ::std::os::raw::c_int,
876 ptr: *mut *mut ::std::os::raw::c_void,
877 ) -> ::std::os::raw::c_int;
878}
879extern "C" {
880 #[doc = " 'rtapi_sem_new()' creates a realtime semaphore. 'key' identifies"]
881 #[doc = "identifies the semaphore, and must be non-zero. All modules wishing"]
882 #[doc = "to use the same semaphore must specify the same key. 'module_id'"]
883 #[doc = "is the ID of the module making the call (see rtapi_init). On"]
884 #[doc = "success, it returns a positive integer semaphore ID, which is used"]
885 #[doc = "for all subsequent calls dealing with the semaphore. On failure"]
886 #[doc = "it returns a negative error code. Call only from within init/cleanup"]
887 #[doc = "code, not from realtime tasks."]
888 pub fn rtapi_sem_new(
889 key: ::std::os::raw::c_int,
890 module_id: ::std::os::raw::c_int,
891 ) -> ::std::os::raw::c_int;
892}
893extern "C" {
894 #[doc = " 'rtapi_sem_delete()' is the counterpart to 'rtapi_sem_new()'. It"]
895 #[doc = "discards the semaphore associated with 'sem_id'. Any tasks blocked"]
896 #[doc = "on 'sem' will resume execution. 'module_id' is the ID of the calling"]
897 #[doc = "module. Returns a status code. Call only from within init/cleanup"]
898 #[doc = "code, not from realtime tasks."]
899 pub fn rtapi_sem_delete(
900 sem_id: ::std::os::raw::c_int,
901 module_id: ::std::os::raw::c_int,
902 ) -> ::std::os::raw::c_int;
903}
904extern "C" {
905 #[doc = " 'rtapi_sem_give()' unlocks a semaphore. If a higher priority task"]
906 #[doc = "is blocked on the semaphore, the calling task will block and the"]
907 #[doc = "higher priority task will begin to run. Returns a status code."]
908 #[doc = "May be called from init/cleanup code, and from within realtime tasks."]
909 pub fn rtapi_sem_give(sem_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
910}
911extern "C" {
912 #[doc = " 'rtapi_sem_take()' locks a semaphore. Returns 0 or"]
913 #[doc = "-EINVAL. If the semaphore is unlocked it returns 0"]
914 #[doc = "immediately. If the semaphore is locked, the calling task blocks"]
915 #[doc = "until the semaphore is unlocked, then it returns 0."]
916 #[doc = "Call only from within a realtime task."]
917 pub fn rtapi_sem_take(sem_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
918}
919extern "C" {
920 #[doc = " 'rtapi_sem_try()' does a non-blocking attempt to lock a semaphore."]
921 #[doc = "Returns 0, -EINVAL, or -EBUSY. If the semaphore"]
922 #[doc = "is unlocked, it returns 0. If the semaphore is locked"]
923 #[doc = "it does not block, instead it returns -EBUSY, and the caller"]
924 #[doc = "can decide how to deal with the situation. Call only from within"]
925 #[doc = "a realtime task."]
926 pub fn rtapi_sem_try(sem_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
927}
928extern "C" {
929 #[doc = " 'rtapi_fifo_new()' creates a realtime fifo. 'key' identifies the"]
930 #[doc = "fifo, all modules wishing to access the same fifo must use the same"]
931 #[doc = "key. 'module_id' is the ID of the module making the call (see"]
932 #[doc = "rtapi_init). 'size' is the depth of the fifo. 'mode' is either"]
933 #[doc = "'R' or 'W', to request either read or write access to the fifo."]
934 #[doc = "On success, it returns a positive integer ID, which is used for"]
935 #[doc = "subsequent calls dealing with the fifo. On failure, returns a"]
936 #[doc = "negative error code. Call only from within user or init/cleanup"]
937 #[doc = "code, not from realtime tasks."]
938 pub fn rtapi_fifo_new(
939 key: ::std::os::raw::c_int,
940 module_id: ::std::os::raw::c_int,
941 size: ::std::os::raw::c_ulong,
942 mode: ::std::os::raw::c_char,
943 ) -> ::std::os::raw::c_int;
944}
945extern "C" {
946 #[doc = " 'rtapi_fifo_delete()' is the counterpart to 'rtapi_fifo_new()'."]
947 #[doc = "It closes the fifo associated with 'fifo_ID'. 'module_id' is the"]
948 #[doc = "ID of the calling module. Returns status code. Call only from"]
949 #[doc = "within user or init/cleanup code, not from realtime tasks."]
950 pub fn rtapi_fifo_delete(
951 fifo_id: ::std::os::raw::c_int,
952 module_id: ::std::os::raw::c_int,
953 ) -> ::std::os::raw::c_int;
954}
955extern "C" {
956 pub fn rtapi_fifo_read(
957 fifo_id: ::std::os::raw::c_int,
958 buf: *mut ::std::os::raw::c_char,
959 size: ::std::os::raw::c_ulong,
960 ) -> ::std::os::raw::c_int;
961}
962extern "C" {
963 pub fn rtapi_fifo_write(
964 fifo_id: ::std::os::raw::c_int,
965 buf: *mut ::std::os::raw::c_char,
966 size: ::std::os::raw::c_ulong,
967 ) -> ::std::os::raw::c_int;
968}
969extern "C" {
970 #[doc = " 'rtapi_assign_interrupt_handler()' is used to set up a handler for"]
971 #[doc = "a hardware interrupt. 'irq' is the interrupt number, and 'handler'"]
972 #[doc = "is a pointer to a function taking no arguments and returning void."]
973 #[doc = "'handler will be called when the interrupt occurs. 'owner' is the"]
974 #[doc = "ID of the calling module (see rtapi_init). Returns a status"]
975 #[doc = "code. Note: The simulated RTOS does not support interrupts."]
976 #[doc = "Call only from within init/cleanup code, not from realtime tasks."]
977 pub fn rtapi_irq_new(
978 irq_num: ::std::os::raw::c_uint,
979 owner: ::std::os::raw::c_int,
980 handler: ::std::option::Option<unsafe extern "C" fn()>,
981 ) -> ::std::os::raw::c_int;
982}
983extern "C" {
984 #[doc = " 'rtapi_free_interrupt_handler()' removes an interrupt handler that"]
985 #[doc = "was previously installed by rtapi_assign_interrupt_handler(). 'irq'"]
986 #[doc = "is the interrupt number. Removing a realtime module without freeing"]
987 #[doc = "any handlers it has installed will almost certainly crash the box."]
988 #[doc = "Returns 0 or -EINVAL. Call only from within"]
989 #[doc = "init/cleanup code, not from realtime tasks."]
990 pub fn rtapi_irq_delete(irq_num: ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
991}
992extern "C" {
993 #[doc = " 'rtapi_enable_interrupt()' and 'rtapi_disable_interrupt()' are"]
994 #[doc = "are used to enable and disable interrupts, presumably ones that"]
995 #[doc = "have handlers assigned to them. Returns a status code. May be"]
996 #[doc = "called from init/cleanup code, and from within realtime tasks."]
997 pub fn rtapi_enable_interrupt(irq: ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
998}
999extern "C" {
1000 pub fn rtapi_disable_interrupt(irq: ::std::os::raw::c_uint) -> ::std::os::raw::c_int;
1001}
1002extern "C" {
1003 #[doc = " 'rtapi_outb() writes 'byte' to 'port'. May be called from"]
1004 #[doc = "init/cleanup code, and from within realtime tasks."]
1005 #[doc = "Note: This function does nothing on the simulated RTOS."]
1006 #[doc = "Note: Many platforms provide an inline outb() that is faster."]
1007 pub fn rtapi_outb(byte: ::std::os::raw::c_uchar, port: ::std::os::raw::c_uint);
1008}
1009extern "C" {
1010 #[doc = " 'rtapi_inb() gets a byte from 'port'. Returns the byte. May"]
1011 #[doc = "be called from init/cleanup code, and from within realtime tasks."]
1012 #[doc = "Note: This function always returns zero on the simulated RTOS."]
1013 #[doc = "Note: Many platforms provide an inline inb() that is faster."]
1014 pub fn rtapi_inb(port: ::std::os::raw::c_uint) -> ::std::os::raw::c_uchar;
1015}
1016extern "C" {
1017 pub fn simple_strtol(
1018 nptr: *const ::std::os::raw::c_char,
1019 endptr: *mut *mut ::std::os::raw::c_char,
1020 base: ::std::os::raw::c_int,
1021 ) -> ::std::os::raw::c_long;
1022}
1023pub type __u_char = ::std::os::raw::c_uchar;
1024pub type __u_short = ::std::os::raw::c_ushort;
1025pub type __u_int = ::std::os::raw::c_uint;
1026pub type __u_long = ::std::os::raw::c_ulong;
1027pub type __int8_t = ::std::os::raw::c_schar;
1028pub type __uint8_t = ::std::os::raw::c_uchar;
1029pub type __int16_t = ::std::os::raw::c_short;
1030pub type __uint16_t = ::std::os::raw::c_ushort;
1031pub type __int32_t = ::std::os::raw::c_int;
1032pub type __uint32_t = ::std::os::raw::c_uint;
1033pub type __int64_t = ::std::os::raw::c_long;
1034pub type __uint64_t = ::std::os::raw::c_ulong;
1035pub type __int_least8_t = __int8_t;
1036pub type __uint_least8_t = __uint8_t;
1037pub type __int_least16_t = __int16_t;
1038pub type __uint_least16_t = __uint16_t;
1039pub type __int_least32_t = __int32_t;
1040pub type __uint_least32_t = __uint32_t;
1041pub type __int_least64_t = __int64_t;
1042pub type __uint_least64_t = __uint64_t;
1043pub type __quad_t = ::std::os::raw::c_long;
1044pub type __u_quad_t = ::std::os::raw::c_ulong;
1045pub type __intmax_t = ::std::os::raw::c_long;
1046pub type __uintmax_t = ::std::os::raw::c_ulong;
1047pub type __dev_t = ::std::os::raw::c_ulong;
1048pub type __uid_t = ::std::os::raw::c_uint;
1049pub type __gid_t = ::std::os::raw::c_uint;
1050pub type __ino_t = ::std::os::raw::c_ulong;
1051pub type __ino64_t = ::std::os::raw::c_ulong;
1052pub type __mode_t = ::std::os::raw::c_uint;
1053pub type __nlink_t = ::std::os::raw::c_uint;
1054pub type __off_t = ::std::os::raw::c_long;
1055pub type __off64_t = ::std::os::raw::c_long;
1056pub type __pid_t = ::std::os::raw::c_int;
1057#[repr(C)]
1058#[derive(Debug, Copy, Clone)]
1059pub struct __fsid_t {
1060 pub __val: [::std::os::raw::c_int; 2usize],
1061}
1062#[test]
1063fn bindgen_test_layout___fsid_t() {
1064 const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit();
1065 let ptr = UNINIT.as_ptr();
1066 assert_eq!(
1067 ::std::mem::size_of::<__fsid_t>(),
1068 8usize,
1069 concat!("Size of: ", stringify!(__fsid_t))
1070 );
1071 assert_eq!(
1072 ::std::mem::align_of::<__fsid_t>(),
1073 4usize,
1074 concat!("Alignment of ", stringify!(__fsid_t))
1075 );
1076 assert_eq!(
1077 unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize },
1078 0usize,
1079 concat!(
1080 "Offset of field: ",
1081 stringify!(__fsid_t),
1082 "::",
1083 stringify!(__val)
1084 )
1085 );
1086}
1087pub type __clock_t = ::std::os::raw::c_long;
1088pub type __rlim_t = ::std::os::raw::c_ulong;
1089pub type __rlim64_t = ::std::os::raw::c_ulong;
1090pub type __id_t = ::std::os::raw::c_uint;
1091pub type __time_t = ::std::os::raw::c_long;
1092pub type __useconds_t = ::std::os::raw::c_uint;
1093pub type __suseconds_t = ::std::os::raw::c_long;
1094pub type __daddr_t = ::std::os::raw::c_int;
1095pub type __key_t = ::std::os::raw::c_int;
1096pub type __clockid_t = ::std::os::raw::c_int;
1097pub type __timer_t = *mut ::std::os::raw::c_void;
1098pub type __blksize_t = ::std::os::raw::c_int;
1099pub type __blkcnt_t = ::std::os::raw::c_long;
1100pub type __blkcnt64_t = ::std::os::raw::c_long;
1101pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
1102pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
1103pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
1104pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
1105pub type __fsword_t = ::std::os::raw::c_long;
1106pub type __ssize_t = ::std::os::raw::c_long;
1107pub type __syscall_slong_t = ::std::os::raw::c_long;
1108pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
1109pub type __loff_t = __off64_t;
1110pub type __caddr_t = *mut ::std::os::raw::c_char;
1111pub type __intptr_t = ::std::os::raw::c_long;
1112pub type __socklen_t = ::std::os::raw::c_uint;
1113pub type __sig_atomic_t = ::std::os::raw::c_int;
1114pub type time_t = __time_t;
1115#[repr(C)]
1116#[derive(Debug, Copy, Clone)]
1117pub struct timespec {
1118 pub tv_sec: __time_t,
1119 pub tv_nsec: __syscall_slong_t,
1120}
1121#[test]
1122fn bindgen_test_layout_timespec() {
1123 const UNINIT: ::std::mem::MaybeUninit<timespec> = ::std::mem::MaybeUninit::uninit();
1124 let ptr = UNINIT.as_ptr();
1125 assert_eq!(
1126 ::std::mem::size_of::<timespec>(),
1127 16usize,
1128 concat!("Size of: ", stringify!(timespec))
1129 );
1130 assert_eq!(
1131 ::std::mem::align_of::<timespec>(),
1132 8usize,
1133 concat!("Alignment of ", stringify!(timespec))
1134 );
1135 assert_eq!(
1136 unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
1137 0usize,
1138 concat!(
1139 "Offset of field: ",
1140 stringify!(timespec),
1141 "::",
1142 stringify!(tv_sec)
1143 )
1144 );
1145 assert_eq!(
1146 unsafe { ::std::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize },
1147 8usize,
1148 concat!(
1149 "Offset of field: ",
1150 stringify!(timespec),
1151 "::",
1152 stringify!(tv_nsec)
1153 )
1154 );
1155}
1156pub type pid_t = __pid_t;
1157#[repr(C)]
1158#[derive(Debug, Copy, Clone)]
1159pub struct sched_param {
1160 pub sched_priority: ::std::os::raw::c_int,
1161}
1162#[test]
1163fn bindgen_test_layout_sched_param() {
1164 const UNINIT: ::std::mem::MaybeUninit<sched_param> = ::std::mem::MaybeUninit::uninit();
1165 let ptr = UNINIT.as_ptr();
1166 assert_eq!(
1167 ::std::mem::size_of::<sched_param>(),
1168 4usize,
1169 concat!("Size of: ", stringify!(sched_param))
1170 );
1171 assert_eq!(
1172 ::std::mem::align_of::<sched_param>(),
1173 4usize,
1174 concat!("Alignment of ", stringify!(sched_param))
1175 );
1176 assert_eq!(
1177 unsafe { ::std::ptr::addr_of!((*ptr).sched_priority) as usize - ptr as usize },
1178 0usize,
1179 concat!(
1180 "Offset of field: ",
1181 stringify!(sched_param),
1182 "::",
1183 stringify!(sched_priority)
1184 )
1185 );
1186}
1187pub type __cpu_mask = ::std::os::raw::c_ulong;
1188#[repr(C)]
1189#[derive(Debug, Copy, Clone)]
1190pub struct cpu_set_t {
1191 pub __bits: [__cpu_mask; 16usize],
1192}
1193#[test]
1194fn bindgen_test_layout_cpu_set_t() {
1195 const UNINIT: ::std::mem::MaybeUninit<cpu_set_t> = ::std::mem::MaybeUninit::uninit();
1196 let ptr = UNINIT.as_ptr();
1197 assert_eq!(
1198 ::std::mem::size_of::<cpu_set_t>(),
1199 128usize,
1200 concat!("Size of: ", stringify!(cpu_set_t))
1201 );
1202 assert_eq!(
1203 ::std::mem::align_of::<cpu_set_t>(),
1204 8usize,
1205 concat!("Alignment of ", stringify!(cpu_set_t))
1206 );
1207 assert_eq!(
1208 unsafe { ::std::ptr::addr_of!((*ptr).__bits) as usize - ptr as usize },
1209 0usize,
1210 concat!(
1211 "Offset of field: ",
1212 stringify!(cpu_set_t),
1213 "::",
1214 stringify!(__bits)
1215 )
1216 );
1217}
1218extern "C" {
1219 pub fn __sched_cpucount(__setsize: usize, __setp: *const cpu_set_t) -> ::std::os::raw::c_int;
1220}
1221extern "C" {
1222 pub fn __sched_cpualloc(__count: usize) -> *mut cpu_set_t;
1223}
1224extern "C" {
1225 pub fn __sched_cpufree(__set: *mut cpu_set_t);
1226}
1227extern "C" {
1228 pub fn sched_setparam(__pid: __pid_t, __param: *const sched_param) -> ::std::os::raw::c_int;
1229}
1230extern "C" {
1231 pub fn sched_getparam(__pid: __pid_t, __param: *mut sched_param) -> ::std::os::raw::c_int;
1232}
1233extern "C" {
1234 pub fn sched_setscheduler(
1235 __pid: __pid_t,
1236 __policy: ::std::os::raw::c_int,
1237 __param: *const sched_param,
1238 ) -> ::std::os::raw::c_int;
1239}
1240extern "C" {
1241 pub fn sched_getscheduler(__pid: __pid_t) -> ::std::os::raw::c_int;
1242}
1243extern "C" {
1244 pub fn sched_yield() -> ::std::os::raw::c_int;
1245}
1246extern "C" {
1247 pub fn sched_get_priority_max(__algorithm: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
1248}
1249extern "C" {
1250 pub fn sched_get_priority_min(__algorithm: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
1251}
1252extern "C" {
1253 pub fn sched_rr_get_interval(__pid: __pid_t, __t: *mut timespec) -> ::std::os::raw::c_int;
1254}
1255pub type u_char = __u_char;
1256pub type u_short = __u_short;
1257pub type u_int = __u_int;
1258pub type u_long = __u_long;
1259pub type quad_t = __quad_t;
1260pub type u_quad_t = __u_quad_t;
1261pub type fsid_t = __fsid_t;
1262pub type loff_t = __loff_t;
1263pub type ino_t = __ino_t;
1264pub type dev_t = __dev_t;
1265pub type gid_t = __gid_t;
1266pub type mode_t = __mode_t;
1267pub type nlink_t = __nlink_t;
1268pub type uid_t = __uid_t;
1269pub type off_t = __off_t;
1270pub type id_t = __id_t;
1271pub type daddr_t = __daddr_t;
1272pub type caddr_t = __caddr_t;
1273pub type key_t = __key_t;
1274pub type clock_t = __clock_t;
1275pub type clockid_t = __clockid_t;
1276pub type timer_t = __timer_t;
1277pub type ulong = ::std::os::raw::c_ulong;
1278pub type ushort = ::std::os::raw::c_ushort;
1279pub type uint = ::std::os::raw::c_uint;
1280pub type u_int8_t = __uint8_t;
1281pub type u_int16_t = __uint16_t;
1282pub type u_int32_t = __uint32_t;
1283pub type u_int64_t = __uint64_t;
1284pub type register_t = ::std::os::raw::c_long;
1285#[repr(C)]
1286#[derive(Debug, Copy, Clone)]
1287pub struct __sigset_t {
1288 pub __val: [::std::os::raw::c_ulong; 16usize],
1289}
1290#[test]
1291fn bindgen_test_layout___sigset_t() {
1292 const UNINIT: ::std::mem::MaybeUninit<__sigset_t> = ::std::mem::MaybeUninit::uninit();
1293 let ptr = UNINIT.as_ptr();
1294 assert_eq!(
1295 ::std::mem::size_of::<__sigset_t>(),
1296 128usize,
1297 concat!("Size of: ", stringify!(__sigset_t))
1298 );
1299 assert_eq!(
1300 ::std::mem::align_of::<__sigset_t>(),
1301 8usize,
1302 concat!("Alignment of ", stringify!(__sigset_t))
1303 );
1304 assert_eq!(
1305 unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize },
1306 0usize,
1307 concat!(
1308 "Offset of field: ",
1309 stringify!(__sigset_t),
1310 "::",
1311 stringify!(__val)
1312 )
1313 );
1314}
1315pub type sigset_t = __sigset_t;
1316#[repr(C)]
1317#[derive(Debug, Copy, Clone)]
1318pub struct timeval {
1319 pub tv_sec: __time_t,
1320 pub tv_usec: __suseconds_t,
1321}
1322#[test]
1323fn bindgen_test_layout_timeval() {
1324 const UNINIT: ::std::mem::MaybeUninit<timeval> = ::std::mem::MaybeUninit::uninit();
1325 let ptr = UNINIT.as_ptr();
1326 assert_eq!(
1327 ::std::mem::size_of::<timeval>(),
1328 16usize,
1329 concat!("Size of: ", stringify!(timeval))
1330 );
1331 assert_eq!(
1332 ::std::mem::align_of::<timeval>(),
1333 8usize,
1334 concat!("Alignment of ", stringify!(timeval))
1335 );
1336 assert_eq!(
1337 unsafe { ::std::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
1338 0usize,
1339 concat!(
1340 "Offset of field: ",
1341 stringify!(timeval),
1342 "::",
1343 stringify!(tv_sec)
1344 )
1345 );
1346 assert_eq!(
1347 unsafe { ::std::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize },
1348 8usize,
1349 concat!(
1350 "Offset of field: ",
1351 stringify!(timeval),
1352 "::",
1353 stringify!(tv_usec)
1354 )
1355 );
1356}
1357pub type suseconds_t = __suseconds_t;
1358pub type __fd_mask = ::std::os::raw::c_long;
1359#[repr(C)]
1360#[derive(Debug, Copy, Clone)]
1361pub struct fd_set {
1362 pub __fds_bits: [__fd_mask; 16usize],
1363}
1364#[test]
1365fn bindgen_test_layout_fd_set() {
1366 const UNINIT: ::std::mem::MaybeUninit<fd_set> = ::std::mem::MaybeUninit::uninit();
1367 let ptr = UNINIT.as_ptr();
1368 assert_eq!(
1369 ::std::mem::size_of::<fd_set>(),
1370 128usize,
1371 concat!("Size of: ", stringify!(fd_set))
1372 );
1373 assert_eq!(
1374 ::std::mem::align_of::<fd_set>(),
1375 8usize,
1376 concat!("Alignment of ", stringify!(fd_set))
1377 );
1378 assert_eq!(
1379 unsafe { ::std::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize },
1380 0usize,
1381 concat!(
1382 "Offset of field: ",
1383 stringify!(fd_set),
1384 "::",
1385 stringify!(__fds_bits)
1386 )
1387 );
1388}
1389pub type fd_mask = __fd_mask;
1390extern "C" {
1391 pub fn select(
1392 __nfds: ::std::os::raw::c_int,
1393 __readfds: *mut fd_set,
1394 __writefds: *mut fd_set,
1395 __exceptfds: *mut fd_set,
1396 __timeout: *mut timeval,
1397 ) -> ::std::os::raw::c_int;
1398}
1399extern "C" {
1400 pub fn pselect(
1401 __nfds: ::std::os::raw::c_int,
1402 __readfds: *mut fd_set,
1403 __writefds: *mut fd_set,
1404 __exceptfds: *mut fd_set,
1405 __timeout: *const timespec,
1406 __sigmask: *const __sigset_t,
1407 ) -> ::std::os::raw::c_int;
1408}
1409pub type blksize_t = __blksize_t;
1410pub type blkcnt_t = __blkcnt_t;
1411pub type fsblkcnt_t = __fsblkcnt_t;
1412pub type fsfilcnt_t = __fsfilcnt_t;
1413#[repr(C)]
1414#[derive(Debug, Copy, Clone)]
1415pub struct __pthread_internal_list {
1416 pub __prev: *mut __pthread_internal_list,
1417 pub __next: *mut __pthread_internal_list,
1418}
1419#[test]
1420fn bindgen_test_layout___pthread_internal_list() {
1421 const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_list> =
1422 ::std::mem::MaybeUninit::uninit();
1423 let ptr = UNINIT.as_ptr();
1424 assert_eq!(
1425 ::std::mem::size_of::<__pthread_internal_list>(),
1426 16usize,
1427 concat!("Size of: ", stringify!(__pthread_internal_list))
1428 );
1429 assert_eq!(
1430 ::std::mem::align_of::<__pthread_internal_list>(),
1431 8usize,
1432 concat!("Alignment of ", stringify!(__pthread_internal_list))
1433 );
1434 assert_eq!(
1435 unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize },
1436 0usize,
1437 concat!(
1438 "Offset of field: ",
1439 stringify!(__pthread_internal_list),
1440 "::",
1441 stringify!(__prev)
1442 )
1443 );
1444 assert_eq!(
1445 unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize },
1446 8usize,
1447 concat!(
1448 "Offset of field: ",
1449 stringify!(__pthread_internal_list),
1450 "::",
1451 stringify!(__next)
1452 )
1453 );
1454}
1455pub type __pthread_list_t = __pthread_internal_list;
1456#[repr(C)]
1457#[derive(Debug, Copy, Clone)]
1458pub struct __pthread_internal_slist {
1459 pub __next: *mut __pthread_internal_slist,
1460}
1461#[test]
1462fn bindgen_test_layout___pthread_internal_slist() {
1463 const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_slist> =
1464 ::std::mem::MaybeUninit::uninit();
1465 let ptr = UNINIT.as_ptr();
1466 assert_eq!(
1467 ::std::mem::size_of::<__pthread_internal_slist>(),
1468 8usize,
1469 concat!("Size of: ", stringify!(__pthread_internal_slist))
1470 );
1471 assert_eq!(
1472 ::std::mem::align_of::<__pthread_internal_slist>(),
1473 8usize,
1474 concat!("Alignment of ", stringify!(__pthread_internal_slist))
1475 );
1476 assert_eq!(
1477 unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize },
1478 0usize,
1479 concat!(
1480 "Offset of field: ",
1481 stringify!(__pthread_internal_slist),
1482 "::",
1483 stringify!(__next)
1484 )
1485 );
1486}
1487pub type __pthread_slist_t = __pthread_internal_slist;
1488#[repr(C)]
1489#[derive(Debug, Copy, Clone)]
1490pub struct __pthread_mutex_s {
1491 pub __lock: ::std::os::raw::c_int,
1492 pub __count: ::std::os::raw::c_uint,
1493 pub __owner: ::std::os::raw::c_int,
1494 pub __nusers: ::std::os::raw::c_uint,
1495 pub __kind: ::std::os::raw::c_int,
1496 pub __spins: ::std::os::raw::c_int,
1497 pub __list: __pthread_list_t,
1498}
1499#[test]
1500fn bindgen_test_layout___pthread_mutex_s() {
1501 const UNINIT: ::std::mem::MaybeUninit<__pthread_mutex_s> = ::std::mem::MaybeUninit::uninit();
1502 let ptr = UNINIT.as_ptr();
1503 assert_eq!(
1504 ::std::mem::size_of::<__pthread_mutex_s>(),
1505 40usize,
1506 concat!("Size of: ", stringify!(__pthread_mutex_s))
1507 );
1508 assert_eq!(
1509 ::std::mem::align_of::<__pthread_mutex_s>(),
1510 8usize,
1511 concat!("Alignment of ", stringify!(__pthread_mutex_s))
1512 );
1513 assert_eq!(
1514 unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize },
1515 0usize,
1516 concat!(
1517 "Offset of field: ",
1518 stringify!(__pthread_mutex_s),
1519 "::",
1520 stringify!(__lock)
1521 )
1522 );
1523 assert_eq!(
1524 unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize },
1525 4usize,
1526 concat!(
1527 "Offset of field: ",
1528 stringify!(__pthread_mutex_s),
1529 "::",
1530 stringify!(__count)
1531 )
1532 );
1533 assert_eq!(
1534 unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize },
1535 8usize,
1536 concat!(
1537 "Offset of field: ",
1538 stringify!(__pthread_mutex_s),
1539 "::",
1540 stringify!(__owner)
1541 )
1542 );
1543 assert_eq!(
1544 unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize },
1545 12usize,
1546 concat!(
1547 "Offset of field: ",
1548 stringify!(__pthread_mutex_s),
1549 "::",
1550 stringify!(__nusers)
1551 )
1552 );
1553 assert_eq!(
1554 unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize },
1555 16usize,
1556 concat!(
1557 "Offset of field: ",
1558 stringify!(__pthread_mutex_s),
1559 "::",
1560 stringify!(__kind)
1561 )
1562 );
1563 assert_eq!(
1564 unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize },
1565 20usize,
1566 concat!(
1567 "Offset of field: ",
1568 stringify!(__pthread_mutex_s),
1569 "::",
1570 stringify!(__spins)
1571 )
1572 );
1573 assert_eq!(
1574 unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize },
1575 24usize,
1576 concat!(
1577 "Offset of field: ",
1578 stringify!(__pthread_mutex_s),
1579 "::",
1580 stringify!(__list)
1581 )
1582 );
1583}
1584#[repr(C)]
1585#[derive(Debug, Copy, Clone)]
1586pub struct __pthread_rwlock_arch_t {
1587 pub __readers: ::std::os::raw::c_uint,
1588 pub __writers: ::std::os::raw::c_uint,
1589 pub __wrphase_futex: ::std::os::raw::c_uint,
1590 pub __writers_futex: ::std::os::raw::c_uint,
1591 pub __pad3: ::std::os::raw::c_uint,
1592 pub __pad4: ::std::os::raw::c_uint,
1593 pub __cur_writer: ::std::os::raw::c_int,
1594 pub __shared: ::std::os::raw::c_int,
1595 pub __pad1: ::std::os::raw::c_ulong,
1596 pub __pad2: ::std::os::raw::c_ulong,
1597 pub __flags: ::std::os::raw::c_uint,
1598}
1599#[test]
1600fn bindgen_test_layout___pthread_rwlock_arch_t() {
1601 const UNINIT: ::std::mem::MaybeUninit<__pthread_rwlock_arch_t> =
1602 ::std::mem::MaybeUninit::uninit();
1603 let ptr = UNINIT.as_ptr();
1604 assert_eq!(
1605 ::std::mem::size_of::<__pthread_rwlock_arch_t>(),
1606 56usize,
1607 concat!("Size of: ", stringify!(__pthread_rwlock_arch_t))
1608 );
1609 assert_eq!(
1610 ::std::mem::align_of::<__pthread_rwlock_arch_t>(),
1611 8usize,
1612 concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t))
1613 );
1614 assert_eq!(
1615 unsafe { ::std::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize },
1616 0usize,
1617 concat!(
1618 "Offset of field: ",
1619 stringify!(__pthread_rwlock_arch_t),
1620 "::",
1621 stringify!(__readers)
1622 )
1623 );
1624 assert_eq!(
1625 unsafe { ::std::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize },
1626 4usize,
1627 concat!(
1628 "Offset of field: ",
1629 stringify!(__pthread_rwlock_arch_t),
1630 "::",
1631 stringify!(__writers)
1632 )
1633 );
1634 assert_eq!(
1635 unsafe { ::std::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize },
1636 8usize,
1637 concat!(
1638 "Offset of field: ",
1639 stringify!(__pthread_rwlock_arch_t),
1640 "::",
1641 stringify!(__wrphase_futex)
1642 )
1643 );
1644 assert_eq!(
1645 unsafe { ::std::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize },
1646 12usize,
1647 concat!(
1648 "Offset of field: ",
1649 stringify!(__pthread_rwlock_arch_t),
1650 "::",
1651 stringify!(__writers_futex)
1652 )
1653 );
1654 assert_eq!(
1655 unsafe { ::std::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize },
1656 16usize,
1657 concat!(
1658 "Offset of field: ",
1659 stringify!(__pthread_rwlock_arch_t),
1660 "::",
1661 stringify!(__pad3)
1662 )
1663 );
1664 assert_eq!(
1665 unsafe { ::std::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize },
1666 20usize,
1667 concat!(
1668 "Offset of field: ",
1669 stringify!(__pthread_rwlock_arch_t),
1670 "::",
1671 stringify!(__pad4)
1672 )
1673 );
1674 assert_eq!(
1675 unsafe { ::std::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize },
1676 24usize,
1677 concat!(
1678 "Offset of field: ",
1679 stringify!(__pthread_rwlock_arch_t),
1680 "::",
1681 stringify!(__cur_writer)
1682 )
1683 );
1684 assert_eq!(
1685 unsafe { ::std::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize },
1686 28usize,
1687 concat!(
1688 "Offset of field: ",
1689 stringify!(__pthread_rwlock_arch_t),
1690 "::",
1691 stringify!(__shared)
1692 )
1693 );
1694 assert_eq!(
1695 unsafe { ::std::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize },
1696 32usize,
1697 concat!(
1698 "Offset of field: ",
1699 stringify!(__pthread_rwlock_arch_t),
1700 "::",
1701 stringify!(__pad1)
1702 )
1703 );
1704 assert_eq!(
1705 unsafe { ::std::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize },
1706 40usize,
1707 concat!(
1708 "Offset of field: ",
1709 stringify!(__pthread_rwlock_arch_t),
1710 "::",
1711 stringify!(__pad2)
1712 )
1713 );
1714 assert_eq!(
1715 unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize },
1716 48usize,
1717 concat!(
1718 "Offset of field: ",
1719 stringify!(__pthread_rwlock_arch_t),
1720 "::",
1721 stringify!(__flags)
1722 )
1723 );
1724}
1725#[repr(C)]
1726#[derive(Copy, Clone)]
1727pub struct __pthread_cond_s {
1728 pub __bindgen_anon_1: __pthread_cond_s__bindgen_ty_1,
1729 pub __bindgen_anon_2: __pthread_cond_s__bindgen_ty_2,
1730 pub __g_refs: [::std::os::raw::c_uint; 2usize],
1731 pub __g_size: [::std::os::raw::c_uint; 2usize],
1732 pub __g1_orig_size: ::std::os::raw::c_uint,
1733 pub __wrefs: ::std::os::raw::c_uint,
1734 pub __g_signals: [::std::os::raw::c_uint; 2usize],
1735}
1736#[repr(C)]
1737#[derive(Copy, Clone)]
1738pub union __pthread_cond_s__bindgen_ty_1 {
1739 pub __wseq: ::std::os::raw::c_ulonglong,
1740 pub __wseq32: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1,
1741}
1742#[repr(C)]
1743#[derive(Debug, Copy, Clone)]
1744pub struct __pthread_cond_s__bindgen_ty_1__bindgen_ty_1 {
1745 pub __low: ::std::os::raw::c_uint,
1746 pub __high: ::std::os::raw::c_uint,
1747}
1748#[test]
1749fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1__bindgen_ty_1() {
1750 const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1> =
1751 ::std::mem::MaybeUninit::uninit();
1752 let ptr = UNINIT.as_ptr();
1753 assert_eq!(
1754 ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(),
1755 8usize,
1756 concat!(
1757 "Size of: ",
1758 stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1)
1759 )
1760 );
1761 assert_eq!(
1762 ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(),
1763 4usize,
1764 concat!(
1765 "Alignment of ",
1766 stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1)
1767 )
1768 );
1769 assert_eq!(
1770 unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize },
1771 0usize,
1772 concat!(
1773 "Offset of field: ",
1774 stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1),
1775 "::",
1776 stringify!(__low)
1777 )
1778 );
1779 assert_eq!(
1780 unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize },
1781 4usize,
1782 concat!(
1783 "Offset of field: ",
1784 stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1),
1785 "::",
1786 stringify!(__high)
1787 )
1788 );
1789}
1790#[test]
1791fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1() {
1792 const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_1> =
1793 ::std::mem::MaybeUninit::uninit();
1794 let ptr = UNINIT.as_ptr();
1795 assert_eq!(
1796 ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1>(),
1797 8usize,
1798 concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_1))
1799 );
1800 assert_eq!(
1801 ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1>(),
1802 8usize,
1803 concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_1))
1804 );
1805 assert_eq!(
1806 unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize },
1807 0usize,
1808 concat!(
1809 "Offset of field: ",
1810 stringify!(__pthread_cond_s__bindgen_ty_1),
1811 "::",
1812 stringify!(__wseq)
1813 )
1814 );
1815 assert_eq!(
1816 unsafe { ::std::ptr::addr_of!((*ptr).__wseq32) as usize - ptr as usize },
1817 0usize,
1818 concat!(
1819 "Offset of field: ",
1820 stringify!(__pthread_cond_s__bindgen_ty_1),
1821 "::",
1822 stringify!(__wseq32)
1823 )
1824 );
1825}
1826#[repr(C)]
1827#[derive(Copy, Clone)]
1828pub union __pthread_cond_s__bindgen_ty_2 {
1829 pub __g1_start: ::std::os::raw::c_ulonglong,
1830 pub __g1_start32: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1,
1831}
1832#[repr(C)]
1833#[derive(Debug, Copy, Clone)]
1834pub struct __pthread_cond_s__bindgen_ty_2__bindgen_ty_1 {
1835 pub __low: ::std::os::raw::c_uint,
1836 pub __high: ::std::os::raw::c_uint,
1837}
1838#[test]
1839fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2__bindgen_ty_1() {
1840 const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1> =
1841 ::std::mem::MaybeUninit::uninit();
1842 let ptr = UNINIT.as_ptr();
1843 assert_eq!(
1844 ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(),
1845 8usize,
1846 concat!(
1847 "Size of: ",
1848 stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1)
1849 )
1850 );
1851 assert_eq!(
1852 ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(),
1853 4usize,
1854 concat!(
1855 "Alignment of ",
1856 stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1)
1857 )
1858 );
1859 assert_eq!(
1860 unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize },
1861 0usize,
1862 concat!(
1863 "Offset of field: ",
1864 stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1),
1865 "::",
1866 stringify!(__low)
1867 )
1868 );
1869 assert_eq!(
1870 unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize },
1871 4usize,
1872 concat!(
1873 "Offset of field: ",
1874 stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1),
1875 "::",
1876 stringify!(__high)
1877 )
1878 );
1879}
1880#[test]
1881fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2() {
1882 const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s__bindgen_ty_2> =
1883 ::std::mem::MaybeUninit::uninit();
1884 let ptr = UNINIT.as_ptr();
1885 assert_eq!(
1886 ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2>(),
1887 8usize,
1888 concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_2))
1889 );
1890 assert_eq!(
1891 ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2>(),
1892 8usize,
1893 concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_2))
1894 );
1895 assert_eq!(
1896 unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize },
1897 0usize,
1898 concat!(
1899 "Offset of field: ",
1900 stringify!(__pthread_cond_s__bindgen_ty_2),
1901 "::",
1902 stringify!(__g1_start)
1903 )
1904 );
1905 assert_eq!(
1906 unsafe { ::std::ptr::addr_of!((*ptr).__g1_start32) as usize - ptr as usize },
1907 0usize,
1908 concat!(
1909 "Offset of field: ",
1910 stringify!(__pthread_cond_s__bindgen_ty_2),
1911 "::",
1912 stringify!(__g1_start32)
1913 )
1914 );
1915}
1916#[test]
1917fn bindgen_test_layout___pthread_cond_s() {
1918 const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s> = ::std::mem::MaybeUninit::uninit();
1919 let ptr = UNINIT.as_ptr();
1920 assert_eq!(
1921 ::std::mem::size_of::<__pthread_cond_s>(),
1922 48usize,
1923 concat!("Size of: ", stringify!(__pthread_cond_s))
1924 );
1925 assert_eq!(
1926 ::std::mem::align_of::<__pthread_cond_s>(),
1927 8usize,
1928 concat!("Alignment of ", stringify!(__pthread_cond_s))
1929 );
1930 assert_eq!(
1931 unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize },
1932 16usize,
1933 concat!(
1934 "Offset of field: ",
1935 stringify!(__pthread_cond_s),
1936 "::",
1937 stringify!(__g_refs)
1938 )
1939 );
1940 assert_eq!(
1941 unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize },
1942 24usize,
1943 concat!(
1944 "Offset of field: ",
1945 stringify!(__pthread_cond_s),
1946 "::",
1947 stringify!(__g_size)
1948 )
1949 );
1950 assert_eq!(
1951 unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize },
1952 32usize,
1953 concat!(
1954 "Offset of field: ",
1955 stringify!(__pthread_cond_s),
1956 "::",
1957 stringify!(__g1_orig_size)
1958 )
1959 );
1960 assert_eq!(
1961 unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize },
1962 36usize,
1963 concat!(
1964 "Offset of field: ",
1965 stringify!(__pthread_cond_s),
1966 "::",
1967 stringify!(__wrefs)
1968 )
1969 );
1970 assert_eq!(
1971 unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize },
1972 40usize,
1973 concat!(
1974 "Offset of field: ",
1975 stringify!(__pthread_cond_s),
1976 "::",
1977 stringify!(__g_signals)
1978 )
1979 );
1980}
1981pub type pthread_t = ::std::os::raw::c_ulong;
1982#[repr(C)]
1983#[derive(Copy, Clone)]
1984pub union pthread_mutexattr_t {
1985 pub __size: [::std::os::raw::c_char; 8usize],
1986 pub __align: ::std::os::raw::c_int,
1987}
1988#[test]
1989fn bindgen_test_layout_pthread_mutexattr_t() {
1990 const UNINIT: ::std::mem::MaybeUninit<pthread_mutexattr_t> = ::std::mem::MaybeUninit::uninit();
1991 let ptr = UNINIT.as_ptr();
1992 assert_eq!(
1993 ::std::mem::size_of::<pthread_mutexattr_t>(),
1994 8usize,
1995 concat!("Size of: ", stringify!(pthread_mutexattr_t))
1996 );
1997 assert_eq!(
1998 ::std::mem::align_of::<pthread_mutexattr_t>(),
1999 4usize,
2000 concat!("Alignment of ", stringify!(pthread_mutexattr_t))
2001 );
2002 assert_eq!(
2003 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2004 0usize,
2005 concat!(
2006 "Offset of field: ",
2007 stringify!(pthread_mutexattr_t),
2008 "::",
2009 stringify!(__size)
2010 )
2011 );
2012 assert_eq!(
2013 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2014 0usize,
2015 concat!(
2016 "Offset of field: ",
2017 stringify!(pthread_mutexattr_t),
2018 "::",
2019 stringify!(__align)
2020 )
2021 );
2022}
2023#[repr(C)]
2024#[derive(Copy, Clone)]
2025pub union pthread_condattr_t {
2026 pub __size: [::std::os::raw::c_char; 8usize],
2027 pub __align: ::std::os::raw::c_int,
2028}
2029#[test]
2030fn bindgen_test_layout_pthread_condattr_t() {
2031 const UNINIT: ::std::mem::MaybeUninit<pthread_condattr_t> = ::std::mem::MaybeUninit::uninit();
2032 let ptr = UNINIT.as_ptr();
2033 assert_eq!(
2034 ::std::mem::size_of::<pthread_condattr_t>(),
2035 8usize,
2036 concat!("Size of: ", stringify!(pthread_condattr_t))
2037 );
2038 assert_eq!(
2039 ::std::mem::align_of::<pthread_condattr_t>(),
2040 4usize,
2041 concat!("Alignment of ", stringify!(pthread_condattr_t))
2042 );
2043 assert_eq!(
2044 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2045 0usize,
2046 concat!(
2047 "Offset of field: ",
2048 stringify!(pthread_condattr_t),
2049 "::",
2050 stringify!(__size)
2051 )
2052 );
2053 assert_eq!(
2054 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2055 0usize,
2056 concat!(
2057 "Offset of field: ",
2058 stringify!(pthread_condattr_t),
2059 "::",
2060 stringify!(__align)
2061 )
2062 );
2063}
2064pub type pthread_key_t = ::std::os::raw::c_uint;
2065pub type pthread_once_t = ::std::os::raw::c_int;
2066#[repr(C)]
2067#[derive(Copy, Clone)]
2068pub union pthread_attr_t {
2069 pub __size: [::std::os::raw::c_char; 64usize],
2070 pub __align: ::std::os::raw::c_long,
2071}
2072#[test]
2073fn bindgen_test_layout_pthread_attr_t() {
2074 const UNINIT: ::std::mem::MaybeUninit<pthread_attr_t> = ::std::mem::MaybeUninit::uninit();
2075 let ptr = UNINIT.as_ptr();
2076 assert_eq!(
2077 ::std::mem::size_of::<pthread_attr_t>(),
2078 64usize,
2079 concat!("Size of: ", stringify!(pthread_attr_t))
2080 );
2081 assert_eq!(
2082 ::std::mem::align_of::<pthread_attr_t>(),
2083 8usize,
2084 concat!("Alignment of ", stringify!(pthread_attr_t))
2085 );
2086 assert_eq!(
2087 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2088 0usize,
2089 concat!(
2090 "Offset of field: ",
2091 stringify!(pthread_attr_t),
2092 "::",
2093 stringify!(__size)
2094 )
2095 );
2096 assert_eq!(
2097 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2098 0usize,
2099 concat!(
2100 "Offset of field: ",
2101 stringify!(pthread_attr_t),
2102 "::",
2103 stringify!(__align)
2104 )
2105 );
2106}
2107#[repr(C)]
2108#[derive(Copy, Clone)]
2109pub union pthread_mutex_t {
2110 pub __data: __pthread_mutex_s,
2111 pub __size: [::std::os::raw::c_char; 48usize],
2112 pub __align: ::std::os::raw::c_long,
2113}
2114#[test]
2115fn bindgen_test_layout_pthread_mutex_t() {
2116 const UNINIT: ::std::mem::MaybeUninit<pthread_mutex_t> = ::std::mem::MaybeUninit::uninit();
2117 let ptr = UNINIT.as_ptr();
2118 assert_eq!(
2119 ::std::mem::size_of::<pthread_mutex_t>(),
2120 48usize,
2121 concat!("Size of: ", stringify!(pthread_mutex_t))
2122 );
2123 assert_eq!(
2124 ::std::mem::align_of::<pthread_mutex_t>(),
2125 8usize,
2126 concat!("Alignment of ", stringify!(pthread_mutex_t))
2127 );
2128 assert_eq!(
2129 unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize },
2130 0usize,
2131 concat!(
2132 "Offset of field: ",
2133 stringify!(pthread_mutex_t),
2134 "::",
2135 stringify!(__data)
2136 )
2137 );
2138 assert_eq!(
2139 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2140 0usize,
2141 concat!(
2142 "Offset of field: ",
2143 stringify!(pthread_mutex_t),
2144 "::",
2145 stringify!(__size)
2146 )
2147 );
2148 assert_eq!(
2149 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2150 0usize,
2151 concat!(
2152 "Offset of field: ",
2153 stringify!(pthread_mutex_t),
2154 "::",
2155 stringify!(__align)
2156 )
2157 );
2158}
2159#[repr(C)]
2160#[derive(Copy, Clone)]
2161pub union pthread_cond_t {
2162 pub __data: __pthread_cond_s,
2163 pub __size: [::std::os::raw::c_char; 48usize],
2164 pub __align: ::std::os::raw::c_longlong,
2165}
2166#[test]
2167fn bindgen_test_layout_pthread_cond_t() {
2168 const UNINIT: ::std::mem::MaybeUninit<pthread_cond_t> = ::std::mem::MaybeUninit::uninit();
2169 let ptr = UNINIT.as_ptr();
2170 assert_eq!(
2171 ::std::mem::size_of::<pthread_cond_t>(),
2172 48usize,
2173 concat!("Size of: ", stringify!(pthread_cond_t))
2174 );
2175 assert_eq!(
2176 ::std::mem::align_of::<pthread_cond_t>(),
2177 8usize,
2178 concat!("Alignment of ", stringify!(pthread_cond_t))
2179 );
2180 assert_eq!(
2181 unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize },
2182 0usize,
2183 concat!(
2184 "Offset of field: ",
2185 stringify!(pthread_cond_t),
2186 "::",
2187 stringify!(__data)
2188 )
2189 );
2190 assert_eq!(
2191 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2192 0usize,
2193 concat!(
2194 "Offset of field: ",
2195 stringify!(pthread_cond_t),
2196 "::",
2197 stringify!(__size)
2198 )
2199 );
2200 assert_eq!(
2201 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2202 0usize,
2203 concat!(
2204 "Offset of field: ",
2205 stringify!(pthread_cond_t),
2206 "::",
2207 stringify!(__align)
2208 )
2209 );
2210}
2211#[repr(C)]
2212#[derive(Copy, Clone)]
2213pub union pthread_rwlock_t {
2214 pub __data: __pthread_rwlock_arch_t,
2215 pub __size: [::std::os::raw::c_char; 56usize],
2216 pub __align: ::std::os::raw::c_long,
2217}
2218#[test]
2219fn bindgen_test_layout_pthread_rwlock_t() {
2220 const UNINIT: ::std::mem::MaybeUninit<pthread_rwlock_t> = ::std::mem::MaybeUninit::uninit();
2221 let ptr = UNINIT.as_ptr();
2222 assert_eq!(
2223 ::std::mem::size_of::<pthread_rwlock_t>(),
2224 56usize,
2225 concat!("Size of: ", stringify!(pthread_rwlock_t))
2226 );
2227 assert_eq!(
2228 ::std::mem::align_of::<pthread_rwlock_t>(),
2229 8usize,
2230 concat!("Alignment of ", stringify!(pthread_rwlock_t))
2231 );
2232 assert_eq!(
2233 unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize },
2234 0usize,
2235 concat!(
2236 "Offset of field: ",
2237 stringify!(pthread_rwlock_t),
2238 "::",
2239 stringify!(__data)
2240 )
2241 );
2242 assert_eq!(
2243 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2244 0usize,
2245 concat!(
2246 "Offset of field: ",
2247 stringify!(pthread_rwlock_t),
2248 "::",
2249 stringify!(__size)
2250 )
2251 );
2252 assert_eq!(
2253 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2254 0usize,
2255 concat!(
2256 "Offset of field: ",
2257 stringify!(pthread_rwlock_t),
2258 "::",
2259 stringify!(__align)
2260 )
2261 );
2262}
2263#[repr(C)]
2264#[derive(Copy, Clone)]
2265pub union pthread_rwlockattr_t {
2266 pub __size: [::std::os::raw::c_char; 8usize],
2267 pub __align: ::std::os::raw::c_long,
2268}
2269#[test]
2270fn bindgen_test_layout_pthread_rwlockattr_t() {
2271 const UNINIT: ::std::mem::MaybeUninit<pthread_rwlockattr_t> = ::std::mem::MaybeUninit::uninit();
2272 let ptr = UNINIT.as_ptr();
2273 assert_eq!(
2274 ::std::mem::size_of::<pthread_rwlockattr_t>(),
2275 8usize,
2276 concat!("Size of: ", stringify!(pthread_rwlockattr_t))
2277 );
2278 assert_eq!(
2279 ::std::mem::align_of::<pthread_rwlockattr_t>(),
2280 8usize,
2281 concat!("Alignment of ", stringify!(pthread_rwlockattr_t))
2282 );
2283 assert_eq!(
2284 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2285 0usize,
2286 concat!(
2287 "Offset of field: ",
2288 stringify!(pthread_rwlockattr_t),
2289 "::",
2290 stringify!(__size)
2291 )
2292 );
2293 assert_eq!(
2294 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2295 0usize,
2296 concat!(
2297 "Offset of field: ",
2298 stringify!(pthread_rwlockattr_t),
2299 "::",
2300 stringify!(__align)
2301 )
2302 );
2303}
2304pub type pthread_spinlock_t = ::std::os::raw::c_int;
2305#[repr(C)]
2306#[derive(Copy, Clone)]
2307pub union pthread_barrier_t {
2308 pub __size: [::std::os::raw::c_char; 32usize],
2309 pub __align: ::std::os::raw::c_long,
2310}
2311#[test]
2312fn bindgen_test_layout_pthread_barrier_t() {
2313 const UNINIT: ::std::mem::MaybeUninit<pthread_barrier_t> = ::std::mem::MaybeUninit::uninit();
2314 let ptr = UNINIT.as_ptr();
2315 assert_eq!(
2316 ::std::mem::size_of::<pthread_barrier_t>(),
2317 32usize,
2318 concat!("Size of: ", stringify!(pthread_barrier_t))
2319 );
2320 assert_eq!(
2321 ::std::mem::align_of::<pthread_barrier_t>(),
2322 8usize,
2323 concat!("Alignment of ", stringify!(pthread_barrier_t))
2324 );
2325 assert_eq!(
2326 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2327 0usize,
2328 concat!(
2329 "Offset of field: ",
2330 stringify!(pthread_barrier_t),
2331 "::",
2332 stringify!(__size)
2333 )
2334 );
2335 assert_eq!(
2336 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2337 0usize,
2338 concat!(
2339 "Offset of field: ",
2340 stringify!(pthread_barrier_t),
2341 "::",
2342 stringify!(__align)
2343 )
2344 );
2345}
2346#[repr(C)]
2347#[derive(Copy, Clone)]
2348pub union pthread_barrierattr_t {
2349 pub __size: [::std::os::raw::c_char; 8usize],
2350 pub __align: ::std::os::raw::c_int,
2351}
2352#[test]
2353fn bindgen_test_layout_pthread_barrierattr_t() {
2354 const UNINIT: ::std::mem::MaybeUninit<pthread_barrierattr_t> =
2355 ::std::mem::MaybeUninit::uninit();
2356 let ptr = UNINIT.as_ptr();
2357 assert_eq!(
2358 ::std::mem::size_of::<pthread_barrierattr_t>(),
2359 8usize,
2360 concat!("Size of: ", stringify!(pthread_barrierattr_t))
2361 );
2362 assert_eq!(
2363 ::std::mem::align_of::<pthread_barrierattr_t>(),
2364 4usize,
2365 concat!("Alignment of ", stringify!(pthread_barrierattr_t))
2366 );
2367 assert_eq!(
2368 unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
2369 0usize,
2370 concat!(
2371 "Offset of field: ",
2372 stringify!(pthread_barrierattr_t),
2373 "::",
2374 stringify!(__size)
2375 )
2376 );
2377 assert_eq!(
2378 unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
2379 0usize,
2380 concat!(
2381 "Offset of field: ",
2382 stringify!(pthread_barrierattr_t),
2383 "::",
2384 stringify!(__align)
2385 )
2386 );
2387}
2388#[repr(C)]
2389#[derive(Debug, Copy, Clone)]
2390pub struct posix_spawnattr_t {
2391 pub __flags: ::std::os::raw::c_short,
2392 pub __pgrp: pid_t,
2393 pub __sd: sigset_t,
2394 pub __ss: sigset_t,
2395 pub __sp: sched_param,
2396 pub __policy: ::std::os::raw::c_int,
2397 pub __pad: [::std::os::raw::c_int; 16usize],
2398}
2399#[test]
2400fn bindgen_test_layout_posix_spawnattr_t() {
2401 const UNINIT: ::std::mem::MaybeUninit<posix_spawnattr_t> = ::std::mem::MaybeUninit::uninit();
2402 let ptr = UNINIT.as_ptr();
2403 assert_eq!(
2404 ::std::mem::size_of::<posix_spawnattr_t>(),
2405 336usize,
2406 concat!("Size of: ", stringify!(posix_spawnattr_t))
2407 );
2408 assert_eq!(
2409 ::std::mem::align_of::<posix_spawnattr_t>(),
2410 8usize,
2411 concat!("Alignment of ", stringify!(posix_spawnattr_t))
2412 );
2413 assert_eq!(
2414 unsafe { ::std::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize },
2415 0usize,
2416 concat!(
2417 "Offset of field: ",
2418 stringify!(posix_spawnattr_t),
2419 "::",
2420 stringify!(__flags)
2421 )
2422 );
2423 assert_eq!(
2424 unsafe { ::std::ptr::addr_of!((*ptr).__pgrp) as usize - ptr as usize },
2425 4usize,
2426 concat!(
2427 "Offset of field: ",
2428 stringify!(posix_spawnattr_t),
2429 "::",
2430 stringify!(__pgrp)
2431 )
2432 );
2433 assert_eq!(
2434 unsafe { ::std::ptr::addr_of!((*ptr).__sd) as usize - ptr as usize },
2435 8usize,
2436 concat!(
2437 "Offset of field: ",
2438 stringify!(posix_spawnattr_t),
2439 "::",
2440 stringify!(__sd)
2441 )
2442 );
2443 assert_eq!(
2444 unsafe { ::std::ptr::addr_of!((*ptr).__ss) as usize - ptr as usize },
2445 136usize,
2446 concat!(
2447 "Offset of field: ",
2448 stringify!(posix_spawnattr_t),
2449 "::",
2450 stringify!(__ss)
2451 )
2452 );
2453 assert_eq!(
2454 unsafe { ::std::ptr::addr_of!((*ptr).__sp) as usize - ptr as usize },
2455 264usize,
2456 concat!(
2457 "Offset of field: ",
2458 stringify!(posix_spawnattr_t),
2459 "::",
2460 stringify!(__sp)
2461 )
2462 );
2463 assert_eq!(
2464 unsafe { ::std::ptr::addr_of!((*ptr).__policy) as usize - ptr as usize },
2465 268usize,
2466 concat!(
2467 "Offset of field: ",
2468 stringify!(posix_spawnattr_t),
2469 "::",
2470 stringify!(__policy)
2471 )
2472 );
2473 assert_eq!(
2474 unsafe { ::std::ptr::addr_of!((*ptr).__pad) as usize - ptr as usize },
2475 272usize,
2476 concat!(
2477 "Offset of field: ",
2478 stringify!(posix_spawnattr_t),
2479 "::",
2480 stringify!(__pad)
2481 )
2482 );
2483}
2484#[repr(C)]
2485#[derive(Debug, Copy, Clone)]
2486pub struct posix_spawn_file_actions_t {
2487 pub __allocated: ::std::os::raw::c_int,
2488 pub __used: ::std::os::raw::c_int,
2489 pub __actions: *mut __spawn_action,
2490 pub __pad: [::std::os::raw::c_int; 16usize],
2491}
2492#[test]
2493fn bindgen_test_layout_posix_spawn_file_actions_t() {
2494 const UNINIT: ::std::mem::MaybeUninit<posix_spawn_file_actions_t> =
2495 ::std::mem::MaybeUninit::uninit();
2496 let ptr = UNINIT.as_ptr();
2497 assert_eq!(
2498 ::std::mem::size_of::<posix_spawn_file_actions_t>(),
2499 80usize,
2500 concat!("Size of: ", stringify!(posix_spawn_file_actions_t))
2501 );
2502 assert_eq!(
2503 ::std::mem::align_of::<posix_spawn_file_actions_t>(),
2504 8usize,
2505 concat!("Alignment of ", stringify!(posix_spawn_file_actions_t))
2506 );
2507 assert_eq!(
2508 unsafe { ::std::ptr::addr_of!((*ptr).__allocated) as usize - ptr as usize },
2509 0usize,
2510 concat!(
2511 "Offset of field: ",
2512 stringify!(posix_spawn_file_actions_t),
2513 "::",
2514 stringify!(__allocated)
2515 )
2516 );
2517 assert_eq!(
2518 unsafe { ::std::ptr::addr_of!((*ptr).__used) as usize - ptr as usize },
2519 4usize,
2520 concat!(
2521 "Offset of field: ",
2522 stringify!(posix_spawn_file_actions_t),
2523 "::",
2524 stringify!(__used)
2525 )
2526 );
2527 assert_eq!(
2528 unsafe { ::std::ptr::addr_of!((*ptr).__actions) as usize - ptr as usize },
2529 8usize,
2530 concat!(
2531 "Offset of field: ",
2532 stringify!(posix_spawn_file_actions_t),
2533 "::",
2534 stringify!(__actions)
2535 )
2536 );
2537 assert_eq!(
2538 unsafe { ::std::ptr::addr_of!((*ptr).__pad) as usize - ptr as usize },
2539 16usize,
2540 concat!(
2541 "Offset of field: ",
2542 stringify!(posix_spawn_file_actions_t),
2543 "::",
2544 stringify!(__pad)
2545 )
2546 );
2547}
2548extern "C" {
2549 pub fn posix_spawn(
2550 __pid: *mut pid_t,
2551 __path: *const ::std::os::raw::c_char,
2552 __file_actions: *const posix_spawn_file_actions_t,
2553 __attrp: *const posix_spawnattr_t,
2554 __argv: *const *mut ::std::os::raw::c_char,
2555 __envp: *const *mut ::std::os::raw::c_char,
2556 ) -> ::std::os::raw::c_int;
2557}
2558extern "C" {
2559 pub fn posix_spawnp(
2560 __pid: *mut pid_t,
2561 __file: *const ::std::os::raw::c_char,
2562 __file_actions: *const posix_spawn_file_actions_t,
2563 __attrp: *const posix_spawnattr_t,
2564 __argv: *const *mut ::std::os::raw::c_char,
2565 __envp: *const *mut ::std::os::raw::c_char,
2566 ) -> ::std::os::raw::c_int;
2567}
2568extern "C" {
2569 pub fn posix_spawnattr_init(__attr: *mut posix_spawnattr_t) -> ::std::os::raw::c_int;
2570}
2571extern "C" {
2572 pub fn posix_spawnattr_destroy(__attr: *mut posix_spawnattr_t) -> ::std::os::raw::c_int;
2573}
2574extern "C" {
2575 pub fn posix_spawnattr_getsigdefault(
2576 __attr: *const posix_spawnattr_t,
2577 __sigdefault: *mut sigset_t,
2578 ) -> ::std::os::raw::c_int;
2579}
2580extern "C" {
2581 pub fn posix_spawnattr_setsigdefault(
2582 __attr: *mut posix_spawnattr_t,
2583 __sigdefault: *const sigset_t,
2584 ) -> ::std::os::raw::c_int;
2585}
2586extern "C" {
2587 pub fn posix_spawnattr_getsigmask(
2588 __attr: *const posix_spawnattr_t,
2589 __sigmask: *mut sigset_t,
2590 ) -> ::std::os::raw::c_int;
2591}
2592extern "C" {
2593 pub fn posix_spawnattr_setsigmask(
2594 __attr: *mut posix_spawnattr_t,
2595 __sigmask: *const sigset_t,
2596 ) -> ::std::os::raw::c_int;
2597}
2598extern "C" {
2599 pub fn posix_spawnattr_getflags(
2600 __attr: *const posix_spawnattr_t,
2601 __flags: *mut ::std::os::raw::c_short,
2602 ) -> ::std::os::raw::c_int;
2603}
2604extern "C" {
2605 pub fn posix_spawnattr_setflags(
2606 _attr: *mut posix_spawnattr_t,
2607 __flags: ::std::os::raw::c_short,
2608 ) -> ::std::os::raw::c_int;
2609}
2610extern "C" {
2611 pub fn posix_spawnattr_getpgroup(
2612 __attr: *const posix_spawnattr_t,
2613 __pgroup: *mut pid_t,
2614 ) -> ::std::os::raw::c_int;
2615}
2616extern "C" {
2617 pub fn posix_spawnattr_setpgroup(
2618 __attr: *mut posix_spawnattr_t,
2619 __pgroup: pid_t,
2620 ) -> ::std::os::raw::c_int;
2621}
2622extern "C" {
2623 pub fn posix_spawnattr_getschedpolicy(
2624 __attr: *const posix_spawnattr_t,
2625 __schedpolicy: *mut ::std::os::raw::c_int,
2626 ) -> ::std::os::raw::c_int;
2627}
2628extern "C" {
2629 pub fn posix_spawnattr_setschedpolicy(
2630 __attr: *mut posix_spawnattr_t,
2631 __schedpolicy: ::std::os::raw::c_int,
2632 ) -> ::std::os::raw::c_int;
2633}
2634extern "C" {
2635 pub fn posix_spawnattr_getschedparam(
2636 __attr: *const posix_spawnattr_t,
2637 __schedparam: *mut sched_param,
2638 ) -> ::std::os::raw::c_int;
2639}
2640extern "C" {
2641 pub fn posix_spawnattr_setschedparam(
2642 __attr: *mut posix_spawnattr_t,
2643 __schedparam: *const sched_param,
2644 ) -> ::std::os::raw::c_int;
2645}
2646extern "C" {
2647 pub fn posix_spawn_file_actions_init(
2648 __file_actions: *mut posix_spawn_file_actions_t,
2649 ) -> ::std::os::raw::c_int;
2650}
2651extern "C" {
2652 pub fn posix_spawn_file_actions_destroy(
2653 __file_actions: *mut posix_spawn_file_actions_t,
2654 ) -> ::std::os::raw::c_int;
2655}
2656extern "C" {
2657 pub fn posix_spawn_file_actions_addopen(
2658 __file_actions: *mut posix_spawn_file_actions_t,
2659 __fd: ::std::os::raw::c_int,
2660 __path: *const ::std::os::raw::c_char,
2661 __oflag: ::std::os::raw::c_int,
2662 __mode: mode_t,
2663 ) -> ::std::os::raw::c_int;
2664}
2665extern "C" {
2666 pub fn posix_spawn_file_actions_addclose(
2667 __file_actions: *mut posix_spawn_file_actions_t,
2668 __fd: ::std::os::raw::c_int,
2669 ) -> ::std::os::raw::c_int;
2670}
2671extern "C" {
2672 pub fn posix_spawn_file_actions_adddup2(
2673 __file_actions: *mut posix_spawn_file_actions_t,
2674 __fd: ::std::os::raw::c_int,
2675 __newfd: ::std::os::raw::c_int,
2676 ) -> ::std::os::raw::c_int;
2677}
2678extern "C" {
2679 pub fn rtapi_spawn_as_root(
2680 pid: *mut pid_t,
2681 path: *const ::std::os::raw::c_char,
2682 file_actions: *const posix_spawn_file_actions_t,
2683 attrp: *const posix_spawnattr_t,
2684 argv: *const *mut ::std::os::raw::c_char,
2685 envp: *const *mut ::std::os::raw::c_char,
2686 ) -> ::std::os::raw::c_int;
2687}
2688extern "C" {
2689 pub fn rtapi_spawnp_as_root(
2690 pid: *mut pid_t,
2691 path: *const ::std::os::raw::c_char,
2692 file_actions: *const posix_spawn_file_actions_t,
2693 attrp: *const posix_spawnattr_t,
2694 argv: *const *mut ::std::os::raw::c_char,
2695 envp: *const *mut ::std::os::raw::c_char,
2696 ) -> ::std::os::raw::c_int;
2697}
2698extern "C" {
2699 pub fn rtapi_is_kernelspace() -> ::std::os::raw::c_int;
2700}
2701extern "C" {
2702 pub fn rtapi_is_realtime() -> ::std::os::raw::c_int;
2703}
2704extern "C" {
2705 pub fn rtapi_open_as_root(
2706 filename: *const ::std::os::raw::c_char,
2707 mode: ::std::os::raw::c_int,
2708 ) -> ::std::os::raw::c_int;
2709}
2710extern "C" {
2711 pub fn __errno_location() -> *mut ::std::os::raw::c_int;
2712}
2713extern "C" {
2714 #[doc = " 'hal_init()' is called by a HAL component before any other hal"]
2715 #[doc = "function is called, to open the HAL shared memory block and"]
2716 #[doc = "do other initialization."]
2717 #[doc = "'name' is the name of the component. It must be unique in the"]
2718 #[doc = "system. It must be no longer than HAL_NAME_LEN."]
2719 #[doc = "On success, hal_init() returns a positive integer component ID,"]
2720 #[doc = "which is used for subsequent calls to hal_xxx_new() and"]
2721 #[doc = "hal_exit(). On failure, returns an error code (see above)."]
2722 #[doc = "'hal_init()' calls rtapi_init(), so after calling hal_init(), a"]
2723 #[doc = "component can use any rtapi functions. The component ID returned"]
2724 #[doc = "by 'hal_init()' is also the RTAPI module ID for the associated"]
2725 #[doc = "module, and can be used when calling rtapi functions."]
2726 #[doc = "Call only from within user space or init/cleanup code, not from"]
2727 #[doc = "realtime code."]
2728 pub fn hal_init(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
2729}
2730extern "C" {
2731 #[doc = " 'hal_exit()' must be called before a HAL component exits, to"]
2732 #[doc = "free resources associated with the component."]
2733 #[doc = "'comp_id' is the ID of the component as returned from its initial"]
2734 #[doc = "call to 'hal_init()'. 'hal_exit()' will remove the component's"]
2735 #[doc = "realtime functions (if any) from realtime threads. It also"]
2736 #[doc = "removes all pins and parameters exported by the component. If"]
2737 #[doc = "the component created _any_ threads, when it exits _all_ threads"]
2738 #[doc = "will be stopped, and the ones it created will be deleted."]
2739 #[doc = "It is assumed that the system will no longer function correctly"]
2740 #[doc = "after a component is removed, but this cleanup will prevent"]
2741 #[doc = "crashes when the component's code and data is unmapped."]
2742 #[doc = "'hal_exit()' calls 'rtapi_exit()', so any rtapi reaources"]
2743 #[doc = "allocated should be discarded before calling hal_exit(), and"]
2744 #[doc = "rtapi functions should not be called afterwards."]
2745 #[doc = "On success, hal_exit() returns 0, on failure it"]
2746 #[doc = "returns a negative error code."]
2747 pub fn hal_exit(comp_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
2748}
2749extern "C" {
2750 #[doc = " hal_malloc() allocates a block of memory from the main HAL"]
2751 #[doc = "shared memory area. It should be used by all components to"]
2752 #[doc = "allocate memory for HAL pins and parameters."]
2753 #[doc = "It allocates 'size' bytes, and returns a pointer to the"]
2754 #[doc = "allocated space, or NULL (0) on error. The returned pointer"]
2755 #[doc = "will be properly aligned for any variable HAL supports (see"]
2756 #[doc = "HAL_TYPE below.)"]
2757 #[doc = "The allocator is very simple, and there is no 'free'. It is"]
2758 #[doc = "assumed that a component will allocate all the memory it needs"]
2759 #[doc = "during initialization. The entire HAL shared memory area is"]
2760 #[doc = "freed when the last component calls hal_exit(). This means"]
2761 #[doc = "that if you continuously install and remove one component"]
2762 #[doc = "while other components are present, you eventually will fill"]
2763 #[doc = "up the shared memory and an install will fail. Removing"]
2764 #[doc = "all components completely clears memory and you start"]
2765 #[doc = "fresh."]
2766 pub fn hal_malloc(size: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_void;
2767}
2768extern "C" {
2769 #[doc = " hal_ready() indicates that this component is ready. This allows"]
2770 #[doc = "halcmd 'loadusr -W hal_example' to wait until the userspace"]
2771 #[doc = "component 'hal_example' is ready before continuing."]
2772 pub fn hal_ready(comp_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
2773}
2774extern "C" {
2775 #[doc = " hal_unready() indicates that this component is ready. This allows"]
2776 #[doc = "halcmd 'loadusr -W hal_example' to wait until the userspace"]
2777 #[doc = "component 'hal_example' is ready before continuing."]
2778 pub fn hal_unready(comp_id: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
2779}
2780extern "C" {
2781 #[doc = " hal_comp_name() returns the name of the given component, or NULL"]
2782 #[doc = "if comp_id is not a loaded component"]
2783 pub fn hal_comp_name(comp_id: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char;
2784}
2785pub const hal_type_t_HAL_TYPE_UNSPECIFIED: hal_type_t = -1;
2786pub const hal_type_t_HAL_TYPE_UNINITIALIZED: hal_type_t = 0;
2787pub const hal_type_t_HAL_BIT: hal_type_t = 1;
2788pub const hal_type_t_HAL_FLOAT: hal_type_t = 2;
2789pub const hal_type_t_HAL_S32: hal_type_t = 3;
2790pub const hal_type_t_HAL_U32: hal_type_t = 4;
2791pub const hal_type_t_HAL_PORT: hal_type_t = 5;
2792#[doc = " HAL pins and signals are typed, and the HAL only allows pins"]
2793#[doc = "to be attached to signals of the same type."]
2794#[doc = "All HAL types can be read or written atomically. (Read-modify-"]
2795#[doc = "write operations are not atomic.)"]
2796#[doc = "Note that when a component reads or writes one of its pins, it"]
2797#[doc = "is actually reading or writing the signal linked to that pin, by"]
2798#[doc = "way of the pointer."]
2799#[doc = "'hal_type_t' is an enum used to identify the type of a pin, signal,"]
2800#[doc = "or parameter."]
2801pub type hal_type_t = ::std::os::raw::c_int;
2802pub const hal_pin_dir_t_HAL_DIR_UNSPECIFIED: hal_pin_dir_t = -1;
2803pub const hal_pin_dir_t_HAL_IN: hal_pin_dir_t = 16;
2804pub const hal_pin_dir_t_HAL_OUT: hal_pin_dir_t = 32;
2805pub const hal_pin_dir_t_HAL_IO: hal_pin_dir_t = 48;
2806#[doc = " HAL pins have a direction attribute. A pin may be an input to"]
2807#[doc = "the HAL component, an output, or it may be bidirectional."]
2808#[doc = "Any number of HAL_IN or HAL_IO pins may be connected to the same"]
2809#[doc = "signal, but only one HAL_OUT pin is permitted. This is equivalent"]
2810#[doc = "to connecting two output pins together in an electronic circuit."]
2811#[doc = "(HAL_IO pins can be thought of as tri-state outputs.)"]
2812pub type hal_pin_dir_t = ::std::os::raw::c_int;
2813pub const hal_param_dir_t_HAL_RO: hal_param_dir_t = 64;
2814pub const hal_param_dir_t_HAL_RW: hal_param_dir_t = 192;
2815#[doc = " HAL parameters also have a direction attribute. For parameters,"]
2816#[doc = "the attribute determines whether the user can write the value"]
2817#[doc = "of the parameter, or simply read it. HAL_RO parameters are"]
2818#[doc = "read-only, and HAL_RW ones are writable with 'halcmd setp'."]
2819pub type hal_param_dir_t = ::std::os::raw::c_uint;
2820pub type int_least8_t = __int_least8_t;
2821pub type int_least16_t = __int_least16_t;
2822pub type int_least32_t = __int_least32_t;
2823pub type int_least64_t = __int_least64_t;
2824pub type uint_least8_t = __uint_least8_t;
2825pub type uint_least16_t = __uint_least16_t;
2826pub type uint_least32_t = __uint_least32_t;
2827pub type uint_least64_t = __uint_least64_t;
2828pub type int_fast8_t = ::std::os::raw::c_schar;
2829pub type int_fast16_t = ::std::os::raw::c_long;
2830pub type int_fast32_t = ::std::os::raw::c_long;
2831pub type int_fast64_t = ::std::os::raw::c_long;
2832pub type uint_fast8_t = ::std::os::raw::c_uchar;
2833pub type uint_fast16_t = ::std::os::raw::c_ulong;
2834pub type uint_fast32_t = ::std::os::raw::c_ulong;
2835pub type uint_fast64_t = ::std::os::raw::c_ulong;
2836pub type intmax_t = __intmax_t;
2837pub type uintmax_t = __uintmax_t;
2838pub type __gwchar_t = ::std::os::raw::c_uint;
2839#[repr(C)]
2840#[derive(Debug, Copy, Clone)]
2841pub struct imaxdiv_t {
2842 pub quot: ::std::os::raw::c_long,
2843 pub rem: ::std::os::raw::c_long,
2844}
2845#[test]
2846fn bindgen_test_layout_imaxdiv_t() {
2847 const UNINIT: ::std::mem::MaybeUninit<imaxdiv_t> = ::std::mem::MaybeUninit::uninit();
2848 let ptr = UNINIT.as_ptr();
2849 assert_eq!(
2850 ::std::mem::size_of::<imaxdiv_t>(),
2851 16usize,
2852 concat!("Size of: ", stringify!(imaxdiv_t))
2853 );
2854 assert_eq!(
2855 ::std::mem::align_of::<imaxdiv_t>(),
2856 8usize,
2857 concat!("Alignment of ", stringify!(imaxdiv_t))
2858 );
2859 assert_eq!(
2860 unsafe { ::std::ptr::addr_of!((*ptr).quot) as usize - ptr as usize },
2861 0usize,
2862 concat!(
2863 "Offset of field: ",
2864 stringify!(imaxdiv_t),
2865 "::",
2866 stringify!(quot)
2867 )
2868 );
2869 assert_eq!(
2870 unsafe { ::std::ptr::addr_of!((*ptr).rem) as usize - ptr as usize },
2871 8usize,
2872 concat!(
2873 "Offset of field: ",
2874 stringify!(imaxdiv_t),
2875 "::",
2876 stringify!(rem)
2877 )
2878 );
2879}
2880extern "C" {
2881 pub fn imaxabs(__n: intmax_t) -> intmax_t;
2882}
2883extern "C" {
2884 pub fn imaxdiv(__numer: intmax_t, __denom: intmax_t) -> imaxdiv_t;
2885}
2886extern "C" {
2887 pub fn strtoimax(
2888 __nptr: *const ::std::os::raw::c_char,
2889 __endptr: *mut *mut ::std::os::raw::c_char,
2890 __base: ::std::os::raw::c_int,
2891 ) -> intmax_t;
2892}
2893extern "C" {
2894 pub fn strtoumax(
2895 __nptr: *const ::std::os::raw::c_char,
2896 __endptr: *mut *mut ::std::os::raw::c_char,
2897 __base: ::std::os::raw::c_int,
2898 ) -> uintmax_t;
2899}
2900extern "C" {
2901 pub fn wcstoimax(
2902 __nptr: *const __gwchar_t,
2903 __endptr: *mut *mut __gwchar_t,
2904 __base: ::std::os::raw::c_int,
2905 ) -> intmax_t;
2906}
2907extern "C" {
2908 pub fn wcstoumax(
2909 __nptr: *const __gwchar_t,
2910 __endptr: *mut *mut __gwchar_t,
2911 __base: ::std::os::raw::c_int,
2912 ) -> uintmax_t;
2913}
2914pub type rtapi_s8 = i8;
2915pub type rtapi_s16 = i16;
2916pub type rtapi_s32 = i32;
2917pub type rtapi_s64 = i64;
2918pub type rtapi_intptr_t = isize;
2919pub type rtapi_u8 = u8;
2920pub type rtapi_u16 = u16;
2921pub type rtapi_u32 = u32;
2922pub type rtapi_u64 = u64;
2923pub type rtapi_uintptr_t = usize;
2924pub type hal_bit_t = bool;
2925pub type hal_u32_t = rtapi_u32;
2926pub type hal_s32_t = rtapi_s32;
2927pub type hal_port_t = ::std::os::raw::c_int;
2928pub type real_t = f64;
2929pub type ireal_t = rtapi_u64;
2930#[doc = " HAL \"data union\" structure"]
2931#[doc = " This structure may hold any type of hal data"]
2932#[repr(C)]
2933#[derive(Copy, Clone)]
2934pub union hal_data_u {
2935 pub b: hal_bit_t,
2936 pub s: hal_s32_t,
2937 pub u: hal_u32_t,
2938 pub f: real_t,
2939 pub p: hal_port_t,
2940}
2941#[test]
2942fn bindgen_test_layout_hal_data_u() {
2943 const UNINIT: ::std::mem::MaybeUninit<hal_data_u> = ::std::mem::MaybeUninit::uninit();
2944 let ptr = UNINIT.as_ptr();
2945 assert_eq!(
2946 ::std::mem::size_of::<hal_data_u>(),
2947 8usize,
2948 concat!("Size of: ", stringify!(hal_data_u))
2949 );
2950 assert_eq!(
2951 ::std::mem::align_of::<hal_data_u>(),
2952 8usize,
2953 concat!("Alignment of ", stringify!(hal_data_u))
2954 );
2955 assert_eq!(
2956 unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
2957 0usize,
2958 concat!(
2959 "Offset of field: ",
2960 stringify!(hal_data_u),
2961 "::",
2962 stringify!(b)
2963 )
2964 );
2965 assert_eq!(
2966 unsafe { ::std::ptr::addr_of!((*ptr).s) as usize - ptr as usize },
2967 0usize,
2968 concat!(
2969 "Offset of field: ",
2970 stringify!(hal_data_u),
2971 "::",
2972 stringify!(s)
2973 )
2974 );
2975 assert_eq!(
2976 unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize },
2977 0usize,
2978 concat!(
2979 "Offset of field: ",
2980 stringify!(hal_data_u),
2981 "::",
2982 stringify!(u)
2983 )
2984 );
2985 assert_eq!(
2986 unsafe { ::std::ptr::addr_of!((*ptr).f) as usize - ptr as usize },
2987 0usize,
2988 concat!(
2989 "Offset of field: ",
2990 stringify!(hal_data_u),
2991 "::",
2992 stringify!(f)
2993 )
2994 );
2995 assert_eq!(
2996 unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize },
2997 0usize,
2998 concat!(
2999 "Offset of field: ",
3000 stringify!(hal_data_u),
3001 "::",
3002 stringify!(p)
3003 )
3004 );
3005}
3006#[repr(C)]
3007#[derive(Debug)]
3008pub struct hal_port_shm_t {
3009 pub read: ::std::os::raw::c_uint,
3010 pub write: ::std::os::raw::c_uint,
3011 pub size: ::std::os::raw::c_uint,
3012 pub buff: __IncompleteArrayField<::std::os::raw::c_char>,
3013}
3014#[test]
3015fn bindgen_test_layout_hal_port_shm_t() {
3016 const UNINIT: ::std::mem::MaybeUninit<hal_port_shm_t> = ::std::mem::MaybeUninit::uninit();
3017 let ptr = UNINIT.as_ptr();
3018 assert_eq!(
3019 ::std::mem::size_of::<hal_port_shm_t>(),
3020 12usize,
3021 concat!("Size of: ", stringify!(hal_port_shm_t))
3022 );
3023 assert_eq!(
3024 ::std::mem::align_of::<hal_port_shm_t>(),
3025 4usize,
3026 concat!("Alignment of ", stringify!(hal_port_shm_t))
3027 );
3028 assert_eq!(
3029 unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize },
3030 0usize,
3031 concat!(
3032 "Offset of field: ",
3033 stringify!(hal_port_shm_t),
3034 "::",
3035 stringify!(read)
3036 )
3037 );
3038 assert_eq!(
3039 unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize },
3040 4usize,
3041 concat!(
3042 "Offset of field: ",
3043 stringify!(hal_port_shm_t),
3044 "::",
3045 stringify!(write)
3046 )
3047 );
3048 assert_eq!(
3049 unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
3050 8usize,
3051 concat!(
3052 "Offset of field: ",
3053 stringify!(hal_port_shm_t),
3054 "::",
3055 stringify!(size)
3056 )
3057 );
3058 assert_eq!(
3059 unsafe { ::std::ptr::addr_of!((*ptr).buff) as usize - ptr as usize },
3060 12usize,
3061 concat!(
3062 "Offset of field: ",
3063 stringify!(hal_port_shm_t),
3064 "::",
3065 stringify!(buff)
3066 )
3067 );
3068}
3069extern "C" {
3070 #[doc = " \"LOCKING\" FUNCTIONS *"]
3071 #[doc = "locking types defined in hal.h"]
3072 #[doc = "HAL_LOCK_NONE -locks none"]
3073 #[doc = "HAL_LOCK_* - intermediate locking levels"]
3074 #[doc = "HAL_LOCK_ALL - locks everything"]
3075 pub fn hal_set_lock(lock_type: ::std::os::raw::c_uchar) -> ::std::os::raw::c_int;
3076}
3077extern "C" {
3078 #[doc = " The 'hal_get_lock()' function returns the current locking level"]
3079 #[doc = "locking types defined in hal.h"]
3080 #[doc = "HAL_LOCK_NONE -locks none"]
3081 #[doc = "HAL_LOCK_* - intermediate locking levels"]
3082 #[doc = "HAL_LOCK_ALL - locks everything"]
3083 pub fn hal_get_lock() -> ::std::os::raw::c_uchar;
3084}
3085extern "C" {
3086 #[doc = " The 'hal_pin_xxx_new()' functions create a new 'pin' object."]
3087 #[doc = "Once a pin has been created, it can be linked to a signal object"]
3088 #[doc = "using hal_link(). A pin contains a pointer, and the component"]
3089 #[doc = "that owns the pin can dereference the pointer to access whatever"]
3090 #[doc = "signal is linked to the pin. (If no signal is linked, it points"]
3091 #[doc = "to a dummy signal.)"]
3092 #[doc = "There are eight functions, one for each of the data types that"]
3093 #[doc = "the HAL supports. Pins may only be linked to signals of the same"]
3094 #[doc = "type."]
3095 #[doc = "'name' is the name of the new pin. It must be no longer than HAL_NAME_LEN."]
3096 #[doc = "If there is already a pin with the same name the call will fail."]
3097 #[doc = "'dir' is the pin direction. It indicates whether the pin is"]
3098 #[doc = "an input or output from the component."]
3099 #[doc = "'data_ptr_addr' is the address of the pointer that the component"]
3100 #[doc = "will use for the pin. When the pin is linked to a signal, the"]
3101 #[doc = "pointer at 'data_ptr_addr' will be changed to point to the signal"]
3102 #[doc = "data location. 'data_ptr_addr' must point to memory allocated by"]
3103 #[doc = "hal_malloc(). Typically the component allocates space for a data"]
3104 #[doc = "structure with hal_malloc(), and 'data_ptr_addr' is the address"]
3105 #[doc = "of a member of that structure."]
3106 #[doc = "'comp_id' is the ID of the component that will 'own' the"]
3107 #[doc = "variable. Normally it should be the ID of the caller, but in"]
3108 #[doc = "some cases, a user mode component may be doing setup for a"]
3109 #[doc = "realtime component, so the ID should be that of the realtime"]
3110 #[doc = "component that will actually be using the pin."]
3111 #[doc = "If successful, the hal_pin_xxx_new() functions return 0."]
3112 #[doc = "On failure they return a negative error code."]
3113 pub fn hal_pin_bit_new(
3114 name: *const ::std::os::raw::c_char,
3115 dir: hal_pin_dir_t,
3116 data_ptr_addr: *mut *mut hal_bit_t,
3117 comp_id: ::std::os::raw::c_int,
3118 ) -> ::std::os::raw::c_int;
3119}
3120extern "C" {
3121 pub fn hal_pin_float_new(
3122 name: *const ::std::os::raw::c_char,
3123 dir: hal_pin_dir_t,
3124 data_ptr_addr: *mut *mut real_t,
3125 comp_id: ::std::os::raw::c_int,
3126 ) -> ::std::os::raw::c_int;
3127}
3128extern "C" {
3129 pub fn hal_pin_u32_new(
3130 name: *const ::std::os::raw::c_char,
3131 dir: hal_pin_dir_t,
3132 data_ptr_addr: *mut *mut hal_u32_t,
3133 comp_id: ::std::os::raw::c_int,
3134 ) -> ::std::os::raw::c_int;
3135}
3136extern "C" {
3137 pub fn hal_pin_s32_new(
3138 name: *const ::std::os::raw::c_char,
3139 dir: hal_pin_dir_t,
3140 data_ptr_addr: *mut *mut hal_s32_t,
3141 comp_id: ::std::os::raw::c_int,
3142 ) -> ::std::os::raw::c_int;
3143}
3144extern "C" {
3145 pub fn hal_pin_port_new(
3146 name: *const ::std::os::raw::c_char,
3147 dir: hal_pin_dir_t,
3148 data_ptr_addr: *mut *mut hal_port_t,
3149 comp_id: ::std::os::raw::c_int,
3150 ) -> ::std::os::raw::c_int;
3151}
3152extern "C" {
3153 #[doc = " The hal_pin_XXX_newf family of functions are similar to"]
3154 #[doc = "hal_pin_XXX_new except that they also do printf-style formatting to compute"]
3155 #[doc = "the pin name"]
3156 #[doc = "If successful, the hal_pin_xxx_newf() functions return 0."]
3157 #[doc = "On failure they return a negative error code."]
3158 pub fn hal_pin_bit_newf(
3159 dir: hal_pin_dir_t,
3160 data_ptr_addr: *mut *mut hal_bit_t,
3161 comp_id: ::std::os::raw::c_int,
3162 fmt: *const ::std::os::raw::c_char,
3163 ...
3164 ) -> ::std::os::raw::c_int;
3165}
3166extern "C" {
3167 pub fn hal_pin_float_newf(
3168 dir: hal_pin_dir_t,
3169 data_ptr_addr: *mut *mut real_t,
3170 comp_id: ::std::os::raw::c_int,
3171 fmt: *const ::std::os::raw::c_char,
3172 ...
3173 ) -> ::std::os::raw::c_int;
3174}
3175extern "C" {
3176 pub fn hal_pin_u32_newf(
3177 dir: hal_pin_dir_t,
3178 data_ptr_addr: *mut *mut hal_u32_t,
3179 comp_id: ::std::os::raw::c_int,
3180 fmt: *const ::std::os::raw::c_char,
3181 ...
3182 ) -> ::std::os::raw::c_int;
3183}
3184extern "C" {
3185 pub fn hal_pin_s32_newf(
3186 dir: hal_pin_dir_t,
3187 data_ptr_addr: *mut *mut hal_s32_t,
3188 comp_id: ::std::os::raw::c_int,
3189 fmt: *const ::std::os::raw::c_char,
3190 ...
3191 ) -> ::std::os::raw::c_int;
3192}
3193extern "C" {
3194 pub fn hal_pin_port_newf(
3195 dir: hal_pin_dir_t,
3196 data_ptr_addr: *mut *mut hal_port_t,
3197 comp_id: ::std::os::raw::c_int,
3198 fmt: *const ::std::os::raw::c_char,
3199 ...
3200 ) -> ::std::os::raw::c_int;
3201}
3202extern "C" {
3203 #[doc = " 'hal_pin_new()' creates a new 'pin' object. It is a generic"]
3204 #[doc = "version of the eight functions above. It is provided ONLY for"]
3205 #[doc = "those special cases where a generic function is needed. It is"]
3206 #[doc = "STRONGLY recommended that the functions above be used instead,"]
3207 #[doc = "because they check the type of 'data_ptr_addr' against the pin"]
3208 #[doc = "type at compile time. Using this function requires a cast of"]
3209 #[doc = "the 'data_ptr_addr' argument that defeats type checking and can"]
3210 #[doc = "cause subtle bugs."]
3211 #[doc = "'name', 'dir', 'data_ptr_addr' and 'comp_id' are the same as in"]
3212 #[doc = "the functions above."]
3213 #[doc = "'type' is the hal type of the new pin - the type of data that"]
3214 #[doc = "will be passed in/out of the component through the new pin."]
3215 #[doc = "If successful, hal_pin_new() returns 0. On failure"]
3216 #[doc = "it returns a negative error code."]
3217 pub fn hal_pin_new(
3218 name: *const ::std::os::raw::c_char,
3219 type_: hal_type_t,
3220 dir: hal_pin_dir_t,
3221 data_ptr_addr: *mut *mut ::std::os::raw::c_void,
3222 comp_id: ::std::os::raw::c_int,
3223 ) -> ::std::os::raw::c_int;
3224}
3225extern "C" {
3226 #[doc = " 'hal_pin_alias()' assigns an alternate name, aka an alias, to"]
3227 #[doc = "a pin. Once assigned, the pin can be referred to by either its"]
3228 #[doc = "original name or the alias. Calling this function with 'alias'"]
3229 #[doc = "set to NULL will remove any existing alias."]
3230 pub fn hal_pin_alias(
3231 pin_name: *const ::std::os::raw::c_char,
3232 alias: *const ::std::os::raw::c_char,
3233 ) -> ::std::os::raw::c_int;
3234}
3235extern "C" {
3236 #[doc = " 'hal_signal_new()' creates a new signal object. Once a signal has"]
3237 #[doc = "been created, pins can be linked to it with hal_link(). The signal"]
3238 #[doc = "object contains the actual storage for the signal data. Pin objects"]
3239 #[doc = "linked to the signal have pointers that point to the data."]
3240 #[doc = "'name' is the name of the new signal. It must be no longer than"]
3241 #[doc = "HAL_NAME_LEN. If there is already a signal with the same"]
3242 #[doc = "name the call will fail."]
3243 #[doc = "'type' is the data type handled by the signal. Pins can only be"]
3244 #[doc = "linked to a signal of the same type."]
3245 #[doc = "Note that the actual address of the data storage for the signal is"]
3246 #[doc = "not accessible. The data can be accessed only by linking a pin to"]
3247 #[doc = "the signal. Also note that signals, unlike pins, do not have"]
3248 #[doc = "'owners'. Once created, a signal remains in place until either it"]
3249 #[doc = "is deleted, or the last HAL component exits."]
3250 #[doc = "If successful, 'hal_signal_new() returns 0. On failure"]
3251 #[doc = "it returns a negative error code."]
3252 pub fn hal_signal_new(
3253 name: *const ::std::os::raw::c_char,
3254 type_: hal_type_t,
3255 ) -> ::std::os::raw::c_int;
3256}
3257extern "C" {
3258 #[doc = " 'hal_signal_delete()' deletes a signal object. Any pins linked to"]
3259 #[doc = "the object are unlinked."]
3260 #[doc = "'name' is the name of the signal to be deleted."]
3261 #[doc = "If successful, 'hal_signal_delete()' returns 0. On"]
3262 #[doc = "failure, it returns a negative error code."]
3263 pub fn hal_signal_delete(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
3264}
3265extern "C" {
3266 #[doc = " 'hal_link()' links a pin to a signal. 'pin_name' and 'sig_name' are"]
3267 #[doc = "strings containing the pin and signal names. If the pin is already"]
3268 #[doc = "linked to the desired signal, the command succeeds. If the pin is"]
3269 #[doc = "already linked to some other signal, it is an error. In either"]
3270 #[doc = "case, the existing connection is not modified. (Use 'hal_unlink'"]
3271 #[doc = "to break an existing connection.) If the signal already has other"]
3272 #[doc = "pins linked to it, they are unaffected - one signal can be linked"]
3273 #[doc = "to many pins, but a pin can be linked to only one signal."]
3274 #[doc = "On success, hal_link() returns 0, on failure it returns a"]
3275 #[doc = "negative error code."]
3276 pub fn hal_link(
3277 pin_name: *const ::std::os::raw::c_char,
3278 sig_name: *const ::std::os::raw::c_char,
3279 ) -> ::std::os::raw::c_int;
3280}
3281extern "C" {
3282 #[doc = " 'hal_unlink()' unlinks any signal from the specified pin. 'pin_name'"]
3283 #[doc = "is a string containing the pin name."]
3284 #[doc = "On success, hal_unlink() returns 0, on failure it"]
3285 #[doc = "returns a negative error code."]
3286 pub fn hal_unlink(pin_name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
3287}
3288extern "C" {
3289 #[doc = " The 'hal_param_xxx_new()' functions create a new 'parameter' object."]
3290 #[doc = "A parameter is a value that is only used inside a component, but may"]
3291 #[doc = "need to be initialized or adjusted from outside the component to set"]
3292 #[doc = "up the system properly."]
3293 #[doc = "Once a parameter has been created, it's value can be changed using"]
3294 #[doc = "the 'hal_param_xxx_set()' functions."]
3295 #[doc = "There are eight functions, one for each of the data types that"]
3296 #[doc = "the HAL supports. Pins may only be linked to signals of the same"]
3297 #[doc = "type."]
3298 #[doc = "'name' is the name of the new parameter. It must be no longer than"]
3299 #[doc = ".HAL_NAME_LEN. If there is already a parameter with the same"]
3300 #[doc = "name the call will fail."]
3301 #[doc = "'dir' is the parameter direction. HAL_RO parameters are read only from"]
3302 #[doc = "outside, and are written to by the component itself, typically to provide a"]
3303 #[doc = "view \"into\" the component for testing or troubleshooting. HAL_RW"]
3304 #[doc = "parameters are writable from outside and also sometimes modified by the"]
3305 #[doc = "component itself as well."]
3306 #[doc = "'data_addr' is the address where the value of the parameter is to be"]
3307 #[doc = "stored. 'data_addr' must point to memory allocated by hal_malloc()."]
3308 #[doc = "Typically the component allocates space for a data structure with"]
3309 #[doc = "hal_malloc(), and 'data_addr' is the address of a member of that"]
3310 #[doc = "structure. Creating the parameter does not initialize or modify the"]
3311 #[doc = "value at *data_addr - the component should load a reasonable default"]
3312 #[doc = "value."]
3313 #[doc = "'comp_id' is the ID of the component that will 'own' the parameter."]
3314 #[doc = "Normally it should be the ID of the caller, but in some cases, a"]
3315 #[doc = "user mode component may be doing setup for a realtime component, so"]
3316 #[doc = "the ID should be that of the realtime component that will actually"]
3317 #[doc = "be using the parameter."]
3318 #[doc = "If successful, the hal_param_xxx_new() functions return 0."]
3319 #[doc = "On failure they return a negative error code."]
3320 pub fn hal_param_bit_new(
3321 name: *const ::std::os::raw::c_char,
3322 dir: hal_param_dir_t,
3323 data_addr: *mut hal_bit_t,
3324 comp_id: ::std::os::raw::c_int,
3325 ) -> ::std::os::raw::c_int;
3326}
3327extern "C" {
3328 pub fn hal_param_float_new(
3329 name: *const ::std::os::raw::c_char,
3330 dir: hal_param_dir_t,
3331 data_addr: *mut real_t,
3332 comp_id: ::std::os::raw::c_int,
3333 ) -> ::std::os::raw::c_int;
3334}
3335extern "C" {
3336 pub fn hal_param_u32_new(
3337 name: *const ::std::os::raw::c_char,
3338 dir: hal_param_dir_t,
3339 data_addr: *mut hal_u32_t,
3340 comp_id: ::std::os::raw::c_int,
3341 ) -> ::std::os::raw::c_int;
3342}
3343extern "C" {
3344 pub fn hal_param_s32_new(
3345 name: *const ::std::os::raw::c_char,
3346 dir: hal_param_dir_t,
3347 data_addr: *mut hal_s32_t,
3348 comp_id: ::std::os::raw::c_int,
3349 ) -> ::std::os::raw::c_int;
3350}
3351extern "C" {
3352 #[doc = " printf_style-style versions of hal_param_XXX_new"]
3353 pub fn hal_param_bit_newf(
3354 dir: hal_param_dir_t,
3355 data_addr: *mut hal_bit_t,
3356 comp_id: ::std::os::raw::c_int,
3357 fmt: *const ::std::os::raw::c_char,
3358 ...
3359 ) -> ::std::os::raw::c_int;
3360}
3361extern "C" {
3362 pub fn hal_param_float_newf(
3363 dir: hal_param_dir_t,
3364 data_addr: *mut real_t,
3365 comp_id: ::std::os::raw::c_int,
3366 fmt: *const ::std::os::raw::c_char,
3367 ...
3368 ) -> ::std::os::raw::c_int;
3369}
3370extern "C" {
3371 pub fn hal_param_u32_newf(
3372 dir: hal_param_dir_t,
3373 data_addr: *mut hal_u32_t,
3374 comp_id: ::std::os::raw::c_int,
3375 fmt: *const ::std::os::raw::c_char,
3376 ...
3377 ) -> ::std::os::raw::c_int;
3378}
3379extern "C" {
3380 pub fn hal_param_s32_newf(
3381 dir: hal_param_dir_t,
3382 data_addr: *mut hal_s32_t,
3383 comp_id: ::std::os::raw::c_int,
3384 fmt: *const ::std::os::raw::c_char,
3385 ...
3386 ) -> ::std::os::raw::c_int;
3387}
3388extern "C" {
3389 #[doc = " 'hal_param_new()' creates a new 'parameter' object. It is a generic"]
3390 #[doc = "version of the eight functions above. It is provided ONLY for those"]
3391 #[doc = "special cases where a generic function is needed. It is STRONGLY"]
3392 #[doc = "recommended that the functions above be used instead, because they"]
3393 #[doc = "check the type of 'data_addr' against the parameter type at compile"]
3394 #[doc = "time. Using this function requires a cast of the 'data_addr' argument"]
3395 #[doc = "that defeats type checking and can cause subtle bugs."]
3396 #[doc = "'name', 'data_addr' and 'comp_id' are the same as in the"]
3397 #[doc = "functions above."]
3398 #[doc = "'type' is the hal type of the new parameter - the type of data"]
3399 #[doc = "that will be stored in the parameter."]
3400 #[doc = "'dir' is the parameter direction. HAL_RO parameters are read only from"]
3401 #[doc = "outside, and are written to by the component itself, typically to provide a"]
3402 #[doc = "view \"into\" the component for testing or troubleshooting. HAL_RW"]
3403 #[doc = "parameters are writable from outside and also sometimes modified by the"]
3404 #[doc = "component itself as well."]
3405 #[doc = "If successful, hal_param_new() returns 0. On failure"]
3406 #[doc = "it returns a negative error code."]
3407 pub fn hal_param_new(
3408 name: *const ::std::os::raw::c_char,
3409 type_: hal_type_t,
3410 dir: hal_param_dir_t,
3411 data_addr: *mut ::std::os::raw::c_void,
3412 comp_id: ::std::os::raw::c_int,
3413 ) -> ::std::os::raw::c_int;
3414}
3415extern "C" {
3416 #[doc = " The 'hal_param_xxx_set()' functions modify the value of a parameter."]
3417 #[doc = "'name' is the name of the parameter that is to be set. The"]
3418 #[doc = "parameter type must match the function type, and the parameter"]
3419 #[doc = "must not be read-only."]
3420 #[doc = "'value' is the value to be loaded into the parameter."]
3421 #[doc = "On success, the hal_param_xxx_set() functions return 0,"]
3422 #[doc = "and on failure they return a negative error code."]
3423 pub fn hal_param_bit_set(
3424 name: *const ::std::os::raw::c_char,
3425 value: ::std::os::raw::c_int,
3426 ) -> ::std::os::raw::c_int;
3427}
3428extern "C" {
3429 pub fn hal_param_float_set(
3430 name: *const ::std::os::raw::c_char,
3431 value: f64,
3432 ) -> ::std::os::raw::c_int;
3433}
3434extern "C" {
3435 pub fn hal_param_u32_set(
3436 name: *const ::std::os::raw::c_char,
3437 value: ::std::os::raw::c_ulong,
3438 ) -> ::std::os::raw::c_int;
3439}
3440extern "C" {
3441 pub fn hal_param_s32_set(
3442 name: *const ::std::os::raw::c_char,
3443 value: ::std::os::raw::c_long,
3444 ) -> ::std::os::raw::c_int;
3445}
3446extern "C" {
3447 #[doc = " 'hal_param_alias()' assigns an alternate name, aka an alias, to"]
3448 #[doc = "a parameter. Once assigned, the parameter can be referred to by"]
3449 #[doc = "either its original name or the alias. Calling this function"]
3450 #[doc = "with 'alias' set to NULL will remove any existing alias."]
3451 pub fn hal_param_alias(
3452 pin_name: *const ::std::os::raw::c_char,
3453 alias: *const ::std::os::raw::c_char,
3454 ) -> ::std::os::raw::c_int;
3455}
3456extern "C" {
3457 #[doc = " 'hal_param_set()' is a generic function that sets the value of a"]
3458 #[doc = "parameter. It is provided ONLY for those special cases where a"]
3459 #[doc = "generic function is needed. It is STRONGLY recommended that the"]
3460 #[doc = "functions above be used instead, because they are simpler and less"]
3461 #[doc = "prone to errors."]
3462 #[doc = "'name', is the same as in the functions above."]
3463 #[doc = "'type' is the hal type of the the data at *value_addr, and must"]
3464 #[doc = "match the type of the parameter. The parameter must not be"]
3465 #[doc = "read only."]
3466 #[doc = "'value_addr' is a pointer to the new value of the parameter."]
3467 #[doc = "The data at that location will be interpreted according to the"]
3468 #[doc = "type of the parameter."]
3469 #[doc = "If successful, hal_param_set() returns 0. On failure"]
3470 #[doc = "it returns a negative error code."]
3471 pub fn hal_param_set(
3472 name: *const ::std::os::raw::c_char,
3473 type_: hal_type_t,
3474 value_addr: *mut ::std::os::raw::c_void,
3475 ) -> ::std::os::raw::c_int;
3476}
3477extern "C" {
3478 #[doc = " 'hal_get_pin_value_by_name()' gets the value of any arbitrary HAL pin by"]
3479 #[doc = " pin name."]
3480 #[doc = ""]
3481 #[doc = " The 'type' and 'data' args are pointers to the returned values. The function"]
3482 #[doc = " returns 0 if successful, or -1 on error. If 'connected' is non-NULL, its"]
3483 #[doc = " value will be true if a signal is connected."]
3484 pub fn hal_get_pin_value_by_name(
3485 name: *const ::std::os::raw::c_char,
3486 type_: *mut hal_type_t,
3487 data: *mut *mut hal_data_u,
3488 connected: *mut bool,
3489 ) -> ::std::os::raw::c_int;
3490}
3491extern "C" {
3492 #[doc = " 'hal_get_signal_value_by_name()' returns the value of any arbitrary HAL"]
3493 #[doc = " signal by signal name."]
3494 #[doc = ""]
3495 #[doc = " The 'type' and 'data' args are pointers to the returned values. The function"]
3496 #[doc = " returns 0 if successful, or -1 on error. If 'has_writers' is non-NULL, its"]
3497 #[doc = " value will be true if the signal has writers."]
3498 pub fn hal_get_signal_value_by_name(
3499 name: *const ::std::os::raw::c_char,
3500 type_: *mut hal_type_t,
3501 data: *mut *mut hal_data_u,
3502 has_writers: *mut bool,
3503 ) -> ::std::os::raw::c_int;
3504}
3505extern "C" {
3506 #[doc = " 'hal_get_param_value_by_name()' returns the value of any arbitrary HAL"]
3507 #[doc = " parameter by parameter name."]
3508 #[doc = ""]
3509 #[doc = " The 'type' and 'data' args are pointers to the returned values. The function"]
3510 #[doc = " returns 0 if successful, or -1 on error."]
3511 pub fn hal_get_param_value_by_name(
3512 name: *const ::std::os::raw::c_char,
3513 type_: *mut hal_type_t,
3514 data: *mut *mut hal_data_u,
3515 ) -> ::std::os::raw::c_int;
3516}
3517extern "C" {
3518 #[doc = " hal_export_funct() makes a realtime function provided by a"]
3519 #[doc = "component available to the system. A subsequent call to"]
3520 #[doc = "hal_add_funct_to_thread() can be used to schedule the"]
3521 #[doc = "execution of the function as needed by the system."]
3522 #[doc = "'name' is the name of the new function. It must be no longer"]
3523 #[doc = "than HAL_NAME_LEN. This is the name as it would appear in an ini"]
3524 #[doc = "file, which does not need to be the same as the C function name."]
3525 #[doc = "'funct' is a pointer to the function code. 'funct' must be"]
3526 #[doc = "the address of a function that accepts a void pointer and"]
3527 #[doc = "a long int. The pointer will be set to the value 'arg' below,"]
3528 #[doc = "and the long will be set to the thread period in nanoseconds."]
3529 #[doc = "'arg' is a void pointer that will be passed to the function"]
3530 #[doc = "each time it is called. This is useful when one actual"]
3531 #[doc = "C function will be exported several times with different HAL"]
3532 #[doc = "names, perhaps to deal with multiple instances of a hardware"]
3533 #[doc = "device."]
3534 #[doc = "'uses_fp' should be non-zero if the function uses floating"]
3535 #[doc = "point. When in doubt, make it non-zero. If you are sure"]
3536 #[doc = "that the function doesn't use the FPU, then set 'uses_fp'"]
3537 #[doc = "to zero."]
3538 #[doc = "'reentrant' should be zero unless the function (and any"]
3539 #[doc = "hardware it accesses) is completely reentrant. If reentrant"]
3540 #[doc = "is non-zero, the function may be prempted and called again"]
3541 #[doc = "before the first call completes."]
3542 #[doc = "'comp_id' is the ID of the calling component, as returned by"]
3543 #[doc = "a call to hal_init()."]
3544 #[doc = "On success, hal_export_funct() returns 0, on failure"]
3545 #[doc = "it returns a negative error code."]
3546 #[doc = "Call only from realtime init code, not from user space or"]
3547 #[doc = "realtime code."]
3548 pub fn hal_export_funct(
3549 name: *const ::std::os::raw::c_char,
3550 funct: ::std::option::Option<
3551 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_long),
3552 >,
3553 arg: *mut ::std::os::raw::c_void,
3554 uses_fp: ::std::os::raw::c_int,
3555 reentrant: ::std::os::raw::c_int,
3556 comp_id: ::std::os::raw::c_int,
3557 ) -> ::std::os::raw::c_int;
3558}
3559extern "C" {
3560 #[doc = " hal_create_thread() establishes a realtime thread that will"]
3561 #[doc = "execute one or more HAL functions periodically."]
3562 #[doc = "'name' is the name of the thread, which must be unique in"]
3563 #[doc = "the system. It must be no longer than HAL_NAME_LEN."]
3564 #[doc = "'period_nsec' is the desired period of the thread, in nano-"]
3565 #[doc = "seconds. All threads must run at an integer multiple of the"]
3566 #[doc = "fastest thread, and the fastest thread must be created first."]
3567 #[doc = "In general, threads should be created in order, from the"]
3568 #[doc = "fastest to the slowest. HAL assigns decreasing priorities to"]
3569 #[doc = "threads that are created later, so creating them from fastest"]
3570 #[doc = "to slowest results in rate monotonic priority scheduling,"]
3571 #[doc = "usually a good thing."]
3572 #[doc = "'uses_fp' should be non-zero if the thread will call any"]
3573 #[doc = "functions that use floating point. In general, it should"]
3574 #[doc = "be non-zero for most threads, with the possible exception"]
3575 #[doc = "of the very fastest, most critical thread in a system."]
3576 #[doc = "On success, hal_create_thread() returns a positive integer"]
3577 #[doc = "thread ID. On failure, returns an error code as defined"]
3578 #[doc = "above. Call only from realtime init code, not from user"]
3579 #[doc = "space or realtime code."]
3580 pub fn hal_create_thread(
3581 name: *const ::std::os::raw::c_char,
3582 period_nsec: ::std::os::raw::c_ulong,
3583 uses_fp: ::std::os::raw::c_int,
3584 ) -> ::std::os::raw::c_int;
3585}
3586extern "C" {
3587 #[doc = " hal_thread_delete() deletes a realtime thread."]
3588 #[doc = "'name' is the name of the thread, which must have been created"]
3589 #[doc = "by 'hal_create_thread()'."]
3590 #[doc = "On success, hal_thread_delete() returns 0, on"]
3591 #[doc = "failure it returns a negative error code."]
3592 #[doc = "Call only from realtime init code, not from user"]
3593 #[doc = "space or realtime code."]
3594 pub fn hal_thread_delete(name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
3595}
3596extern "C" {
3597 #[doc = " hal_add_funct_to_thread() adds a function exported by a"]
3598 #[doc = "realtime HAL component to a realtime thread. This determines"]
3599 #[doc = "how often and in what order functions are executed."]
3600 #[doc = "'funct_name' is the name of the function, as specified in"]
3601 #[doc = "a call to hal_export_funct()."]
3602 #[doc = "'thread_name' is the name of the thread to which the function"]
3603 #[doc = "should be added. When the thread runs, the functions will"]
3604 #[doc = "be executed in the order in which they were added to the"]
3605 #[doc = "thread."]
3606 #[doc = "'position' is the desired location within the thread. This"]
3607 #[doc = "determines when the function will run, in relation to other"]
3608 #[doc = "functions in the thread. A positive number indicates the"]
3609 #[doc = "desired location as measured from the beginning of the thread,"]
3610 #[doc = "and a negative is measured from the end. So +1 means this"]
3611 #[doc = "function will become the first one to run, +5 means it will"]
3612 #[doc = "be the fifth one to run, -2 means it will be next to last,"]
3613 #[doc = "and -1 means it will be last. Zero is illegal."]
3614 #[doc = "Returns 0, or a negative error code. Call"]
3615 #[doc = "only from within user space or init code, not from"]
3616 #[doc = "realtime code."]
3617 pub fn hal_add_funct_to_thread(
3618 funct_name: *const ::std::os::raw::c_char,
3619 thread_name: *const ::std::os::raw::c_char,
3620 position: ::std::os::raw::c_int,
3621 ) -> ::std::os::raw::c_int;
3622}
3623extern "C" {
3624 #[doc = " hal_del_funct_from_thread() removes a function from a thread."]
3625 #[doc = "'funct_name' is the name of the function, as specified in"]
3626 #[doc = "a call to hal_export_funct()."]
3627 #[doc = "'thread_name' is the name of a thread which currently calls"]
3628 #[doc = "the function."]
3629 #[doc = "Returns 0, or a negative error code. Call"]
3630 #[doc = "only from within user space or init code, not from"]
3631 #[doc = "realtime code."]
3632 pub fn hal_del_funct_from_thread(
3633 funct_name: *const ::std::os::raw::c_char,
3634 thread_name: *const ::std::os::raw::c_char,
3635 ) -> ::std::os::raw::c_int;
3636}
3637extern "C" {
3638 #[doc = " hal_start_threads() starts all threads that have been created."]
3639 #[doc = "This is the point at which realtime functions start being called."]
3640 #[doc = "On success it returns 0, on failure a negative"]
3641 #[doc = "error code."]
3642 pub fn hal_start_threads() -> ::std::os::raw::c_int;
3643}
3644extern "C" {
3645 #[doc = " hal_stop_threads() stops all threads that were previously"]
3646 #[doc = "started by hal_start_threads(). It should be called before"]
3647 #[doc = "any component that is part of a system exits."]
3648 #[doc = "On success it returns 0, on failure a negative"]
3649 #[doc = "error code."]
3650 pub fn hal_stop_threads() -> ::std::os::raw::c_int;
3651}
3652#[doc = " HAL 'constructor' typedef"]
3653#[doc = "If it is not NULL, this points to a function which can construct a new"]
3654#[doc = "instance of its component. Return value is >=0 for success,"]
3655#[doc = "<0 for error."]
3656pub type constructor = ::std::option::Option<
3657 unsafe extern "C" fn(
3658 prefix: *mut ::std::os::raw::c_char,
3659 arg: *mut ::std::os::raw::c_char,
3660 ) -> ::std::os::raw::c_int,
3661>;
3662extern "C" {
3663 #[doc = " hal_set_constructor() sets the constructor function for this component"]
3664 pub fn hal_set_constructor(
3665 comp_id: ::std::os::raw::c_int,
3666 make: constructor,
3667 ) -> ::std::os::raw::c_int;
3668}
3669extern "C" {
3670 #[doc = " hal_port_read reads count bytes from the port into dest."]
3671 #[doc = "This function should only be called by the component that owns"]
3672 #[doc = "the IN PORT pin."]
3673 #[doc = "returns"]
3674 #[doc = "true: count bytes were read into dest"]
3675 #[doc = "false: no bytes were read into dest"]
3676 pub fn hal_port_read(
3677 port: hal_port_t,
3678 dest: *mut ::std::os::raw::c_char,
3679 count: ::std::os::raw::c_uint,
3680 ) -> bool;
3681}
3682extern "C" {
3683 #[doc = " hal_port_peek operates the same as hal_port_read but no bytes are consumed"]
3684 #[doc = "from the input port. Repeated calls to hal_port_peek will return the same data."]
3685 #[doc = "This function should only be called by the component that owns the IN PORT pin."]
3686 #[doc = "returns"]
3687 #[doc = "true: count bytes were read into dest"]
3688 #[doc = "false: no bytes were read into dest"]
3689 pub fn hal_port_peek(
3690 port: hal_port_t,
3691 dest: *mut ::std::os::raw::c_char,
3692 count: ::std::os::raw::c_uint,
3693 ) -> bool;
3694}
3695extern "C" {
3696 #[doc = " hal_port_peek_commit advances the read position in the port buffer"]
3697 #[doc = "by count bytes. A hal_port_peek followed by a hal_port_peek_commit"]
3698 #[doc = "with the same count value would function equivalently to"]
3699 #[doc = "hal_port_read given the same count value. This function should only"]
3700 #[doc = "be called by the component that owns the IN PORT pin."]
3701 #[doc = "returns:"]
3702 #[doc = "true: count readable bytes were skipped and are no longer accessible"]
3703 #[doc = "false: no bytes wer skipped"]
3704 pub fn hal_port_peek_commit(port: hal_port_t, count: ::std::os::raw::c_uint) -> bool;
3705}
3706extern "C" {
3707 #[doc = " hal_port_write writes count bytes from src into the port."]
3708 #[doc = "This function should only be called by the component that owns"]
3709 #[doc = "the OUT PORT pin."]
3710 #[doc = "returns:"]
3711 #[doc = "true: count bytes were written"]
3712 #[doc = "false: no bytes were written into dest"]
3713 pub fn hal_port_write(
3714 port: hal_port_t,
3715 src: *const ::std::os::raw::c_char,
3716 count: ::std::os::raw::c_uint,
3717 ) -> bool;
3718}
3719extern "C" {
3720 #[doc = " hal_port_readable returns the number of bytes available"]
3721 #[doc = "for reading from the port."]
3722 pub fn hal_port_readable(port: hal_port_t) -> ::std::os::raw::c_uint;
3723}
3724extern "C" {
3725 #[doc = " hal_port_writable returns the number of bytes that"]
3726 #[doc = "can be written into the port"]
3727 pub fn hal_port_writable(port: hal_port_t) -> ::std::os::raw::c_uint;
3728}
3729extern "C" {
3730 #[doc = " hal_port_buffer_size returns the total number of bytes"]
3731 #[doc = "that a port can buffer"]
3732 pub fn hal_port_buffer_size(port: hal_port_t) -> ::std::os::raw::c_uint;
3733}
3734extern "C" {
3735 #[doc = " hal_port_clear emptys a given port of all data"]
3736 #[doc = "without consuming any of it."]
3737 #[doc = "hal_port_clear should only be called by a reader"]
3738 pub fn hal_port_clear(port: hal_port_t);
3739}
3740#[repr(C)]
3741#[derive(Copy, Clone)]
3742pub union hal_stream_data {
3743 pub f: real_t,
3744 pub b: bool,
3745 pub s: i32,
3746 pub u: u32,
3747}
3748#[test]
3749fn bindgen_test_layout_hal_stream_data() {
3750 const UNINIT: ::std::mem::MaybeUninit<hal_stream_data> = ::std::mem::MaybeUninit::uninit();
3751 let ptr = UNINIT.as_ptr();
3752 assert_eq!(
3753 ::std::mem::size_of::<hal_stream_data>(),
3754 8usize,
3755 concat!("Size of: ", stringify!(hal_stream_data))
3756 );
3757 assert_eq!(
3758 ::std::mem::align_of::<hal_stream_data>(),
3759 8usize,
3760 concat!("Alignment of ", stringify!(hal_stream_data))
3761 );
3762 assert_eq!(
3763 unsafe { ::std::ptr::addr_of!((*ptr).f) as usize - ptr as usize },
3764 0usize,
3765 concat!(
3766 "Offset of field: ",
3767 stringify!(hal_stream_data),
3768 "::",
3769 stringify!(f)
3770 )
3771 );
3772 assert_eq!(
3773 unsafe { ::std::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
3774 0usize,
3775 concat!(
3776 "Offset of field: ",
3777 stringify!(hal_stream_data),
3778 "::",
3779 stringify!(b)
3780 )
3781 );
3782 assert_eq!(
3783 unsafe { ::std::ptr::addr_of!((*ptr).s) as usize - ptr as usize },
3784 0usize,
3785 concat!(
3786 "Offset of field: ",
3787 stringify!(hal_stream_data),
3788 "::",
3789 stringify!(s)
3790 )
3791 );
3792 assert_eq!(
3793 unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize },
3794 0usize,
3795 concat!(
3796 "Offset of field: ",
3797 stringify!(hal_stream_data),
3798 "::",
3799 stringify!(u)
3800 )
3801 );
3802}
3803#[repr(C)]
3804#[derive(Debug, Copy, Clone)]
3805pub struct hal_stream_t {
3806 pub comp_id: ::std::os::raw::c_int,
3807 pub shmem_id: ::std::os::raw::c_int,
3808 pub fifo: *mut hal_stream_shm,
3809}
3810#[test]
3811fn bindgen_test_layout_hal_stream_t() {
3812 const UNINIT: ::std::mem::MaybeUninit<hal_stream_t> = ::std::mem::MaybeUninit::uninit();
3813 let ptr = UNINIT.as_ptr();
3814 assert_eq!(
3815 ::std::mem::size_of::<hal_stream_t>(),
3816 16usize,
3817 concat!("Size of: ", stringify!(hal_stream_t))
3818 );
3819 assert_eq!(
3820 ::std::mem::align_of::<hal_stream_t>(),
3821 8usize,
3822 concat!("Alignment of ", stringify!(hal_stream_t))
3823 );
3824 assert_eq!(
3825 unsafe { ::std::ptr::addr_of!((*ptr).comp_id) as usize - ptr as usize },
3826 0usize,
3827 concat!(
3828 "Offset of field: ",
3829 stringify!(hal_stream_t),
3830 "::",
3831 stringify!(comp_id)
3832 )
3833 );
3834 assert_eq!(
3835 unsafe { ::std::ptr::addr_of!((*ptr).shmem_id) as usize - ptr as usize },
3836 4usize,
3837 concat!(
3838 "Offset of field: ",
3839 stringify!(hal_stream_t),
3840 "::",
3841 stringify!(shmem_id)
3842 )
3843 );
3844 assert_eq!(
3845 unsafe { ::std::ptr::addr_of!((*ptr).fifo) as usize - ptr as usize },
3846 8usize,
3847 concat!(
3848 "Offset of field: ",
3849 stringify!(hal_stream_t),
3850 "::",
3851 stringify!(fifo)
3852 )
3853 );
3854}
3855extern "C" {
3856 #[doc = " create and attach a stream"]
3857 pub fn hal_stream_create(
3858 stream: *mut hal_stream_t,
3859 comp: ::std::os::raw::c_int,
3860 key: ::std::os::raw::c_int,
3861 depth: ::std::os::raw::c_int,
3862 typestring: *const ::std::os::raw::c_char,
3863 ) -> ::std::os::raw::c_int;
3864}
3865extern "C" {
3866 #[doc = " detach and destroy an open stream"]
3867 pub fn hal_stream_destroy(stream: *mut hal_stream_t);
3868}
3869extern "C" {
3870 #[doc = " attach to an existing stream"]
3871 pub fn hal_stream_attach(
3872 stream: *mut hal_stream_t,
3873 comp: ::std::os::raw::c_int,
3874 key: ::std::os::raw::c_int,
3875 typestring: *const ::std::os::raw::c_char,
3876 ) -> ::std::os::raw::c_int;
3877}
3878extern "C" {
3879 #[doc = " detach from an open stream"]
3880 pub fn hal_stream_detach(stream: *mut hal_stream_t) -> ::std::os::raw::c_int;
3881}
3882extern "C" {
3883 #[doc = " stream introspection"]
3884 pub fn hal_stream_element_count(stream: *mut hal_stream_t) -> ::std::os::raw::c_int;
3885}
3886extern "C" {
3887 pub fn hal_stream_element_type(
3888 stream: *mut hal_stream_t,
3889 idx: ::std::os::raw::c_int,
3890 ) -> hal_type_t;
3891}
3892extern "C" {
3893 pub fn hal_stream_read(
3894 stream: *mut hal_stream_t,
3895 buf: *mut hal_stream_data,
3896 sampleno: *mut ::std::os::raw::c_uint,
3897 ) -> ::std::os::raw::c_int;
3898}
3899extern "C" {
3900 pub fn hal_stream_readable(stream: *mut hal_stream_t) -> bool;
3901}
3902extern "C" {
3903 pub fn hal_stream_depth(stream: *mut hal_stream_t) -> ::std::os::raw::c_int;
3904}
3905extern "C" {
3906 pub fn hal_stream_maxdepth(stream: *mut hal_stream_t) -> ::std::os::raw::c_int;
3907}
3908extern "C" {
3909 pub fn hal_stream_num_underruns(stream: *mut hal_stream_t) -> ::std::os::raw::c_int;
3910}
3911extern "C" {
3912 pub fn hal_stream_num_overruns(stream: *mut hal_stream_t) -> ::std::os::raw::c_int;
3913}
3914extern "C" {
3915 pub fn hal_stream_write(
3916 stream: *mut hal_stream_t,
3917 buf: *mut hal_stream_data,
3918 ) -> ::std::os::raw::c_int;
3919}
3920extern "C" {
3921 pub fn hal_stream_writable(stream: *mut hal_stream_t) -> bool;
3922}
3923#[repr(C)]
3924#[derive(Debug, Copy, Clone)]
3925pub struct __spawn_action {
3926 pub _address: u8,
3927}
3928#[repr(C)]
3929#[derive(Debug, Copy, Clone)]
3930pub struct hal_stream_shm {
3931 pub _address: u8,
3932}