2 * Copyright (c) 2009 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@
24 Copyright (c) 1998-2009, Apple Inc. All rights reserved.
28 APPLE SPI: NOT TO BE USED OUTSIDE APPLE!
31 #if !defined(__COREFOUNDATION_CFPRIV__)
32 #define __COREFOUNDATION_CFPRIV__ 1
35 #include <CoreFoundation/CFBase.h>
36 #include <CoreFoundation/CFArray.h>
37 #include <CoreFoundation/CFString.h>
38 #include <CoreFoundation/CFURL.h>
39 #include <CoreFoundation/CFBundlePriv.h>
45 #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
46 #include <CoreFoundation/CFMachPort.h>
49 #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) || TARGET_OS_WIN32
50 #include <CoreFoundation/CFRunLoop.h>
51 #include <CoreFoundation/CFSocket.h>
56 CF_EXPORT
intptr_t _CFDoOperation(intptr_t code
, intptr_t subcode1
, intptr_t subcode2
);
58 CF_EXPORT
void _CFRuntimeSetCFMPresent(void *a
);
60 CF_EXPORT
const char *_CFProcessPath(void);
61 CF_EXPORT
const char **_CFGetProcessPath(void);
62 CF_EXPORT
const char **_CFGetProgname(void);
65 #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
66 CF_EXPORT CFRunLoopRef
CFRunLoopGetMain(void);
67 CF_EXPORT SInt32
CFRunLoopRunSpecific(CFRunLoopRef rl
, CFStringRef modeName
, CFTimeInterval seconds
, Boolean returnAfterSourceHandled
);
69 CF_EXPORT
void _CFRunLoopSetCurrent(CFRunLoopRef rl
);
71 CF_EXPORT Boolean
_CFRunLoopModeContainsMode(CFRunLoopRef rl
, CFStringRef modeName
, CFStringRef candidateContainedName
);
72 CF_EXPORT
void _CFRunLoopAddModeToMode(CFRunLoopRef rl
, CFStringRef modeName
, CFStringRef toModeName
);
73 CF_EXPORT
void _CFRunLoopRemoveModeFromMode(CFRunLoopRef rl
, CFStringRef modeName
, CFStringRef fromModeName
);
74 CF_EXPORT
void _CFRunLoopStopMode(CFRunLoopRef rl
, CFStringRef modeName
);
76 CF_EXPORT CFIndex
CFMachPortGetQueuedMessageCount(CFMachPortRef mp
);
78 CF_EXPORT CFPropertyListRef
_CFURLCopyPropertyListRepresentation(CFURLRef url
);
80 CF_EXPORT CFPropertyListRef
_CFURLCopyPropertyListRepresentation(CFURLRef url
);
81 CF_EXPORT CFURLRef
_CFURLCreateFromPropertyListRepresentation(CFAllocatorRef alloc
, CFPropertyListRef pListRepresentation
);
83 CF_EXPORT
void CFPreferencesFlushCaches(void);
86 CF_EXPORT Boolean
_CFURLGetWideFileSystemRepresentation(CFURLRef url
, Boolean resolveAgainstBase
, wchar_t *buffer
, CFIndex bufferLength
);
90 #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
93 Boolean
_CFGetFSSpecFromURL(CFAllocatorRef alloc
, CFURLRef url
, struct FSSpec
*spec
);
96 CFURLRef
_CFCreateURLFromFSSpec(CFAllocatorRef alloc
, const struct FSSpec
*voidspec
, Boolean isDirectory
);
100 #if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED
102 kCFURLComponentDecompositionNonHierarchical
,
103 kCFURLComponentDecompositionRFC1808
, /* use this for RFC 1738 decompositions as well */
104 kCFURLComponentDecompositionRFC2396
106 typedef CFIndex CFURLComponentDecomposition
;
110 CFStringRef schemeSpecific
;
111 } CFURLComponentsNonHierarchical
;
116 CFStringRef password
;
118 CFIndex port
; /* kCFNotFound means ignore/omit */
119 CFArrayRef pathComponents
;
120 CFStringRef parameterString
;
122 CFStringRef fragment
;
124 } CFURLComponentsRFC1808
;
129 /* if the registered name form of the net location is used, userinfo is NULL, port is kCFNotFound, and host is the entire registered name. */
130 CFStringRef userinfo
;
134 CFArrayRef pathComponents
;
136 CFStringRef fragment
;
138 } CFURLComponentsRFC2396
;
140 /* Fills components and returns TRUE if the URL can be decomposed according to decompositionType; FALSE (leaving components unchanged) otherwise. components should be a pointer to the CFURLComponents struct defined above that matches decompositionStyle */
142 Boolean
_CFURLCopyComponents(CFURLRef url
, CFURLComponentDecomposition decompositionType
, void *components
);
144 /* Creates and returns the URL described by components; components should point to the CFURLComponents struct defined above that matches decompositionType. */
146 CFURLRef
_CFURLCreateFromComponents(CFAllocatorRef alloc
, CFURLComponentDecomposition decompositionType
, const void *components
);
147 #define CFURLCopyComponents _CFURLCopyComponents
148 #define CFURLCreateFromComponents _CFURLCreateFromComponents
152 CF_EXPORT Boolean
_CFStringGetFileSystemRepresentation(CFStringRef string
, UInt8
*buffer
, CFIndex maxBufLen
);
154 /* If this is publicized, we might need to create a GetBytesPtr type function as well. */
155 CF_EXPORT CFStringRef
_CFStringCreateWithBytesNoCopy(CFAllocatorRef alloc
, const UInt8
*bytes
, CFIndex numBytes
, CFStringEncoding encoding
, Boolean externalFormat
, CFAllocatorRef contentsDeallocator
);
157 /* These return NULL on MacOS 8 */
159 CFStringRef
CFGetUserName(void);
162 CFURLRef
CFCopyHomeDirectoryURLForUser(CFStringRef uName
); /* Pass NULL for the current user's home directory */
166 CFCopySearchPathForDirectoriesInDomains returns the various
167 standard system directories where apps, resources, etc get
168 installed. Because queries can return multiple directories,
169 you get back a CFArray (which you should free when done) of
170 CFStrings. The directories are returned in search path order;
171 that is, the first place to look is returned first. This API
172 may return directories that do not exist yet. If NSUserDomain
173 is included in a query, then the results will contain "~" to
174 refer to the user's directory. Specify expandTilde to expand
175 this to the current user's home. Some calls might return no
177 ??? On MacOS 8 this function currently returns an empty array.
180 kCFApplicationDirectory
= 1, /* supported applications (Applications) */
181 kCFDemoApplicationDirectory
, /* unsupported applications, demonstration versions (Demos) */
182 kCFDeveloperApplicationDirectory
, /* developer applications (Developer/Applications) */
183 kCFAdminApplicationDirectory
, /* system and network administration applications (Administration) */
184 kCFLibraryDirectory
, /* various user-visible documentation, support, and configuration files, resources (Library) */
185 kCFDeveloperDirectory
, /* developer resources (Developer) */
186 kCFUserDirectory
, /* user home directories (Users) */
187 kCFDocumentationDirectory
, /* documentation (Documentation) */
188 kCFDocumentDirectory
, /* documents (Library/Documents) */
189 kCFAllApplicationsDirectory
= 100, /* all directories where applications can occur (ie Applications, Demos, Administration, Developer/Applications) */
190 kCFAllLibrariesDirectory
= 101 /* all directories where resources can occur (Library, Developer) */
192 typedef CFIndex CFSearchPathDirectory
;
195 kCFUserDomainMask
= 1, /* user's home directory --- place to install user's personal items (~) */
196 kCFLocalDomainMask
= 2, /* local to the current machine --- place to install items available to everyone on this machine (/Local) */
197 kCFNetworkDomainMask
= 4, /* publically available location in the local area network --- place to install items available on the network (/Network) */
198 kCFSystemDomainMask
= 8, /* provided by Apple, unmodifiable (/System) */
199 kCFAllDomainsMask
= 0x0ffff /* all domains: all of the above and more, future items */
201 typedef CFOptionFlags CFSearchPathDomainMask
;
204 CFArrayRef
CFCopySearchPathForDirectoriesInDomains(CFSearchPathDirectory directory
, CFSearchPathDomainMask domainMask
, Boolean expandTilde
);
207 CF_EXPORT
const CFStringRef kCFFileURLExists
;
208 CF_EXPORT
const CFStringRef kCFFileURLPOSIXMode
;
209 CF_EXPORT
const CFStringRef kCFFileURLSize
;
210 CF_EXPORT
const CFStringRef kCFFileURLDirectoryContents
;
211 CF_EXPORT
const CFStringRef kCFFileURLLastModificationTime
;
212 CF_EXPORT
const CFStringRef kCFHTTPURLStatusCode
;
213 CF_EXPORT
const CFStringRef kCFHTTPURLStatusLine
;
216 /* System Version file access */
217 CF_EXPORT CFStringRef
CFCopySystemVersionString(void); // Human-readable string containing both marketing and build version
218 CF_EXPORT CFDictionaryRef
_CFCopySystemVersionDictionary(void);
219 CF_EXPORT CFDictionaryRef
_CFCopyServerVersionDictionary(void);
220 CF_EXPORT
const CFStringRef _kCFSystemVersionProductNameKey
;
221 CF_EXPORT
const CFStringRef _kCFSystemVersionProductCopyrightKey
;
222 CF_EXPORT
const CFStringRef _kCFSystemVersionProductVersionKey
;
223 CF_EXPORT
const CFStringRef _kCFSystemVersionProductVersionExtraKey
;
224 CF_EXPORT
const CFStringRef _kCFSystemVersionProductUserVisibleVersionKey
; // For loginwindow; see 2987512
225 CF_EXPORT
const CFStringRef _kCFSystemVersionBuildVersionKey
;
226 CF_EXPORT
const CFStringRef _kCFSystemVersionProductVersionStringKey
; // Localized string for the string "Version"
227 CF_EXPORT
const CFStringRef _kCFSystemVersionBuildStringKey
; // Localized string for the string "Build"
230 CF_EXPORT
void CFMergeSortArray(void *list
, CFIndex count
, CFIndex elementSize
, CFComparatorFunction comparator
, void *context
);
231 CF_EXPORT
void CFQSortArray(void *list
, CFIndex count
, CFIndex elementSize
, CFComparatorFunction comparator
, void *context
);
233 /* _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.
234 This function caches its results, so no need to cache at call sites.
236 Note that for non-MACH this function always returns true.
239 CFSystemVersionCheetah
= 0, /* 10.0 */
240 CFSystemVersionPuma
= 1, /* 10.1 */
241 CFSystemVersionJaguar
= 2, /* 10.2 */
242 CFSystemVersionPanther
= 3, /* 10.3 */
243 CFSystemVersionPinot
= 3, /* Deprecated name for Panther */
244 CFSystemVersionTiger
= 4, /* 10.4 */
245 CFSystemVersionMerlot
= 4, /* Deprecated name for Tiger */
246 CFSystemVersionLeopard
= 5, /* 10.5 */
247 CFSystemVersionChablis
= 5, /* Deprecated name for Leopard */
248 CFSystemVersionSnowLeopard
= 6, /* 10.6 */
249 CFSystemVersionMax
, /* This should bump up when new entries are added */
252 typedef CFIndex CFSystemVersion
;
254 CF_EXPORT Boolean
_CFExecutableLinkedOnOrAfter(CFSystemVersion version
);
258 kCFStringGraphemeCluster
= 1, /* Unicode Grapheme Cluster */
259 kCFStringComposedCharacterCluster
= 2, /* Compose all non-base (including spacing marks) */
260 kCFStringCursorMovementCluster
= 3, /* Cluster suitable for cursor movements */
261 kCFStringBackwardDeletionCluster
= 4 /* Cluster suitable for backward deletion */
263 typedef CFIndex CFStringCharacterClusterType
;
265 CF_EXPORT CFRange
CFStringGetRangeOfCharacterClusterAtIndex(CFStringRef string
, CFIndex charIndex
, CFStringCharacterClusterType type
);
267 // Compatibility kCFCompare flags. Use the new public kCFCompareDiacriticInsensitive
269 kCFCompareDiacriticsInsensitive
= 128 /* Use kCFCompareDiacriticInsensitive */
272 /* kCFCompare flags planned to be publicized (Aki 10/20/2008 Does not work with kCFCompareForceOrdering/CFStringFold). see <rdar://problem/6305147>)
275 kCFCompareIgnoreNonAlphanumeric
= (1UL << 16), // Ignores characters NOT in kCFCharacterSetAlphaNumeric
279 /* CFStringEncoding SPI */
280 /* When set, CF encoding conversion engine keeps ASCII compatibility. (i.e. ASCII backslash <-> Unicode backslash in MacJapanese */
281 CF_EXPORT
void _CFStringEncodingSetForceASCIICompatibility(Boolean flag
);
283 extern void __CFSetCharToUniCharFunc(Boolean (*func
)(UInt32 flags
, UInt8 ch
, UniChar
*unicodeChar
));
284 extern UniChar __CFCharToUniCharTable
[256];
287 #if defined(CF_INLINE)
288 CF_INLINE
const UniChar
*CFStringGetCharactersPtrFromInlineBuffer(CFStringInlineBuffer
*buf
, CFRange desiredRange
) {
289 if ((desiredRange
.location
< 0) || ((desiredRange
.location
+ desiredRange
.length
) > buf
->rangeToBuffer
.length
)) return NULL
;
291 if (buf
->directBuffer
) {
292 return buf
->directBuffer
+ buf
->rangeToBuffer
.location
+ desiredRange
.location
;
294 if (desiredRange
.length
> __kCFStringInlineBufferLength
) return NULL
;
296 if (((desiredRange
.location
+ desiredRange
.length
) > buf
->bufferedRangeEnd
) || (desiredRange
.location
< buf
->bufferedRangeStart
)) {
297 buf
->bufferedRangeStart
= desiredRange
.location
;
298 buf
->bufferedRangeEnd
= buf
->bufferedRangeStart
+ __kCFStringInlineBufferLength
;
299 if (buf
->bufferedRangeEnd
> buf
->rangeToBuffer
.length
) buf
->bufferedRangeEnd
= buf
->rangeToBuffer
.length
;
300 CFStringGetCharacters(buf
->theString
, CFRangeMake(buf
->rangeToBuffer
.location
+ buf
->bufferedRangeStart
, buf
->bufferedRangeEnd
- buf
->bufferedRangeStart
), buf
->buffer
);
303 return buf
->buffer
+ (desiredRange
.location
- buf
->bufferedRangeStart
);
307 CF_INLINE
void CFStringGetCharactersFromInlineBuffer(CFStringInlineBuffer
*buf
, CFRange desiredRange
, UniChar
*outBuf
) {
308 if (buf
->directBuffer
) {
309 memmove(outBuf
, buf
->directBuffer
+ buf
->rangeToBuffer
.location
+ desiredRange
.location
, desiredRange
.length
* sizeof(UniChar
));
311 if ((desiredRange
.location
>= buf
->bufferedRangeStart
) && (desiredRange
.location
< buf
->bufferedRangeEnd
)) {
312 CFIndex bufLen
= desiredRange
.length
;
314 if (bufLen
> (buf
->bufferedRangeEnd
- desiredRange
.location
)) bufLen
= (buf
->bufferedRangeEnd
- desiredRange
.location
);
316 memmove(outBuf
, buf
->buffer
+ (desiredRange
.location
- buf
->bufferedRangeStart
), bufLen
* sizeof(UniChar
));
317 outBuf
+= bufLen
; desiredRange
.location
+= bufLen
; desiredRange
.length
-= bufLen
;
319 CFIndex desiredRangeMax
= (desiredRange
.location
+ desiredRange
.length
);
321 if ((desiredRangeMax
> buf
->bufferedRangeStart
) && (desiredRangeMax
< buf
->bufferedRangeEnd
)) {
322 desiredRange
.length
= (buf
->bufferedRangeStart
- desiredRange
.location
);
323 memmove(outBuf
+ desiredRange
.length
, buf
->buffer
, (desiredRangeMax
- buf
->bufferedRangeStart
) * sizeof(UniChar
));
327 if (desiredRange
.length
> 0) CFStringGetCharacters(buf
->theString
, CFRangeMake(buf
->rangeToBuffer
.location
+ desiredRange
.location
, desiredRange
.length
), outBuf
);
332 #define CFStringGetCharactersPtrFromInlineBuffer(buf, desiredRange) ((buf)->directBuffer ? (buf)->directBuffer + (buf)->rangeToBuffer.location + desiredRange.location : NULL)
334 #define CFStringGetCharactersFromInlineBuffer(buf, desiredRange, outBuf) \
335 if (buf->directBuffer) memmove(outBuf, (buf)->directBuffer + (buf)->rangeToBuffer.location + desiredRange.location, desiredRange.length * sizeof(UniChar)); \
336 else CFStringGetCharacters((buf)->theString, CFRangeMake((buf)->rangeToBuffer.location + desiredRange.location, desiredRange.length), outBuf);
338 #endif /* CF_INLINE */
341 CFCharacterSetInlineBuffer related declarations
344 @typedef CFCharacterSetInlineBuffer
345 @field cset The character set this inline buffer is initialized with.
346 The object is not retained by the structure.
347 @field flags The field is a bit mask that carries various settings.
348 @field rangeStart The beginning of the character range that contains all members.
349 It is guaranteed that there is no member below this value.
350 @field rangeLimit The end of the character range that contains all members.
351 It is guaranteed that there is no member above and equal to this value.
352 @field bitmap The bitmap data representing the membership of the Basic Multilingual Plane characters.
353 If NULL, all BMP characters inside the range are members of the character set.
356 CFCharacterSetRef cset
;
360 const uint8_t *bitmap
;
361 } CFCharacterSetInlineBuffer
;
363 // Bits for flags field
365 kCFCharacterSetIsCompactBitmap
= (1UL << 0),
366 kCFCharacterSetNoBitmapAvailable
= (1UL << 1),
367 kCFCharacterSetIsInverted
= (1UL << 2)
371 @function CFCharacterSetInitInlineBuffer
372 Initializes buffer with cset.
373 @param cset The character set used to initialized the buffer.
374 If this parameter is not a valid CFCharacterSet, the behavior is undefined.
375 @param buffer The reference to the inline buffer to be initialized.
378 void CFCharacterSetInitInlineBuffer(CFCharacterSetRef cset
, CFCharacterSetInlineBuffer
*buffer
);
381 @function CFCharacterSetInlineBufferIsLongCharacterMember
382 Reports whether or not the UTF-32 character is in the character set.
383 @param buffer The reference to the inline buffer to be searched.
384 @param character The UTF-32 character for which to test against the
386 @result true, if the value is in the character set, otherwise false.
388 #if defined(CF_INLINE)
389 CF_INLINE
bool CFCharacterSetInlineBufferIsLongCharacterMember(CFCharacterSetInlineBuffer
*buffer
, UTF32Char character
) {
390 bool isInverted
= ((0 == (buffer
->flags
& kCFCharacterSetIsInverted
)) ? false : true);
392 if ((character
>= buffer
->rangeStart
) && (character
< buffer
->rangeLimit
)) {
393 if ((character
> 0xFFFF) || (0 != (buffer
->flags
& kCFCharacterSetNoBitmapAvailable
))) return (CFCharacterSetIsLongCharacterMember(buffer
->cset
, character
) != 0);
394 if (NULL
== buffer
->bitmap
) {
395 if (0 == (buffer
->flags
& kCFCharacterSetIsCompactBitmap
)) isInverted
= !isInverted
;
396 } else if (0 == (buffer
->flags
& kCFCharacterSetIsCompactBitmap
)) {
397 if (buffer
->bitmap
[character
>> 3] & (1UL << (character
& 7))) isInverted
= !isInverted
;
399 uint8_t value
= buffer
->bitmap
[character
>> 8];
402 isInverted
= !isInverted
;
403 } else if (value
> 0) {
404 const uint8_t *segment
= buffer
->bitmap
+ (256 + (32 * (value
- 1)));
406 if (segment
[character
>> 3] & (1UL << (character
% 8))) isInverted
= !isInverted
;
412 #else /* CF_INLINE */
413 #define CFCharacterSetInlineBufferIsLongCharacterMember(buffer, character) (CFCharacterSetIsLongCharacterMember(buffer->cset, character))
414 #endif /* CF_INLINE */
418 CF_EXPORT CFMutableStringRef
_CFCreateApplicationRepositoryPath(CFAllocatorRef alloc
, int nFolder
);
422 CFLocaleGetLanguageRegionEncodingForLocaleIdentifier gets the appropriate language and region codes,
423 and the default legacy script code and encoding, for the specified locale (or language) string.
424 Returns false if CFLocale has no information about the given locale; otherwise may set
425 *langCode and/or *regCode to -1 if there is no appropriate legacy value for the locale.
426 This is a replacement for the CFBundle SPI CFBundleGetLocalizationInfoForLocalization (which was intended to be temporary and transitional);
427 this function is more up-to-date in its handling of locale strings, and is in CFLocale where this functionality should belong. Compared
428 to CFBundleGetLocalizationInfoForLocalization, this function does not spcially interpret a NULL localeIdentifier to mean use the single most
429 preferred localization in the current context (this function returns NO for a NULL localeIdentifier); and in this function
430 langCode, regCode, and scriptCode are all SInt16* (not SInt32* like the equivalent parameters in CFBundleGetLocalizationInfoForLocalization).
433 Boolean
CFLocaleGetLanguageRegionEncodingForLocaleIdentifier(CFStringRef localeIdentifier
, LangCode
*langCode
, RegionCode
*regCode
, ScriptCode
*scriptCode
, CFStringEncoding
*stringEncoding
);
436 CF_EXPORT CFMutableStringRef
_CFCreateApplicationRepositoryPath(CFAllocatorRef alloc
, int nFolder
);
440 #include <CoreFoundation/CFMessagePort.h>
442 #define CF_MESSAGE_PORT_CLONE_MESSAGE_ID -1209
443 CF_EXPORT CFMessagePortRef
CFMessagePortCreateUber(CFAllocatorRef allocator
, CFStringRef name
, CFMessagePortCallBack callout
, CFMessagePortContext
*context
, Boolean
*shouldFreeInfo
, Boolean isRemote
);
444 CF_EXPORT
void CFMessagePortSetCloneCallout(CFMessagePortRef ms
, CFMessagePortCallBack cloneCallout
);
447 #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
448 #include <CoreFoundation/CFMessagePort.h>
450 CFMessagePortRef
CFMessagePortCreatePerProcessLocal(CFAllocatorRef allocator
, CFStringRef name
, CFMessagePortCallBack callout
, CFMessagePortContext
*context
, Boolean
*shouldFreeInfo
);
451 CFMessagePortRef
CFMessagePortCreatePerProcessRemote(CFAllocatorRef allocator
, CFStringRef name
, CFIndex pid
);
455 CF_INLINE CFAbsoluteTime
_CFAbsoluteTimeFromFileTimeSpec(struct timespec ts
) {
456 return (CFAbsoluteTime
)((CFTimeInterval
)ts
.tv_sec
- kCFAbsoluteTimeIntervalSince1970
) + (1.0e-9 * (CFTimeInterval
)ts
.tv_nsec
);
460 CF_INLINE
struct timespec
_CFFileTimeSpecFromAbsoluteTime(CFAbsoluteTime at
) {
463 double frac
= modf(at
, &sec
);
468 ts
.tv_sec
= (time_t)(sec
+ kCFAbsoluteTimeIntervalSince1970
);
469 ts
.tv_nsec
= (long)(NSEC_PER_SEC
* frac
+ 0.5);
475 CF_EXPORT CFStringRef
_CFGetWindowsAppleAppDataDirectory(void);
476 CF_EXPORT CFArrayRef
_CFGetWindowsBinaryDirectories(void);
477 CF_EXPORT CFStringRef
_CFGetWindowsAppleSystemLibraryDirectory(void);
482 #endif /* ! __COREFOUNDATION_CFPRIV__ */