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