rust_macios/
core_foundation.rs

1//! Access low-level functions, primitive data types, and various collection
2//! types that are bridged seamlessly with the Foundation framework.
3
4mod macros;
5mod traits;
6pub use traits::*;
7
8use libc::{c_double, c_ulong, c_void};
9
10/* Callbacks */
11
12pub type CFComparatorFunction =
13    fn(val1: *const c_void, val2: *const c_void, context: *mut c_void) -> CFComparisonResult;
14
15/* Data Types */
16
17/// Priority values used for kAXPriorityKey
18pub type CFIndex = c_ulong;
19
20/// A bitfield used for passing special allocation and other requests into Core Foundation functions.
21pub type CFOptionFlags = c_ulong;
22
23/* Constants */
24
25/// Constants returned by comparison functions, indicating whether a value is equal to, less than, or greater than another value.
26#[derive(Debug, PartialEq, Eq, PartialOrd, Ord)]
27#[repr(i64)]
28pub enum CFComparisonResult {
29    /// Returned by a comparison function if the first value is less than the second value.
30    KCFCompareLessThan = -1,
31    /// Returned by a comparison function if the first value is equal to the second value.
32    KCFCompareEqualTo = 0,
33    /// Returned by a comparison function if the first value is greater than the second value.
34    KCFCompareGreaterThan = 1,
35}
36
37extern "C" {
38    pub static kCFCoreFoundationVersionNumber: c_double;
39}
40
41/* Opaque Types
42 */
43mod cf_allocator;
44pub use cf_allocator::*;
45mod cf_array;
46pub use cf_array::*;
47mod cf_character_set;
48pub use cf_character_set::*;
49mod cf_data;
50pub use cf_data::*;
51mod cf_dictionary;
52pub use cf_dictionary::*;
53mod cf_locale;
54pub use cf_locale::*;
55mod cf_range;
56pub use cf_range::*;
57mod cf_string;
58pub use cf_string::*;
59mod cf_type;
60pub use cf_type::*;