9
9
10
10
use std:: os:: raw:: c_void;
11
11
12
- use base:: { CFRange , CFIndex , CFAllocatorRef , CFTypeID , Boolean } ;
12
+ use base:: { CFRange , CFIndex , CFAllocatorRef , CFTypeID , Boolean , CFComparisonResult } ;
13
13
use string:: CFStringRef ;
14
14
15
15
pub type CFArrayRetainCallBack = extern "C" fn ( allocator : CFAllocatorRef , value : * const c_void ) -> * const c_void ;
16
16
pub type CFArrayReleaseCallBack = extern "C" fn ( allocator : CFAllocatorRef , value : * const c_void ) ;
17
17
pub type CFArrayCopyDescriptionCallBack = extern "C" fn ( value : * const c_void ) -> CFStringRef ;
18
18
pub type CFArrayEqualCallBack = extern "C" fn ( value1 : * const c_void , value2 : * const c_void ) -> Boolean ;
19
+ pub type CFArrayApplierFunction = extern "C" fn ( value : * const c_void , context : * mut c_void ) ;
20
+ pub type CFComparatorFunction = extern "C" fn ( val1 : * const c_void , val2 : * const c_void ) -> CFComparisonResult ;
19
21
20
22
#[ repr( C ) ]
21
23
#[ derive( Clone , Copy ) ]
@@ -31,25 +33,35 @@ pub struct CFArrayCallBacks {
31
33
pub struct __CFArray ( c_void ) ;
32
34
33
35
pub type CFArrayRef = * const __CFArray ;
36
+ pub type CFMutableArrayRef = * mut __CFArray ;
34
37
35
38
extern {
36
39
/*
37
40
* CFArray.h
38
41
*/
39
42
pub static kCFTypeArrayCallBacks: CFArrayCallBacks ;
40
43
41
- pub fn CFArrayCreate ( allocator : CFAllocatorRef , values : * const * const c_void ,
42
- numValues : CFIndex , callBacks : * const CFArrayCallBacks ) -> CFArrayRef ;
44
+ pub fn CFArrayGetTypeID ( ) -> CFTypeID ;
45
+ pub fn CFArrayCreate ( allocator : CFAllocatorRef , values : * const * const c_void , numValues : CFIndex , callBacks : * const CFArrayCallBacks ) -> CFArrayRef ;
43
46
pub fn CFArrayCreateCopy ( allocator : CFAllocatorRef , theArray : CFArrayRef ) -> CFArrayRef ;
44
-
45
- // CFArrayBSearchValues
46
- // CFArrayContainsValue
47
+ pub fn CFArrayCreateMutable ( allocator : CFAllocatorRef , capacity : CFIndex , callBacks : * const CFArrayCallBacks ) -> CFMutableArrayRef ;
48
+ pub fn CFArrayCreateMutableCopy ( allocator : CFAllocatorRef , capacity : CFIndex , theArray : CFArrayRef ) -> CFMutableArrayRef ;
47
49
pub fn CFArrayGetCount ( theArray : CFArrayRef ) -> CFIndex ;
48
- // CFArrayGetCountOfValue
49
- // CFArrayGetFirstIndexOfValue
50
- // CFArrayGetLastIndexOfValue
51
- pub fn CFArrayGetValues ( theArray : CFArrayRef , range : CFRange , values : * mut * const c_void ) ;
50
+ pub fn CFArrayGetCountOfValue ( theArray : CFArrayRef , range : CFRange , value : * const c_void ) -> CFIndex ;
51
+ pub fn CFArrayContainsValue ( theArray : CFArrayRef , range : CFRange , value : * const c_void ) -> Boolean ;
52
52
pub fn CFArrayGetValueAtIndex ( theArray : CFArrayRef , idx : CFIndex ) -> * const c_void ;
53
- // CFArrayApplyFunction
54
- pub fn CFArrayGetTypeID ( ) -> CFTypeID ;
53
+ pub fn CFArrayGetValues ( theArray : CFArrayRef , range : CFRange , values : * mut * const c_void ) ;
54
+ pub fn CFArrayApplyFunction ( theArray : CFArrayRef , range : CFRange , applier : CFArrayApplierFunction , context : * mut c_void ) ;
55
+ pub fn CFArrayGetFirstIndexOfValue ( theArray : CFArrayRef , range : CFRange , value : * const c_void ) -> CFIndex ;
56
+ pub fn CFArrayGetLastIndexOfValue ( theArray : CFArrayRef , range : CFRange , value : * const c_void ) -> CFIndex ;
57
+ pub fn CFArrayBSearchValues ( theArray : CFArrayRef , range : CFRange , value : * const c_void , comparator : CFComparatorFunction , context : * mut c_void ) -> CFIndex ;
58
+ pub fn CFArrayAppendValue ( theArray : CFMutableArrayRef , value : * const c_void ) ;
59
+ pub fn CFArrayInsertValueAtIndex ( theArray : CFMutableArrayRef , idx : CFIndex , value : * const c_void ) ;
60
+ pub fn CFArraySetValueAtIndex ( theArray : CFMutableArrayRef , idx : CFIndex , value : * const c_void ) ;
61
+ pub fn CFArrayRemoveValueAtIndex ( theArray : CFMutableArrayRef , idx : CFIndex ) ;
62
+ pub fn CFArrayRemoveAllValues ( theArray : CFMutableArrayRef ) ;
63
+ pub fn CFArrayReplaceValues ( theArray : CFMutableArrayRef , range : CFRange , newValues : * mut * const c_void , newCount : CFIndex ) ;
64
+ pub fn CFArrayExchangeValuesAtIndices ( theArray : CFMutableArrayRef , idx1 : CFIndex , idx2 : CFIndex ) ;
65
+ pub fn CFArraySortValues ( theArray : CFMutableArrayRef , range : CFRange , comparator : CFComparatorFunction , context : * mut c_void ) ;
66
+ pub fn CFArrayAppendArray ( theArray : CFMutableArrayRef , otherArray : CFArrayRef , otherRange : CFRange ) ;
55
67
}
0 commit comments