1 // Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT 2 // file at the top-level directory of this distribution. 3 // 4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or 5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license 6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your 7 // option. This file may not be copied, modified, or distributed 8 // except according to those terms. 9 10 use std::os::raw::c_void; 11 12 use base::{CFAllocatorRef, CFComparisonResult, CFTypeID}; 13 14 #[repr(C)] 15 pub struct __CFDate(c_void); 16 17 pub type CFDateRef = *const __CFDate; 18 19 pub type CFTimeInterval = f64; 20 pub type CFAbsoluteTime = CFTimeInterval; 21 22 extern { 23 pub static kCFAbsoluteTimeIntervalSince1904: CFTimeInterval; 24 pub static kCFAbsoluteTimeIntervalSince1970: CFTimeInterval; 25 CFAbsoluteTimeGetCurrent() -> CFAbsoluteTime26 pub fn CFAbsoluteTimeGetCurrent() -> CFAbsoluteTime; 27 CFDateCreate(allocator: CFAllocatorRef, at: CFAbsoluteTime) -> CFDateRef28 pub fn CFDateCreate(allocator: CFAllocatorRef, at: CFAbsoluteTime) -> CFDateRef; CFDateGetAbsoluteTime(date: CFDateRef) -> CFAbsoluteTime29 pub fn CFDateGetAbsoluteTime(date: CFDateRef) -> CFAbsoluteTime; CFDateGetTimeIntervalSinceDate(date: CFDateRef, other: CFDateRef) -> CFTimeInterval30 pub fn CFDateGetTimeIntervalSinceDate(date: CFDateRef, other: CFDateRef) -> CFTimeInterval; CFDateCompare(date: CFDateRef, other: CFDateRef, context: *mut c_void) -> CFComparisonResult31 pub fn CFDateCompare(date: CFDateRef, other: CFDateRef, context: *mut c_void) -> CFComparisonResult; 32 CFDateGetTypeID() -> CFTypeID33 pub fn CFDateGetTypeID() -> CFTypeID; 34 } 35