diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:25 +0000 |
commit | 5363f350887b1e5b5dd21a86f88c8af9d7fea6da (patch) | |
tree | 35ca005eb6e0e9a1ba3bb5dbc033209ad445dc17 /vendor/sysinfo/src/apple/ffi.rs | |
parent | Adding debian version 1.66.0+dfsg1-1. (diff) | |
download | rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.tar.xz rustc-5363f350887b1e5b5dd21a86f88c8af9d7fea6da.zip |
Merging upstream version 1.67.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/sysinfo/src/apple/ffi.rs')
-rw-r--r-- | vendor/sysinfo/src/apple/ffi.rs | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/vendor/sysinfo/src/apple/ffi.rs b/vendor/sysinfo/src/apple/ffi.rs index 7a8248537..72822202f 100644 --- a/vendor/sysinfo/src/apple/ffi.rs +++ b/vendor/sysinfo/src/apple/ffi.rs @@ -1,21 +1,31 @@ // Take a look at the license at the top of the repository in the LICENSE file. -use libc::c_void; +use core_foundation_sys::{ + array::CFArrayRef, dictionary::CFDictionaryRef, error::CFErrorRef, string::CFStringRef, + url::CFURLRef, +}; // Reexport items defined in either macos or ios ffi module. pub use crate::sys::inner::ffi::*; -#[repr(C)] -pub struct __DADisk(c_void); -#[repr(C)] -pub struct __DASession(c_void); +#[link(name = "CoreFoundation", kind = "framework")] +extern "C" { + pub fn CFURLCopyResourcePropertiesForKeys( + url: CFURLRef, + keys: CFArrayRef, + error: *mut CFErrorRef, + ) -> CFDictionaryRef; -// #[allow(non_camel_case_types)] -// pub type io_name_t = [u8; 128]; -// #[allow(non_camel_case_types)] -// pub type io_registry_entry_t = io_object_t; - -// pub type IOOptionBits = u32; + pub static kCFURLVolumeIsEjectableKey: CFStringRef; + pub static kCFURLVolumeIsRemovableKey: CFStringRef; + pub static kCFURLVolumeAvailableCapacityKey: CFStringRef; + pub static kCFURLVolumeAvailableCapacityForImportantUsageKey: CFStringRef; + pub static kCFURLVolumeTotalCapacityKey: CFStringRef; + pub static kCFURLVolumeNameKey: CFStringRef; + pub static kCFURLVolumeIsLocalKey: CFStringRef; + pub static kCFURLVolumeIsInternalKey: CFStringRef; + pub static kCFURLVolumeIsBrowsableKey: CFStringRef; +} #[cfg_attr(feature = "debug", derive(Eq, Hash, PartialEq))] #[derive(Clone)] |