objc2_core_foundation/generated/
CFSet.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/// Type of the callback function used by CFSets for retaining values.
13///
14/// Parameter `allocator`: The allocator of the CFSet.
15///
16/// Parameter `value`: The value to retain.
17///
18/// Returns: The value to store in the set, 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 set.
21///
22/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfsetretaincallback?language=objc)
23#[cfg(feature = "CFBase")]
24pub type CFSetRetainCallBack =
25    Option<unsafe extern "C-unwind" fn(*const CFAllocator, *const c_void) -> *const c_void>;
26
27/// Type of the callback function used by CFSets for releasing a retain on values.
28///
29/// Parameter `allocator`: The allocator of the CFSet.
30///
31/// Parameter `value`: The value to release.
32///
33/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfsetreleasecallback?language=objc)
34#[cfg(feature = "CFBase")]
35pub type CFSetReleaseCallBack =
36    Option<unsafe extern "C-unwind" fn(*const CFAllocator, *const c_void)>;
37
38/// Type of the callback function used by CFSets for describing values.
39///
40/// Parameter `value`: The value to describe.
41///
42/// Returns: A description of the specified value.
43///
44/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfsetcopydescriptioncallback?language=objc)
45#[cfg(feature = "CFBase")]
46pub type CFSetCopyDescriptionCallBack =
47    Option<unsafe extern "C-unwind" fn(*const c_void) -> *const CFString>;
48
49/// Type of the callback function used by CFSets for comparing values.
50///
51/// Parameter `value1`: The first value to compare.
52///
53/// Parameter `value2`: The second value to compare.
54///
55/// Returns: True if the values are equal, otherwise false.
56///
57/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfsetequalcallback?language=objc)
58pub type CFSetEqualCallBack =
59    Option<unsafe extern "C-unwind" fn(*const c_void, *const c_void) -> Boolean>;
60
61/// Type of the callback function used by CFSets for hashing values.
62///
63/// Parameter `value`: The value to hash.
64///
65/// Returns: The hash of the value.
66///
67/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfsethashcallback?language=objc)
68#[cfg(feature = "CFBase")]
69pub type CFSetHashCallBack = Option<unsafe extern "C-unwind" fn(*const c_void) -> CFHashCode>;
70
71/// Structure containing the callbacks of a CFSet.
72/// Field: version The version number of the structure type being passed
73/// in as a parameter to the CFSet creation functions. This
74/// structure is version 0.
75/// Field: retain The callback used to add a retain for the set on
76/// values as they are put into the set. This callback returns
77/// the value to store in the set, which is usually the value
78/// parameter passed to this callback, but may be a different
79/// value if a different value should be stored in the set.
80/// The set's allocator is passed as the first argument.
81/// Field: release The callback used to remove a retain previously added
82/// for the set from values as they are removed from the
83/// set. The set's allocator is passed as the first
84/// argument.
85/// Field: copyDescription The callback used to create a descriptive
86/// string representation of each value in the set. This is
87/// used by the CFCopyDescription() function.
88/// Field: equal The callback used to compare values in the set for
89/// equality for some operations.
90/// Field: hash The callback used to compare values in the set for
91/// uniqueness for some operations.
92///
93/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfsetcallbacks?language=objc)
94#[cfg(feature = "CFBase")]
95#[repr(C)]
96#[derive(Clone, Copy, Debug, PartialEq)]
97pub struct CFSetCallBacks {
98    pub version: CFIndex,
99    pub retain: CFSetRetainCallBack,
100    pub release: CFSetReleaseCallBack,
101    pub copyDescription: CFSetCopyDescriptionCallBack,
102    pub equal: CFSetEqualCallBack,
103    pub hash: CFSetHashCallBack,
104}
105
106#[cfg(all(feature = "CFBase", feature = "objc2"))]
107unsafe impl Encode for CFSetCallBacks {
108    const ENCODING: Encoding = Encoding::Struct(
109        "?",
110        &[
111            <CFIndex>::ENCODING,
112            <CFSetRetainCallBack>::ENCODING,
113            <CFSetReleaseCallBack>::ENCODING,
114            <CFSetCopyDescriptionCallBack>::ENCODING,
115            <CFSetEqualCallBack>::ENCODING,
116            <CFSetHashCallBack>::ENCODING,
117        ],
118    );
119}
120
121#[cfg(all(feature = "CFBase", feature = "objc2"))]
122unsafe impl RefEncode for CFSetCallBacks {
123    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
124}
125
126extern "C" {
127    /// Predefined CFSetCallBacks structure containing a set of callbacks
128    /// appropriate for use when the values in a CFSet are all CFTypes.
129    ///
130    /// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcftypesetcallbacks?language=objc)
131    #[cfg(feature = "CFBase")]
132    pub static kCFTypeSetCallBacks: CFSetCallBacks;
133}
134
135extern "C" {
136    /// Predefined CFSetCallBacks structure containing a set of callbacks
137    /// appropriate for use when the values in a CFSet should be copies
138    /// of a CFString.
139    ///
140    /// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfcopystringsetcallbacks?language=objc)
141    #[cfg(feature = "CFBase")]
142    pub static kCFCopyStringSetCallBacks: CFSetCallBacks;
143}
144
145/// Type of the callback function used by the apply functions of
146/// CFSets.
147///
148/// Parameter `value`: The current value from the set.
149///
150/// Parameter `context`: The user-defined context parameter given to the apply
151/// function.
152///
153/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfsetapplierfunction?language=objc)
154pub type CFSetApplierFunction = Option<unsafe extern "C-unwind" fn(*const c_void, *mut c_void)>;
155
156/// This is the type of a reference to immutable CFSets.
157///
158/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfset?language=objc)
159#[repr(C)]
160pub struct CFSet {
161    inner: [u8; 0],
162    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
163}
164
165cf_type!(
166    #[encoding_name = "__CFSet"]
167    unsafe impl CFSet {}
168);
169
170/// This is the type of a reference to mutable CFSets.
171///
172/// See also [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfmutableset?language=objc)
173#[repr(C)]
174pub struct CFMutableSet {
175    inner: [u8; 0],
176    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
177}
178
179cf_type!(
180    #[encoding_name = "__CFSet"]
181    unsafe impl CFMutableSet: CFSet {}
182);
183
184#[cfg(feature = "CFBase")]
185unsafe impl ConcreteType for CFSet {
186    /// Returns the type identifier of all CFSet instances.
187    #[doc(alias = "CFSetGetTypeID")]
188    #[inline]
189    fn type_id() -> CFTypeID {
190        extern "C-unwind" {
191            fn CFSetGetTypeID() -> CFTypeID;
192        }
193        unsafe { CFSetGetTypeID() }
194    }
195}
196
197/// Creates a new immutable set with the given values.
198///
199/// Parameter `allocator`: The CFAllocator which should be used to allocate
200/// memory for the set and its storage for values. This
201/// parameter may be NULL in which case the current default
202/// CFAllocator is used. If this reference is not a valid
203/// CFAllocator, the behavior is undefined.
204///
205/// Parameter `values`: A C array of the pointer-sized values to be in the
206/// set.  This C array is not changed or freed by this function.
207/// If this parameter is not a valid pointer to a C array of at
208/// least numValues pointers, the behavior is undefined.
209///
210/// Parameter `numValues`: The number of values to copy from the values C
211/// array into the CFSet. This number will be the count of the
212/// set.  If this parameter is zero, negative, or greater than
213/// the number of values actually in the values C array, the
214/// behavior is undefined.
215///
216/// Parameter `callBacks`: A C pointer to a CFSetCallBacks structure
217/// initialized with the callbacks for the set to use on each
218/// value in the set. A copy of the contents of the
219/// callbacks structure is made, so that a pointer to a
220/// structure on the stack can be passed in, or can be reused
221/// for multiple set creations. If the version field of this
222/// callbacks structure is not one of the defined ones for
223/// CFSet, the behavior is undefined. The retain field may be
224/// NULL, in which case the CFSet will do nothing to add a
225/// retain to the contained values for the set. The release
226/// field may be NULL, in which case the CFSet will do nothing
227/// to remove the set's retain (if any) on the values when the
228/// set is destroyed. If the copyDescription field is NULL,
229/// the set will create a simple description for the value. If
230/// the equal field is NULL, the set will use pointer equality
231/// to test for equality of values. The hash field may be NULL,
232/// in which case the CFSet will determine uniqueness by pointer
233/// equality. This callbacks parameter
234/// itself may be NULL, which is treated as if a valid structure
235/// of version 0 with all fields NULL had been passed in.
236/// Otherwise, if any of the fields are not valid pointers to
237/// functions of the correct type, or this parameter is not a
238/// valid pointer to a  CFSetCallBacks callbacks structure,
239/// the behavior is undefined. If any of the values put into the
240/// set is not one understood by one of the callback functions
241/// the behavior when that callback function is used is
242/// undefined.
243///
244/// Returns: A reference to the new immutable CFSet.
245#[cfg(feature = "CFBase")]
246#[inline]
247pub unsafe extern "C-unwind" fn CFSetCreate(
248    allocator: Option<&CFAllocator>,
249    values: *mut *const c_void,
250    num_values: CFIndex,
251    call_backs: *const CFSetCallBacks,
252) -> Option<CFRetained<CFSet>> {
253    extern "C-unwind" {
254        fn CFSetCreate(
255            allocator: Option<&CFAllocator>,
256            values: *mut *const c_void,
257            num_values: CFIndex,
258            call_backs: *const CFSetCallBacks,
259        ) -> Option<NonNull<CFSet>>;
260    }
261    let ret = unsafe { CFSetCreate(allocator, values, num_values, call_backs) };
262    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
263}
264
265/// Creates a new immutable set with the values from the given set.
266///
267/// Parameter `allocator`: The CFAllocator which should be used to allocate
268/// memory for the set and its storage for values. This
269/// parameter may be NULL in which case the current default
270/// CFAllocator is used. If this reference is not a valid
271/// CFAllocator, the behavior is undefined.
272///
273/// Parameter `theSet`: The set which is to be copied. The values from the
274/// set are copied as pointers into the new set (that is,
275/// the values themselves are copied, not that which the values
276/// point to, if anything). However, the values are also
277/// retained by the new set. The count of the new set will
278/// be the same as the copied set. The new set uses the same
279/// callbacks as the set to be copied. If this parameter is
280/// not a valid CFSet, the behavior is undefined.
281///
282/// Returns: A reference to the new immutable CFSet.
283#[cfg(feature = "CFBase")]
284#[inline]
285pub unsafe extern "C-unwind" fn CFSetCreateCopy(
286    allocator: Option<&CFAllocator>,
287    the_set: Option<&CFSet>,
288) -> Option<CFRetained<CFSet>> {
289    extern "C-unwind" {
290        fn CFSetCreateCopy(
291            allocator: Option<&CFAllocator>,
292            the_set: Option<&CFSet>,
293        ) -> Option<NonNull<CFSet>>;
294    }
295    let ret = unsafe { CFSetCreateCopy(allocator, the_set) };
296    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
297}
298
299/// Creates a new empty mutable set.
300///
301/// Parameter `allocator`: The CFAllocator which should be used to allocate
302/// memory for the set and its storage for values. This
303/// parameter may be NULL in which case the current default
304/// CFAllocator is used. If this reference is not a valid
305/// CFAllocator, the behavior is undefined.
306///
307/// Parameter `capacity`: A hint about the number of values that will be held
308/// by the CFSet. Pass 0 for no hint. The implementation may
309/// ignore this hint, or may use it to optimize various
310/// operations. A set's actual capacity is only limited by
311/// address space and available memory constraints). If this
312/// parameter is negative, the behavior is undefined.
313///
314/// Parameter `callBacks`: A C pointer to a CFSetCallBacks structure
315/// initialized with the callbacks for the set to use on each
316/// value in the set. A copy of the contents of the
317/// callbacks structure is made, so that a pointer to a
318/// structure on the stack can be passed in, or can be reused
319/// for multiple set creations. If the version field of this
320/// callbacks structure is not one of the defined ones for
321/// CFSet, the behavior is undefined. The retain field may be
322/// NULL, in which case the CFSet will do nothing to add a
323/// retain to the contained values for the set. The release
324/// field may be NULL, in which case the CFSet will do nothing
325/// to remove the set's retain (if any) on the values when the
326/// set is destroyed. If the copyDescription field is NULL,
327/// the set will create a simple description for the value. If
328/// the equal field is NULL, the set will use pointer equality
329/// to test for equality of values. The hash field may be NULL,
330/// in which case the CFSet will determine uniqueness by pointer
331/// equality. This callbacks parameter
332/// itself may be NULL, which is treated as if a valid structure
333/// of version 0 with all fields NULL had been passed in.
334/// Otherwise, if any of the fields are not valid pointers to
335/// functions of the correct type, or this parameter is not a
336/// valid pointer to a  CFSetCallBacks callbacks structure,
337/// the behavior is undefined. If any of the values put into the
338/// set is not one understood by one of the callback functions
339/// the behavior when that callback function is used is
340/// undefined.
341///
342/// Returns: A reference to the new mutable CFSet.
343#[cfg(feature = "CFBase")]
344#[inline]
345pub unsafe extern "C-unwind" fn CFSetCreateMutable(
346    allocator: Option<&CFAllocator>,
347    capacity: CFIndex,
348    call_backs: *const CFSetCallBacks,
349) -> Option<CFRetained<CFMutableSet>> {
350    extern "C-unwind" {
351        fn CFSetCreateMutable(
352            allocator: Option<&CFAllocator>,
353            capacity: CFIndex,
354            call_backs: *const CFSetCallBacks,
355        ) -> Option<NonNull<CFMutableSet>>;
356    }
357    let ret = unsafe { CFSetCreateMutable(allocator, capacity, call_backs) };
358    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
359}
360
361/// Creates a new immutable set with the values from the given set.
362///
363/// Parameter `allocator`: The CFAllocator which should be used to allocate
364/// memory for the set and its storage for values. This
365/// parameter may be NULL in which case the current default
366/// CFAllocator is used. If this reference is not a valid
367/// CFAllocator, the behavior is undefined.
368///
369/// Parameter `capacity`: A hint about the number of values that will be held
370/// by the CFSet. Pass 0 for no hint. The implementation may
371/// ignore this hint, or may use it to optimize various
372/// operations. A set's actual capacity is only limited by
373/// address space and available memory constraints).
374/// This parameter must be greater than or equal
375/// to the count of the set which is to be copied, or the
376/// behavior is undefined. If this parameter is negative, the
377/// behavior is undefined.
378///
379/// Parameter `theSet`: The set which is to be copied. The values from the
380/// set are copied as pointers into the new set (that is,
381/// the values themselves are copied, not that which the values
382/// point to, if anything). However, the values are also
383/// retained by the new set. The count of the new set will
384/// be the same as the copied set. The new set uses the same
385/// callbacks as the set to be copied. If this parameter is
386/// not a valid CFSet, the behavior is undefined.
387///
388/// Returns: A reference to the new mutable CFSet.
389#[cfg(feature = "CFBase")]
390#[inline]
391pub unsafe extern "C-unwind" fn CFSetCreateMutableCopy(
392    allocator: Option<&CFAllocator>,
393    capacity: CFIndex,
394    the_set: Option<&CFSet>,
395) -> Option<CFRetained<CFMutableSet>> {
396    extern "C-unwind" {
397        fn CFSetCreateMutableCopy(
398            allocator: Option<&CFAllocator>,
399            capacity: CFIndex,
400            the_set: Option<&CFSet>,
401        ) -> Option<NonNull<CFMutableSet>>;
402    }
403    let ret = unsafe { CFSetCreateMutableCopy(allocator, capacity, the_set) };
404    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
405}
406
407extern "C-unwind" {
408    /// Returns the number of values currently in the set.
409    ///
410    /// Parameter `theSet`: The set to be queried. If this parameter is not a valid
411    /// CFSet, the behavior is undefined.
412    ///
413    /// Returns: The number of values in the set.
414    #[cfg(feature = "CFBase")]
415    pub fn CFSetGetCount(the_set: &CFSet) -> CFIndex;
416}
417
418extern "C-unwind" {
419    /// Counts the number of times the given value occurs in the set. Since
420    /// sets by definition contain only one instance of a value, this function
421    /// is synonymous to CFSetContainsValue.
422    ///
423    /// Parameter `theSet`: The set to be searched. If this parameter is not a
424    /// valid CFSet, the behavior is undefined.
425    ///
426    /// Parameter `value`: The value for which to find matches in the set. The
427    /// equal() callback provided when the set was created is
428    /// used to compare. If the equal() callback was NULL, pointer
429    /// equality (in C, ==) is used. If value, or any of the values
430    /// in the set, are not understood by the equal() callback,
431    /// the behavior is undefined.
432    ///
433    /// Returns: The number of times the given value occurs in the set.
434    #[cfg(feature = "CFBase")]
435    pub fn CFSetGetCountOfValue(the_set: &CFSet, value: *const c_void) -> CFIndex;
436}
437
438/// Reports whether or not the value is in the set.
439///
440/// Parameter `theSet`: The set to be searched. If this parameter is not a
441/// valid CFSet, the behavior is undefined.
442///
443/// Parameter `value`: The value for which to find matches in the set. The
444/// equal() callback provided when the set was created is
445/// used to compare. If the equal() callback was NULL, pointer
446/// equality (in C, ==) is used. If value, or any of the values
447/// in the set, are not understood by the equal() callback,
448/// the behavior is undefined.
449///
450/// Returns: true, if the value is in the set, otherwise false.
451#[inline]
452pub unsafe extern "C-unwind" fn CFSetContainsValue(the_set: &CFSet, value: *const c_void) -> bool {
453    extern "C-unwind" {
454        fn CFSetContainsValue(the_set: &CFSet, value: *const c_void) -> Boolean;
455    }
456    let ret = unsafe { CFSetContainsValue(the_set, value) };
457    ret != 0
458}
459
460extern "C-unwind" {
461    /// Retrieves a value in the set which hashes the same as the specified value.
462    ///
463    /// Parameter `theSet`: The set to be queried. If this parameter is not a
464    /// valid CFSet, the behavior is undefined.
465    ///
466    /// Parameter `value`: The value to retrieve. The equal() callback provided when
467    /// the set was created is used to compare. If the equal() callback
468    /// was NULL, pointer equality (in C, ==) is used. If a value, or
469    /// any of the values in the set, are not understood by the equal()
470    /// callback, the behavior is undefined.
471    ///
472    /// Returns: The value in the set with the given hash.
473    pub fn CFSetGetValue(the_set: &CFSet, value: *const c_void) -> *const c_void;
474}
475
476/// Retrieves a value in the set which hashes the same as the specified value,
477/// if present.
478///
479/// Parameter `theSet`: The set to be queried. If this parameter is not a
480/// valid CFSet, the behavior is undefined.
481///
482/// Parameter `candidate`: This value is hashed and compared with values in the
483/// set to determine which value to retrieve. The equal() callback provided when
484/// the set was created is used to compare. If the equal() callback
485/// was NULL, pointer equality (in C, ==) is used. If a value, or
486/// any of the values in the set, are not understood by the equal()
487/// callback, the behavior is undefined.
488///
489/// Parameter `value`: A pointer to memory which should be filled with the
490/// pointer-sized value if a matching value is found. If no
491/// match is found, the contents of the storage pointed to by
492/// this parameter are undefined. This parameter may be NULL,
493/// in which case the value from the dictionary is not returned
494/// (but the return value of this function still indicates
495/// whether or not the value was present).
496///
497/// Returns: True if the value was present in the set, otherwise false.
498#[inline]
499pub unsafe extern "C-unwind" fn CFSetGetValueIfPresent(
500    the_set: &CFSet,
501    candidate: *const c_void,
502    value: *mut *const c_void,
503) -> bool {
504    extern "C-unwind" {
505        fn CFSetGetValueIfPresent(
506            the_set: &CFSet,
507            candidate: *const c_void,
508            value: *mut *const c_void,
509        ) -> Boolean;
510    }
511    let ret = unsafe { CFSetGetValueIfPresent(the_set, candidate, value) };
512    ret != 0
513}
514
515extern "C-unwind" {
516    /// Fills the buffer with values from the set.
517    ///
518    /// Parameter `theSet`: The set to be queried. If this parameter is not a
519    /// valid CFSet, the behavior is undefined.
520    ///
521    /// Parameter `values`: A C array of pointer-sized values to be filled with
522    /// values from the set. The values in the C array are ordered
523    /// in the same order in which they appear in the set. If this
524    /// parameter is not a valid pointer to a C array of at least
525    /// CFSetGetCount() pointers, the behavior is undefined.
526    pub fn CFSetGetValues(the_set: &CFSet, values: *mut *const c_void);
527}
528
529extern "C-unwind" {
530    /// Calls a function once for each value in the set.
531    ///
532    /// Parameter `theSet`: The set to be operated upon. If this parameter is not
533    /// a valid CFSet, the behavior is undefined.
534    ///
535    /// Parameter `applier`: The callback function to call once for each value in
536    /// the given set. If this parameter is not a
537    /// pointer to a function of the correct prototype, the behavior
538    /// is undefined. If there are values in the set which the
539    /// applier function does not expect or cannot properly apply
540    /// to, the behavior is undefined.
541    ///
542    /// Parameter `context`: A pointer-sized user-defined value, which is passed
543    /// as the second parameter to the applier function, but is
544    /// otherwise unused by this function. If the context is not
545    /// what is expected by the applier function, the behavior is
546    /// undefined.
547    pub fn CFSetApplyFunction(the_set: &CFSet, applier: CFSetApplierFunction, context: *mut c_void);
548}
549
550extern "C-unwind" {
551    /// Adds the value to the set if it is not already present.
552    ///
553    /// Parameter `theSet`: The set to which the value is to be added. If this
554    /// parameter is not a valid mutable CFSet, the behavior is
555    /// undefined.
556    ///
557    /// Parameter `value`: The value to add to the set. The value is retained by
558    /// the set using the retain callback provided when the set
559    /// was created. If the value is not of the sort expected by the
560    /// retain callback, the behavior is undefined. The count of the
561    /// set is increased by one.
562    pub fn CFSetAddValue(the_set: Option<&CFMutableSet>, value: *const c_void);
563}
564
565extern "C-unwind" {
566    /// Replaces the value in the set if it is present.
567    ///
568    /// Parameter `theSet`: The set to which the value is to be replaced. If this
569    /// parameter is not a valid mutable CFSet, the behavior is
570    /// undefined.
571    ///
572    /// Parameter `value`: The value to replace in the set. The equal() callback provided when
573    /// the set was created is used to compare. If the equal() callback
574    /// was NULL, pointer equality (in C, ==) is used. If a value, or
575    /// any of the values in the set, are not understood by the equal()
576    /// callback, the behavior is undefined. The value is retained by
577    /// the set using the retain callback provided when the set
578    /// was created. If the value is not of the sort expected by the
579    /// retain callback, the behavior is undefined. The count of the
580    /// set is increased by one.
581    pub fn CFSetReplaceValue(the_set: Option<&CFMutableSet>, value: *const c_void);
582}
583
584extern "C-unwind" {
585    /// Replaces the value in the set if it is present, or adds the value to
586    /// the set if it is absent.
587    ///
588    /// Parameter `theSet`: The set to which the value is to be replaced. If this
589    /// parameter is not a valid mutable CFSet, the behavior is
590    /// undefined.
591    ///
592    /// Parameter `value`: The value to set in the CFSet. The equal() callback provided when
593    /// the set was created is used to compare. If the equal() callback
594    /// was NULL, pointer equality (in C, ==) is used. If a value, or
595    /// any of the values in the set, are not understood by the equal()
596    /// callback, the behavior is undefined. The value is retained by
597    /// the set using the retain callback provided when the set
598    /// was created. If the value is not of the sort expected by the
599    /// retain callback, the behavior is undefined. The count of the
600    /// set is increased by one.
601    pub fn CFSetSetValue(the_set: Option<&CFMutableSet>, value: *const c_void);
602}
603
604extern "C-unwind" {
605    /// Removes the specified value from the set.
606    ///
607    /// Parameter `theSet`: The set from which the value is to be removed.
608    /// If this parameter is not a valid mutable CFSet,
609    /// the behavior is undefined.
610    ///
611    /// Parameter `value`: The value to remove. The equal() callback provided when
612    /// the set was created is used to compare. If the equal() callback
613    /// was NULL, pointer equality (in C, ==) is used. If a value, or
614    /// any of the values in the set, are not understood by the equal()
615    /// callback, the behavior is undefined.
616    pub fn CFSetRemoveValue(the_set: Option<&CFMutableSet>, value: *const c_void);
617}
618
619extern "C-unwind" {
620    /// Removes all the values from the set, making it empty.
621    ///
622    /// Parameter `theSet`: The set from which all of the values are to be
623    /// removed. If this parameter is not a valid mutable CFSet,
624    /// the behavior is undefined.
625    pub fn CFSetRemoveAllValues(the_set: Option<&CFMutableSet>);
626}