1 // Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
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.
10 use std
::os
::raw
::c_void
;
12 use base
::{CFAllocatorRef, CFIndex, CFTypeID, Boolean}
;
14 pub type CFSetApplierFunction
= extern "C" fn (value
: *const c_void
,
15 context
: *const c_void
);
16 pub type CFSetRetainCallBack
= *const u8;
17 pub type CFSetReleaseCallBack
= *const u8;
18 pub type CFSetCopyDescriptionCallBack
= *const u8;
19 pub type CFSetEqualCallBack
= *const u8;
20 pub type CFSetHashCallBack
= *const u8;
23 #[derive(Clone, Copy)]
24 pub struct CFSetCallBacks
{
26 pub retain
: CFSetRetainCallBack
,
27 pub release
: CFSetReleaseCallBack
,
28 pub copyDescription
: CFSetCopyDescriptionCallBack
,
29 pub equal
: CFSetEqualCallBack
,
30 pub hash
: CFSetHashCallBack
,
34 pub struct __CFSet(c_void
);
36 pub type CFSetRef
= *const __CFSet
;
43 pub static kCFTypeSetCallBacks
: CFSetCallBacks
;
46 pub fn CFSetCreate(allocator
: CFAllocatorRef
, values
: *const *const c_void
, numValues
: CFIndex
,
47 callBacks
: *const CFSetCallBacks
) -> CFSetRef
;
48 pub fn CFSetCreateCopy(allocator
: CFAllocatorRef
, theSet
: CFSetRef
) -> CFSetRef
;
51 pub fn CFSetContainsValue(theSet
: CFSetRef
, value
: *const c_void
) -> Boolean
;
52 pub fn CFSetGetCount(theSet
: CFSetRef
) -> CFIndex
;
53 pub fn CFSetGetCountOfValue(theSet
: CFSetRef
, value
: *const c_void
) -> CFIndex
;
54 pub fn CFSetGetValue(theSet
: CFSetRef
, value
: *const c_void
) -> *const c_void
;
55 pub fn CFSetGetValueIfPresent(theSet
: CFSetRef
, candidate
: *const c_void
, value
: *mut *const c_void
) -> Boolean
;
56 pub fn CFSetGetValues(theSet
: CFSetRef
, values
: *mut *const c_void
);
58 /* Applying a Function to Set Members */
59 pub fn CFSetApplyFunction(theSet
: CFSetRef
,
60 applier
: CFSetApplierFunction
,
61 context
: *const c_void
);
63 /* Getting the CFSet Type ID */
64 pub fn CFSetGetTypeID() -> CFTypeID
;