1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use libc::c_void;
use ::{CFAllocatorRef, CFStringRef, CFTypeID, UInt8};

#[doc(hidden)]
#[repr(C)]
pub struct __CFUUID {
    __private: c_void
}

pub type CFUUIDRef = *const __CFUUID;

#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct CFUUIDBytes {
    byte0: UInt8,
    byte1: UInt8,
    byte2: UInt8,
    byte3: UInt8,
    byte4: UInt8,
    byte5: UInt8,
    byte6: UInt8,
    byte7: UInt8,
    byte8: UInt8,
    byte9: UInt8,
    byte10: UInt8,
    byte11: UInt8,
    byte12: UInt8,
    byte13: UInt8,
    byte14: UInt8,
    byte15: UInt8
}

extern "C" {
    pub fn CFUUIDGetTypeID() -> CFTypeID;

    pub fn CFUUIDCreate(alloc: CFAllocatorRef) -> CFUUIDRef;
    pub fn CFUUIDCreateWithBytes(alloc: CFAllocatorRef, byte0: UInt8, byte1: UInt8, byte2: UInt8, byte3: UInt8,
                                 byte4: UInt8, byte5: UInt8, byte6: UInt8, byte7: UInt8, byte8: UInt8, byte9: UInt8,
                                 byte10: UInt8, byte11: UInt8, byte12: UInt8, byte13: UInt8, byte14: UInt8, byte15: UInt8)
                                 -> CFUUIDRef;
    pub fn CFUUIDCreateFromString(alloc: CFAllocatorRef, uuidStr: CFStringRef) -> CFUUIDRef;
    pub fn CFUUIDCreateString(alloc: CFAllocatorRef, uuid: CFUUIDRef) -> CFStringRef;
    pub fn CFUUIDGetConstantUUIDWithBytes(alloc: CFAllocatorRef, byte0: UInt8, byte1: UInt8, byte2: UInt8, byte3: UInt8,
                                          byte4: UInt8, byte5: UInt8, byte6: UInt8, byte7: UInt8, byte8: UInt8, byte9: UInt8,
                                          byte10: UInt8, byte11: UInt8, byte12: UInt8, byte13: UInt8, byte14: UInt8,
                                          byte15: UInt8) -> CFUUIDRef;
    pub fn CFUUIDGetUUIDBytes(uuid: CFUUIDRef) -> CFUUIDBytes;
    pub fn CFUUIDCreateFromUUIDBytes(alloc: CFAllocatorRef, bytes: CFUUIDBytes) -> CFUUIDRef;
}