1/* 2 * Copyright (c) 2014 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-2013, 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 34CF_IMPLICIT_BRIDGING_ENABLED 35CF_EXTERN_C_BEGIN 36 37typedef const struct __CFUUID * CFUUIDRef; 38 39typedef struct { 40 UInt8 byte0; 41 UInt8 byte1; 42 UInt8 byte2; 43 UInt8 byte3; 44 UInt8 byte4; 45 UInt8 byte5; 46 UInt8 byte6; 47 UInt8 byte7; 48 UInt8 byte8; 49 UInt8 byte9; 50 UInt8 byte10; 51 UInt8 byte11; 52 UInt8 byte12; 53 UInt8 byte13; 54 UInt8 byte14; 55 UInt8 byte15; 56} CFUUIDBytes; 57/* The CFUUIDBytes struct is a 128-bit struct that contains the 58raw UUID. A CFUUIDRef can provide such a struct from the 59CFUUIDGetUUIDBytes() function. This struct is suitable for 60passing to APIs that expect a raw UUID. 61*/ 62 63CF_EXPORT 64CFTypeID CFUUIDGetTypeID(void); 65 66CF_EXPORT 67CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc); 68 /* Create and return a brand new unique identifier */ 69 70CF_EXPORT 71CFUUIDRef 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); 72 /* Create and return an identifier with the given contents. This may return an existing instance with its ref count bumped because of uniquing. */ 73 74CF_EXPORT 75CFUUIDRef CFUUIDCreateFromString(CFAllocatorRef alloc, CFStringRef uuidStr); 76 /* Converts from a string representation to the UUID. This may return an existing instance with its ref count bumped because of uniquing. */ 77 78CF_EXPORT 79CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid); 80 /* Converts from a UUID to its string representation. */ 81 82CF_EXPORT 83CFUUIDRef 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); 84 /* This returns an immortal CFUUIDRef that should not be released. It can be used in headers to declare UUID constants with #define. */ 85 86CF_EXPORT 87CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid); 88 89CF_EXPORT 90CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes); 91 92CF_EXTERN_C_END 93CF_IMPLICIT_BRIDGING_DISABLED 94 95#endif /* ! __COREFOUNDATION_CFUUID__ */ 96 97