]>
git.saurik.com Git - apple/cf.git/blob - CFUUID.h
2 * Copyright (c) 2012 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
25 Copyright (c) 1999-2011, Apple Inc. All rights reserved.
28 #if !defined(__COREFOUNDATION_CFUUID__)
29 #define __COREFOUNDATION_CFUUID__ 1
31 #include <CoreFoundation/CFBase.h>
32 #include <CoreFoundation/CFString.h>
36 typedef const struct __CFUUID
* CFUUIDRef
;
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.
63 CFTypeID
CFUUIDGetTypeID(void);
66 CFUUIDRef
CFUUIDCreate(CFAllocatorRef alloc
);
67 /* Create and return a brand new unique identifier */
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. */
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. */
78 CFStringRef
CFUUIDCreateString(CFAllocatorRef alloc
, CFUUIDRef uuid
);
79 /* Converts from a UUID to its string representation. */
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. */
86 CFUUIDBytes
CFUUIDGetUUIDBytes(CFUUIDRef uuid
);
89 CFUUIDRef
CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc
, CFUUIDBytes bytes
);
93 #endif /* ! __COREFOUNDATION_CFUUID__ */