]> git.saurik.com Git - apple/cf.git/blame - Base.subproj/CFUtilities.h
CF-299.35.tar.gz
[apple/cf.git] / Base.subproj / CFUtilities.h
CommitLineData
9ce05555
A
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/* CFUtilities.h
26 Copyright (c) 1998-2003, Apple, Inc. All rights reserved.
27*/
28
29#if !defined(__COREFOUNDATION_CFUTILITIES__)
30#define __COREFOUNDATION_CFUTILITIES__ 1
31
32#include <CoreFoundation/CFBase.h>
33
34#if defined(__cplusplus)
35extern "C" {
36#endif
37
38CF_EXPORT uint32_t CFLog2(uint64_t x);
39
40CF_EXPORT void CFMergeSortArray(void *list, CFIndex count, CFIndex elementSize, CFComparatorFunction comparator, void *context);
41CF_EXPORT void CFQSortArray(void *list, CFIndex count, CFIndex elementSize, CFComparatorFunction comparator, void *context);
42
43#if defined(__MACH__)
44typedef struct {
45 uint16_t primaryVersion;
46 uint8_t secondaryVersion;
47 uint8_t tertiaryVersion;
48} CFLibraryVersion;
49
50CF_EXPORT CFLibraryVersion CFGetExecutableLinkedLibraryVersion(CFStringRef libraryName);
51CF_EXPORT CFLibraryVersion CFGetExecutingLibraryVersion(CFStringRef libraryName);
52
53/* _CFExecutableLinkedOnOrAfter(releaseVersionName) will return YES if the current executable seems to be linked on or after the specified release. Example: If you specify CFSystemVersionPuma (10.1), you will get back true for executables linked on Puma or Jaguar(10.2), but false for those linked on Cheetah (10.0) or any of its software updates (10.0.x). You will also get back false for any app whose version info could not be figured out.
54 This function caches its results, so no need to cache at call sites.
55*/
56typedef enum {
57 CFSystemVersionCheetah = 0, /* 10.0 */
58 CFSystemVersionPuma = 1, /* 10.1 */
59 CFSystemVersionJaguar = 2, /* 10.2? TBD */
60 CFSystemVersionPanther = 3, /* Post-Jaguar */
61 CFSystemVersionPinot = 3, /* Deprecated name for Panther */
62 CFSystemVersionMerlot = 4, /* Post-Panther */
63 CFSystemVersionMax /* This should bump up when new entries are added */
64} CFSystemVersion;
65
66CF_EXPORT Boolean _CFExecutableLinkedOnOrAfter(CFSystemVersion version);
67
68#endif /* __MACH__ */
69
70
71#if defined(__cplusplus)
72}
73#endif
74
75#endif /* ! __COREFOUNDATION_CFUTILITIES__ */
76