CoreFoundation_sys/
set.rs1use libc::c_void;
4use ::{Boolean, CFAllocatorRef, CFHashCode, CFIndex, CFStringRef, CFTypeID};
5
6#[doc(hidden)]
7#[repr(C)]
8pub struct __CFSet {
9 __private: c_void
10}
11
12pub type CFSetRef = *const __CFSet;
13pub type CFMutableSetRef = *mut __CFSet;
14
15pub type CFSetApplierFunction = extern "C" fn(value: *const c_void, context: *mut c_void);
16pub type CFSetCopyDescriptionCallBack = extern "C" fn(value: *const c_void) -> CFStringRef;
17pub type CFSetEqualCallBack = extern "C" fn(value1: *const c_void, value2: *const c_void) -> Boolean;
18pub type CFSetHashCallBack = extern "C" fn(value: *const c_void) -> CFHashCode;
19pub type CFSetReleaseCallBack = extern "C" fn(allocator: CFAllocatorRef, value: *const c_void);
20pub type CFSetRetainCallBack = extern "C" fn(allocator: CFAllocatorRef, value: *const c_void) -> *const c_void;
21
22#[repr(C)]
23pub struct CFSetCallBacks {
24 pub version: CFIndex,
25 pub retain: CFSetRetainCallBack,
26 pub release: CFSetReleaseCallBack,
27 pub copyDescription: CFSetCopyDescriptionCallBack,
28 pub equal: CFSetEqualCallBack,
29 pub hash: CFSetHashCallBack
30}
31
32extern {
33 pub fn CFSetCreate(allocator: CFAllocatorRef, values: *mut *const c_void, numValues: CFIndex,
34 callBacks: *const CFSetCallBacks) -> CFSetRef;
35 pub fn CFSetCreateCopy(allocator: CFAllocatorRef, theSet: CFSetRef) -> CFSetRef;
36
37 pub fn CFSetCreateMutable(allocator: CFAllocatorRef, capacity: CFIndex, callBacks: *const CFSetCallBacks)
38 -> CFMutableSetRef;
39 pub fn CFSetCreateMutableCopy(allocator: CFAllocatorRef, capacity: CFIndex, theSet: CFSetRef) -> CFMutableSetRef;
40
41 pub fn CFSetContainsValue(theSet: CFSetRef, value: *const c_void) -> Boolean;
42 pub fn CFSetGetCount(theSet: CFSetRef) -> CFIndex;
43 pub fn CFSetGetCountOfValue(theSet: CFSetRef, value: *const c_void) -> CFIndex;
44 pub fn CFSetGetValue(theSet: CFSetRef, value: *const c_void) -> *const c_void;
45 pub fn CFSetGetValueIfPresent(theSet: CFSetRef, candidate: *const c_void, value: *mut *const c_void) -> Boolean;
46 pub fn CFSetGetValues(theSet: CFSetRef, values: *mut *const c_void);
47
48 pub fn CFSetApplyFunction(theSet: CFSetRef, applier: CFSetApplierFunction, context: *mut c_void);
49
50 pub fn CFSetGetTypeID() -> CFTypeID;
51
52 pub fn CFSetAddValue(theSet: CFMutableSetRef, value: *const c_void);
53 pub fn CFSetRemoveAllValues(theSet: CFMutableSetRef);
54 pub fn CFSetRemoveValue(theSet: CFMutableSetRef, value: *const c_void);
55 pub fn CFSetReplaceValue(theSet: CFMutableSetRef, value: *const c_void);
56 pub fn CFSetSetValue(theSet: CFMutableSetRef, value: *const c_void);
57
58 pub static kCFTypeSetCallBacks: CFSetCallBacks;
59 pub static kCFCopyStringSetCallBacks: CFSetCallBacks;
60}