diff options
Diffstat (limited to 'vendor/sysinfo-0.26.7/src/apple/ffi.rs')
-rw-r--r-- | vendor/sysinfo-0.26.7/src/apple/ffi.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/sysinfo-0.26.7/src/apple/ffi.rs b/vendor/sysinfo-0.26.7/src/apple/ffi.rs new file mode 100644 index 000000000..72822202f --- /dev/null +++ b/vendor/sysinfo-0.26.7/src/apple/ffi.rs @@ -0,0 +1,38 @@ +// Take a look at the license at the top of the repository in the LICENSE file. + +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::*; + +#[link(name = "CoreFoundation", kind = "framework")] +extern "C" { + pub fn CFURLCopyResourcePropertiesForKeys( + url: CFURLRef, + keys: CFArrayRef, + error: *mut CFErrorRef, + ) -> CFDictionaryRef; + + 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)] +#[repr(C)] +pub struct Val_t { + pub key: [i8; 5], + pub data_size: u32, + pub data_type: [i8; 5], // UInt32Char_t + pub bytes: [i8; 32], // SMCBytes_t +} |