| 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 crate::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 "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 |
} |