core_foundation_sys/
date.rs1use std::os::raw::c_void;
11
12use crate::base::{CFAllocatorRef, CFComparisonResult, CFTypeID};
13
14#[repr(C)]
15pub struct __CFDate(c_void);
16
17pub type CFDateRef = *const __CFDate;
18
19pub type CFTimeInterval = f64;
20pub type CFAbsoluteTime = CFTimeInterval;
21
22extern "C" {
23 pub static kCFAbsoluteTimeIntervalSince1904: CFTimeInterval;
24 pub static kCFAbsoluteTimeIntervalSince1970: CFTimeInterval;
25
26 pub fn CFAbsoluteTimeGetCurrent() -> CFAbsoluteTime;
27
28 pub fn CFDateCreate(allocator: CFAllocatorRef, at: CFAbsoluteTime) -> CFDateRef;
29 pub fn CFDateGetAbsoluteTime(date: CFDateRef) -> CFAbsoluteTime;
30 pub fn CFDateGetTimeIntervalSinceDate(date: CFDateRef, other: CFDateRef) -> CFTimeInterval;
31 pub fn CFDateCompare(
32 date: CFDateRef,
33 other: CFDateRef,
34 context: *mut c_void,
35 ) -> CFComparisonResult;
36
37 pub fn CFDateGetTypeID() -> CFTypeID;
38}