objc2_core_foundation/generated/CFArray.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9
10use crate::*;
11
12/// Structure containing the callbacks of a CFArray.
13/// Field: version The version number of the structure type being passed
14/// in as a parameter to the CFArray creation functions. This
15/// structure is version 0.
16/// Field: retain The callback used to add a retain for the array on
17/// values as they are put into the array. This callback returns
18/// the value to store in the array, which is usually the value
19/// parameter passed to this callback, but may be a different
20/// value if a different value should be stored in the array.
21/// The array's allocator is passed as the first argument.
22/// Field: release The callback used to remove a retain previously added
23/// for the array from values as they are removed from the
24/// array. The array's allocator is passed as the first
25/// argument.
26/// Field: copyDescription The callback used to create a descriptive
27/// string representation of each value in the array. This is
28/// used by the CFCopyDescription() function.
29/// Field: equal The callback used to compare values in the array for
30/// equality for some operations.
31///
32/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfarrayretaincallback?language=objc)
33pub type CFArrayRetainCallBack =
34 Option<unsafe extern "C-unwind" fn(*const CFAllocator, *const c_void) -> *const c_void>;
35
36/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfarrayreleasecallback?language=objc)
37pub type CFArrayReleaseCallBack =
38 Option<unsafe extern "C-unwind" fn(*const CFAllocator, *const c_void)>;
39
40/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfarraycopydescriptioncallback?language=objc)
41pub type CFArrayCopyDescriptionCallBack =
42 Option<unsafe extern "C-unwind" fn(*const c_void) -> *const CFString>;
43
44/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfarrayequalcallback?language=objc)
45pub type CFArrayEqualCallBack =
46 Option<unsafe extern "C-unwind" fn(*const c_void, *const c_void) -> Boolean>;
47
48/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfarraycallbacks?language=objc)
49#[repr(C)]
50#[derive(Clone, Copy, Debug, PartialEq)]
51pub struct CFArrayCallBacks {
52 pub version: CFIndex,
53 pub retain: CFArrayRetainCallBack,
54 pub release: CFArrayReleaseCallBack,
55 pub copyDescription: CFArrayCopyDescriptionCallBack,
56 pub equal: CFArrayEqualCallBack,
57}
58
59#[cfg(feature = "objc2")]
60unsafe impl Encode for CFArrayCallBacks {
61 const ENCODING: Encoding = Encoding::Struct(
62 "?",
63 &[
64 <CFIndex>::ENCODING,
65 <CFArrayRetainCallBack>::ENCODING,
66 <CFArrayReleaseCallBack>::ENCODING,
67 <CFArrayCopyDescriptionCallBack>::ENCODING,
68 <CFArrayEqualCallBack>::ENCODING,
69 ],
70 );
71}
72
73#[cfg(feature = "objc2")]
74unsafe impl RefEncode for CFArrayCallBacks {
75 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
76}
77
78extern "C" {
79 /// Predefined CFArrayCallBacks structure containing a set of callbacks
80 /// appropriate for use when the values in a CFArray are all CFTypes.
81 ///
82 /// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcftypearraycallbacks?language=objc)
83 pub static kCFTypeArrayCallBacks: CFArrayCallBacks;
84}
85
86/// Type of the callback function used by the apply functions of
87/// CFArrays.
88///
89/// Parameter `value`: The current value from the array.
90///
91/// Parameter `context`: The user-defined context parameter given to the apply
92/// function.
93///
94/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfarrayapplierfunction?language=objc)
95pub type CFArrayApplierFunction = Option<unsafe extern "C-unwind" fn(*const c_void, *mut c_void)>;
96
97/// This is the type of a reference to immutable CFArrays.
98///
99/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfarray?language=objc)
100#[repr(C)]
101pub struct CFArray<T: ?Sized = Opaque> {
102 inner: [u8; 0],
103 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
104 _generics: PhantomData<(*mut T,)>,
105}
106
107cf_type!(
108 unsafe impl<T: ?Sized> CFArray<T> {}
109);
110#[cfg(feature = "objc2")]
111cf_objc2_type!(
112 unsafe impl<T: ?Sized> RefEncode<"__CFArray"> for CFArray<T> {}
113);
114
115/// This is the type of a reference to mutable CFArrays.
116///
117/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfmutablearray?language=objc)
118#[repr(C)]
119pub struct CFMutableArray<T: ?Sized = Opaque> {
120 inner: [u8; 0],
121 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
122 _generics: PhantomData<(*mut T,)>,
123}
124
125cf_type!(
126 unsafe impl<T: ?Sized> CFMutableArray<T>: CFArray<T> {}
127);
128#[cfg(feature = "objc2")]
129cf_objc2_type!(
130 unsafe impl<T: ?Sized> RefEncode<"__CFArray"> for CFMutableArray<T> {}
131);
132
133unsafe impl ConcreteType for CFArray {
134 /// Returns the type identifier of all CFArray instances.
135 #[doc(alias = "CFArrayGetTypeID")]
136 #[inline]
137 fn type_id() -> CFTypeID {
138 extern "C-unwind" {
139 fn CFArrayGetTypeID() -> CFTypeID;
140 }
141 unsafe { CFArrayGetTypeID() }
142 }
143}
144
145impl CFArray {
146 /// Creates a new immutable array with the given values.
147 ///
148 /// Parameter `allocator`: The CFAllocator which should be used to allocate
149 /// memory for the array and its storage for values. This
150 /// parameter may be NULL in which case the current default
151 /// CFAllocator is used. If this reference is not a valid
152 /// CFAllocator, the behavior is undefined.
153 ///
154 /// Parameter `values`: A C array of the pointer-sized values to be in the
155 /// array. The values in the array are ordered in the same order
156 /// in which they appear in this C array. This parameter may be
157 /// NULL if the numValues parameter is 0. This C array is not
158 /// changed or freed by this function. If this parameter is not
159 /// a valid pointer to a C array of at least numValues pointers,
160 /// the behavior is undefined.
161 ///
162 /// Parameter `numValues`: The number of values to copy from the values C
163 /// array into the CFArray. This number will be the count of the
164 /// array.
165 /// If this parameter is negative, or greater than the number of
166 /// values actually in the value's C array, the behavior is
167 /// undefined.
168 ///
169 /// Parameter `callBacks`: A pointer to a CFArrayCallBacks structure
170 /// initialized with the callbacks for the array to use on each
171 /// value in the array. The retain callback will be used within
172 /// this function, for example, to retain all of the new values
173 /// from the values C array. A copy of the contents of the
174 /// callbacks structure is made, so that a pointer to a
175 /// structure on the stack can be passed in, or can be reused
176 /// for multiple array creations. If the version field of this
177 /// callbacks structure is not one of the defined ones for
178 /// CFArray, the behavior is undefined. The retain field may be
179 /// NULL, in which case the CFArray will do nothing to add a
180 /// retain to the contained values for the array. The release
181 /// field may be NULL, in which case the CFArray will do nothing
182 /// to remove the array's retain (if any) on the values when the
183 /// array is destroyed. If the copyDescription field is NULL,
184 /// the array will create a simple description for the value. If
185 /// the equal field is NULL, the array will use pointer equality
186 /// to test for equality of values. This callbacks parameter
187 /// itself may be NULL, which is treated as if a valid structure
188 /// of version 0 with all fields NULL had been passed in.
189 /// Otherwise, if any of the fields are not valid pointers to
190 /// functions of the correct type, or this parameter is not a
191 /// valid pointer to a CFArrayCallBacks callbacks structure,
192 /// the behavior is undefined. If any of the values put into the
193 /// array is not one understood by one of the callback functions
194 /// the behavior when that callback function is used is
195 /// undefined.
196 ///
197 /// Returns: A reference to the new immutable CFArray.
198 #[doc(alias = "CFArrayCreate")]
199 #[inline]
200 pub unsafe fn new(
201 allocator: Option<&CFAllocator>,
202 values: *mut *const c_void,
203 num_values: CFIndex,
204 call_backs: *const CFArrayCallBacks,
205 ) -> Option<CFRetained<CFArray>> {
206 extern "C-unwind" {
207 fn CFArrayCreate(
208 allocator: Option<&CFAllocator>,
209 values: *mut *const c_void,
210 num_values: CFIndex,
211 call_backs: *const CFArrayCallBacks,
212 ) -> Option<NonNull<CFArray>>;
213 }
214 let ret = unsafe { CFArrayCreate(allocator, values, num_values, call_backs) };
215 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
216 }
217
218 /// Creates a new immutable array with the values from the given array.
219 ///
220 /// Parameter `allocator`: The CFAllocator which should be used to allocate
221 /// memory for the array and its storage for values. This
222 /// parameter may be NULL in which case the current default
223 /// CFAllocator is used. If this reference is not a valid
224 /// CFAllocator, the behavior is undefined.
225 ///
226 /// Parameter `theArray`: The array which is to be copied. The values from the
227 /// array are copied as pointers into the new array (that is,
228 /// the values themselves are copied, not that which the values
229 /// point to, if anything). However, the values are also
230 /// retained by the new array. The count of the new array will
231 /// be the same as the given array. The new array uses the same
232 /// callbacks as the array to be copied. If this parameter is
233 /// not a valid CFArray, the behavior is undefined.
234 ///
235 /// Returns: A reference to the new immutable CFArray.
236 #[doc(alias = "CFArrayCreateCopy")]
237 #[inline]
238 pub unsafe fn new_copy(
239 allocator: Option<&CFAllocator>,
240 the_array: Option<&CFArray>,
241 ) -> Option<CFRetained<CFArray>> {
242 extern "C-unwind" {
243 fn CFArrayCreateCopy(
244 allocator: Option<&CFAllocator>,
245 the_array: Option<&CFArray>,
246 ) -> Option<NonNull<CFArray>>;
247 }
248 let ret = unsafe { CFArrayCreateCopy(allocator, the_array) };
249 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
250 }
251}
252
253impl CFMutableArray {
254 /// Creates a new empty mutable array.
255 ///
256 /// Parameter `allocator`: The CFAllocator which should be used to allocate
257 /// memory for the array and its storage for values. This
258 /// parameter may be NULL in which case the current default
259 /// CFAllocator is used. If this reference is not a valid
260 /// CFAllocator, the behavior is undefined.
261 ///
262 /// Parameter `capacity`: A hint about the number of values that will be held
263 /// by the CFArray. Pass 0 for no hint. The implementation may
264 /// ignore this hint, or may use it to optimize various
265 /// operations. An array's actual capacity is only limited by
266 /// address space and available memory constraints). If this
267 /// parameter is negative, the behavior is undefined.
268 ///
269 /// Parameter `callBacks`: A pointer to a CFArrayCallBacks structure
270 /// initialized with the callbacks for the array to use on each
271 /// value in the array. A copy of the contents of the
272 /// callbacks structure is made, so that a pointer to a
273 /// structure on the stack can be passed in, or can be reused
274 /// for multiple array creations. If the version field of this
275 /// callbacks structure is not one of the defined ones for
276 /// CFArray, the behavior is undefined. The retain field may be
277 /// NULL, in which case the CFArray will do nothing to add a
278 /// retain to the contained values for the array. The release
279 /// field may be NULL, in which case the CFArray will do nothing
280 /// to remove the array's retain (if any) on the values when the
281 /// array is destroyed. If the copyDescription field is NULL,
282 /// the array will create a simple description for the value. If
283 /// the equal field is NULL, the array will use pointer equality
284 /// to test for equality of values. This callbacks parameter
285 /// itself may be NULL, which is treated as if a valid structure
286 /// of version 0 with all fields NULL had been passed in.
287 /// Otherwise, if any of the fields are not valid pointers to
288 /// functions of the correct type, or this parameter is not a
289 /// valid pointer to a CFArrayCallBacks callbacks structure,
290 /// the behavior is undefined. If any of the values put into the
291 /// array is not one understood by one of the callback functions
292 /// the behavior when that callback function is used is
293 /// undefined.
294 ///
295 /// Returns: A reference to the new mutable CFArray.
296 #[doc(alias = "CFArrayCreateMutable")]
297 #[inline]
298 pub unsafe fn new(
299 allocator: Option<&CFAllocator>,
300 capacity: CFIndex,
301 call_backs: *const CFArrayCallBacks,
302 ) -> Option<CFRetained<CFMutableArray>> {
303 extern "C-unwind" {
304 fn CFArrayCreateMutable(
305 allocator: Option<&CFAllocator>,
306 capacity: CFIndex,
307 call_backs: *const CFArrayCallBacks,
308 ) -> Option<NonNull<CFMutableArray>>;
309 }
310 let ret = unsafe { CFArrayCreateMutable(allocator, capacity, call_backs) };
311 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
312 }
313
314 /// Creates a new mutable array with the values from the given array.
315 ///
316 /// Parameter `allocator`: The CFAllocator which should be used to allocate
317 /// memory for the array and its storage for values. This
318 /// parameter may be NULL in which case the current default
319 /// CFAllocator is used. If this reference is not a valid
320 /// CFAllocator, the behavior is undefined.
321 ///
322 /// Parameter `capacity`: A hint about the number of values that will be held
323 /// by the CFArray. Pass 0 for no hint. The implementation may
324 /// ignore this hint, or may use it to optimize various
325 /// operations. An array's actual capacity is only limited by
326 /// address space and available memory constraints).
327 /// This parameter must be greater than or equal
328 /// to the count of the array which is to be copied, or the
329 /// behavior is undefined. If this parameter is negative, the
330 /// behavior is undefined.
331 ///
332 /// Parameter `theArray`: The array which is to be copied. The values from the
333 /// array are copied as pointers into the new array (that is,
334 /// the values themselves are copied, not that which the values
335 /// point to, if anything). However, the values are also
336 /// retained by the new array. The count of the new array will
337 /// be the same as the given array. The new array uses the same
338 /// callbacks as the array to be copied. If this parameter is
339 /// not a valid CFArray, the behavior is undefined.
340 ///
341 /// Returns: A reference to the new mutable CFArray.
342 #[doc(alias = "CFArrayCreateMutableCopy")]
343 #[inline]
344 pub unsafe fn new_copy(
345 allocator: Option<&CFAllocator>,
346 capacity: CFIndex,
347 the_array: Option<&CFArray>,
348 ) -> Option<CFRetained<CFMutableArray>> {
349 extern "C-unwind" {
350 fn CFArrayCreateMutableCopy(
351 allocator: Option<&CFAllocator>,
352 capacity: CFIndex,
353 the_array: Option<&CFArray>,
354 ) -> Option<NonNull<CFMutableArray>>;
355 }
356 let ret = unsafe { CFArrayCreateMutableCopy(allocator, capacity, the_array) };
357 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
358 }
359}
360
361impl CFArray {
362 /// Returns the number of values currently in the array.
363 ///
364 /// Parameter `theArray`: The array to be queried. If this parameter is not a valid
365 /// CFArray, the behavior is undefined.
366 ///
367 /// Returns: The number of values in the array.
368 #[doc(alias = "CFArrayGetCount")]
369 #[inline]
370 pub fn count(self: &CFArray) -> CFIndex {
371 extern "C-unwind" {
372 fn CFArrayGetCount(the_array: &CFArray) -> CFIndex;
373 }
374 unsafe { CFArrayGetCount(self) }
375 }
376
377 /// Counts the number of times the given value occurs in the array.
378 ///
379 /// Parameter `theArray`: The array to be searched. If this parameter is not a
380 /// valid CFArray, the behavior is undefined.
381 ///
382 /// Parameter `range`: The range within the array to search. If the range
383 /// location or end point (defined by the location plus length
384 /// minus 1) is outside the index space of the array (0 to
385 /// N-1 inclusive, where N is the count of the array), the
386 /// behavior is undefined. If the range length is negative, the
387 /// behavior is undefined. The range may be empty (length 0).
388 ///
389 /// Parameter `value`: The value for which to find matches in the array. The
390 /// equal() callback provided when the array was created is
391 /// used to compare. If the equal() callback was NULL, pointer
392 /// equality (in C, ==) is used. If value, or any of the values
393 /// in the array, are not understood by the equal() callback,
394 /// the behavior is undefined.
395 ///
396 /// Returns: The number of times the given value occurs in the array,
397 /// within the specified range.
398 #[doc(alias = "CFArrayGetCountOfValue")]
399 #[inline]
400 pub unsafe fn count_of_value(self: &CFArray, range: CFRange, value: *const c_void) -> CFIndex {
401 extern "C-unwind" {
402 fn CFArrayGetCountOfValue(
403 the_array: &CFArray,
404 range: CFRange,
405 value: *const c_void,
406 ) -> CFIndex;
407 }
408 unsafe { CFArrayGetCountOfValue(self, range, value) }
409 }
410
411 /// Reports whether or not the value is in the array.
412 ///
413 /// Parameter `theArray`: The array to be searched. If this parameter is not a
414 /// valid CFArray, the behavior is undefined.
415 ///
416 /// Parameter `range`: The range within the array to search. If the range
417 /// location or end point (defined by the location plus length
418 /// minus 1) is outside the index space of the array (0 to
419 /// N-1 inclusive, where N is the count of the array), the
420 /// behavior is undefined. If the range length is negative, the
421 /// behavior is undefined. The range may be empty (length 0).
422 ///
423 /// Parameter `value`: The value for which to find matches in the array. The
424 /// equal() callback provided when the array was created is
425 /// used to compare. If the equal() callback was NULL, pointer
426 /// equality (in C, ==) is used. If value, or any of the values
427 /// in the array, are not understood by the equal() callback,
428 /// the behavior is undefined.
429 ///
430 /// Returns: true, if the value is in the specified range of the array,
431 /// otherwise false.
432 #[doc(alias = "CFArrayContainsValue")]
433 #[inline]
434 pub unsafe fn contains_value(self: &CFArray, range: CFRange, value: *const c_void) -> bool {
435 extern "C-unwind" {
436 fn CFArrayContainsValue(
437 the_array: &CFArray,
438 range: CFRange,
439 value: *const c_void,
440 ) -> Boolean;
441 }
442 let ret = unsafe { CFArrayContainsValue(self, range, value) };
443 ret != 0
444 }
445
446 /// Retrieves the value at the given index.
447 ///
448 /// Parameter `theArray`: The array to be queried. If this parameter is not a
449 /// valid CFArray, the behavior is undefined.
450 ///
451 /// Parameter `idx`: The index of the value to retrieve. If the index is
452 /// outside the index space of the array (0 to N-1 inclusive,
453 /// where N is the count of the array), the behavior is
454 /// undefined.
455 ///
456 /// Returns: The value with the given index in the array.
457 #[doc(alias = "CFArrayGetValueAtIndex")]
458 #[inline]
459 pub unsafe fn value_at_index(self: &CFArray, idx: CFIndex) -> *const c_void {
460 extern "C-unwind" {
461 fn CFArrayGetValueAtIndex(the_array: &CFArray, idx: CFIndex) -> *const c_void;
462 }
463 unsafe { CFArrayGetValueAtIndex(self, idx) }
464 }
465
466 /// Fills the buffer with values from the array.
467 ///
468 /// Parameter `theArray`: The array to be queried. If this parameter is not a
469 /// valid CFArray, the behavior is undefined.
470 ///
471 /// Parameter `range`: The range of values within the array to retrieve. If
472 /// the range location or end point (defined by the location
473 /// plus length minus 1) is outside the index space of the
474 /// array (0 to N-1 inclusive, where N is the count of the
475 /// array), the behavior is undefined. If the range length is
476 /// negative, the behavior is undefined. The range may be empty
477 /// (length 0), in which case no values are put into the buffer.
478 ///
479 /// Parameter `values`: A C array of pointer-sized values to be filled with
480 /// values from the array. The values in the C array are ordered
481 /// in the same order in which they appear in the array. If this
482 /// parameter is not a valid pointer to a C array of at least
483 /// range.length pointers, the behavior is undefined.
484 #[doc(alias = "CFArrayGetValues")]
485 #[inline]
486 pub unsafe fn values(self: &CFArray, range: CFRange, values: *mut *const c_void) {
487 extern "C-unwind" {
488 fn CFArrayGetValues(the_array: &CFArray, range: CFRange, values: *mut *const c_void);
489 }
490 unsafe { CFArrayGetValues(self, range, values) }
491 }
492
493 /// Calls a function once for each value in the array.
494 ///
495 /// Parameter `theArray`: The array to be operated upon. If this parameter is not
496 /// a valid CFArray, the behavior is undefined.
497 ///
498 /// Parameter `range`: The range of values within the array to which to apply
499 /// the function. If the range location or end point (defined by
500 /// the location plus length minus 1) is outside the index
501 /// space of the array (0 to N-1 inclusive, where N is the count
502 /// of the array), the behavior is undefined. If the range
503 /// length is negative, the behavior is undefined. The range may
504 /// be empty (length 0).
505 ///
506 /// Parameter `applier`: The callback function to call once for each value in
507 /// the given range in the array. If this parameter is not a
508 /// pointer to a function of the correct prototype, the behavior
509 /// is undefined. If there are values in the range which the
510 /// applier function does not expect or cannot properly apply
511 /// to, the behavior is undefined.
512 ///
513 /// Parameter `context`: A pointer-sized user-defined value, which is passed
514 /// as the second parameter to the applier function, but is
515 /// otherwise unused by this function. If the context is not
516 /// what is expected by the applier function, the behavior is
517 /// undefined.
518 #[doc(alias = "CFArrayApplyFunction")]
519 #[inline]
520 pub unsafe fn apply_function(
521 self: &CFArray,
522 range: CFRange,
523 applier: CFArrayApplierFunction,
524 context: *mut c_void,
525 ) {
526 extern "C-unwind" {
527 fn CFArrayApplyFunction(
528 the_array: &CFArray,
529 range: CFRange,
530 applier: CFArrayApplierFunction,
531 context: *mut c_void,
532 );
533 }
534 unsafe { CFArrayApplyFunction(self, range, applier, context) }
535 }
536
537 /// Searches the array for the value.
538 ///
539 /// Parameter `theArray`: The array to be searched. If this parameter is not a
540 /// valid CFArray, the behavior is undefined.
541 ///
542 /// Parameter `range`: The range within the array to search. If the range
543 /// location or end point (defined by the location plus length
544 /// minus 1) is outside the index space of the array (0 to
545 /// N-1 inclusive, where N is the count of the array), the
546 /// behavior is undefined. If the range length is negative, the
547 /// behavior is undefined. The range may be empty (length 0).
548 /// The search progresses from the smallest index defined by
549 /// the range to the largest.
550 ///
551 /// Parameter `value`: The value for which to find a match in the array. The
552 /// equal() callback provided when the array was created is
553 /// used to compare. If the equal() callback was NULL, pointer
554 /// equality (in C, ==) is used. If value, or any of the values
555 /// in the array, are not understood by the equal() callback,
556 /// the behavior is undefined.
557 ///
558 /// Returns: The lowest index of the matching values in the range, or
559 /// kCFNotFound if no value in the range matched.
560 #[doc(alias = "CFArrayGetFirstIndexOfValue")]
561 #[inline]
562 pub unsafe fn first_index_of_value(
563 self: &CFArray,
564 range: CFRange,
565 value: *const c_void,
566 ) -> CFIndex {
567 extern "C-unwind" {
568 fn CFArrayGetFirstIndexOfValue(
569 the_array: &CFArray,
570 range: CFRange,
571 value: *const c_void,
572 ) -> CFIndex;
573 }
574 unsafe { CFArrayGetFirstIndexOfValue(self, range, value) }
575 }
576
577 /// Searches the array for the value.
578 ///
579 /// Parameter `theArray`: The array to be searched. If this parameter is not a
580 /// valid CFArray, the behavior is undefined.
581 ///
582 /// Parameter `range`: The range within the array to search. If the range
583 /// location or end point (defined by the location plus length
584 /// minus 1) is outside the index space of the array (0 to
585 /// N-1 inclusive, where N is the count of the array), the
586 /// behavior is undefined. If the range length is negative, the
587 /// behavior is undefined. The range may be empty (length 0).
588 /// The search progresses from the largest index defined by the
589 /// range to the smallest.
590 ///
591 /// Parameter `value`: The value for which to find a match in the array. The
592 /// equal() callback provided when the array was created is
593 /// used to compare. If the equal() callback was NULL, pointer
594 /// equality (in C, ==) is used. If value, or any of the values
595 /// in the array, are not understood by the equal() callback,
596 /// the behavior is undefined.
597 ///
598 /// Returns: The highest index of the matching values in the range, or
599 /// kCFNotFound if no value in the range matched.
600 #[doc(alias = "CFArrayGetLastIndexOfValue")]
601 #[inline]
602 pub unsafe fn last_index_of_value(
603 self: &CFArray,
604 range: CFRange,
605 value: *const c_void,
606 ) -> CFIndex {
607 extern "C-unwind" {
608 fn CFArrayGetLastIndexOfValue(
609 the_array: &CFArray,
610 range: CFRange,
611 value: *const c_void,
612 ) -> CFIndex;
613 }
614 unsafe { CFArrayGetLastIndexOfValue(self, range, value) }
615 }
616
617 /// Searches the array for the value using a binary search algorithm.
618 ///
619 /// Parameter `theArray`: The array to be searched. If this parameter is not a
620 /// valid CFArray, the behavior is undefined. If the array is
621 /// not sorted from least to greatest according to the
622 /// comparator function, the behavior is undefined.
623 ///
624 /// Parameter `range`: The range within the array to search. If the range
625 /// location or end point (defined by the location plus length
626 /// minus 1) is outside the index space of the array (0 to
627 /// N-1 inclusive, where N is the count of the array), the
628 /// behavior is undefined. If the range length is negative, the
629 /// behavior is undefined. The range may be empty (length 0).
630 ///
631 /// Parameter `value`: The value for which to find a match in the array. If
632 /// value, or any of the values in the array, are not understood
633 /// by the comparator callback, the behavior is undefined.
634 ///
635 /// Parameter `comparator`: The function with the comparator function type
636 /// signature which is used in the binary search operation to
637 /// compare values in the array with the given value. If this
638 /// parameter is not a pointer to a function of the correct
639 /// prototype, the behavior is undefined. If there are values
640 /// in the range which the comparator function does not expect
641 /// or cannot properly compare, the behavior is undefined.
642 ///
643 /// Parameter `context`: A pointer-sized user-defined value, which is passed
644 /// as the third parameter to the comparator function, but is
645 /// otherwise unused by this function. If the context is not
646 /// what is expected by the comparator function, the behavior is
647 /// undefined.
648 ///
649 /// Returns: The return value is either 1) the index of a value that
650 /// matched, if the target value matches one or more in the
651 /// range, 2) greater than or equal to the end point of the
652 /// range, if the value is greater than all the values in the
653 /// range, or 3) the index of the value greater than the target
654 /// value, if the value lies between two of (or less than all
655 /// of) the values in the range.
656 #[doc(alias = "CFArrayBSearchValues")]
657 #[inline]
658 pub unsafe fn b_search_values(
659 self: &CFArray,
660 range: CFRange,
661 value: *const c_void,
662 comparator: CFComparatorFunction,
663 context: *mut c_void,
664 ) -> CFIndex {
665 extern "C-unwind" {
666 fn CFArrayBSearchValues(
667 the_array: &CFArray,
668 range: CFRange,
669 value: *const c_void,
670 comparator: CFComparatorFunction,
671 context: *mut c_void,
672 ) -> CFIndex;
673 }
674 unsafe { CFArrayBSearchValues(self, range, value, comparator, context) }
675 }
676}
677
678impl CFMutableArray {
679 /// Adds the value to the array giving it a new largest index.
680 ///
681 /// Parameter `theArray`: The array to which the value is to be added. If this
682 /// parameter is not a valid mutable CFArray, the behavior is
683 /// undefined.
684 ///
685 /// Parameter `value`: The value to add to the array. The value is retained by
686 /// the array using the retain callback provided when the array
687 /// was created. If the value is not of the sort expected by the
688 /// retain callback, the behavior is undefined. The value is
689 /// assigned to the index one larger than the previous largest
690 /// index, and the count of the array is increased by one.
691 #[doc(alias = "CFArrayAppendValue")]
692 #[inline]
693 pub unsafe fn append_value(the_array: Option<&CFMutableArray>, value: *const c_void) {
694 extern "C-unwind" {
695 fn CFArrayAppendValue(the_array: Option<&CFMutableArray>, value: *const c_void);
696 }
697 unsafe { CFArrayAppendValue(the_array, value) }
698 }
699
700 /// Adds the value to the array, giving it the given index.
701 ///
702 /// Parameter `theArray`: The array to which the value is to be added. If this
703 /// parameter is not a valid mutable CFArray, the behavior is
704 /// undefined.
705 ///
706 /// Parameter `idx`: The index to which to add the new value. If the index is
707 /// outside the index space of the array (0 to N inclusive,
708 /// where N is the count of the array before the operation), the
709 /// behavior is undefined. If the index is the same as N, this
710 /// function has the same effect as CFArrayAppendValue().
711 ///
712 /// Parameter `value`: The value to add to the array. The value is retained by
713 /// the array using the retain callback provided when the array
714 /// was created. If the value is not of the sort expected by the
715 /// retain callback, the behavior is undefined. The value is
716 /// assigned to the given index, and all values with equal and
717 /// larger indices have their indexes increased by one.
718 #[doc(alias = "CFArrayInsertValueAtIndex")]
719 #[inline]
720 pub unsafe fn insert_value_at_index(
721 the_array: Option<&CFMutableArray>,
722 idx: CFIndex,
723 value: *const c_void,
724 ) {
725 extern "C-unwind" {
726 fn CFArrayInsertValueAtIndex(
727 the_array: Option<&CFMutableArray>,
728 idx: CFIndex,
729 value: *const c_void,
730 );
731 }
732 unsafe { CFArrayInsertValueAtIndex(the_array, idx, value) }
733 }
734
735 /// Changes the value with the given index in the array.
736 ///
737 /// Parameter `theArray`: The array in which the value is to be changed. If this
738 /// parameter is not a valid mutable CFArray, the behavior is
739 /// undefined.
740 ///
741 /// Parameter `idx`: The index to which to set the new value. If the index is
742 /// outside the index space of the array (0 to N inclusive,
743 /// where N is the count of the array before the operation), the
744 /// behavior is undefined. If the index is the same as N, this
745 /// function has the same effect as CFArrayAppendValue().
746 ///
747 /// Parameter `value`: The value to set in the array. The value is retained by
748 /// the array using the retain callback provided when the array
749 /// was created, and the previous value with that index is
750 /// released. If the value is not of the sort expected by the
751 /// retain callback, the behavior is undefined. The indices of
752 /// other values is not affected.
753 #[doc(alias = "CFArraySetValueAtIndex")]
754 #[inline]
755 pub unsafe fn set_value_at_index(
756 the_array: Option<&CFMutableArray>,
757 idx: CFIndex,
758 value: *const c_void,
759 ) {
760 extern "C-unwind" {
761 fn CFArraySetValueAtIndex(
762 the_array: Option<&CFMutableArray>,
763 idx: CFIndex,
764 value: *const c_void,
765 );
766 }
767 unsafe { CFArraySetValueAtIndex(the_array, idx, value) }
768 }
769
770 /// Removes the value with the given index from the array.
771 ///
772 /// Parameter `theArray`: The array from which the value is to be removed. If
773 /// this parameter is not a valid mutable CFArray, the behavior
774 /// is undefined.
775 ///
776 /// Parameter `idx`: The index from which to remove the value. If the index is
777 /// outside the index space of the array (0 to N-1 inclusive,
778 /// where N is the count of the array before the operation), the
779 /// behavior is undefined.
780 #[doc(alias = "CFArrayRemoveValueAtIndex")]
781 #[inline]
782 pub unsafe fn remove_value_at_index(the_array: Option<&CFMutableArray>, idx: CFIndex) {
783 extern "C-unwind" {
784 fn CFArrayRemoveValueAtIndex(the_array: Option<&CFMutableArray>, idx: CFIndex);
785 }
786 unsafe { CFArrayRemoveValueAtIndex(the_array, idx) }
787 }
788
789 /// Removes all the values from the array, making it empty.
790 ///
791 /// Parameter `theArray`: The array from which all of the values are to be
792 /// removed. If this parameter is not a valid mutable CFArray,
793 /// the behavior is undefined.
794 #[doc(alias = "CFArrayRemoveAllValues")]
795 #[inline]
796 pub fn remove_all_values(the_array: Option<&CFMutableArray>) {
797 extern "C-unwind" {
798 fn CFArrayRemoveAllValues(the_array: Option<&CFMutableArray>);
799 }
800 unsafe { CFArrayRemoveAllValues(the_array) }
801 }
802
803 /// Replaces a range of values in the array.
804 ///
805 /// Parameter `theArray`: The array from which all of the values are to be
806 /// removed. If this parameter is not a valid mutable CFArray,
807 /// the behavior is undefined.
808 ///
809 /// Parameter `range`: The range of values within the array to replace. If the
810 /// range location or end point (defined by the location plus
811 /// length minus 1) is outside the index space of the array (0
812 /// to N inclusive, where N is the count of the array), the
813 /// behavior is undefined. If the range length is negative, the
814 /// behavior is undefined. The range may be empty (length 0),
815 /// in which case the new values are merely inserted at the
816 /// range location.
817 ///
818 /// Parameter `newValues`: A C array of the pointer-sized values to be placed
819 /// into the array. The new values in the array are ordered in
820 /// the same order in which they appear in this C array. This
821 /// parameter may be NULL if the newCount parameter is 0. This
822 /// C array is not changed or freed by this function. If this
823 /// parameter is not a valid pointer to a C array of at least
824 /// newCount pointers, the behavior is undefined.
825 ///
826 /// Parameter `newCount`: The number of values to copy from the values C
827 /// array into the CFArray. If this parameter is different than
828 /// the range length, the excess newCount values will be
829 /// inserted after the range, or the excess range values will be
830 /// deleted. This parameter may be 0, in which case no new
831 /// values are replaced into the array and the values in the
832 /// range are simply removed. If this parameter is negative, or
833 /// greater than the number of values actually in the newValues
834 /// C array, the behavior is undefined.
835 #[doc(alias = "CFArrayReplaceValues")]
836 #[inline]
837 pub unsafe fn replace_values(
838 the_array: Option<&CFMutableArray>,
839 range: CFRange,
840 new_values: *mut *const c_void,
841 new_count: CFIndex,
842 ) {
843 extern "C-unwind" {
844 fn CFArrayReplaceValues(
845 the_array: Option<&CFMutableArray>,
846 range: CFRange,
847 new_values: *mut *const c_void,
848 new_count: CFIndex,
849 );
850 }
851 unsafe { CFArrayReplaceValues(the_array, range, new_values, new_count) }
852 }
853
854 /// Exchanges the values at two indices of the array.
855 ///
856 /// Parameter `theArray`: The array of which the values are to be swapped. If
857 /// this parameter is not a valid mutable CFArray, the behavior
858 /// is undefined.
859 ///
860 /// Parameter `idx1`: The first index whose values should be swapped. If the
861 /// index is outside the index space of the array (0 to N-1
862 /// inclusive, where N is the count of the array before the
863 /// operation), the behavior is undefined.
864 ///
865 /// Parameter `idx2`: The second index whose values should be swapped. If the
866 /// index is outside the index space of the array (0 to N-1
867 /// inclusive, where N is the count of the array before the
868 /// operation), the behavior is undefined.
869 #[doc(alias = "CFArrayExchangeValuesAtIndices")]
870 #[inline]
871 pub unsafe fn exchange_values_at_indices(
872 the_array: Option<&CFMutableArray>,
873 idx1: CFIndex,
874 idx2: CFIndex,
875 ) {
876 extern "C-unwind" {
877 fn CFArrayExchangeValuesAtIndices(
878 the_array: Option<&CFMutableArray>,
879 idx1: CFIndex,
880 idx2: CFIndex,
881 );
882 }
883 unsafe { CFArrayExchangeValuesAtIndices(the_array, idx1, idx2) }
884 }
885
886 /// Sorts the values in the array using the given comparison function.
887 ///
888 /// Parameter `theArray`: The array whose values are to be sorted. If this
889 /// parameter is not a valid mutable CFArray, the behavior is
890 /// undefined.
891 ///
892 /// Parameter `range`: The range of values within the array to sort. If the
893 /// range location or end point (defined by the location plus
894 /// length minus 1) is outside the index space of the array (0
895 /// to N-1 inclusive, where N is the count of the array), the
896 /// behavior is undefined. If the range length is negative, the
897 /// behavior is undefined. The range may be empty (length 0).
898 ///
899 /// Parameter `comparator`: The function with the comparator function type
900 /// signature which is used in the sort operation to compare
901 /// values in the array with the given value. If this parameter
902 /// is not a pointer to a function of the correct prototype, the
903 /// the behavior is undefined. If there are values in the array
904 /// which the comparator function does not expect or cannot
905 /// properly compare, the behavior is undefined. The values in
906 /// the range are sorted from least to greatest according to
907 /// this function.
908 ///
909 /// Parameter `context`: A pointer-sized user-defined value, which is passed
910 /// as the third parameter to the comparator function, but is
911 /// otherwise unused by this function. If the context is not
912 /// what is expected by the comparator function, the behavior is
913 /// undefined.
914 #[doc(alias = "CFArraySortValues")]
915 #[inline]
916 pub unsafe fn sort_values(
917 the_array: Option<&CFMutableArray>,
918 range: CFRange,
919 comparator: CFComparatorFunction,
920 context: *mut c_void,
921 ) {
922 extern "C-unwind" {
923 fn CFArraySortValues(
924 the_array: Option<&CFMutableArray>,
925 range: CFRange,
926 comparator: CFComparatorFunction,
927 context: *mut c_void,
928 );
929 }
930 unsafe { CFArraySortValues(the_array, range, comparator, context) }
931 }
932
933 /// Adds the values from an array to another array.
934 ///
935 /// Parameter `theArray`: The array to which values from the otherArray are to
936 /// be added. If this parameter is not a valid mutable CFArray,
937 /// the behavior is undefined.
938 ///
939 /// Parameter `otherArray`: The array providing the values to be added to the
940 /// array. If this parameter is not a valid CFArray, the
941 /// behavior is undefined.
942 ///
943 /// Parameter `otherRange`: The range within the otherArray from which to add
944 /// the values to the array. If the range location or end point
945 /// (defined by the location plus length minus 1) is outside
946 /// the index space of the otherArray (0 to N-1 inclusive, where
947 /// N is the count of the otherArray), the behavior is
948 /// undefined. The new values are retained by the array using
949 /// the retain callback provided when the array was created. If
950 /// the values are not of the sort expected by the retain
951 /// callback, the behavior is undefined. The values are assigned
952 /// to the indices one larger than the previous largest index
953 /// in the array, and beyond, and the count of the array is
954 /// increased by range.length. The values are assigned new
955 /// indices in the array from smallest to largest index in the
956 /// order in which they appear in the otherArray.
957 #[doc(alias = "CFArrayAppendArray")]
958 #[inline]
959 pub unsafe fn append_array(
960 the_array: Option<&CFMutableArray>,
961 other_array: Option<&CFArray>,
962 other_range: CFRange,
963 ) {
964 extern "C-unwind" {
965 fn CFArrayAppendArray(
966 the_array: Option<&CFMutableArray>,
967 other_array: Option<&CFArray>,
968 other_range: CFRange,
969 );
970 }
971 unsafe { CFArrayAppendArray(the_array, other_array, other_range) }
972 }
973}
974
975#[deprecated = "renamed to `CFArray::new`"]
976#[inline]
977pub unsafe extern "C-unwind" fn CFArrayCreate(
978 allocator: Option<&CFAllocator>,
979 values: *mut *const c_void,
980 num_values: CFIndex,
981 call_backs: *const CFArrayCallBacks,
982) -> Option<CFRetained<CFArray>> {
983 extern "C-unwind" {
984 fn CFArrayCreate(
985 allocator: Option<&CFAllocator>,
986 values: *mut *const c_void,
987 num_values: CFIndex,
988 call_backs: *const CFArrayCallBacks,
989 ) -> Option<NonNull<CFArray>>;
990 }
991 let ret = unsafe { CFArrayCreate(allocator, values, num_values, call_backs) };
992 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
993}
994
995#[deprecated = "renamed to `CFArray::new_copy`"]
996#[inline]
997pub unsafe extern "C-unwind" fn CFArrayCreateCopy(
998 allocator: Option<&CFAllocator>,
999 the_array: Option<&CFArray>,
1000) -> Option<CFRetained<CFArray>> {
1001 extern "C-unwind" {
1002 fn CFArrayCreateCopy(
1003 allocator: Option<&CFAllocator>,
1004 the_array: Option<&CFArray>,
1005 ) -> Option<NonNull<CFArray>>;
1006 }
1007 let ret = unsafe { CFArrayCreateCopy(allocator, the_array) };
1008 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1009}
1010
1011#[deprecated = "renamed to `CFMutableArray::new`"]
1012#[inline]
1013pub unsafe extern "C-unwind" fn CFArrayCreateMutable(
1014 allocator: Option<&CFAllocator>,
1015 capacity: CFIndex,
1016 call_backs: *const CFArrayCallBacks,
1017) -> Option<CFRetained<CFMutableArray>> {
1018 extern "C-unwind" {
1019 fn CFArrayCreateMutable(
1020 allocator: Option<&CFAllocator>,
1021 capacity: CFIndex,
1022 call_backs: *const CFArrayCallBacks,
1023 ) -> Option<NonNull<CFMutableArray>>;
1024 }
1025 let ret = unsafe { CFArrayCreateMutable(allocator, capacity, call_backs) };
1026 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1027}
1028
1029#[deprecated = "renamed to `CFMutableArray::new_copy`"]
1030#[inline]
1031pub unsafe extern "C-unwind" fn CFArrayCreateMutableCopy(
1032 allocator: Option<&CFAllocator>,
1033 capacity: CFIndex,
1034 the_array: Option<&CFArray>,
1035) -> Option<CFRetained<CFMutableArray>> {
1036 extern "C-unwind" {
1037 fn CFArrayCreateMutableCopy(
1038 allocator: Option<&CFAllocator>,
1039 capacity: CFIndex,
1040 the_array: Option<&CFArray>,
1041 ) -> Option<NonNull<CFMutableArray>>;
1042 }
1043 let ret = unsafe { CFArrayCreateMutableCopy(allocator, capacity, the_array) };
1044 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1045}
1046
1047#[deprecated = "renamed to `CFArray::count`"]
1048#[inline]
1049pub extern "C-unwind" fn CFArrayGetCount(the_array: &CFArray) -> CFIndex {
1050 extern "C-unwind" {
1051 fn CFArrayGetCount(the_array: &CFArray) -> CFIndex;
1052 }
1053 unsafe { CFArrayGetCount(the_array) }
1054}
1055
1056extern "C-unwind" {
1057 #[deprecated = "renamed to `CFArray::count_of_value`"]
1058 pub fn CFArrayGetCountOfValue(
1059 the_array: &CFArray,
1060 range: CFRange,
1061 value: *const c_void,
1062 ) -> CFIndex;
1063}
1064
1065#[deprecated = "renamed to `CFArray::contains_value`"]
1066#[inline]
1067pub unsafe extern "C-unwind" fn CFArrayContainsValue(
1068 the_array: &CFArray,
1069 range: CFRange,
1070 value: *const c_void,
1071) -> bool {
1072 extern "C-unwind" {
1073 fn CFArrayContainsValue(
1074 the_array: &CFArray,
1075 range: CFRange,
1076 value: *const c_void,
1077 ) -> Boolean;
1078 }
1079 let ret = unsafe { CFArrayContainsValue(the_array, range, value) };
1080 ret != 0
1081}
1082
1083extern "C-unwind" {
1084 #[deprecated = "renamed to `CFArray::value_at_index`"]
1085 pub fn CFArrayGetValueAtIndex(the_array: &CFArray, idx: CFIndex) -> *const c_void;
1086}
1087
1088extern "C-unwind" {
1089 #[deprecated = "renamed to `CFArray::values`"]
1090 pub fn CFArrayGetValues(the_array: &CFArray, range: CFRange, values: *mut *const c_void);
1091}
1092
1093extern "C-unwind" {
1094 #[deprecated = "renamed to `CFArray::apply_function`"]
1095 pub fn CFArrayApplyFunction(
1096 the_array: &CFArray,
1097 range: CFRange,
1098 applier: CFArrayApplierFunction,
1099 context: *mut c_void,
1100 );
1101}
1102
1103extern "C-unwind" {
1104 #[deprecated = "renamed to `CFArray::first_index_of_value`"]
1105 pub fn CFArrayGetFirstIndexOfValue(
1106 the_array: &CFArray,
1107 range: CFRange,
1108 value: *const c_void,
1109 ) -> CFIndex;
1110}
1111
1112extern "C-unwind" {
1113 #[deprecated = "renamed to `CFArray::last_index_of_value`"]
1114 pub fn CFArrayGetLastIndexOfValue(
1115 the_array: &CFArray,
1116 range: CFRange,
1117 value: *const c_void,
1118 ) -> CFIndex;
1119}
1120
1121extern "C-unwind" {
1122 #[deprecated = "renamed to `CFArray::b_search_values`"]
1123 pub fn CFArrayBSearchValues(
1124 the_array: &CFArray,
1125 range: CFRange,
1126 value: *const c_void,
1127 comparator: CFComparatorFunction,
1128 context: *mut c_void,
1129 ) -> CFIndex;
1130}
1131
1132extern "C-unwind" {
1133 #[deprecated = "renamed to `CFMutableArray::append_value`"]
1134 pub fn CFArrayAppendValue(the_array: Option<&CFMutableArray>, value: *const c_void);
1135}
1136
1137extern "C-unwind" {
1138 #[deprecated = "renamed to `CFMutableArray::insert_value_at_index`"]
1139 pub fn CFArrayInsertValueAtIndex(
1140 the_array: Option<&CFMutableArray>,
1141 idx: CFIndex,
1142 value: *const c_void,
1143 );
1144}
1145
1146extern "C-unwind" {
1147 #[deprecated = "renamed to `CFMutableArray::set_value_at_index`"]
1148 pub fn CFArraySetValueAtIndex(
1149 the_array: Option<&CFMutableArray>,
1150 idx: CFIndex,
1151 value: *const c_void,
1152 );
1153}
1154
1155extern "C-unwind" {
1156 #[deprecated = "renamed to `CFMutableArray::remove_value_at_index`"]
1157 pub fn CFArrayRemoveValueAtIndex(the_array: Option<&CFMutableArray>, idx: CFIndex);
1158}
1159
1160#[deprecated = "renamed to `CFMutableArray::remove_all_values`"]
1161#[inline]
1162pub extern "C-unwind" fn CFArrayRemoveAllValues(the_array: Option<&CFMutableArray>) {
1163 extern "C-unwind" {
1164 fn CFArrayRemoveAllValues(the_array: Option<&CFMutableArray>);
1165 }
1166 unsafe { CFArrayRemoveAllValues(the_array) }
1167}
1168
1169extern "C-unwind" {
1170 #[deprecated = "renamed to `CFMutableArray::replace_values`"]
1171 pub fn CFArrayReplaceValues(
1172 the_array: Option<&CFMutableArray>,
1173 range: CFRange,
1174 new_values: *mut *const c_void,
1175 new_count: CFIndex,
1176 );
1177}
1178
1179extern "C-unwind" {
1180 #[deprecated = "renamed to `CFMutableArray::exchange_values_at_indices`"]
1181 pub fn CFArrayExchangeValuesAtIndices(
1182 the_array: Option<&CFMutableArray>,
1183 idx1: CFIndex,
1184 idx2: CFIndex,
1185 );
1186}
1187
1188extern "C-unwind" {
1189 #[deprecated = "renamed to `CFMutableArray::sort_values`"]
1190 pub fn CFArraySortValues(
1191 the_array: Option<&CFMutableArray>,
1192 range: CFRange,
1193 comparator: CFComparatorFunction,
1194 context: *mut c_void,
1195 );
1196}
1197
1198extern "C-unwind" {
1199 #[deprecated = "renamed to `CFMutableArray::append_array`"]
1200 pub fn CFArrayAppendArray(
1201 the_array: Option<&CFMutableArray>,
1202 other_array: Option<&CFArray>,
1203 other_range: CFRange,
1204 );
1205}