]>
git.saurik.com Git - apple/cf.git/blob - Base.subproj/CFUUID.h
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
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
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.
23 * @APPLE_LICENSE_HEADER_END@
26 Copyright (c) 1999-2003, Apple, Inc. All rights reserved.
29 #if !defined(__COREFOUNDATION_CFUUID__)
30 #define __COREFOUNDATION_CFUUID__ 1
32 #include <CoreFoundation/CFBase.h>
33 #include <CoreFoundation/CFString.h>
35 #if defined(__cplusplus)
39 typedef const struct __CFUUID
* CFUUIDRef
;
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.
66 CFTypeID
CFUUIDGetTypeID(void);
69 CFUUIDRef
CFUUIDCreate(CFAllocatorRef alloc
);
70 /* Create and return a brand new unique identifier */
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. */
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. */
81 CFStringRef
CFUUIDCreateString(CFAllocatorRef alloc
, CFUUIDRef uuid
);
82 /* Converts from a UUID to its string representation. */
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. */
89 CFUUIDBytes
CFUUIDGetUUIDBytes(CFUUIDRef uuid
);
92 CFUUIDRef
CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc
, CFUUIDBytes bytes
);
94 #if defined(__cplusplus)
98 #endif /* ! __COREFOUNDATION_CFUUID__ */