1#![doc = include_str!("../README.md")]
2
3#![allow(non_camel_case_types)]
4#![allow(non_upper_case_globals)]
5
6#![allow(
7 clippy::module_name_repetitions,
8 clippy::cast_sign_loss,
9 clippy::cast_possible_truncation,
10 clippy::trivially_copy_pass_by_ref
11)]
12
13#![deny(missing_debug_implementations)]
14#![deny(missing_copy_implementations)]
15
16#![cfg_attr(not(feature = "std"), no_std)]
21
22#[cfg(test)]
24mod _test_utils {
25 #[macro_export]
27 macro_rules! p {
28 ($($args:tt)*) => {{
29 let out = format!( $($args)* );
30 let n =
31 out.lines()
32 .map(|x|{ x.len() })
33 .max().unwrap_or(20);
34
35 let mut stderr = std::io::stderr().lock();
36 writeln!(stderr, "{}", ".".repeat(n)).expect("cannot print to stderr");
37 write!(stderr, "{}", out).expect("cannot print to stderr");
38 writeln!(stderr, "{}", ".".repeat(n)).expect("cannot print to stderr");
39 }};
40 }
41
42 #[macro_export]
43 macro_rules! pl {
44 ($($args:tt)*) => {{
45 let mut s = format!( $($args)* );
46 s.push('\n');
47 $crate::p!("{}", s);
48 }}
49 }
50}
51
52#[cfg(not(target_vendor="apple"))]
53mod _err {
54 }
56
57#[allow(unused_imports)]
58use core::{clone, cmp, default, fmt, hash, marker, mem, option};
59
60pub const NONCE_RANDOM: u64 = include!(env!("MACH_SYS_NONCE_RANDOM"));
61
62pub mod ffi {
64 pub use core::ffi::{
65 c_void,
66 c_uchar, c_char,
67 c_ushort,
68 c_uint, c_int,
69 c_ulong, c_long,
70 c_ulonglong, c_longlong,
71 };
72
73 pub type clock_t = c_ulong; pub type policy_t = c_int; pub type intptr_t = isize; pub type uintptr_t = usize; use crate::vm_types::integer_t;
83 pub type cpu_type_t = integer_t;
84 pub type cpu_subtype_t = integer_t;
85
86 pub type pid_t = i32;
90 pub type uid_t = u32;
91}
92
93pub mod boolean;
94pub mod bootstrap;
95pub mod clock;
96pub mod clock_priv;
97pub mod clock_reply;
98pub mod clock_types;
99
100pub mod dyld_kernel;
101pub mod error;
102pub mod exc;
103pub mod exception_types;
104pub mod kern_return;
105
106pub mod loader;
107pub mod mach_init;
108pub mod mach_port;
109pub mod mach_time;
110pub mod mach_types;
111pub mod memory_object_types;
112pub mod message;
113pub mod ndr;
114pub mod port;
115pub mod semaphore;
116pub mod structs;
117pub mod sync_policy;
118pub mod task;
119pub mod task_info;
120pub mod thread_act;
121pub mod thread_policy;
122pub mod thread_status;
123pub mod time_value;
124pub mod traps;
125pub mod vm;
126pub mod vm_attributes;
127pub mod vm_behavior;
128pub mod vm_inherit;
129pub mod vm_page_size;
130pub mod vm_prot;
131pub mod vm_purgable;
132pub mod vm_region;
133pub mod vm_statistics;
134pub mod vm_sync;
135pub mod vm_types;
136
137pub mod dyld;
139pub mod dlfcn;
140pub mod dyld_images;
141pub mod libproc;
142pub mod nlist;
143