]> git.saurik.com Git - apple/cf.git/blob - CFUUID.h
CF-550.13.tar.gz
[apple/cf.git] / CFUUID.h
1 /*
2 * Copyright (c) 2009 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 /* CFUUID.h
25 Copyright (c) 1999-2009, Apple Inc. All rights reserved.
26 */
27
28 #if !defined(__COREFOUNDATION_CFUUID__)
29 #define __COREFOUNDATION_CFUUID__ 1
30
31 #include <CoreFoundation/CFBase.h>
32 #include <CoreFoundation/CFString.h>
33
34 CF_EXTERN_C_BEGIN
35
36 typedef const struct __CFUUID * CFUUIDRef;
37
38 typedef struct {
39 UInt8 byte0;
40 UInt8 byte1;
41 UInt8 byte2;
42 UInt8 byte3;
43 UInt8 byte4;
44 UInt8 byte5;
45 UInt8 byte6;
46 UInt8 byte7;
47 UInt8 byte8;
48 UInt8 byte9;
49 UInt8 byte10;
50 UInt8 byte11;
51 UInt8 byte12;
52 UInt8 byte13;
53 UInt8 byte14;
54 UInt8 byte15;
55 } CFUUIDBytes;
56 /* The CFUUIDBytes struct is a 128-bit struct that contains the
57 raw UUID. A CFUUIDRef can provide such a struct from the
58 CFUUIDGetUUIDBytes() function. This struct is suitable for
59 passing to APIs that expect a raw UUID.
60 */
61
62 CF_EXPORT
63 CFTypeID CFUUIDGetTypeID(void);
64
65 CF_EXPORT
66 CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc);
67 /* Create and return a brand new unique identifier */
68
69 CF_EXPORT
70 CFUUIDRef CFUUIDCreateWithBytes(CFAllocatorRef alloc, UInt8 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);
71 /* Create and return an identifier with the given contents. This may return an existing instance with its ref count bumped because of uniquing. */
72
73 CF_EXPORT
74 CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr);
75 /* Converts from a string representation to the UUID. This may return an existing instance with its ref count bumped because of uniquing. */
76
77 CF_EXPORT
78 CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid);
79 /* Converts from a UUID to its string representation. */
80
81 CF_EXPORT
82 CFUUIDRef CFUUIDGetConstantUUIDWithBytes(CFAllocatorRef alloc, UInt8 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);
83 /* This returns an immortal CFUUIDRef that should not be released. It can be used in headers to declare UUID constants with #define. */
84
85 CF_EXPORT
86 CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid);
87
88 CF_EXPORT
89 CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes);
90
91 CF_EXTERN_C_END
92
93 #endif /* ! __COREFOUNDATION_CFUUID__ */
94