2 * Copyright (c) 2005 Apple Computer, 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@
24 Copyright (c) 1998-2005, Apple, Inc. All rights reserved.
27 #if !defined(__COREFOUNDATION_CFUTILITIES__)
28 #define __COREFOUNDATION_CFUTILITIES__ 1
30 #include <CoreFoundation/CFBase.h>
32 #if defined(__cplusplus)
37 Only hits in Panther sources on this file:
38 ./DisplayServices/O3Manager/O3Master.m:#import <CoreFoundation/CFUtilities.h>
39 ./HIServices/CoreDrag.subproj/DragManager.c:#include <CoreFoundation/CFUtilities.h>
40 ./HIToolbox/Menus/Source/MenuEvents.cp:#include <CoreFoundation/CFUtilities.h>
41 ./WebBrowser/BugReportController.m:#import <CoreFoundation/CFUtilities.h>
44 lore% grep '\(CFLog2\|CFMergeSortArray\|CFQSortArray\|CFLibraryVersion\|primaryVersion\|secondaryVersion\|tertiaryVersion\|CFGetExecutableLinkedLibraryVersion\|CFGetExecutingLibraryVersion\|CFSystemVersion\|_CFExecutableLinkedOnOrAfter\)' ./DisplayServices/O3Manager/O3Master.m ./HIServices/CoreDrag.subproj/DragManager.c ./HIToolbox/Menus/Source/MenuEvents.cp ./WebBrowser/BugReportController.m
46 ./DisplayServices/O3Manager/O3Master.m: if (!_CFExecutableLinkedOnOrAfter(CFSystemVersionJaguar))
47 ./HIServices/CoreDrag.subproj/DragManager.c: if( _CFExecutableLinkedOnOrAfter( CFSystemVersionJaguar ) && (info->remoteAllowableActions == kCoreDragActionNothing) )
48 ./HIToolbox/Menus/Source/MenuEvents.cp: if ( _CFExecutableLinkedOnOrAfter( CFSystemVersionPanther ) )
51 ... Other than CF, Foundation, and AppKit of course.
57 CF_EXPORT
uint32_t CFLog2(uint64_t x
);
59 CF_EXPORT
void CFMergeSortArray(void *list
, CFIndex count
, CFIndex elementSize
, CFComparatorFunction comparator
, void *context
);
60 CF_EXPORT
void CFQSortArray(void *list
, CFIndex count
, CFIndex elementSize
, CFComparatorFunction comparator
, void *context
);
62 /* _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.
63 This function caches its results, so no need to cache at call sites.
65 Note that for non-MACH this function always returns true.
68 CFSystemVersionCheetah
= 0, /* 10.0 */
69 CFSystemVersionPuma
= 1, /* 10.1 */
70 CFSystemVersionJaguar
= 2, /* 10.2 */
71 CFSystemVersionPanther
= 3, /* 10.3 */
72 CFSystemVersionPinot
= 3, /* Deprecated name for Panther */
73 CFSystemVersionTiger
= 4, /* 10.4 */
74 CFSystemVersionMerlot
= 4, /* Deprecated name for Tiger */
75 CFSystemVersionChablis
= 5, /* Post-Tiger */
76 CFSystemVersionMax
/* This should bump up when new entries are added */
79 CF_EXPORT Boolean
_CFExecutableLinkedOnOrAfter(CFSystemVersion version
);
82 #if defined(__cplusplus)
86 #endif /* ! __COREFOUNDATION_CFUTILITIES__ */