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, CFTypeID, CFComparisonResult}; 13 14 #[repr(C)] 15 pub struct __CFBoolean(c_void); 16 17 pub type CFBooleanRef = *const __CFBoolean; 18 19 pub type CFNumberType = u32; 20 21 // members of enum CFNumberType 22 // static kCFNumberSInt8Type: CFNumberType = 1; 23 // static kCFNumberSInt16Type: CFNumberType = 2; 24 pub static kCFNumberSInt32Type: CFNumberType = 3; 25 pub static kCFNumberSInt64Type: CFNumberType = 4; 26 pub static kCFNumberFloat32Type: CFNumberType = 5; 27 pub static kCFNumberFloat64Type: CFNumberType = 6; 28 // static kCFNumberCharType: CFNumberType = 7; 29 // static kCFNumberShortType: CFNumberType = 8; 30 // static kCFNumberIntType: CFNumberType = 9; 31 // static kCFNumberLongType: CFNumberType = 10; 32 // static kCFNumberLongLongType: CFNumberType = 11; 33 // static kCFNumberFloatType: CFNumberType = 12; 34 // static kCFNumberDoubleType: CFNumberType = 13; 35 // static kCFNumberCFIndexType: CFNumberType = 14; 36 // static kCFNumberNSIntegerType: CFNumberType = 15; 37 // static kCFNumberCGFloatType: CFNumberType = 16; 38 // static kCFNumberMaxType: CFNumberType = 16; 39 40 // This is an enum due to zero-sized types warnings. 41 // For more details see https://github.com/rust-lang/rust/issues/27303 42 pub enum __CFNumber {} 43 44 pub type CFNumberRef = *const __CFNumber; 45 46 extern { 47 /* 48 * CFNumber.h 49 */ 50 pub static kCFBooleanTrue: CFBooleanRef; 51 pub static kCFBooleanFalse: CFBooleanRef; 52 CFBooleanGetTypeID() -> CFTypeID53 pub fn CFBooleanGetTypeID() -> CFTypeID; CFNumberCreate(allocator: CFAllocatorRef, theType: CFNumberType, valuePtr: *const c_void) -> CFNumberRef54 pub fn CFNumberCreate(allocator: CFAllocatorRef, theType: CFNumberType, valuePtr: *const c_void) 55 -> CFNumberRef; 56 //fn CFNumberGetByteSize CFNumberGetValue(number: CFNumberRef, theType: CFNumberType, valuePtr: *mut c_void) -> bool57 pub fn CFNumberGetValue(number: CFNumberRef, theType: CFNumberType, valuePtr: *mut c_void) -> bool; CFNumberCompare(date: CFNumberRef, other: CFNumberRef, context: *mut c_void) -> CFComparisonResult58 pub fn CFNumberCompare(date: CFNumberRef, other: CFNumberRef, context: *mut c_void) -> CFComparisonResult; CFNumberGetTypeID() -> CFTypeID59 pub fn CFNumberGetTypeID() -> CFTypeID; 60 } 61