libunwind/
lib.rs

1//! Bindings to libunwind's functions.
2
3#![allow(non_snake_case)]
4#![allow(non_upper_case_globals)]
5#![allow(non_camel_case_types)]
6
7pub const _STDINT_H: u32 = 1;
8pub const _FEATURES_H: u32 = 1;
9pub const _DEFAULT_SOURCE: u32 = 1;
10pub const __GLIBC_USE_ISOC2X: u32 = 0;
11pub const __USE_ISOC11: u32 = 1;
12pub const __USE_ISOC99: u32 = 1;
13pub const __USE_ISOC95: u32 = 1;
14pub const __USE_POSIX_IMPLICITLY: u32 = 1;
15pub const _POSIX_SOURCE: u32 = 1;
16pub const _POSIX_C_SOURCE: u32 = 200809;
17pub const __USE_POSIX: u32 = 1;
18pub const __USE_POSIX2: u32 = 1;
19pub const __USE_POSIX199309: u32 = 1;
20pub const __USE_POSIX199506: u32 = 1;
21pub const __USE_XOPEN2K: u32 = 1;
22pub const __USE_XOPEN2K8: u32 = 1;
23pub const _ATFILE_SOURCE: u32 = 1;
24pub const __WORDSIZE: u32 = 64;
25pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
26pub const __SYSCALL_WORDSIZE: u32 = 64;
27pub const __TIMESIZE: u32 = 64;
28pub const __USE_MISC: u32 = 1;
29pub const __USE_ATFILE: u32 = 1;
30pub const __USE_FORTIFY_LEVEL: u32 = 0;
31pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
32pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
33pub const _STDC_PREDEF_H: u32 = 1;
34pub const __STDC_IEC_559__: u32 = 1;
35pub const __STDC_IEC_60559_BFP__: u32 = 201404;
36pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
37pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
38pub const __STDC_ISO_10646__: u32 = 201706;
39pub const __GNU_LIBRARY__: u32 = 6;
40pub const __GLIBC__: u32 = 2;
41pub const __GLIBC_MINOR__: u32 = 35;
42pub const _SYS_CDEFS_H: u32 = 1;
43pub const __glibc_c99_flexarr_available: u32 = 1;
44pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
45pub const __HAVE_GENERIC_SELECTION: u32 = 1;
46pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
47pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
48pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
49pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
50pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
51pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
52pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
53pub const _BITS_TYPES_H: u32 = 1;
54pub const _BITS_TYPESIZES_H: u32 = 1;
55pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
56pub const __INO_T_MATCHES_INO64_T: u32 = 1;
57pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
58pub const __STATFS_MATCHES_STATFS64: u32 = 1;
59pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
60pub const __FD_SETSIZE: u32 = 1024;
61pub const _BITS_TIME64_H: u32 = 1;
62pub const _BITS_WCHAR_H: u32 = 1;
63pub const _BITS_STDINT_INTN_H: u32 = 1;
64pub const _BITS_STDINT_UINTN_H: u32 = 1;
65pub const INT8_MIN: i32 = -128;
66pub const INT16_MIN: i32 = -32768;
67pub const INT32_MIN: i32 = -2147483648;
68pub const INT8_MAX: u32 = 127;
69pub const INT16_MAX: u32 = 32767;
70pub const INT32_MAX: u32 = 2147483647;
71pub const UINT8_MAX: u32 = 255;
72pub const UINT16_MAX: u32 = 65535;
73pub const UINT32_MAX: u32 = 4294967295;
74pub const INT_LEAST8_MIN: i32 = -128;
75pub const INT_LEAST16_MIN: i32 = -32768;
76pub const INT_LEAST32_MIN: i32 = -2147483648;
77pub const INT_LEAST8_MAX: u32 = 127;
78pub const INT_LEAST16_MAX: u32 = 32767;
79pub const INT_LEAST32_MAX: u32 = 2147483647;
80pub const UINT_LEAST8_MAX: u32 = 255;
81pub const UINT_LEAST16_MAX: u32 = 65535;
82pub const UINT_LEAST32_MAX: u32 = 4294967295;
83pub const INT_FAST8_MIN: i32 = -128;
84pub const INT_FAST16_MIN: i64 = -9223372036854775808;
85pub const INT_FAST32_MIN: i64 = -9223372036854775808;
86pub const INT_FAST8_MAX: u32 = 127;
87pub const INT_FAST16_MAX: u64 = 9223372036854775807;
88pub const INT_FAST32_MAX: u64 = 9223372036854775807;
89pub const UINT_FAST8_MAX: u32 = 255;
90pub const UINT_FAST16_MAX: i32 = -1;
91pub const UINT_FAST32_MAX: i32 = -1;
92pub const INTPTR_MIN: i64 = -9223372036854775808;
93pub const INTPTR_MAX: u64 = 9223372036854775807;
94pub const UINTPTR_MAX: i32 = -1;
95pub const PTRDIFF_MIN: i64 = -9223372036854775808;
96pub const PTRDIFF_MAX: u64 = 9223372036854775807;
97pub const SIG_ATOMIC_MIN: i32 = -2147483648;
98pub const SIG_ATOMIC_MAX: u32 = 2147483647;
99pub const SIZE_MAX: i32 = -1;
100pub const WINT_MIN: u32 = 0;
101pub const WINT_MAX: u32 = 4294967295;
102pub type __u_char = ::std::os::raw::c_uchar;
103pub type __u_short = ::std::os::raw::c_ushort;
104pub type __u_int = ::std::os::raw::c_uint;
105pub type __u_long = ::std::os::raw::c_ulong;
106pub type __int8_t = ::std::os::raw::c_schar;
107pub type __uint8_t = ::std::os::raw::c_uchar;
108pub type __int16_t = ::std::os::raw::c_short;
109pub type __uint16_t = ::std::os::raw::c_ushort;
110pub type __int32_t = ::std::os::raw::c_int;
111pub type __uint32_t = ::std::os::raw::c_uint;
112pub type __int64_t = ::std::os::raw::c_long;
113pub type __uint64_t = ::std::os::raw::c_ulong;
114pub type __int_least8_t = __int8_t;
115pub type __uint_least8_t = __uint8_t;
116pub type __int_least16_t = __int16_t;
117pub type __uint_least16_t = __uint16_t;
118pub type __int_least32_t = __int32_t;
119pub type __uint_least32_t = __uint32_t;
120pub type __int_least64_t = __int64_t;
121pub type __uint_least64_t = __uint64_t;
122pub type __quad_t = ::std::os::raw::c_long;
123pub type __u_quad_t = ::std::os::raw::c_ulong;
124pub type __intmax_t = ::std::os::raw::c_long;
125pub type __uintmax_t = ::std::os::raw::c_ulong;
126pub type __dev_t = ::std::os::raw::c_ulong;
127pub type __uid_t = ::std::os::raw::c_uint;
128pub type __gid_t = ::std::os::raw::c_uint;
129pub type __ino_t = ::std::os::raw::c_ulong;
130pub type __ino64_t = ::std::os::raw::c_ulong;
131pub type __mode_t = ::std::os::raw::c_uint;
132pub type __nlink_t = ::std::os::raw::c_ulong;
133pub type __off_t = ::std::os::raw::c_long;
134pub type __off64_t = ::std::os::raw::c_long;
135pub type __pid_t = ::std::os::raw::c_int;
136#[repr(C)]
137#[derive(Debug, Copy, Clone)]
138pub struct __fsid_t {
139    pub __val: [::std::os::raw::c_int; 2usize],
140}
141#[test]
142fn bindgen_test_layout___fsid_t() {
143    const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit();
144    let ptr = UNINIT.as_ptr();
145    assert_eq!(
146        ::std::mem::size_of::<__fsid_t>(),
147        8usize,
148        concat!("Size of: ", stringify!(__fsid_t))
149    );
150    assert_eq!(
151        ::std::mem::align_of::<__fsid_t>(),
152        4usize,
153        concat!("Alignment of ", stringify!(__fsid_t))
154    );
155    assert_eq!(
156        unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize },
157        0usize,
158        concat!(
159            "Offset of field: ",
160            stringify!(__fsid_t),
161            "::",
162            stringify!(__val)
163        )
164    );
165}
166pub type __clock_t = ::std::os::raw::c_long;
167pub type __rlim_t = ::std::os::raw::c_ulong;
168pub type __rlim64_t = ::std::os::raw::c_ulong;
169pub type __id_t = ::std::os::raw::c_uint;
170pub type __time_t = ::std::os::raw::c_long;
171pub type __useconds_t = ::std::os::raw::c_uint;
172pub type __suseconds_t = ::std::os::raw::c_long;
173pub type __suseconds64_t = ::std::os::raw::c_long;
174pub type __daddr_t = ::std::os::raw::c_int;
175pub type __key_t = ::std::os::raw::c_int;
176pub type __clockid_t = ::std::os::raw::c_int;
177pub type __timer_t = *mut ::std::os::raw::c_void;
178pub type __blksize_t = ::std::os::raw::c_long;
179pub type __blkcnt_t = ::std::os::raw::c_long;
180pub type __blkcnt64_t = ::std::os::raw::c_long;
181pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
182pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
183pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
184pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
185pub type __fsword_t = ::std::os::raw::c_long;
186pub type __ssize_t = ::std::os::raw::c_long;
187pub type __syscall_slong_t = ::std::os::raw::c_long;
188pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
189pub type __loff_t = __off64_t;
190pub type __caddr_t = *mut ::std::os::raw::c_char;
191pub type __intptr_t = ::std::os::raw::c_long;
192pub type __socklen_t = ::std::os::raw::c_uint;
193pub type __sig_atomic_t = ::std::os::raw::c_int;
194pub type int_least8_t = __int_least8_t;
195pub type int_least16_t = __int_least16_t;
196pub type int_least32_t = __int_least32_t;
197pub type int_least64_t = __int_least64_t;
198pub type uint_least8_t = __uint_least8_t;
199pub type uint_least16_t = __uint_least16_t;
200pub type uint_least32_t = __uint_least32_t;
201pub type uint_least64_t = __uint_least64_t;
202pub type int_fast8_t = ::std::os::raw::c_schar;
203pub type int_fast16_t = ::std::os::raw::c_long;
204pub type int_fast32_t = ::std::os::raw::c_long;
205pub type int_fast64_t = ::std::os::raw::c_long;
206pub type uint_fast8_t = ::std::os::raw::c_uchar;
207pub type uint_fast16_t = ::std::os::raw::c_ulong;
208pub type uint_fast32_t = ::std::os::raw::c_ulong;
209pub type uint_fast64_t = ::std::os::raw::c_ulong;
210pub type intmax_t = __intmax_t;
211pub type uintmax_t = __uintmax_t;
212pub type _Unwind_Word = ::std::os::raw::c_ulong;
213pub type _Unwind_Sword = ::std::os::raw::c_long;
214pub type _Unwind_Ptr = usize;
215pub type _Unwind_Internal_Ptr = usize;
216pub type _Unwind_Exception_Class = u64;
217pub type _sleb128_t = isize;
218pub type _uleb128_t = usize;
219#[repr(C)]
220#[derive(Debug, Copy, Clone)]
221pub struct _Unwind_Context {
222    _unused: [u8; 0],
223}
224pub const _Unwind_Reason_Code__URC_NO_REASON: _Unwind_Reason_Code = 0;
225pub const _Unwind_Reason_Code__URC_FOREIGN_EXCEPTION_CAUGHT: _Unwind_Reason_Code = 1;
226pub const _Unwind_Reason_Code__URC_FATAL_PHASE2_ERROR: _Unwind_Reason_Code = 2;
227pub const _Unwind_Reason_Code__URC_FATAL_PHASE1_ERROR: _Unwind_Reason_Code = 3;
228pub const _Unwind_Reason_Code__URC_NORMAL_STOP: _Unwind_Reason_Code = 4;
229pub const _Unwind_Reason_Code__URC_END_OF_STACK: _Unwind_Reason_Code = 5;
230pub const _Unwind_Reason_Code__URC_HANDLER_FOUND: _Unwind_Reason_Code = 6;
231pub const _Unwind_Reason_Code__URC_INSTALL_CONTEXT: _Unwind_Reason_Code = 7;
232pub const _Unwind_Reason_Code__URC_CONTINUE_UNWIND: _Unwind_Reason_Code = 8;
233pub type _Unwind_Reason_Code = ::std::os::raw::c_uint;
234pub const _Unwind_Action__UA_SEARCH_PHASE: _Unwind_Action = 1;
235pub const _Unwind_Action__UA_CLEANUP_PHASE: _Unwind_Action = 2;
236pub const _Unwind_Action__UA_HANDLER_FRAME: _Unwind_Action = 4;
237pub const _Unwind_Action__UA_FORCE_UNWIND: _Unwind_Action = 8;
238pub const _Unwind_Action__UA_END_OF_STACK: _Unwind_Action = 16;
239pub type _Unwind_Action = ::std::os::raw::c_uint;
240pub type _Unwind_Exception_Cleanup_Fn = ::std::option::Option<
241    unsafe extern "C" fn(arg1: _Unwind_Reason_Code, arg2: *mut _Unwind_Exception),
242>;
243#[repr(C)]
244#[repr(align(16))]
245#[derive(Debug, Copy, Clone)]
246pub struct _Unwind_Exception {
247    pub exception_class: _Unwind_Exception_Class,
248    pub exception_cleanup: _Unwind_Exception_Cleanup_Fn,
249    pub private_1: _Unwind_Word,
250    pub private_2: _Unwind_Word,
251}
252#[test]
253fn bindgen_test_layout__Unwind_Exception() {
254    const UNINIT: ::std::mem::MaybeUninit<_Unwind_Exception> = ::std::mem::MaybeUninit::uninit();
255    let ptr = UNINIT.as_ptr();
256    assert_eq!(
257        ::std::mem::size_of::<_Unwind_Exception>(),
258        32usize,
259        concat!("Size of: ", stringify!(_Unwind_Exception))
260    );
261    assert_eq!(
262        ::std::mem::align_of::<_Unwind_Exception>(),
263        16usize,
264        concat!("Alignment of ", stringify!(_Unwind_Exception))
265    );
266    assert_eq!(
267        unsafe { ::std::ptr::addr_of!((*ptr).exception_class) as usize - ptr as usize },
268        0usize,
269        concat!(
270            "Offset of field: ",
271            stringify!(_Unwind_Exception),
272            "::",
273            stringify!(exception_class)
274        )
275    );
276    assert_eq!(
277        unsafe { ::std::ptr::addr_of!((*ptr).exception_cleanup) as usize - ptr as usize },
278        8usize,
279        concat!(
280            "Offset of field: ",
281            stringify!(_Unwind_Exception),
282            "::",
283            stringify!(exception_cleanup)
284        )
285    );
286    assert_eq!(
287        unsafe { ::std::ptr::addr_of!((*ptr).private_1) as usize - ptr as usize },
288        16usize,
289        concat!(
290            "Offset of field: ",
291            stringify!(_Unwind_Exception),
292            "::",
293            stringify!(private_1)
294        )
295    );
296    assert_eq!(
297        unsafe { ::std::ptr::addr_of!((*ptr).private_2) as usize - ptr as usize },
298        24usize,
299        concat!(
300            "Offset of field: ",
301            stringify!(_Unwind_Exception),
302            "::",
303            stringify!(private_2)
304        )
305    );
306}
307pub type _Unwind_Stop_Fn = ::std::option::Option<
308    unsafe extern "C" fn(
309        arg1: ::std::os::raw::c_int,
310        arg2: _Unwind_Action,
311        arg3: _Unwind_Exception_Class,
312        arg4: *mut _Unwind_Exception,
313        arg5: *mut _Unwind_Context,
314        arg6: *mut ::std::os::raw::c_void,
315    ) -> _Unwind_Reason_Code,
316>;
317pub type _Unwind_Personality_Fn = ::std::option::Option<
318    unsafe extern "C" fn(
319        arg1: ::std::os::raw::c_int,
320        arg2: _Unwind_Action,
321        arg3: _Unwind_Exception_Class,
322        arg4: *mut _Unwind_Exception,
323        arg5: *mut _Unwind_Context,
324    ) -> _Unwind_Reason_Code,
325>;
326pub type __personality_routine = _Unwind_Personality_Fn;
327pub type _Unwind_Trace_Fn = ::std::option::Option<
328    unsafe extern "C" fn(
329        arg1: *mut _Unwind_Context,
330        arg2: *mut ::std::os::raw::c_void,
331    ) -> _Unwind_Reason_Code,
332>;
333extern "C" {
334    pub fn _Unwind_GetGR(arg1: *mut _Unwind_Context, arg2: ::std::os::raw::c_int) -> _Unwind_Word;
335}
336extern "C" {
337    pub fn _Unwind_SetGR(
338        arg1: *mut _Unwind_Context,
339        arg2: ::std::os::raw::c_int,
340        arg3: _Unwind_Word,
341    );
342}
343extern "C" {
344    pub fn _Unwind_GetIP(arg1: *mut _Unwind_Context) -> _Unwind_Word;
345}
346extern "C" {
347    pub fn _Unwind_SetIP(arg1: *mut _Unwind_Context, arg2: _Unwind_Word);
348}
349extern "C" {
350    pub fn _Unwind_GetIPInfo(
351        arg1: *mut _Unwind_Context,
352        arg2: *mut ::std::os::raw::c_int,
353    ) -> _Unwind_Word;
354}
355extern "C" {
356    pub fn _Unwind_GetCFA(arg1: *mut _Unwind_Context) -> _Unwind_Word;
357}
358extern "C" {
359    pub fn _Unwind_GetBSP(arg1: *mut _Unwind_Context) -> _Unwind_Word;
360}
361extern "C" {
362    pub fn _Unwind_GetLanguageSpecificData(
363        arg1: *mut _Unwind_Context,
364    ) -> *mut ::std::os::raw::c_void;
365}
366extern "C" {
367    pub fn _Unwind_GetRegionStart(arg1: *mut _Unwind_Context) -> _Unwind_Ptr;
368}
369extern "C" {
370    pub fn _Unwind_RaiseException(arg1: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
371}
372extern "C" {
373    pub fn _Unwind_ForcedUnwind(
374        arg1: *mut _Unwind_Exception,
375        arg2: _Unwind_Stop_Fn,
376        arg3: *mut ::std::os::raw::c_void,
377    ) -> _Unwind_Reason_Code;
378}
379extern "C" {
380    pub fn _Unwind_DeleteException(arg1: *mut _Unwind_Exception);
381}
382extern "C" {
383    pub fn _Unwind_Resume(arg1: *mut _Unwind_Exception);
384}
385extern "C" {
386    pub fn _Unwind_Resume_or_Rethrow(arg1: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
387}
388extern "C" {
389    pub fn _Unwind_Backtrace(
390        arg1: _Unwind_Trace_Fn,
391        arg2: *mut ::std::os::raw::c_void,
392    ) -> _Unwind_Reason_Code;
393}
394#[repr(C)]
395#[derive(Debug, Copy, Clone)]
396pub struct SjLj_Function_Context {
397    _unused: [u8; 0],
398}
399pub type _Unwind_FunctionContext_t = *mut SjLj_Function_Context;
400extern "C" {
401    pub fn _Unwind_SjLj_Register(arg1: _Unwind_FunctionContext_t);
402}
403extern "C" {
404    pub fn _Unwind_SjLj_Unregister(arg1: _Unwind_FunctionContext_t);
405}
406extern "C" {
407    pub fn _Unwind_SjLj_RaiseException(arg1: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
408}
409extern "C" {
410    pub fn _Unwind_SjLj_ForcedUnwind(
411        arg1: *mut _Unwind_Exception,
412        arg2: _Unwind_Stop_Fn,
413        arg3: *mut ::std::os::raw::c_void,
414    ) -> _Unwind_Reason_Code;
415}
416extern "C" {
417    pub fn _Unwind_SjLj_Resume(arg1: *mut _Unwind_Exception);
418}
419extern "C" {
420    pub fn _Unwind_SjLj_Resume_or_Rethrow(arg1: *mut _Unwind_Exception) -> _Unwind_Reason_Code;
421}
422extern "C" {
423    pub fn _Unwind_FindEnclosingFunction(
424        arg1: *mut ::std::os::raw::c_void,
425    ) -> *mut ::std::os::raw::c_void;
426}
427extern "C" {
428    pub fn _Unwind_GetDataRelBase(arg1: *mut _Unwind_Context) -> _Unwind_Ptr;
429}
430extern "C" {
431    pub fn _Unwind_GetTextRelBase(arg1: *mut _Unwind_Context) -> _Unwind_Ptr;
432}