linenoise/ffi.rs
1#![allow(non_snake_case)]
2#![allow(non_camel_case_types)]
3extern crate libc;
4
5// pub type tcflag_t = libc::c_ulong;
6// pub type cc_t = libc::c_uchar;
7// pub type speed_t = libc::c_ulong;
8// #[repr(C)]
9// pub struct Struct_termios {
10// pub c_iflag: tcflag_t,
11// pub c_oflag: tcflag_t,
12// pub c_cflag: tcflag_t,
13// pub c_lflag: tcflag_t,
14// pub c_cc: [cc_t, ..20u],
15// pub c_ispeed: speed_t,
16// pub c_ospeed: speed_t,
17// }
18pub type __int8_t = libc::c_char;
19pub type __uint8_t = libc::c_uchar;
20pub type __int16_t = libc::c_short;
21pub type __uint16_t = libc::c_ushort;
22pub type __int32_t = libc::c_int;
23pub type __uint32_t = libc::c_uint;
24pub type __int64_t = libc::c_longlong;
25pub type __uint64_t = libc::c_ulonglong;
26pub type __darwin_intptr_t = libc::c_long;
27pub type __darwin_natural_t = libc::c_uint;
28pub type __darwin_ct_rune_t = libc::c_int;
29// #[repr(C)]
30// pub struct Union_Unnamed1 {
31// pub data: [u64, ..16u],
32// }
33// impl Union_Unnamed1 {
34// pub fn __mbstate8(&mut self) -> *mut [libc::c_char, ..128u] {
35// unsafe { ::std::mem::transmute(self) }
36// }
37// pub fn _mbstateL(&mut self) -> *mut libc::c_longlong {
38// unsafe { ::std::mem::transmute(self) }
39// }
40// }
41// pub type __mbstate_t = Union_Unnamed1;
42// pub type __darwin_mbstate_t = __mbstate_t;
43pub type __darwin_ptrdiff_t = libc::c_long;
44pub type __darwin_wchar_t = libc::c_int;
45pub type __darwin_rune_t = __darwin_wchar_t;
46pub type __darwin_wint_t = libc::c_int;
47pub type __darwin_clock_t = libc::c_ulong;
48pub type __darwin_socklen_t = __uint32_t;
49pub type __darwin_ssize_t = libc::c_long;
50pub type __darwin_time_t = libc::c_long;
51pub type __darwin_blkcnt_t = __int64_t;
52pub type __darwin_blksize_t = __int32_t;
53pub type __darwin_dev_t = __int32_t;
54pub type __darwin_fsblkcnt_t = libc::c_uint;
55pub type __darwin_fsfilcnt_t = libc::c_uint;
56pub type __darwin_gid_t = __uint32_t;
57pub type __darwin_id_t = __uint32_t;
58pub type __darwin_ino64_t = __uint64_t;
59pub type __darwin_ino_t = __darwin_ino64_t;
60pub type __darwin_mach_port_name_t = __darwin_natural_t;
61pub type __darwin_mach_port_t = __darwin_mach_port_name_t;
62pub type __darwin_mode_t = __uint16_t;
63pub type __darwin_off_t = __int64_t;
64pub type __darwin_pid_t = __int32_t;
65pub type __darwin_sigset_t = __uint32_t;
66pub type __darwin_suseconds_t = __int32_t;
67pub type __darwin_uid_t = __uint32_t;
68pub type __darwin_useconds_t = __uint32_t;
69// #[repr(C)]
70// pub struct Struct___darwin_pthread_handler_rec {
71// pub __routine: ::std::option::Option<extern "C" fn
72// (arg1: *mut libc::c_void)>,
73// pub __arg: *mut libc::c_void,
74// pub __next: *mut Struct___darwin_pthread_handler_rec,
75// }
76// #[repr(C)]
77// pub struct Struct__opaque_pthread_attr_t {
78// pub __sig: libc::c_long,
79// pub __opaque: [libc::c_char, ..56u],
80// }
81// #[repr(C)]
82// pub struct Struct__opaque_pthread_cond_t {
83// pub __sig: libc::c_long,
84// pub __opaque: [libc::c_char, ..40u],
85// }
86// #[repr(C)]
87// pub struct Struct__opaque_pthread_condattr_t {
88// pub __sig: libc::c_long,
89// pub __opaque: [libc::c_char, ..8u],
90// }
91// #[repr(C)]
92// pub struct Struct__opaque_pthread_mutex_t {
93// pub __sig: libc::c_long,
94// pub __opaque: [libc::c_char, ..56u],
95// }
96// #[repr(C)]
97// pub struct Struct__opaque_pthread_mutexattr_t {
98// pub __sig: libc::c_long,
99// pub __opaque: [libc::c_char, ..8u],
100// }
101// #[repr(C)]
102// pub struct Struct__opaque_pthread_once_t {
103// pub __sig: libc::c_long,
104// pub __opaque: [libc::c_char, ..8u],
105// }
106// #[repr(C)]
107// pub struct Struct__opaque_pthread_rwlock_t {
108// pub __sig: libc::c_long,
109// pub __opaque: [libc::c_char, ..192u],
110// }
111// #[repr(C)]
112// pub struct Struct__opaque_pthread_rwlockattr_t {
113// pub __sig: libc::c_long,
114// pub __opaque: [libc::c_char, ..16u],
115// }
116// #[repr(C)]
117// pub struct Struct__opaque_pthread_t {
118// pub __sig: libc::c_long,
119// pub __cleanup_stack: *mut Struct___darwin_pthread_handler_rec,
120// pub __opaque: [libc::c_char, ..8176u],
121// }
122// pub type __darwin_pthread_attr_t = Struct__opaque_pthread_attr_t;
123// pub type __darwin_pthread_cond_t = Struct__opaque_pthread_cond_t;
124// pub type __darwin_pthread_condattr_t = Struct__opaque_pthread_condattr_t;
125// pub type __darwin_pthread_key_t = libc::c_ulong;
126// pub type __darwin_pthread_mutex_t = Struct__opaque_pthread_mutex_t;
127// pub type __darwin_pthread_mutexattr_t = Struct__opaque_pthread_mutexattr_t;
128// pub type __darwin_pthread_once_t = Struct__opaque_pthread_once_t;
129// pub type __darwin_pthread_rwlock_t = Struct__opaque_pthread_rwlock_t;
130// pub type __darwin_pthread_rwlockattr_t = Struct__opaque_pthread_rwlockattr_t;
131// pub type __darwin_pthread_t = *mut Struct__opaque_pthread_t;
132// #[repr(C)]
133// pub struct Struct_winsize {
134// pub ws_row: libc::c_ushort,
135// pub ws_col: libc::c_ushort,
136// pub ws_xpixel: libc::c_ushort,
137// pub ws_ypixel: libc::c_ushort,
138// }
139// pub type __darwin_nl_item = libc::c_int;
140// pub type __darwin_wctrans_t = libc::c_int;
141// pub type __darwin_wctype_t = __uint32_t;
142// pub type pid_t = __darwin_pid_t;
143// #[repr(C)]
144// pub struct Struct_accessx_descriptor {
145// pub ad_name_offset: libc::c_uint,
146// pub ad_flags: libc::c_int,
147// pub ad_pad: [libc::c_int, ..2u],
148// }
149pub type uint64_t = libc::c_ulonglong;
150// pub type ssize_t = __darwin_ssize_t;
151// pub type uid_t = __darwin_uid_t;
152// pub type gid_t = __darwin_gid_t;
153// pub type intptr_t = __darwin_intptr_t;
154// pub type off_t = __darwin_off_t;
155// pub type useconds_t = __darwin_useconds_t;
156// #[repr(C)]
157// pub struct Struct_fd_set {
158// pub fds_bits: [__int32_t, ..32u],
159// }
160// pub type fd_set = Struct_fd_set;
161// #[repr(C)]
162// pub struct Struct_timespec {
163// pub tv_sec: __darwin_time_t,
164// pub tv_nsec: libc::c_long,
165// }
166// #[repr(C)]
167// pub struct Struct_timeval {
168// pub tv_sec: __darwin_time_t,
169// pub tv_usec: __darwin_suseconds_t,
170// }
171// pub type time_t = __darwin_time_t;
172// pub type suseconds_t = __darwin_suseconds_t;
173// pub type sigset_t = __darwin_sigset_t;
174// pub type dev_t = __darwin_dev_t;
175// pub type mode_t = __darwin_mode_t;
176// pub type uuid_t = __darwin_uuid_t;
177// pub enum Struct_fssearchblock { }
178// pub enum Struct_searchstate { }
179// pub type Enum_Unnamed2 = libc::c_uint;
180// pub const P_ALL: libc::c_uint = 0;
181// pub const P_PID: libc::c_uint = 1;
182// pub const P_PGID: libc::c_uint = 2;
183// pub type idtype_t = Enum_Unnamed2;
184// pub type id_t = __darwin_id_t;
185// pub type sig_atomic_t = libc::c_int;
186// #[repr(C)]
187// pub struct Struct___darwin_i386_thread_state {
188// pub __eax: libc::c_uint,
189// pub __ebx: libc::c_uint,
190// pub __ecx: libc::c_uint,
191// pub __edx: libc::c_uint,
192// pub __edi: libc::c_uint,
193// pub __esi: libc::c_uint,
194// pub __ebp: libc::c_uint,
195// pub __esp: libc::c_uint,
196// pub __ss: libc::c_uint,
197// pub __eflags: libc::c_uint,
198// pub __eip: libc::c_uint,
199// pub __cs: libc::c_uint,
200// pub __ds: libc::c_uint,
201// pub __es: libc::c_uint,
202// pub __fs: libc::c_uint,
203// pub __gs: libc::c_uint,
204// }
205// #[repr(C)]
206// pub struct Struct___darwin_fp_control {
207// pub __invalid: libc::c_ushort,
208// pub __denorm: libc::c_ushort,
209// pub __zdiv: libc::c_ushort,
210// pub __ovrfl: libc::c_ushort,
211// pub __undfl: libc::c_ushort,
212// pub __precis: libc::c_ushort,
213// pub unnamed_field1: libc::c_ushort,
214// pub __pc: libc::c_ushort,
215// pub __rc: libc::c_ushort,
216// pub unnamed_field2: libc::c_ushort,
217// pub unnamed_field3: libc::c_ushort,
218// }
219// pub type __darwin_fp_control_t = Struct___darwin_fp_control;
220// #[repr(C)]
221// pub struct Struct___darwin_fp_status {
222// pub __invalid: libc::c_ushort,
223// pub __denorm: libc::c_ushort,
224// pub __zdiv: libc::c_ushort,
225// pub __ovrfl: libc::c_ushort,
226// pub __undfl: libc::c_ushort,
227// pub __precis: libc::c_ushort,
228// pub __stkflt: libc::c_ushort,
229// pub __errsumm: libc::c_ushort,
230// pub __c0: libc::c_ushort,
231// pub __c1: libc::c_ushort,
232// pub __c2: libc::c_ushort,
233// pub __tos: libc::c_ushort,
234// pub __c3: libc::c_ushort,
235// pub __busy: libc::c_ushort,
236// }
237// pub type __darwin_fp_status_t = Struct___darwin_fp_status;
238// #[repr(C)]
239// pub struct Struct___darwin_mmst_reg {
240// pub __mmst_reg: [libc::c_char, ..10u],
241// pub __mmst_rsrv: [libc::c_char, ..6u],
242// }
243// #[repr(C)]
244// pub struct Struct___darwin_xmm_reg {
245// pub __xmm_reg: [libc::c_char, ..16u],
246// }
247// #[repr(C)]
248// pub struct Struct___darwin_i386_float_state {
249// pub __fpu_reserved: [libc::c_int, ..2u],
250// pub __fpu_fcw: Struct___darwin_fp_control,
251// pub __fpu_fsw: Struct___darwin_fp_status,
252// pub __fpu_ftw: __uint8_t,
253// pub __fpu_rsrv1: __uint8_t,
254// pub __fpu_fop: __uint16_t,
255// pub __fpu_ip: __uint32_t,
256// pub __fpu_cs: __uint16_t,
257// pub __fpu_rsrv2: __uint16_t,
258// pub __fpu_dp: __uint32_t,
259// pub __fpu_ds: __uint16_t,
260// pub __fpu_rsrv3: __uint16_t,
261// pub __fpu_mxcsr: __uint32_t,
262// pub __fpu_mxcsrmask: __uint32_t,
263// pub __fpu_stmm0: Struct___darwin_mmst_reg,
264// pub __fpu_stmm1: Struct___darwin_mmst_reg,
265// pub __fpu_stmm2: Struct___darwin_mmst_reg,
266// pub __fpu_stmm3: Struct___darwin_mmst_reg,
267// pub __fpu_stmm4: Struct___darwin_mmst_reg,
268// pub __fpu_stmm5: Struct___darwin_mmst_reg,
269// pub __fpu_stmm6: Struct___darwin_mmst_reg,
270// pub __fpu_stmm7: Struct___darwin_mmst_reg,
271// pub __fpu_xmm0: Struct___darwin_xmm_reg,
272// pub __fpu_xmm1: Struct___darwin_xmm_reg,
273// pub __fpu_xmm2: Struct___darwin_xmm_reg,
274// pub __fpu_xmm3: Struct___darwin_xmm_reg,
275// pub __fpu_xmm4: Struct___darwin_xmm_reg,
276// pub __fpu_xmm5: Struct___darwin_xmm_reg,
277// pub __fpu_xmm6: Struct___darwin_xmm_reg,
278// pub __fpu_xmm7: Struct___darwin_xmm_reg,
279// pub __fpu_rsrv4: [libc::c_char, ..224u],
280// pub __fpu_reserved1: libc::c_int,
281// }
282// #[repr(C)]
283// pub struct Struct___darwin_i386_avx_state {
284// pub __fpu_reserved: [libc::c_int, ..2u],
285// pub __fpu_fcw: Struct___darwin_fp_control,
286// pub __fpu_fsw: Struct___darwin_fp_status,
287// pub __fpu_ftw: __uint8_t,
288// pub __fpu_rsrv1: __uint8_t,
289// pub __fpu_fop: __uint16_t,
290// pub __fpu_ip: __uint32_t,
291// pub __fpu_cs: __uint16_t,
292// pub __fpu_rsrv2: __uint16_t,
293// pub __fpu_dp: __uint32_t,
294// pub __fpu_ds: __uint16_t,
295// pub __fpu_rsrv3: __uint16_t,
296// pub __fpu_mxcsr: __uint32_t,
297// pub __fpu_mxcsrmask: __uint32_t,
298// pub __fpu_stmm0: Struct___darwin_mmst_reg,
299// pub __fpu_stmm1: Struct___darwin_mmst_reg,
300// pub __fpu_stmm2: Struct___darwin_mmst_reg,
301// pub __fpu_stmm3: Struct___darwin_mmst_reg,
302// pub __fpu_stmm4: Struct___darwin_mmst_reg,
303// pub __fpu_stmm5: Struct___darwin_mmst_reg,
304// pub __fpu_stmm6: Struct___darwin_mmst_reg,
305// pub __fpu_stmm7: Struct___darwin_mmst_reg,
306// pub __fpu_xmm0: Struct___darwin_xmm_reg,
307// pub __fpu_xmm1: Struct___darwin_xmm_reg,
308// pub __fpu_xmm2: Struct___darwin_xmm_reg,
309// pub __fpu_xmm3: Struct___darwin_xmm_reg,
310// pub __fpu_xmm4: Struct___darwin_xmm_reg,
311// pub __fpu_xmm5: Struct___darwin_xmm_reg,
312// pub __fpu_xmm6: Struct___darwin_xmm_reg,
313// pub __fpu_xmm7: Struct___darwin_xmm_reg,
314// pub __fpu_rsrv4: [libc::c_char, ..224u],
315// pub __fpu_reserved1: libc::c_int,
316// pub __avx_reserved1: [libc::c_char, ..64u],
317// pub __fpu_ymmh0: Struct___darwin_xmm_reg,
318// pub __fpu_ymmh1: Struct___darwin_xmm_reg,
319// pub __fpu_ymmh2: Struct___darwin_xmm_reg,
320// pub __fpu_ymmh3: Struct___darwin_xmm_reg,
321// pub __fpu_ymmh4: Struct___darwin_xmm_reg,
322// pub __fpu_ymmh5: Struct___darwin_xmm_reg,
323// pub __fpu_ymmh6: Struct___darwin_xmm_reg,
324// pub __fpu_ymmh7: Struct___darwin_xmm_reg,
325// }
326// #[repr(C)]
327// pub struct Struct___darwin_i386_exception_state {
328// pub __trapno: __uint16_t,
329// pub __cpu: __uint16_t,
330// pub __err: __uint32_t,
331// pub __faultvaddr: __uint32_t,
332// }
333// #[repr(C)]
334// pub struct Struct___darwin_x86_debug_state32 {
335// pub __dr0: libc::c_uint,
336// pub __dr1: libc::c_uint,
337// pub __dr2: libc::c_uint,
338// pub __dr3: libc::c_uint,
339// pub __dr4: libc::c_uint,
340// pub __dr5: libc::c_uint,
341// pub __dr6: libc::c_uint,
342// pub __dr7: libc::c_uint,
343// }
344// #[repr(C)]
345// pub struct Struct___darwin_x86_thread_state64 {
346// pub __rax: __uint64_t,
347// pub __rbx: __uint64_t,
348// pub __rcx: __uint64_t,
349// pub __rdx: __uint64_t,
350// pub __rdi: __uint64_t,
351// pub __rsi: __uint64_t,
352// pub __rbp: __uint64_t,
353// pub __rsp: __uint64_t,
354// pub __r8: __uint64_t,
355// pub __r9: __uint64_t,
356// pub __r10: __uint64_t,
357// pub __r11: __uint64_t,
358// pub __r12: __uint64_t,
359// pub __r13: __uint64_t,
360// pub __r14: __uint64_t,
361// pub __r15: __uint64_t,
362// pub __rip: __uint64_t,
363// pub __rflags: __uint64_t,
364// pub __cs: __uint64_t,
365// pub __fs: __uint64_t,
366// pub __gs: __uint64_t,
367// }
368// #[repr(C)]
369// pub struct Struct___darwin_x86_float_state64 {
370// pub __fpu_reserved: [libc::c_int, ..2u],
371// pub __fpu_fcw: Struct___darwin_fp_control,
372// pub __fpu_fsw: Struct___darwin_fp_status,
373// pub __fpu_ftw: __uint8_t,
374// pub __fpu_rsrv1: __uint8_t,
375// pub __fpu_fop: __uint16_t,
376// pub __fpu_ip: __uint32_t,
377// pub __fpu_cs: __uint16_t,
378// pub __fpu_rsrv2: __uint16_t,
379// pub __fpu_dp: __uint32_t,
380// pub __fpu_ds: __uint16_t,
381// pub __fpu_rsrv3: __uint16_t,
382// pub __fpu_mxcsr: __uint32_t,
383// pub __fpu_mxcsrmask: __uint32_t,
384// pub __fpu_stmm0: Struct___darwin_mmst_reg,
385// pub __fpu_stmm1: Struct___darwin_mmst_reg,
386// pub __fpu_stmm2: Struct___darwin_mmst_reg,
387// pub __fpu_stmm3: Struct___darwin_mmst_reg,
388// pub __fpu_stmm4: Struct___darwin_mmst_reg,
389// pub __fpu_stmm5: Struct___darwin_mmst_reg,
390// pub __fpu_stmm6: Struct___darwin_mmst_reg,
391// pub __fpu_stmm7: Struct___darwin_mmst_reg,
392// pub __fpu_xmm0: Struct___darwin_xmm_reg,
393// pub __fpu_xmm1: Struct___darwin_xmm_reg,
394// pub __fpu_xmm2: Struct___darwin_xmm_reg,
395// pub __fpu_xmm3: Struct___darwin_xmm_reg,
396// pub __fpu_xmm4: Struct___darwin_xmm_reg,
397// pub __fpu_xmm5: Struct___darwin_xmm_reg,
398// pub __fpu_xmm6: Struct___darwin_xmm_reg,
399// pub __fpu_xmm7: Struct___darwin_xmm_reg,
400// pub __fpu_xmm8: Struct___darwin_xmm_reg,
401// pub __fpu_xmm9: Struct___darwin_xmm_reg,
402// pub __fpu_xmm10: Struct___darwin_xmm_reg,
403// pub __fpu_xmm11: Struct___darwin_xmm_reg,
404// pub __fpu_xmm12: Struct___darwin_xmm_reg,
405// pub __fpu_xmm13: Struct___darwin_xmm_reg,
406// pub __fpu_xmm14: Struct___darwin_xmm_reg,
407// pub __fpu_xmm15: Struct___darwin_xmm_reg,
408// pub __fpu_rsrv4: [libc::c_char, ..96u],
409// pub __fpu_reserved1: libc::c_int,
410// }
411// #[repr(C)]
412// pub struct Struct___darwin_x86_avx_state64 {
413// pub __fpu_reserved: [libc::c_int, ..2u],
414// pub __fpu_fcw: Struct___darwin_fp_control,
415// pub __fpu_fsw: Struct___darwin_fp_status,
416// pub __fpu_ftw: __uint8_t,
417// pub __fpu_rsrv1: __uint8_t,
418// pub __fpu_fop: __uint16_t,
419// pub __fpu_ip: __uint32_t,
420// pub __fpu_cs: __uint16_t,
421// pub __fpu_rsrv2: __uint16_t,
422// pub __fpu_dp: __uint32_t,
423// pub __fpu_ds: __uint16_t,
424// pub __fpu_rsrv3: __uint16_t,
425// pub __fpu_mxcsr: __uint32_t,
426// pub __fpu_mxcsrmask: __uint32_t,
427// pub __fpu_stmm0: Struct___darwin_mmst_reg,
428// pub __fpu_stmm1: Struct___darwin_mmst_reg,
429// pub __fpu_stmm2: Struct___darwin_mmst_reg,
430// pub __fpu_stmm3: Struct___darwin_mmst_reg,
431// pub __fpu_stmm4: Struct___darwin_mmst_reg,
432// pub __fpu_stmm5: Struct___darwin_mmst_reg,
433// pub __fpu_stmm6: Struct___darwin_mmst_reg,
434// pub __fpu_stmm7: Struct___darwin_mmst_reg,
435// pub __fpu_xmm0: Struct___darwin_xmm_reg,
436// pub __fpu_xmm1: Struct___darwin_xmm_reg,
437// pub __fpu_xmm2: Struct___darwin_xmm_reg,
438// pub __fpu_xmm3: Struct___darwin_xmm_reg,
439// pub __fpu_xmm4: Struct___darwin_xmm_reg,
440// pub __fpu_xmm5: Struct___darwin_xmm_reg,
441// pub __fpu_xmm6: Struct___darwin_xmm_reg,
442// pub __fpu_xmm7: Struct___darwin_xmm_reg,
443// pub __fpu_xmm8: Struct___darwin_xmm_reg,
444// pub __fpu_xmm9: Struct___darwin_xmm_reg,
445// pub __fpu_xmm10: Struct___darwin_xmm_reg,
446// pub __fpu_xmm11: Struct___darwin_xmm_reg,
447// pub __fpu_xmm12: Struct___darwin_xmm_reg,
448// pub __fpu_xmm13: Struct___darwin_xmm_reg,
449// pub __fpu_xmm14: Struct___darwin_xmm_reg,
450// pub __fpu_xmm15: Struct___darwin_xmm_reg,
451// pub __fpu_rsrv4: [libc::c_char, ..96u],
452// pub __fpu_reserved1: libc::c_int,
453// pub __avx_reserved1: [libc::c_char, ..64u],
454// pub __fpu_ymmh0: Struct___darwin_xmm_reg,
455// pub __fpu_ymmh1: Struct___darwin_xmm_reg,
456// pub __fpu_ymmh2: Struct___darwin_xmm_reg,
457// pub __fpu_ymmh3: Struct___darwin_xmm_reg,
458// pub __fpu_ymmh4: Struct___darwin_xmm_reg,
459// pub __fpu_ymmh5: Struct___darwin_xmm_reg,
460// pub __fpu_ymmh6: Struct___darwin_xmm_reg,
461// pub __fpu_ymmh7: Struct___darwin_xmm_reg,
462// pub __fpu_ymmh8: Struct___darwin_xmm_reg,
463// pub __fpu_ymmh9: Struct___darwin_xmm_reg,
464// pub __fpu_ymmh10: Struct___darwin_xmm_reg,
465// pub __fpu_ymmh11: Struct___darwin_xmm_reg,
466// pub __fpu_ymmh12: Struct___darwin_xmm_reg,
467// pub __fpu_ymmh13: Struct___darwin_xmm_reg,
468// pub __fpu_ymmh14: Struct___darwin_xmm_reg,
469// pub __fpu_ymmh15: Struct___darwin_xmm_reg,
470// }
471// #[repr(C)]
472// pub struct Struct___darwin_x86_exception_state64 {
473// pub __trapno: __uint16_t,
474// pub __cpu: __uint16_t,
475// pub __err: __uint32_t,
476// pub __faultvaddr: __uint64_t,
477// }
478// #[repr(C)]
479// pub struct Struct___darwin_x86_debug_state64 {
480// pub __dr0: __uint64_t,
481// pub __dr1: __uint64_t,
482// pub __dr2: __uint64_t,
483// pub __dr3: __uint64_t,
484// pub __dr4: __uint64_t,
485// pub __dr5: __uint64_t,
486// pub __dr6: __uint64_t,
487// pub __dr7: __uint64_t,
488// }
489// #[repr(C)]
490// pub struct Struct___darwin_mcontext32 {
491// pub __es: Struct___darwin_i386_exception_state,
492// pub __ss: Struct___darwin_i386_thread_state,
493// pub __fs: Struct___darwin_i386_float_state,
494// }
495// #[repr(C)]
496// pub struct Struct___darwin_mcontext_avx32 {
497// pub __es: Struct___darwin_i386_exception_state,
498// pub __ss: Struct___darwin_i386_thread_state,
499// pub __fs: Struct___darwin_i386_avx_state,
500// }
501// #[repr(C)]
502// pub struct Struct___darwin_mcontext64 {
503// pub __es: Struct___darwin_x86_exception_state64,
504// pub __ss: Struct___darwin_x86_thread_state64,
505// pub __fs: Struct___darwin_x86_float_state64,
506// }
507// #[repr(C)]
508// pub struct Struct___darwin_mcontext_avx64 {
509// pub __es: Struct___darwin_x86_exception_state64,
510// pub __ss: Struct___darwin_x86_thread_state64,
511// pub __fs: Struct___darwin_x86_avx_state64,
512// }
513// pub type mcontext_t = *mut Struct___darwin_mcontext64;
514// pub type pthread_attr_t = __darwin_pthread_attr_t;
515// #[repr(C)]
516// pub struct Struct___darwin_sigaltstack {
517// pub ss_sp: *mut libc::c_void,
518// pub ss_size: __darwin_size_t,
519// pub ss_flags: libc::c_int,
520// }
521// pub type stack_t = Struct___darwin_sigaltstack;
522// #[repr(C)]
523// pub struct Struct___darwin_ucontext {
524// pub uc_onstack: libc::c_int,
525// pub uc_sigmask: __darwin_sigset_t,
526// pub uc_stack: Struct___darwin_sigaltstack,
527// pub uc_link: *mut Struct___darwin_ucontext,
528// pub uc_mcsize: __darwin_size_t,
529// pub uc_mcontext: *mut Struct___darwin_mcontext64,
530// }
531// pub type ucontext_t = Struct___darwin_ucontext;
532// #[repr(C)]
533// pub struct Union_sigval {
534// pub data: [u64, ..1u],
535// }
536// impl Union_sigval {
537// pub fn sival_int(&mut self) -> *mut libc::c_int {
538// unsafe { ::std::mem::transmute(self) }
539// }
540// pub fn sival_ptr(&mut self) -> *mut *mut libc::c_void {
541// unsafe { ::std::mem::transmute(self) }
542// }
543// }
544// #[repr(C)]
545// pub struct Struct_sigevent {
546// pub sigev_notify: libc::c_int,
547// pub sigev_signo: libc::c_int,
548// pub sigev_value: Union_sigval,
549// pub sigev_notify_function: ::std::option::Option<extern "C" fn
550// (arg1:
551// Union_sigval)>,
552// pub sigev_notify_attributes: *mut pthread_attr_t,
553// }
554// #[repr(C)]
555// pub struct Struct___siginfo {
556// pub si_signo: libc::c_int,
557// pub si_errno: libc::c_int,
558// pub si_code: libc::c_int,
559// pub si_pid: pid_t,
560// pub si_uid: uid_t,
561// pub si_status: libc::c_int,
562// pub si_addr: *mut libc::c_void,
563// pub si_value: Union_sigval,
564// pub si_band: libc::c_long,
565// pub __pad: [libc::c_ulong, ..7u],
566// }
567// pub type siginfo_t = Struct___siginfo;
568// #[repr(C)]
569// pub struct Union___sigaction_u {
570// pub data: [u64, ..1u],
571// }
572// impl Union___sigaction_u {
573// pub fn __sa_handler(&mut self)
574// -> *mut ::std::option::Option<extern "C" fn(arg1: libc::c_int)> {
575// unsafe { ::std::mem::transmute(self) }
576// }
577// pub fn __sa_sigaction(&mut self)
578// ->
579// *mut ::std::option::Option<extern "C" fn
580// (arg1: libc::c_int,
581// arg2: *mut Struct___siginfo,
582// arg3: *mut libc::c_void)> {
583// unsafe { ::std::mem::transmute(self) }
584// }
585// }
586// #[repr(C)]
587// pub struct Struct___sigaction {
588// pub __sigaction_u: Union___sigaction_u,
589// pub sa_tramp: ::std::option::Option<extern "C" fn
590// (arg1: *mut libc::c_void,
591// arg2: libc::c_int,
592// arg3: libc::c_int,
593// arg4: *mut siginfo_t,
594// arg5: *mut libc::c_void)>,
595// pub sa_mask: sigset_t,
596// pub sa_flags: libc::c_int,
597// }
598// #[repr(C)]
599// pub struct Struct_sigaction {
600// pub __sigaction_u: Union___sigaction_u,
601// pub sa_mask: sigset_t,
602// pub sa_flags: libc::c_int,
603// }
604// pub type sig_t = ::std::option::Option<extern "C" fn(arg1: libc::c_int)>;
605// #[repr(C)]
606// pub struct Struct_sigvec {
607// pub sv_handler: ::std::option::Option<extern "C" fn(arg1: libc::c_int)>,
608// pub sv_mask: libc::c_int,
609// pub sv_flags: libc::c_int,
610// }
611// #[repr(C)]
612// pub struct Struct_sigstack {
613// pub ss_sp: *mut libc::c_char,
614// pub ss_onstack: libc::c_int,
615// }
616pub type int8_t = libc::c_char;
617pub type int16_t = libc::c_short;
618pub type int32_t = libc::c_int;
619pub type int64_t = libc::c_longlong;
620pub type uint8_t = libc::c_uchar;
621pub type uint16_t = libc::c_ushort;
622pub type uint32_t = libc::c_uint;
623pub type int_least8_t = int8_t;
624pub type int_least16_t = int16_t;
625pub type int_least32_t = int32_t;
626pub type int_least64_t = int64_t;
627pub type uint_least8_t = uint8_t;
628pub type uint_least16_t = uint16_t;
629pub type uint_least32_t = uint32_t;
630pub type uint_least64_t = uint64_t;
631pub type int_fast8_t = int8_t;
632pub type int_fast16_t = int16_t;
633pub type int_fast32_t = int32_t;
634pub type int_fast64_t = int64_t;
635pub type uint_fast8_t = uint8_t;
636pub type uint_fast16_t = uint16_t;
637pub type uint_fast32_t = uint32_t;
638pub type uint_fast64_t = uint64_t;
639pub type uintptr_t = libc::c_ulong;
640pub type intmax_t = libc::c_long;
641pub type uintmax_t = libc::c_ulong;
642pub type rlim_t = __uint64_t;
643// #[repr(C)]
644// pub struct Struct_rusage {
645// pub ru_utime: Struct_timeval,
646// pub ru_stime: Struct_timeval,
647// pub ru_maxrss: libc::c_long,
648// pub ru_ixrss: libc::c_long,
649// pub ru_idrss: libc::c_long,
650// pub ru_isrss: libc::c_long,
651// pub ru_minflt: libc::c_long,
652// pub ru_majflt: libc::c_long,
653// pub ru_nswap: libc::c_long,
654// pub ru_inblock: libc::c_long,
655// pub ru_oublock: libc::c_long,
656// pub ru_msgsnd: libc::c_long,
657// pub ru_msgrcv: libc::c_long,
658// pub ru_nsignals: libc::c_long,
659// pub ru_nvcsw: libc::c_long,
660// pub ru_nivcsw: libc::c_long,
661// }
662// pub type rusage_info_t = *mut libc::c_void;
663// #[repr(C)]
664// pub struct Struct_rusage_info_v0 {
665// pub ri_uuid: [uint8_t, ..16u],
666// pub ri_user_time: uint64_t,
667// pub ri_system_time: uint64_t,
668// pub ri_pkg_idle_wkups: uint64_t,
669// pub ri_interrupt_wkups: uint64_t,
670// pub ri_pageins: uint64_t,
671// pub ri_wired_size: uint64_t,
672// pub ri_resident_size: uint64_t,
673// pub ri_phys_footprint: uint64_t,
674// pub ri_proc_start_abstime: uint64_t,
675// pub ri_proc_exit_abstime: uint64_t,
676// }
677// #[repr(C)]
678// pub struct Struct_rusage_info_v1 {
679// pub ri_uuid: [uint8_t, ..16u],
680// pub ri_user_time: uint64_t,
681// pub ri_system_time: uint64_t,
682// pub ri_pkg_idle_wkups: uint64_t,
683// pub ri_interrupt_wkups: uint64_t,
684// pub ri_pageins: uint64_t,
685// pub ri_wired_size: uint64_t,
686// pub ri_resident_size: uint64_t,
687// pub ri_phys_footprint: uint64_t,
688// pub ri_proc_start_abstime: uint64_t,
689// pub ri_proc_exit_abstime: uint64_t,
690// pub ri_child_user_time: uint64_t,
691// pub ri_child_system_time: uint64_t,
692// pub ri_child_pkg_idle_wkups: uint64_t,
693// pub ri_child_interrupt_wkups: uint64_t,
694// pub ri_child_pageins: uint64_t,
695// pub ri_child_elapsed_abstime: uint64_t,
696// }
697// #[repr(C)]
698// pub struct Struct_rusage_info_v2 {
699// pub ri_uuid: [uint8_t, ..16u],
700// pub ri_user_time: uint64_t,
701// pub ri_system_time: uint64_t,
702// pub ri_pkg_idle_wkups: uint64_t,
703// pub ri_interrupt_wkups: uint64_t,
704// pub ri_pageins: uint64_t,
705// pub ri_wired_size: uint64_t,
706// pub ri_resident_size: uint64_t,
707// pub ri_phys_footprint: uint64_t,
708// pub ri_proc_start_abstime: uint64_t,
709// pub ri_proc_exit_abstime: uint64_t,
710// pub ri_child_user_time: uint64_t,
711// pub ri_child_system_time: uint64_t,
712// pub ri_child_pkg_idle_wkups: uint64_t,
713// pub ri_child_interrupt_wkups: uint64_t,
714// pub ri_child_pageins: uint64_t,
715// pub ri_child_elapsed_abstime: uint64_t,
716// pub ri_diskio_bytesread: uint64_t,
717// pub ri_diskio_byteswritten: uint64_t,
718// }
719// #[repr(C)]
720// pub struct Struct_rusage_info_v3 {
721// pub ri_uuid: [uint8_t, ..16u],
722// pub ri_user_time: uint64_t,
723// pub ri_system_time: uint64_t,
724// pub ri_pkg_idle_wkups: uint64_t,
725// pub ri_interrupt_wkups: uint64_t,
726// pub ri_pageins: uint64_t,
727// pub ri_wired_size: uint64_t,
728// pub ri_resident_size: uint64_t,
729// pub ri_phys_footprint: uint64_t,
730// pub ri_proc_start_abstime: uint64_t,
731// pub ri_proc_exit_abstime: uint64_t,
732// pub ri_child_user_time: uint64_t,
733// pub ri_child_system_time: uint64_t,
734// pub ri_child_pkg_idle_wkups: uint64_t,
735// pub ri_child_interrupt_wkups: uint64_t,
736// pub ri_child_pageins: uint64_t,
737// pub ri_child_elapsed_abstime: uint64_t,
738// pub ri_diskio_bytesread: uint64_t,
739// pub ri_diskio_byteswritten: uint64_t,
740// pub ri_cpu_time_qos_default: uint64_t,
741// pub ri_cpu_time_qos_maintenance: uint64_t,
742// pub ri_cpu_time_qos_background: uint64_t,
743// pub ri_cpu_time_qos_utility: uint64_t,
744// pub ri_cpu_time_qos_legacy: uint64_t,
745// pub ri_cpu_time_qos_user_initiated: uint64_t,
746// pub ri_cpu_time_qos_user_interactive: uint64_t,
747// pub ri_billed_system_time: uint64_t,
748// pub ri_serviced_system_time: uint64_t,
749// }
750// pub type rusage_info_current = Struct_rusage_info_v3;
751// #[repr(C)]
752// pub struct Struct_rlimit {
753// pub rlim_cur: rlim_t,
754// pub rlim_max: rlim_t,
755// }
756// #[repr(C)]
757// pub struct Struct_proc_rlimit_control_wakeupmon {
758// pub wm_flags: uint32_t,
759// pub wm_rate: int32_t,
760// }
761// #[repr(C)]
762// pub struct Union_wait {
763// pub data: [u32, ..1u],
764// }
765// impl Union_wait {
766// pub fn w_status(&mut self) -> *mut libc::c_int {
767// unsafe { ::std::mem::transmute(self) }
768// }
769// pub fn w_T(&mut self) -> *mut Struct_Unnamed3 {
770// unsafe { ::std::mem::transmute(self) }
771// }
772// pub fn w_S(&mut self) -> *mut Struct_Unnamed4 {
773// unsafe { ::std::mem::transmute(self) }
774// }
775// }
776// #[repr(C)]
777// pub struct Struct_Unnamed3 {
778// pub w_Termsig: libc::c_uint,
779// pub w_Coredump: libc::c_uint,
780// pub w_Retcode: libc::c_uint,
781// pub w_Filler: libc::c_uint,
782// }
783// #[repr(C)]
784// pub struct Struct_Unnamed4 {
785// pub w_Stopval: libc::c_uint,
786// pub w_Stopsig: libc::c_uint,
787// pub w_Filler: libc::c_uint,
788// }
789// pub type ct_rune_t = __darwin_ct_rune_t;
790// pub type rune_t = __darwin_rune_t;
791// pub type wchar_t = __darwin_wchar_t;
792// #[repr(C)]
793// pub struct Struct_Unnamed5 {
794// pub quot: libc::c_int,
795// pub rem: libc::c_int,
796// }
797// pub type div_t = Struct_Unnamed5;
798// #[repr(C)]
799// pub struct Struct_Unnamed6 {
800// pub quot: libc::c_long,
801// pub rem: libc::c_long,
802// }
803// pub type ldiv_t = Struct_Unnamed6;
804// #[repr(C)]
805// pub struct Struct_Unnamed7 {
806// pub quot: libc::c_longlong,
807// pub rem: libc::c_longlong,
808// }
809// pub type lldiv_t = Struct_Unnamed7;
810pub type u_int8_t = libc::c_uchar;
811pub type u_int16_t = libc::c_ushort;
812pub type u_int32_t = libc::c_uint;
813pub type u_int64_t = libc::c_ulonglong;
814pub type register_t = int64_t;
815pub type user_addr_t = u_int64_t;
816pub type user_size_t = u_int64_t;
817pub type user_ssize_t = int64_t;
818pub type user_long_t = int64_t;
819pub type user_ulong_t = u_int64_t;
820pub type user_time_t = int64_t;
821pub type user_off_t = int64_t;
822pub type syscall_arg_t = u_int64_t;
823pub type fpos_t = __darwin_off_t;
824#[repr(C)]
825pub struct Struct___sbuf {
826 pub _base: *mut libc::c_uchar,
827 pub _size: libc::c_int,
828}
829
830pub enum Struct___sFILEX { }
831
832
833#[repr(C)]
834pub struct Struct___sFILE {
835 pub _p: *mut libc::c_uchar,
836 pub _r: libc::c_int,
837 pub _w: libc::c_int,
838 pub _flags: libc::c_short,
839 pub _file: libc::c_short,
840 pub _bf: Struct___sbuf,
841 pub _lbfsize: libc::c_int,
842 pub _cookie: *mut libc::c_void,
843 pub _close: ::std::option::Option<extern "C" fn(arg1: *mut libc::c_void)
844 -> libc::c_int>,
845 pub _read: ::std::option::Option<extern "C" fn
846 (arg1: *mut libc::c_void,
847 arg2: *mut libc::c_char,
848 arg3: libc::c_int)
849 -> libc::c_int>,
850 pub _seek: ::std::option::Option<extern "C" fn
851 (arg1: *mut libc::c_void,
852 arg2: fpos_t, arg3: libc::c_int)
853 -> fpos_t>,
854 pub _write: ::std::option::Option<extern "C" fn
855 (arg1: *mut libc::c_void,
856 arg2: *const libc::c_char,
857 arg3: libc::c_int)
858 -> libc::c_int>,
859 pub _ub: Struct___sbuf,
860 pub _extra: *mut Struct___sFILEX,
861 pub _ur: libc::c_int,
862 pub _ubuf: [libc::c_uchar; 3],
863 pub _nbuf: [libc::c_uchar; 1],
864 pub _lb: Struct___sbuf,
865 pub _blksize: libc::c_int,
866 pub _offset: fpos_t,
867}
868
869pub type FILE = Struct___sFILE;
870// pub type errno_t = libc::c_int;
871// pub type rsize_t = __darwin_size_t;
872// pub type wint_t = __darwin_wint_t;
873// #[repr(C)]
874// pub struct Struct_Unnamed8 {
875// pub __min: __darwin_rune_t,
876// pub __max: __darwin_rune_t,
877// pub __map: __darwin_rune_t,
878// pub __types: *mut __uint32_t,
879// }
880// pub type _RuneEntry = Struct_Unnamed8;
881// #[repr(C)]
882// pub struct Struct_Unnamed9 {
883// pub __nranges: libc::c_int,
884// pub __ranges: *mut _RuneEntry,
885// }
886// pub type _RuneRange = Struct_Unnamed9;
887#[repr(C)]
888pub struct Struct_Unnamed10 {
889 pub __name: [libc::c_char; 14],
890 pub __mask: __uint32_t,
891}
892
893pub type _RuneCharClass = Struct_Unnamed10;
894// #[repr(C)]
895// pub struct Struct_Unnamed11 {
896// pub __magic: [libc::c_char, ..8u],
897// pub __encoding: [libc::c_char, ..32u],
898// pub __sgetrune: ::std::option::Option<extern "C" fn
899// (arg1: *const libc::c_char,
900// arg2: __darwin_size_t,
901// arg3:
902// *mut *const libc::c_char)
903// -> __darwin_rune_t>,
904// pub __sputrune: ::std::option::Option<extern "C" fn
905// (arg1: __darwin_rune_t,
906// arg2: *mut libc::c_char,
907// arg3: __darwin_size_t,
908// arg4: *mut *mut libc::c_char)
909// -> libc::c_int>,
910// pub __invalid_rune: __darwin_rune_t,
911// pub __runetype: [__uint32_t, ..256u],
912// pub __maplower: [__darwin_rune_t, ..256u],
913// pub __mapupper: [__darwin_rune_t, ..256u],
914// pub __runetype_ext: _RuneRange,
915// pub __maplower_ext: _RuneRange,
916// pub __mapupper_ext: _RuneRange,
917// pub __variable: *mut libc::c_void,
918// pub __variable_len: libc::c_int,
919// pub __ncharclasses: libc::c_int,
920// pub __charclasses: *mut _RuneCharClass,
921// }
922// pub type _RuneLocale = Struct_Unnamed11;
923pub type u_char = libc::c_uchar;
924pub type u_short = libc::c_ushort;
925pub type u_int = libc::c_uint;
926pub type u_long = libc::c_ulong;
927pub type ushort = libc::c_ushort;
928pub type _uint = libc::c_uint;
929pub type u_quad_t = u_int64_t;
930pub type quad_t = int64_t;
931pub type qaddr_t = *mut quad_t;
932pub type caddr_t = *mut libc::c_char;
933pub type daddr_t = int32_t;
934pub type fixpt_t = u_int32_t;
935pub type blkcnt_t = __darwin_blkcnt_t;
936pub type blksize_t = __darwin_blksize_t;
937pub type in_addr_t = __uint32_t;
938pub type in_port_t = __uint16_t;
939pub type ino_t = __darwin_ino_t;
940pub type ino64_t = __darwin_ino64_t;
941pub type key_t = __int32_t;
942pub type nlink_t = __uint16_t;
943pub type segsz_t = int32_t;
944pub type swblk_t = int32_t;
945pub type clock_t = __darwin_clock_t;
946pub type fd_mask = __int32_t;
947// pub type pthread_cond_t = __darwin_pthread_cond_t;
948// pub type pthread_condattr_t = __darwin_pthread_condattr_t;
949// pub type pthread_mutex_t = __darwin_pthread_mutex_t;
950// pub type pthread_mutexattr_t = __darwin_pthread_mutexattr_t;
951// pub type pthread_once_t = __darwin_pthread_once_t;
952// pub type pthread_rwlock_t = __darwin_pthread_rwlock_t;
953// pub type pthread_rwlockattr_t = __darwin_pthread_rwlockattr_t;
954// pub type pthread_t = __darwin_pthread_t;
955// pub type pthread_key_t = __darwin_pthread_key_t;
956// pub type fsblkcnt_t = __darwin_fsblkcnt_t;
957// pub type fsfilcnt_t = __darwin_fsfilcnt_t;
958#[repr(C)]
959pub struct Struct_ttysize {
960 pub ts_lines: libc::c_ushort,
961 pub ts_cols: libc::c_ushort,
962 pub ts_xxx: libc::c_ushort,
963 pub ts_yyy: libc::c_ushort,
964}
965
966pub type __darwin_size_t = libc::c_ulong;
967pub type size_t = __darwin_size_t;
968
969#[repr(C)]
970#[allow(missing_copy_implementations)]
971pub struct Struct_linenoiseCompletions {
972 pub len: size_t,
973 pub cvec: *mut *mut libc::c_char,
974}
975
976pub type linenoiseCompletionCallback = extern fn(*mut libc::c_char, *mut Struct_linenoiseCompletions);
977
978pub type linenoiseCompletions = Struct_linenoiseCompletions;
979// pub type linenoiseCompletionCallback = libc::c_void;
980extern "C" {
981 pub static mut optarg: *mut libc::c_char;
982 pub static mut optind: libc::c_int;
983 pub static mut opterr: libc::c_int;
984 pub static mut optopt: libc::c_int;
985 pub static mut suboptarg: *mut libc::c_char;
986 pub static mut optreset: libc::c_int;
987 pub static mut __mb_cur_max: libc::c_int;
988 pub static mut __stdinp: *mut FILE;
989 pub static mut __stdoutp: *mut FILE;
990 pub static mut __stderrp: *mut FILE;
991 pub static sys_nerr: libc::c_int;
992 pub static mut sys_errlist: *const *const libc::c_char;
993 // pub static mut _DefaultRuneLocale: _RuneLocale;
994 // pub static mut _CurrentRuneLocale: *mut _RuneLocale;
995}
996extern "C" {
997 pub fn linenoiseSetCompletionCallback(arg1:
998 *mut linenoiseCompletionCallback);
999 pub fn linenoiseAddCompletion(arg1: *mut linenoiseCompletions,
1000 arg2: *const libc::c_char);
1001 pub fn linenoise(prompt: *const libc::c_char) -> *mut libc::c_char;
1002 pub fn linenoiseHistoryAdd(line: *const libc::c_char) -> libc::c_int;
1003 pub fn linenoiseHistorySetMaxLen(len: libc::c_int) -> libc::c_int;
1004 pub fn linenoiseHistoryLine(index: libc::c_int) -> *mut libc::c_char;
1005 pub fn linenoiseHistorySave(filename: *const libc::c_char)
1006 -> libc::c_int;
1007 pub fn linenoiseHistoryLoad(filename: *const libc::c_char)
1008 -> libc::c_int;
1009 // pub fn linenoiseHistoryLine(index: libc::c_int) -> *mut libc::c_char;
1010 pub fn linenoiseClearScreen();
1011 pub fn linenoiseSetMultiLine(ml: libc::c_int);
1012 pub fn linenoisePrintKeyCodes();
1013}