yazi/yazi-ffi/src/io_kit.rs
三咲雅 · Misaki Masa 3e1c8950f2
feat: mount manager (#2199)
2025-01-17 21:32:55 +08:00

26 lines
732 B
Rust

use std::ffi::c_char;
use core_foundation_sys::{base::{CFAllocatorRef, CFTypeRef, mach_port_t}, dictionary::CFMutableDictionaryRef, string::CFStringRef};
use libc::kern_return_t;
#[link(name = "IOKit", kind = "framework")]
extern "C" {
pub fn IOServiceGetMatchingServices(
mainPort: mach_port_t,
matching: CFMutableDictionaryRef,
existing: *mut mach_port_t,
) -> kern_return_t;
pub fn IOServiceMatching(a: *const c_char) -> CFMutableDictionaryRef;
pub fn IOIteratorNext(iterator: mach_port_t) -> mach_port_t;
pub fn IORegistryEntryCreateCFProperty(
entry: mach_port_t,
key: CFStringRef,
allocator: CFAllocatorRef,
options: u32,
) -> CFTypeRef;
pub fn IOObjectRelease(obj: mach_port_t) -> kern_return_t;
}