├── .gitignore
├── MakefileVersion
├── .DS_Store
├── CFUnicodeData-B.mapping
├── CFUnicodeData-L.mapping
├── CFCharacterSetBitmaps.bitmap
├── CFUniCharPropertyDatabase.data
├── TargetConditionals.h
├── Info.plist
├── PropertyList.dtd
├── CFVersion.c
├── CFUtilities.h
├── CFUniCharPriv.h
├── CFUnicodePrecomposition.h
├── CFStringEncodingDatabase.h
├── CFLogUtilities.h
├── CFICUConverters.h
├── CFError_Private.h
├── CFUnicodeDecomposition.h
├── CFBundle_BinaryTypes.h
├── CFStringDefaultEncoding.h
├── CFStringEncodingConverterPriv.h
├── CFPlugIn_Factory.h
├── CFMachPort.h
├── CFBitVector.h
├── CFData.h
├── README
├── CFBigNumber.h
├── CFUUID.h
├── CFStreamInternal.h
├── CoreFoundation.h
├── CFTimeZone.h
├── CFBag.h
├── CFCharacterSetPriv.h
├── CFMessagePort.h
├── CFSystemDirectories.c
├── MakefileLinux
├── Examples
└── plconvert.c
├── MakefileAndroid
├── Makefile
├── CFPlugInCOM.h
├── CFPlugIn_Instance.c
├── CFCalendar.h
├── CFICULogging.h
├── CFWindowsUtilities.c
├── CFNumber.h
├── CFDate.h
├── plconvert.c
├── CFURLEnumerator.h
├── CFXMLInputStream.h
├── CFStringEncodingConverterExt.h
├── CFStringEncodingConverter.h
├── CFPreferences.h
├── CFPlugIn.h
├── CFBundle_Strings.c
├── SymbolAliases
├── CFBasicHash.h
├── CFPlugIn.c
└── CFURLAccess.h
/.gitignore:
--------------------------------------------------------------------------------
1 | CF-Objects
2 |
--------------------------------------------------------------------------------
/MakefileVersion:
--------------------------------------------------------------------------------
1 | VERSION=1153.18
2 |
--------------------------------------------------------------------------------
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fjolnir/CoreFoundation-Lite-Linux/HEAD/.DS_Store
--------------------------------------------------------------------------------
/CFUnicodeData-B.mapping:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fjolnir/CoreFoundation-Lite-Linux/HEAD/CFUnicodeData-B.mapping
--------------------------------------------------------------------------------
/CFUnicodeData-L.mapping:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fjolnir/CoreFoundation-Lite-Linux/HEAD/CFUnicodeData-L.mapping
--------------------------------------------------------------------------------
/CFCharacterSetBitmaps.bitmap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fjolnir/CoreFoundation-Lite-Linux/HEAD/CFCharacterSetBitmaps.bitmap
--------------------------------------------------------------------------------
/CFUniCharPropertyDatabase.data:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fjolnir/CoreFoundation-Lite-Linux/HEAD/CFUniCharPropertyDatabase.data
--------------------------------------------------------------------------------
/TargetConditionals.h:
--------------------------------------------------------------------------------
1 | /* TargetConditionals.h
2 | Copyright (c) 2010-2014, Apple Inc. All rights reserved.
3 | For CF on Linux ONLY
4 | */
5 |
6 | #ifndef __TARGETCONDITIONALS__
7 | #define __TARGETCONDITIONALS__
8 |
9 | #define TARGET_OS_MAC 0
10 | #define TARGET_OS_WIN32 0
11 | #define TARGET_OS_UNIX 0
12 | #define TARGET_OS_EMBEDDED 0
13 | #define TARGET_OS_IPHONE 0
14 | #define TARGET_IPHONE_SIMULATOR 0
15 | #define TARGET_OS_LINUX 1
16 |
17 | #endif /* __TARGETCONDITIONALS__ */
18 |
--------------------------------------------------------------------------------
/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en_US
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | com.apple.CoreFoundation
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | CoreFoundation
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 6.9
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 |
24 |
25 |
--------------------------------------------------------------------------------
/PropertyList.dtd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/CFVersion.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFVersion.c
25 | Copyright 2009-2014, Apple Inc. All rights reserved.
26 | Responsibility: CFLite Team
27 | */
28 | const unsigned char kCFCoreFoundationVersionString[] = "@(#)PROGRAM:CoreFoundation PROJECT:CoreFoundation-1153.18 SYSTEM:Darwin DEVELOPER:unknown BUILT:" __DATE__ " " __TIME__ "\n";
29 | double kCFCoreFoundationVersionNumber = (double)1153.18;
30 |
--------------------------------------------------------------------------------
/CFUtilities.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFUtilities.h
25 | Copyright (c) 2005-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFUTILITIES__)
29 | #define __COREFOUNDATION_CFUTILITIES__ 1
30 |
31 | #include
32 | #include
33 | #include
34 |
35 | CF_IMPLICIT_BRIDGING_ENABLED
36 | CF_EXTERN_C_BEGIN
37 |
38 | CF_EXPORT
39 | CFURLRef CFCopyHomeDirectoryURL(void) CF_AVAILABLE_IOS(5_0);
40 |
41 | CF_EXTERN_C_END
42 | CF_IMPLICIT_BRIDGING_DISABLED
43 |
44 | #endif /* ! __COREFOUNDATION_CFUTILITIES__ */
45 |
46 |
--------------------------------------------------------------------------------
/CFUniCharPriv.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFUniCharPriv.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFUNICHARPRIV__)
29 | #define __COREFOUNDATION_CFUNICHARPRIV__ 1
30 |
31 | #include
32 | #include
33 |
34 | #define kCFUniCharRecursiveDecompositionFlag (1UL << 30)
35 | #define kCFUniCharNonBmpFlag (1UL << 31)
36 | #define CFUniCharConvertCountToFlag(count) ((count & 0x1F) << 24)
37 | #define CFUniCharConvertFlagToCount(flag) ((flag >> 24) & 0x1F)
38 |
39 | enum {
40 | kCFUniCharCanonicalDecompMapping = (kCFUniCharCaseFold + 1),
41 | kCFUniCharCanonicalPrecompMapping,
42 | kCFUniCharCompatibilityDecompMapping
43 | };
44 |
45 | CF_EXPORT const void *CFUniCharGetMappingData(uint32_t type);
46 |
47 | #endif /* ! __COREFOUNDATION_CFUNICHARPRIV__ */
48 |
49 |
--------------------------------------------------------------------------------
/CFUnicodePrecomposition.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /*
25 | * CFUnicodePrecomposition.h
26 | * CoreFoundation
27 | *
28 | * Created by aki on Wed Oct 03 2001.
29 | * Copyright (c) 2001-2014, Apple Inc. All rights reserved.
30 | *
31 | */
32 |
33 | #if !defined(__COREFOUNDATION_CFUNICODEPRECOMPOSITION__)
34 | #define __COREFOUNDATION_CFUNICODEPRECOMPOSITION__ 1
35 |
36 | #include
37 |
38 | CF_EXTERN_C_BEGIN
39 |
40 | // As you can see, this function cannot precompose Hangul Jamo
41 | CF_EXPORT UTF32Char CFUniCharPrecomposeCharacter(UTF32Char base, UTF32Char combining);
42 |
43 | CF_EXPORT bool CFUniCharPrecompose(const UTF16Char *characters, CFIndex length, CFIndex *consumedLength, UTF16Char *precomposed, CFIndex maxLength, CFIndex *filledLength);
44 |
45 | CF_EXTERN_C_END
46 |
47 | #endif /* ! __COREFOUNDATION_CFUNICODEPRECOMPOSITION__ */
48 |
49 |
--------------------------------------------------------------------------------
/CFStringEncodingDatabase.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /*
25 | * CFStringEncodingDatabase.h
26 | * CoreFoundation
27 | *
28 | * Created by Aki Inoue on 07/12/05.
29 | * Copyright (c) 2007-2014, Apple Inc. All rights reserved.
30 | *
31 | */
32 |
33 | #include
34 |
35 | CF_PRIVATE uint16_t __CFStringEncodingGetWindowsCodePage(CFStringEncoding encoding);
36 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetFromWindowsCodePage(uint16_t codepage);
37 |
38 | CF_PRIVATE bool __CFStringEncodingGetCanonicalName(CFStringEncoding encoding, char *buffer, CFIndex bufferSize);
39 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetFromCanonicalName(const char *canonicalName);
40 |
41 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetMostCompatibleMacScript(CFStringEncoding encoding);
42 |
43 | CF_PRIVATE const char *__CFStringEncodingGetName(CFStringEncoding encoding); // Returns simple non-localizd name
44 |
--------------------------------------------------------------------------------
/CFLogUtilities.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFLogUtilities.h
25 | Copyright (c) 2004-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | /*
29 | APPLE SPI: NOT TO BE USED OUTSIDE APPLE!
30 | */
31 |
32 | #if !defined(__COREFOUNDATION_CFLOGUTILITIES__)
33 | #define __COREFOUNDATION_CFLOGUTILITIES__ 1
34 |
35 | #include
36 | #include
37 |
38 | CF_EXTERN_C_BEGIN
39 |
40 |
41 | enum { // Legal level values for CFLog()
42 | kCFLogLevelEmergency = 0,
43 | kCFLogLevelAlert = 1,
44 | kCFLogLevelCritical = 2,
45 | kCFLogLevelError = 3,
46 | kCFLogLevelWarning = 4,
47 | kCFLogLevelNotice = 5,
48 | kCFLogLevelInfo = 6,
49 | kCFLogLevelDebug = 7,
50 | };
51 |
52 | CF_EXPORT void CFLog(int32_t level, CFStringRef format, ...);
53 | /* Passing in a level value which is outside the range of 0-7 will cause the the call to do nothing.
54 | CFLog() logs the message using the asl.h API, and uses the level parameter as the log level.
55 | Note that the asl subsystem ignores some log levels by default.
56 | CFLog() is not fast, and is not going to be guaranteed to be fast.
57 | Even "no-op" CFLogs are not necessarily fast.
58 | If you care about performance, you shouldn't be logging.
59 | */
60 |
61 | CF_EXTERN_C_END
62 |
63 | #endif /* ! __COREFOUNDATION_CFLOGUTILITIES__ */
64 |
65 |
--------------------------------------------------------------------------------
/CFICUConverters.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /*
25 | * CFICUConverters.h
26 | * CoreFoundation
27 | *
28 | * Created by Aki Inoue on 07/12/04.
29 | * Copyright (c) 2007-2014, Apple Inc. All rights reserved.
30 | *
31 | */
32 |
33 | #include
34 |
35 | CF_PRIVATE const char *__CFStringEncodingGetICUName(CFStringEncoding encoding);
36 |
37 | CF_PRIVATE CFStringEncoding __CFStringEncodingGetFromICUName(const char *icuName);
38 |
39 |
40 | CF_PRIVATE CFIndex __CFStringEncodingICUToBytes(const char *icuName, uint32_t flags, const UniChar *characters, CFIndex numChars, CFIndex *usedCharLen, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen);
41 | CF_PRIVATE CFIndex __CFStringEncodingICUToUnicode(const char *icuName, uint32_t flags, const uint8_t *bytes, CFIndex numBytes, CFIndex *usedByteLen, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen);
42 | CF_PRIVATE CFIndex __CFStringEncodingICUCharLength(const char *icuName, uint32_t flags, const uint8_t *bytes, CFIndex numBytes);
43 | CF_PRIVATE CFIndex __CFStringEncodingICUByteLength(const char *icuName, uint32_t flags, const UniChar *characters, CFIndex numChars);
44 |
45 | // The caller is responsible for freeing the memory (use CFAllocatorDeallocate)
46 | CF_PRIVATE CFStringEncoding *__CFStringEncodingCreateICUEncodings(CFAllocatorRef allocator, CFIndex *numberOfIndex);
47 |
48 |
49 |
--------------------------------------------------------------------------------
/CFError_Private.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFError_Private.h
25 | Copyright (c) 2006-2014, Apple Inc. All rights reserved.
26 |
27 | This is Apple-internal SPI for CFError.
28 | */
29 |
30 | #if !defined(__COREFOUNDATION_CFERRORPRIVATE__)
31 | #define __COREFOUNDATION_CFERRORPRIVATE__ 1
32 |
33 | #include
34 |
35 | CF_EXTERN_C_BEGIN
36 |
37 | /* This callback function is consulted if a key is not present in the userInfo dictionary. Note that setting a callback for the same domain again simply replaces the previous callback. Set NULL as the callback to remove it.
38 | */
39 | typedef CFTypeRef (*CFErrorUserInfoKeyCallBack)(CFErrorRef err, CFStringRef key);
40 | CF_EXPORT void CFErrorSetCallBackForDomain(CFStringRef domainName, CFErrorUserInfoKeyCallBack callBack) CF_AVAILABLE(10_5, 2_0);
41 | CF_EXPORT CFErrorUserInfoKeyCallBack CFErrorGetCallBackForDomain(CFStringRef domainName) CF_AVAILABLE(10_5, 2_0);
42 |
43 |
44 | /* A key for "true" debugging descriptions which should never be shown to the user. It's only used when the CFError is shown to the console, and nothing else is available. For instance the rather terse and techie OSStatus descriptions are in this boat.
45 | */
46 | CF_EXPORT const CFStringRef kCFErrorDebugDescriptionKey CF_AVAILABLE(10_5, 2_0);
47 |
48 |
49 | CF_EXTERN_C_END
50 |
51 | #endif /* ! __COREFOUNDATION_CFERRORPRIVATE__ */
52 |
53 |
--------------------------------------------------------------------------------
/CFUnicodeDecomposition.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /*
25 | * CFUnicodeDecomposition.h
26 | * CoreFoundation
27 | *
28 | * Created by aki on Wed Oct 03 2001.
29 | * Copyright (c) 2001-2014, Apple Inc. All rights reserved.
30 | *
31 | */
32 |
33 | #if !defined(__COREFOUNDATION_CFUNICODEDECOMPOSITION__)
34 | #define __COREFOUNDATION_CFUNICODEDECOMPOSITION__ 1
35 |
36 | #include
37 |
38 | CF_EXTERN_C_BEGIN
39 |
40 | CF_INLINE bool CFUniCharIsDecomposableCharacter(UTF32Char character, bool isHFSPlusCanonical) {
41 | if (isHFSPlusCanonical && !isHFSPlusCanonical) return false; // hack to get rid of "unused" warning
42 | if (character < 0x80) return false;
43 | return CFUniCharIsMemberOf(character, kCFUniCharHFSPlusDecomposableCharacterSet);
44 | }
45 |
46 | CF_EXPORT CFIndex CFUniCharDecomposeCharacter(UTF32Char character, UTF32Char *convertedChars, CFIndex maxBufferLength);
47 | CF_EXPORT CFIndex CFUniCharCompatibilityDecompose(UTF32Char *convertedChars, CFIndex length, CFIndex maxBufferLength);
48 |
49 | CF_EXPORT bool CFUniCharDecompose(const UTF16Char *src, CFIndex length, CFIndex *consumedLength, void *dst, CFIndex maxLength, CFIndex *filledLength, bool needToReorder, uint32_t dstFormat, bool isHFSPlus);
50 |
51 | CF_EXPORT void CFUniCharPrioritySort(UTF32Char *characters, CFIndex length);
52 |
53 | CF_EXTERN_C_END
54 |
55 | #endif /* ! __COREFOUNDATION_CFUNICODEDECOMPOSITION__ */
56 |
57 |
--------------------------------------------------------------------------------
/CFBundle_BinaryTypes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFBundle_BinaryTypes.h
25 | Copyright (c) 1999-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFBUNDLE_BINARYTYPES__)
29 | #define __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ 1
30 |
31 | CF_EXTERN_C_BEGIN
32 |
33 | #if DEPLOYMENT_TARGET_MACOSX
34 | #define BINARY_SUPPORT_DYLD 1
35 | #define BINARY_SUPPORT_DLFCN 1
36 | #define USE_DYLD_PRIV 1
37 | #elif DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
38 | #define BINARY_SUPPORT_DYLD 1
39 | #define BINARY_SUPPORT_DLFCN 1
40 | #define USE_DYLD_PRIV 1
41 | #elif DEPLOYMENT_TARGET_WINDOWS
42 | #define BINARY_SUPPORT_DLL 1
43 | #else
44 | #error Unknown or unspecified DEPLOYMENT_TARGET
45 | #endif
46 |
47 |
48 | typedef enum {
49 | __CFBundleUnknownBinary,
50 | __CFBundleCFMBinary,
51 | __CFBundleDYLDExecutableBinary,
52 | __CFBundleDYLDBundleBinary,
53 | __CFBundleDYLDFrameworkBinary,
54 | __CFBundleDLLBinary,
55 | __CFBundleUnreadableBinary,
56 | __CFBundleNoBinary,
57 | __CFBundleELFBinary
58 | } __CFPBinaryType;
59 |
60 | /* Intended for eventual public consumption */
61 | typedef enum {
62 | kCFBundleOtherExecutableType = 0,
63 | kCFBundleMachOExecutableType,
64 | kCFBundlePEFExecutableType,
65 | kCFBundleELFExecutableType,
66 | kCFBundleDLLExecutableType
67 | } CFBundleExecutableType;
68 |
69 | CF_EXTERN_C_END
70 |
71 | #endif /* ! __COREFOUNDATION_CFBUNDLE_BINARYTYPES__ */
72 |
73 |
--------------------------------------------------------------------------------
/CFStringDefaultEncoding.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFStringDefaultEncoding.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFSTRINGDEFAULTENCODING__)
29 | #define __COREFOUNDATION_CFSTRINGDEFAULTENCODING__ 1
30 |
31 | #include
32 |
33 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 | #include
40 | #include
41 | #include
42 |
43 | CF_EXTERN_C_BEGIN
44 |
45 | #define __kCFUserEncodingEnvVariableName ("__CF_USER_TEXT_ENCODING")
46 | #define __kCFMaxDefaultEncodingFileLength (64)
47 | #define __kCFUserEncodingFileName ("/.CFUserTextEncoding")
48 |
49 | CF_EXPORT void _CFStringGetUserDefaultEncoding(UInt32 *oScriptValue, UInt32 *oRegionValue);
50 | CF_EXPORT void _CFStringGetInstallationEncodingAndRegion(uint32_t *encoding, uint32_t *region);
51 | CF_EXPORT Boolean _CFStringSaveUserDefaultEncoding(UInt32 iScriptValue, UInt32 iRegionValue);
52 |
53 | CF_INLINE void __CFStringGetUserDefaultEncoding(UInt32 *oScriptValue, UInt32 *oRegionValue) { _CFStringGetUserDefaultEncoding(oScriptValue, oRegionValue); }
54 | CF_INLINE void __CFStringGetInstallationEncodingAndRegion(uint32_t *encoding, uint32_t *region) { _CFStringGetInstallationEncodingAndRegion(encoding, region); }
55 | CF_INLINE void __CFStringSaveUserDefaultEncoding(UInt32 iScriptValue, UInt32 iRegionValue) { _CFStringSaveUserDefaultEncoding(iScriptValue, iRegionValue); }
56 |
57 | CF_EXTERN_C_END
58 |
59 | #endif
60 |
61 | #endif /* ! __COREFOUNDATION_CFSTRINGDEFAULTENCODING__ */
62 |
63 |
64 |
--------------------------------------------------------------------------------
/CFStringEncodingConverterPriv.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFStringEncodingConverterPriv.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__)
29 | #define __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ 1
30 |
31 | #include
32 | #include "CFStringEncodingConverterExt.h"
33 |
34 | extern const CFStringEncodingConverter __CFConverterASCII;
35 | extern const CFStringEncodingConverter __CFConverterISOLatin1;
36 | extern const CFStringEncodingConverter __CFConverterMacRoman;
37 | extern const CFStringEncodingConverter __CFConverterWinLatin1;
38 | extern const CFStringEncodingConverter __CFConverterNextStepLatin;
39 | extern const CFStringEncodingConverter __CFConverterUTF8;
40 |
41 | extern CFStringEncoding *__CFStringEncodingCreateListOfAvailablePlatformConverters(CFAllocatorRef allocator, CFIndex *numberOfConverters);
42 | extern const CFStringEncodingConverter *__CFStringEncodingGetExternalConverter(uint32_t encoding);
43 | extern CFIndex __CFStringEncodingPlatformUnicodeToBytes(uint32_t encoding, uint32_t flags, const UniChar *characters, CFIndex numChars, CFIndex *usedCharLen, uint8_t *bytes, CFIndex maxByteLen, CFIndex *usedByteLen);
44 | extern CFIndex __CFStringEncodingPlatformBytesToUnicode(uint32_t encoding, uint32_t flags, const uint8_t *bytes, CFIndex numBytes, CFIndex *usedByteLen, UniChar *characters, CFIndex maxCharLen, CFIndex *usedCharLen);
45 | extern CFIndex __CFStringEncodingPlatformCharLengthForBytes(uint32_t encoding, uint32_t flags, const uint8_t *bytes, CFIndex numBytes);
46 | extern CFIndex __CFStringEncodingPlatformByteLengthForCharacters(uint32_t encoding, uint32_t flags, const UniChar *characters, CFIndex numChars);
47 |
48 | #endif /* ! __COREFOUNDATION_CFSTRINGENCODINGCONVERTERPRIV__ */
49 |
50 |
--------------------------------------------------------------------------------
/CFPlugIn_Factory.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFPlugIn_Factory.h
25 | Copyright (c) 1999-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFPLUGIN_FACTORY__)
29 | #define __COREFOUNDATION_CFPLUGIN_FACTORY__ 1
30 |
31 | #include "CFBundle_Internal.h"
32 |
33 | CF_EXTERN_C_BEGIN
34 |
35 | typedef struct __CFPFactory *_CFPFactoryRef;
36 |
37 | extern _CFPFactoryRef _CFPFactoryCreate(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInFactoryFunction func);
38 | extern _CFPFactoryRef _CFPFactoryCreateByName(CFAllocatorRef allocator, CFUUIDRef factoryID, CFPlugInRef plugIn, CFStringRef funcName);
39 |
40 | extern _CFPFactoryRef _CFPFactoryFind(CFUUIDRef factoryID, Boolean enabled);
41 |
42 | extern CFUUIDRef _CFPFactoryCopyFactoryID(_CFPFactoryRef factory);
43 | extern CFPlugInRef _CFPFactoryCopyPlugIn(_CFPFactoryRef factory);
44 |
45 | extern void *_CFPFactoryCreateInstance(CFAllocatorRef allocator, _CFPFactoryRef factory, CFUUIDRef typeID);
46 | extern void _CFPFactoryDisable(_CFPFactoryRef factory);
47 |
48 | extern void _CFPFactoryFlushFunctionCache(_CFPFactoryRef factory);
49 |
50 | extern void _CFPFactoryAddType(_CFPFactoryRef factory, CFUUIDRef typeID);
51 | extern void _CFPFactoryRemoveType(_CFPFactoryRef factory, CFUUIDRef typeID);
52 |
53 | extern Boolean _CFPFactorySupportsType(_CFPFactoryRef factory, CFUUIDRef typeID);
54 | extern CFArrayRef _CFPFactoryFindCopyForType(CFUUIDRef typeID);
55 |
56 | /* These methods are called by CFPlugInInstance when an instance is created or destroyed. If a factory's instance count goes to 0 and the factory has been disabled, the factory is destroyed. */
57 | extern void _CFPFactoryAddInstance(_CFPFactoryRef factory);
58 | extern void _CFPFactoryRemoveInstance(_CFPFactoryRef factory);
59 |
60 | CF_EXTERN_C_END
61 |
62 | #endif /* ! __COREFOUNDATION_CFPLUGIN_FACTORY__ */
63 |
64 |
--------------------------------------------------------------------------------
/CFMachPort.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFMachPort.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFMACHPORT__)
29 | #define __COREFOUNDATION_CFMACHPORT__ 1
30 |
31 | #include
32 | #include
33 |
34 | CF_IMPLICIT_BRIDGING_ENABLED
35 | CF_EXTERN_C_BEGIN
36 |
37 | typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMachPort) __CFMachPort * CFMachPortRef;
38 |
39 | typedef struct {
40 | CFIndex version;
41 | void * info;
42 | const void *(*retain)(const void *info);
43 | void (*release)(const void *info);
44 | CFStringRef (*copyDescription)(const void *info);
45 | } CFMachPortContext;
46 |
47 | typedef void (*CFMachPortCallBack)(CFMachPortRef port, void *msg, CFIndex size, void *info);
48 | typedef void (*CFMachPortInvalidationCallBack)(CFMachPortRef port, void *info);
49 |
50 | CF_EXPORT CFTypeID CFMachPortGetTypeID(void);
51 |
52 | CF_EXPORT CFMachPortRef CFMachPortCreate(CFAllocatorRef allocator, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
53 | CF_EXPORT CFMachPortRef CFMachPortCreateWithPort(CFAllocatorRef allocator, mach_port_t portNum, CFMachPortCallBack callout, CFMachPortContext *context, Boolean *shouldFreeInfo);
54 |
55 | CF_EXPORT mach_port_t CFMachPortGetPort(CFMachPortRef port);
56 | CF_EXPORT void CFMachPortGetContext(CFMachPortRef port, CFMachPortContext *context);
57 | CF_EXPORT void CFMachPortInvalidate(CFMachPortRef port);
58 | CF_EXPORT Boolean CFMachPortIsValid(CFMachPortRef port);
59 | CF_EXPORT CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack(CFMachPortRef port);
60 | CF_EXPORT void CFMachPortSetInvalidationCallBack(CFMachPortRef port, CFMachPortInvalidationCallBack callout);
61 |
62 | CF_EXPORT CFRunLoopSourceRef CFMachPortCreateRunLoopSource(CFAllocatorRef allocator, CFMachPortRef port, CFIndex order);
63 |
64 | CF_EXTERN_C_END
65 | CF_IMPLICIT_BRIDGING_DISABLED
66 |
67 | #endif /* ! __COREFOUNDATION_CFMACHPORT__ */
68 |
69 |
--------------------------------------------------------------------------------
/CFBitVector.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFBitVector.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFBITVECTOR__)
29 | #define __COREFOUNDATION_CFBITVECTOR__ 1
30 |
31 | #include
32 |
33 | CF_IMPLICIT_BRIDGING_ENABLED
34 | CF_EXTERN_C_BEGIN
35 |
36 | typedef UInt32 CFBit;
37 |
38 | typedef const struct __CFBitVector * CFBitVectorRef;
39 | typedef struct __CFBitVector * CFMutableBitVectorRef;
40 |
41 | CF_EXPORT CFTypeID CFBitVectorGetTypeID(void);
42 |
43 | CF_EXPORT CFBitVectorRef CFBitVectorCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex numBits);
44 | CF_EXPORT CFBitVectorRef CFBitVectorCreateCopy(CFAllocatorRef allocator, CFBitVectorRef bv);
45 | CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
46 | CF_EXPORT CFMutableBitVectorRef CFBitVectorCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBitVectorRef bv);
47 |
48 | CF_EXPORT CFIndex CFBitVectorGetCount(CFBitVectorRef bv);
49 | CF_EXPORT CFIndex CFBitVectorGetCountOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
50 | CF_EXPORT Boolean CFBitVectorContainsBit(CFBitVectorRef bv, CFRange range, CFBit value);
51 | CF_EXPORT CFBit CFBitVectorGetBitAtIndex(CFBitVectorRef bv, CFIndex idx);
52 | CF_EXPORT void CFBitVectorGetBits(CFBitVectorRef bv, CFRange range, UInt8 *bytes);
53 | CF_EXPORT CFIndex CFBitVectorGetFirstIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
54 | CF_EXPORT CFIndex CFBitVectorGetLastIndexOfBit(CFBitVectorRef bv, CFRange range, CFBit value);
55 |
56 | CF_EXPORT void CFBitVectorSetCount(CFMutableBitVectorRef bv, CFIndex count);
57 | CF_EXPORT void CFBitVectorFlipBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx);
58 | CF_EXPORT void CFBitVectorFlipBits(CFMutableBitVectorRef bv, CFRange range);
59 | CF_EXPORT void CFBitVectorSetBitAtIndex(CFMutableBitVectorRef bv, CFIndex idx, CFBit value);
60 | CF_EXPORT void CFBitVectorSetBits(CFMutableBitVectorRef bv, CFRange range, CFBit value);
61 | CF_EXPORT void CFBitVectorSetAllBits(CFMutableBitVectorRef bv, CFBit value);
62 |
63 | CF_EXTERN_C_END
64 | CF_IMPLICIT_BRIDGING_DISABLED
65 |
66 | #endif /* ! __COREFOUNDATION_CFBITVECTOR__ */
67 |
68 |
--------------------------------------------------------------------------------
/CFData.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFData.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFDATA__)
29 | #define __COREFOUNDATION_CFDATA__ 1
30 |
31 | #include
32 |
33 | CF_IMPLICIT_BRIDGING_ENABLED
34 | CF_EXTERN_C_BEGIN
35 |
36 | typedef const struct CF_BRIDGED_TYPE(NSData) __CFData * CFDataRef;
37 | typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMutableData) __CFData * CFMutableDataRef;
38 |
39 | CF_EXPORT
40 | CFTypeID CFDataGetTypeID(void);
41 |
42 | CF_EXPORT
43 | CFDataRef CFDataCreate(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length);
44 |
45 | CF_EXPORT
46 | CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator);
47 | /* Pass kCFAllocatorNull as bytesDeallocator to assure the bytes aren't freed */
48 |
49 | CF_EXPORT
50 | CFDataRef CFDataCreateCopy(CFAllocatorRef allocator, CFDataRef theData);
51 |
52 | CF_EXPORT
53 | CFMutableDataRef CFDataCreateMutable(CFAllocatorRef allocator, CFIndex capacity);
54 |
55 | CF_EXPORT
56 | CFMutableDataRef CFDataCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFDataRef theData);
57 |
58 | CF_EXPORT
59 | CFIndex CFDataGetLength(CFDataRef theData);
60 |
61 | CF_EXPORT
62 | const UInt8 *CFDataGetBytePtr(CFDataRef theData);
63 |
64 | CF_EXPORT
65 | UInt8 *CFDataGetMutableBytePtr(CFMutableDataRef theData);
66 |
67 | CF_EXPORT
68 | void CFDataGetBytes(CFDataRef theData, CFRange range, UInt8 *buffer);
69 |
70 | CF_EXPORT
71 | void CFDataSetLength(CFMutableDataRef theData, CFIndex length);
72 |
73 | CF_EXPORT
74 | void CFDataIncreaseLength(CFMutableDataRef theData, CFIndex extraLength);
75 |
76 | CF_EXPORT
77 | void CFDataAppendBytes(CFMutableDataRef theData, const UInt8 *bytes, CFIndex length);
78 |
79 | CF_EXPORT
80 | void CFDataReplaceBytes(CFMutableDataRef theData, CFRange range, const UInt8 *newBytes, CFIndex newLength);
81 |
82 | CF_EXPORT
83 | void CFDataDeleteBytes(CFMutableDataRef theData, CFRange range);
84 |
85 | typedef CF_OPTIONS(CFOptionFlags, CFDataSearchFlags) {
86 | kCFDataSearchBackwards = 1UL << 0,
87 | kCFDataSearchAnchored = 1UL << 1
88 | } CF_ENUM_AVAILABLE(10_6, 4_0);
89 |
90 | CF_EXPORT
91 | CFRange CFDataFind(CFDataRef theData, CFDataRef dataToFind, CFRange searchRange, CFDataSearchFlags compareOptions) CF_AVAILABLE(10_6, 4_0);
92 |
93 | CF_EXTERN_C_END
94 | CF_IMPLICIT_BRIDGING_DISABLED
95 |
96 | #endif /* ! __COREFOUNDATION_CFDATA__ */
97 |
98 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | What is CFLite?
2 | **** **** **** **** ****
3 |
4 | CFLite is an open source version of the CoreFoundation framework found on Mac OS X and iOS. It is designed to be simple and portable. For example, it can be used on other platforms to read and write property lists that may come from Mac OS X or iOS.
5 |
6 | It is important to note that this version is not the exact same version as is used on Mac OS X or iOS, but they do share a significant amount of code.
7 |
8 | How to Contact the CFLite Team
9 | **** **** **** **** ****
10 |
11 | If you have patches, or enhancement requests, please file a bug report here:
12 | https://bugreport.apple.com
13 |
14 | Please include as much detail as possible in your bug report, including platform, compiler, CFLite version, and a test case if appropriate. Mention that the bug should be sent to CoreFoundation in your descriptioon.
15 |
16 |
17 | Building and Installing CFLite
18 | **** **** **** **** ****
19 |
20 | On Mac OS X / Darwin
21 | ---- ---- ---- ---- ----
22 |
23 | Use the default Makefile:
24 |
25 | % make
26 |
27 | This will create a CoreFoundation.framework, containing the shared library, header files, and resources. You can link to this library and use it at runtime by setting the DYLD_FRAMEWORK_PATH environment variable. 'man dyld' will give more information about this.
28 |
29 | An application must not link both this version of CFLite and the installed version of CoreFoundation. They are not compatible. CFLite will also not work with Foundation or any higher-level Cocoa framework that depends on the installed CoreFoundation.
30 |
31 | On Linux
32 | ---- ---- ---- ---- ----
33 |
34 | First, you will need to fetch a few dependencies of CoreFoundation.
35 |
36 | * clang compiler 2.8 or later
37 | http://clang.llvm.org/
38 |
39 | CoreFoundation use the clang compiler to support modern features like Blocks.
40 |
41 | * libBlocksRuntime
42 | http://compiler-rt.llvm.org/
43 |
44 | This small shared library supports Blocks at runtime. You will need the 'cmake' utility (http://www.cmake.org/) to build this. It is recommended to install this library in /usr/local/lib and put the headers in /usr/local/include.
45 |
46 | * ICU 4.4 or later (ICU4C, the C version, not ICU4J, the Java version)
47 | http://site.icu-project.org/download
48 |
49 | ICU is used for locales, time zones, calendars, and unicode support in CoreFoundation. Again, it is recommended to install this library in /usr/local/lib.
50 |
51 | Once you have the dependencies in place, build CFLite using the Linux Makefile:
52 |
53 | % sudo make -f MakefileLinux install
54 |
55 | This will create and install these files:
56 |
57 | /usr/local/lib/libCoreFoundation.so
58 | /usr/local/lib/libCoreFoundation.a
59 | /usr/local/include/CoreFoundation/
60 | /usr/local/include/TargetConditionals.h
61 | /usr/local/share/CoreFoundation/
62 |
63 | Make sure to set LD_LIBRARY_PATH environment variable to include /usr/local/lib when using an executable that has linked CFLite.
64 |
65 | On Windows
66 | ---- ---- ---- ---- ----
67 |
68 | CFLite does not yet fully support Windows. The primary missing dependency is a version of clang that can build a dynamically linked library (.DLL) that supports the Windows executable format.
69 |
70 | Using CFLite
71 | **** **** **** **** ****
72 |
73 | The Mac OS X version of CFLite supports most of the functionality of the full CoreFoundation. The Linux version of CFLite focuses on strings, dates, collections, and other property-list related items.
74 |
75 | There is an example of using CFLite on linux to process property lists in the 'plconvert.c' file.
76 |
--------------------------------------------------------------------------------
/CFBigNumber.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFBigNumber.h
25 | Copyright (c) 2012-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFBIGNUMBER__)
29 | #define __COREFOUNDATION_CFBIGNUMBER__ 1
30 |
31 | #include
32 | #include
33 |
34 |
35 | // Base 1 billion number: each digit represents 0 to 999999999
36 | typedef struct {
37 | uint32_t digits[5];
38 | int32_t sign:8;
39 | uint32_t __:24;
40 | } _CFBigNum;
41 |
42 | void _CFBigNumInitWithInt8(_CFBigNum *r, int8_t inNum);
43 | void _CFBigNumInitWithInt16(_CFBigNum *r, int16_t inNum);
44 | void _CFBigNumInitWithInt32(_CFBigNum *r, int32_t inNum);
45 | void _CFBigNumInitWithInt64(_CFBigNum *r, int64_t inNum);
46 | #ifdef __LP64__
47 | void _CFBigNumInitWithInt128(_CFBigNum *r, __int128_t inNum);
48 | #endif
49 |
50 | void _CFBigNumInitWithUInt8(_CFBigNum *r, uint8_t inNum);
51 | void _CFBigNumInitWithUInt16(_CFBigNum *r, uint16_t inNum);
52 | void _CFBigNumInitWithUInt32(_CFBigNum *r, uint32_t inNum);
53 | void _CFBigNumInitWithUInt64(_CFBigNum *r, uint64_t inNum);
54 | #ifdef __LP64__
55 | void _CFBigNumInitWithUInt128(_CFBigNum *r, __uint128_t inNum);
56 | #endif
57 |
58 | int8_t _CFBigNumGetInt8(const _CFBigNum *num);
59 | int16_t _CFBigNumGetInt16(const _CFBigNum *num);
60 | int32_t _CFBigNumGetInt32(const _CFBigNum *num);
61 | int64_t _CFBigNumGetInt64(const _CFBigNum *num);
62 | #ifdef __LP64__
63 | __int128_t _CFBigNumGetInt128(const _CFBigNum *num);
64 | #endif
65 |
66 | uint8_t _CFBigNumGetUInt8(const _CFBigNum *num);
67 | uint16_t _CFBigNumGetUInt16(const _CFBigNum *num);
68 | uint32_t _CFBigNumGetUInt32(const _CFBigNum *num);
69 | uint64_t _CFBigNumGetUInt64(const _CFBigNum *num);
70 | #ifdef __LP64__
71 | __uint128_t _CFBigNumGetUInt128(const _CFBigNum *num);
72 | #endif
73 |
74 | void _CFBigNumInitWithCFNumber(_CFBigNum *r, CFNumberRef input);
75 | void _CFBigNumInitWithBytes(_CFBigNum *r, const void *bytes, CFNumberType type);
76 | CFNumberRef _CFNumberCreateWithBigNum(const _CFBigNum *input);
77 |
78 |
79 | CFComparisonResult _CFBigNumCompare(const _CFBigNum *a, const _CFBigNum *b);
80 |
81 | void _CFBigNumNeg(_CFBigNum *r, const _CFBigNum *a);
82 | uint8_t _CFBigNumAdd(_CFBigNum *r, const _CFBigNum *a, const _CFBigNum *b);
83 | uint8_t _CFBigNumSub(_CFBigNum *r, const _CFBigNum *a, const _CFBigNum *b);
84 |
85 |
86 | void _CFBigNumToCString(const _CFBigNum *vp, Boolean leading_zeros, Boolean leading_plus, char *buffer, size_t buflen);
87 | void _CFBigNumFromCString(_CFBigNum *r, const char *string);
88 |
89 | char *_CFBigNumCopyDescription(const _CFBigNum *num); // caller must free() returned ptr
90 |
91 |
92 | #endif /* ! __COREFOUNDATION_CFBIGNUMBER__ */
93 |
94 |
--------------------------------------------------------------------------------
/CFUUID.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFUUID__)
29 | #define __COREFOUNDATION_CFUUID__ 1
30 |
31 | #include
32 | #include
33 |
34 | CF_IMPLICIT_BRIDGING_ENABLED
35 | CF_EXTERN_C_BEGIN
36 |
37 | typedef const struct __CFUUID * CFUUIDRef;
38 |
39 | typedef 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
58 | raw UUID. A CFUUIDRef can provide such a struct from the
59 | CFUUIDGetUUIDBytes() function. This struct is suitable for
60 | passing to APIs that expect a raw UUID.
61 | */
62 |
63 | CF_EXPORT
64 | CFTypeID CFUUIDGetTypeID(void);
65 |
66 | CF_EXPORT
67 | CFUUIDRef CFUUIDCreate(CFAllocatorRef alloc);
68 | /* Create and return a brand new unique identifier */
69 |
70 | CF_EXPORT
71 | 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);
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 |
74 | CF_EXPORT
75 | CFUUIDRef 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 |
78 | CF_EXPORT
79 | CFStringRef CFUUIDCreateString(CFAllocatorRef alloc, CFUUIDRef uuid);
80 | /* Converts from a UUID to its string representation. */
81 |
82 | CF_EXPORT
83 | 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);
84 | /* This returns an immortal CFUUIDRef that should not be released. It can be used in headers to declare UUID constants with #define. */
85 |
86 | CF_EXPORT
87 | CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef uuid);
88 |
89 | CF_EXPORT
90 | CFUUIDRef CFUUIDCreateFromUUIDBytes(CFAllocatorRef alloc, CFUUIDBytes bytes);
91 |
92 | CF_EXTERN_C_END
93 | CF_IMPLICIT_BRIDGING_DISABLED
94 |
95 | #endif /* ! __COREFOUNDATION_CFUUID__ */
96 |
97 |
--------------------------------------------------------------------------------
/CFStreamInternal.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | #if !defined(__COREFOUNDATION_CFSTREAMINTERNAL__)
25 | #define __COREFOUNDATION_CFSTREAMINTERNAL__ 1
26 |
27 | #include
28 | #include
29 | #include
30 | #include
31 |
32 | CF_EXTERN_C_BEGIN
33 |
34 |
35 | // Older versions of the callbacks; v0 callbacks match v1 callbacks, except that create, finalize, and copyDescription are missing.
36 | typedef Boolean (*_CFStreamCBOpenV1)(struct _CFStream *stream, CFStreamError *error, Boolean *openComplete, void *info);
37 | typedef Boolean (*_CFStreamCBOpenCompletedV1)(struct _CFStream *stream, CFStreamError *error, void *info);
38 | typedef CFIndex (*_CFStreamCBReadV1)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info);
39 | typedef const UInt8 *(*_CFStreamCBGetBufferV1)(CFReadStreamRef sream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info);
40 | typedef Boolean (*_CFStreamCBCanReadV1)(CFReadStreamRef, void *info);
41 | typedef CFIndex (*_CFStreamCBWriteV1)(CFWriteStreamRef, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info);
42 | typedef Boolean (*_CFStreamCBCanWriteV1)(CFWriteStreamRef, void *info);
43 |
44 | struct _CFStreamCallBacksV1 {
45 | CFIndex version;
46 | void *(*create)(struct _CFStream *stream, void *info);
47 | void (*finalize)(struct _CFStream *stream, void *info);
48 | CFStringRef (*copyDescription)(struct _CFStream *stream, void *info);
49 |
50 | _CFStreamCBOpenV1 open;
51 | _CFStreamCBOpenCompletedV1 openCompleted;
52 | _CFStreamCBReadV1 read;
53 | _CFStreamCBGetBufferV1 getBuffer;
54 | _CFStreamCBCanReadV1 canRead;
55 | _CFStreamCBWriteV1 write;
56 | _CFStreamCBCanWriteV1 canWrite;
57 | void (*close)(struct _CFStream *stream, void *info);
58 |
59 | CFTypeRef (*copyProperty)(struct _CFStream *stream, CFStringRef propertyName, void *info);
60 | Boolean (*setProperty)(struct _CFStream *stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
61 | void (*requestEvents)(struct _CFStream *stream, CFOptionFlags events, void *info);
62 | void (*schedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
63 | void (*unschedule)(struct _CFStream *stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
64 | };
65 |
66 | // These two are defined in CFSocketStream.c because that's where the glue for CFNetwork is.
67 | CF_PRIVATE CFErrorRef _CFErrorFromStreamError(CFAllocatorRef alloc, CFStreamError *err);
68 | CF_PRIVATE CFStreamError _CFStreamErrorFromError(CFErrorRef error);
69 |
70 | CF_EXTERN_C_END
71 |
72 | #endif /* ! __COREFOUNDATION_CFSTREAMINTERNAL__ */
73 |
74 |
75 |
--------------------------------------------------------------------------------
/CoreFoundation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CoreFoundation.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_COREFOUNDATION__)
29 | #define __COREFOUNDATION_COREFOUNDATION__ 1
30 | #define __COREFOUNDATION__ 1
31 |
32 | #if !defined(CF_EXCLUDE_CSTD_HEADERS)
33 |
34 | #include
35 | #include
36 | #include
37 | #include
38 | #include
39 | #include
40 | #include
41 | #include
42 | #include
43 | #include
44 | #include
45 | #include
46 | #include
47 | #include
48 | #include
49 | #include
50 |
51 | #if defined(__STDC_VERSION__) && (199901L <= __STDC_VERSION__)
52 |
53 | #include
54 | #include
55 | #include
56 |
57 | #endif
58 |
59 | #endif
60 |
61 | #include
62 | #include
63 | #include
64 | #include
65 | #include
66 | #include
67 | #include
68 | #include
69 | #include
70 | #include
71 | #include
72 | #include
73 | #include
74 | #include
75 | #include
76 | #include
77 | #include
78 | #include
79 | #include
80 | #include
81 | #include
82 | #include
83 | #include
84 | #include
85 | #include
86 | #include
87 |
88 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE) || TARGET_OS_WIN32
89 | #include
90 | #include
91 | #include
92 | #include
93 | #include
94 | #include
95 |
96 |
97 | #endif
98 |
99 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)) || (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
100 | #endif
101 |
102 | #if (TARGET_OS_MAC && !(TARGET_OS_EMBEDDED || TARGET_OS_IPHONE))
103 | #include
104 | #include
105 | #include
106 | #endif
107 |
108 |
109 | #endif /* ! __COREFOUNDATION_COREFOUNDATION__ */
110 |
111 |
--------------------------------------------------------------------------------
/CFTimeZone.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFTimeZone.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFTIMEZONE__)
29 | #define __COREFOUNDATION_CFTIMEZONE__ 1
30 |
31 | #include
32 | #include
33 | #include
34 | #include
35 | #include
36 | #include
37 |
38 | CF_IMPLICIT_BRIDGING_ENABLED
39 | CF_EXTERN_C_BEGIN
40 |
41 | CF_EXPORT
42 | CFTypeID CFTimeZoneGetTypeID(void);
43 |
44 | CF_EXPORT
45 | CFTimeZoneRef CFTimeZoneCopySystem(void);
46 |
47 | CF_EXPORT
48 | void CFTimeZoneResetSystem(void);
49 |
50 | CF_EXPORT
51 | CFTimeZoneRef CFTimeZoneCopyDefault(void);
52 |
53 | CF_EXPORT
54 | void CFTimeZoneSetDefault(CFTimeZoneRef tz);
55 |
56 | CF_EXPORT
57 | CFArrayRef CFTimeZoneCopyKnownNames(void);
58 |
59 | CF_EXPORT
60 | CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary(void);
61 |
62 | CF_EXPORT
63 | void CFTimeZoneSetAbbreviationDictionary(CFDictionaryRef dict);
64 |
65 | CF_EXPORT
66 | CFTimeZoneRef CFTimeZoneCreate(CFAllocatorRef allocator, CFStringRef name, CFDataRef data);
67 |
68 | CF_EXPORT
69 | CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT(CFAllocatorRef allocator, CFTimeInterval ti);
70 |
71 | CF_EXPORT
72 | CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef name, Boolean tryAbbrev);
73 |
74 | CF_EXPORT
75 | CFStringRef CFTimeZoneGetName(CFTimeZoneRef tz);
76 |
77 | CF_EXPORT
78 | CFDataRef CFTimeZoneGetData(CFTimeZoneRef tz);
79 |
80 | CF_EXPORT
81 | CFTimeInterval CFTimeZoneGetSecondsFromGMT(CFTimeZoneRef tz, CFAbsoluteTime at);
82 |
83 | CF_EXPORT
84 | CFStringRef CFTimeZoneCopyAbbreviation(CFTimeZoneRef tz, CFAbsoluteTime at);
85 |
86 | CF_EXPORT
87 | Boolean CFTimeZoneIsDaylightSavingTime(CFTimeZoneRef tz, CFAbsoluteTime at);
88 |
89 | CF_EXPORT
90 | CFTimeInterval CFTimeZoneGetDaylightSavingTimeOffset(CFTimeZoneRef tz, CFAbsoluteTime at) CF_AVAILABLE(10_5, 2_0);
91 |
92 | CF_EXPORT
93 | CFAbsoluteTime CFTimeZoneGetNextDaylightSavingTimeTransition(CFTimeZoneRef tz, CFAbsoluteTime at) CF_AVAILABLE(10_5, 2_0);
94 |
95 | typedef CF_ENUM(CFIndex, CFTimeZoneNameStyle) {
96 | kCFTimeZoneNameStyleStandard,
97 | kCFTimeZoneNameStyleShortStandard,
98 | kCFTimeZoneNameStyleDaylightSaving,
99 | kCFTimeZoneNameStyleShortDaylightSaving,
100 | kCFTimeZoneNameStyleGeneric,
101 | kCFTimeZoneNameStyleShortGeneric
102 | } CF_ENUM_AVAILABLE(10_5, 2_0);
103 |
104 | CF_EXPORT
105 | CFStringRef CFTimeZoneCopyLocalizedName(CFTimeZoneRef tz, CFTimeZoneNameStyle style, CFLocaleRef locale) CF_AVAILABLE(10_5, 2_0);
106 |
107 | CF_EXPORT
108 | const CFStringRef kCFTimeZoneSystemTimeZoneDidChangeNotification CF_AVAILABLE(10_5, 2_0);
109 |
110 | CF_EXTERN_C_END
111 | CF_IMPLICIT_BRIDGING_DISABLED
112 |
113 | #endif /* ! __COREFOUNDATION_CFTIMEZONE__ */
114 |
115 |
--------------------------------------------------------------------------------
/CFBag.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFBag.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFBAG__)
29 | #define __COREFOUNDATION_CFBAG__ 1
30 |
31 | #include
32 |
33 | CF_IMPLICIT_BRIDGING_ENABLED
34 | CF_EXTERN_C_BEGIN
35 |
36 | typedef const void * (*CFBagRetainCallBack)(CFAllocatorRef allocator, const void *value);
37 | typedef void (*CFBagReleaseCallBack)(CFAllocatorRef allocator, const void *value);
38 | typedef CFStringRef (*CFBagCopyDescriptionCallBack)(const void *value);
39 | typedef Boolean (*CFBagEqualCallBack)(const void *value1, const void *value2);
40 | typedef CFHashCode (*CFBagHashCallBack)(const void *value);
41 | typedef struct {
42 | CFIndex version;
43 | CFBagRetainCallBack retain;
44 | CFBagReleaseCallBack release;
45 | CFBagCopyDescriptionCallBack copyDescription;
46 | CFBagEqualCallBack equal;
47 | CFBagHashCallBack hash;
48 | } CFBagCallBacks;
49 |
50 | CF_EXPORT
51 | const CFBagCallBacks kCFTypeBagCallBacks;
52 | CF_EXPORT
53 | const CFBagCallBacks kCFCopyStringBagCallBacks;
54 |
55 | typedef void (*CFBagApplierFunction)(const void *value, void *context);
56 |
57 | typedef const struct __CFBag * CFBagRef;
58 | typedef struct __CFBag * CFMutableBagRef;
59 |
60 | CF_EXPORT
61 | CFTypeID CFBagGetTypeID(void);
62 |
63 | CF_EXPORT
64 | CFBagRef CFBagCreate(CFAllocatorRef allocator, const void **values, CFIndex numValues, const CFBagCallBacks *callBacks);
65 |
66 | CF_EXPORT
67 | CFBagRef CFBagCreateCopy(CFAllocatorRef allocator, CFBagRef theBag);
68 |
69 | CF_EXPORT
70 | CFMutableBagRef CFBagCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFBagCallBacks *callBacks);
71 |
72 | CF_EXPORT
73 | CFMutableBagRef CFBagCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFBagRef theBag);
74 |
75 | CF_EXPORT
76 | CFIndex CFBagGetCount(CFBagRef theBag);
77 |
78 | CF_EXPORT
79 | CFIndex CFBagGetCountOfValue(CFBagRef theBag, const void *value);
80 |
81 | CF_EXPORT
82 | Boolean CFBagContainsValue(CFBagRef theBag, const void *value);
83 |
84 | CF_EXPORT
85 | const void *CFBagGetValue(CFBagRef theBag, const void *value);
86 |
87 | CF_EXPORT
88 | Boolean CFBagGetValueIfPresent(CFBagRef theBag, const void *candidate, const void **value);
89 |
90 | CF_EXPORT
91 | void CFBagGetValues(CFBagRef theBag, const void **values);
92 |
93 | CF_EXPORT
94 | void CFBagApplyFunction(CFBagRef theBag, CFBagApplierFunction applier, void *context);
95 |
96 | CF_EXPORT
97 | void CFBagAddValue(CFMutableBagRef theBag, const void *value);
98 |
99 | CF_EXPORT
100 | void CFBagReplaceValue(CFMutableBagRef theBag, const void *value);
101 |
102 | CF_EXPORT
103 | void CFBagSetValue(CFMutableBagRef theBag, const void *value);
104 |
105 | CF_EXPORT
106 | void CFBagRemoveValue(CFMutableBagRef theBag, const void *value);
107 |
108 | CF_EXPORT
109 | void CFBagRemoveAllValues(CFMutableBagRef theBag);
110 |
111 | CF_EXTERN_C_END
112 | CF_IMPLICIT_BRIDGING_DISABLED
113 |
114 | #endif /* ! __COREFOUNDATION_CFBAG__ */
115 |
116 |
--------------------------------------------------------------------------------
/CFCharacterSetPriv.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFCharacterSetPriv.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFCHARACTERSETPRIV__)
29 | #define __COREFOUNDATION_CFCHARACTERSETPRIV__ 1
30 |
31 | #include
32 |
33 | CF_EXTERN_C_BEGIN
34 |
35 | /*!
36 | @function CFCharacterSetIsSurrogateHighCharacter
37 | Reports whether or not the character is a high surrogate.
38 | @param character The character to be checked.
39 | @result true, if character is a high surrogate, otherwise false.
40 | */
41 | CF_INLINE Boolean CFCharacterSetIsSurrogateHighCharacter(UniChar character) {
42 | return ((character >= 0xD800UL) && (character <= 0xDBFFUL) ? true : false);
43 | }
44 |
45 | /*!
46 | @function CFCharacterSetIsSurrogateLowCharacter
47 | Reports whether or not the character is a low surrogate.
48 | @param character The character to be checked.
49 | @result true, if character is a low surrogate, otherwise false.
50 | */
51 | CF_INLINE Boolean CFCharacterSetIsSurrogateLowCharacter(UniChar character) {
52 | return ((character >= 0xDC00UL) && (character <= 0xDFFFUL) ? true : false);
53 | }
54 |
55 | /*!
56 | @function CFCharacterSetGetLongCharacterForSurrogatePair
57 | Returns the UTF-32 value corresponding to the surrogate pair passed in.
58 | @param surrogateHigh The high surrogate character. If this parameter
59 | is not a valid high surrogate character, the behavior is undefined.
60 | @param surrogateLow The low surrogate character. If this parameter
61 | is not a valid low surrogate character, the behavior is undefined.
62 | @result The UTF-32 value for the surrogate pair.
63 | */
64 | CF_INLINE UTF32Char CFCharacterSetGetLongCharacterForSurrogatePair(UniChar surrogateHigh, UniChar surrogateLow) {
65 | return (UTF32Char)(((surrogateHigh - 0xD800UL) << 10) + (surrogateLow - 0xDC00UL) + 0x0010000UL);
66 | }
67 |
68 | /* Check to see if the character represented by the surrogate pair surrogateHigh & surrogateLow is in the chraracter set */
69 | CF_EXPORT Boolean CFCharacterSetIsSurrogatePairMember(CFCharacterSetRef theSet, UniChar surrogateHigh, UniChar surrogateLow) ;
70 |
71 | /* Keyed-coding support
72 | */
73 | typedef CF_ENUM(CFIndex, CFCharacterSetKeyedCodingType) {
74 | kCFCharacterSetKeyedCodingTypeBitmap = 1,
75 | kCFCharacterSetKeyedCodingTypeBuiltin = 2,
76 | kCFCharacterSetKeyedCodingTypeRange = 3,
77 | kCFCharacterSetKeyedCodingTypeString = 4,
78 | kCFCharacterSetKeyedCodingTypeBuiltinAndBitmap = 5
79 | };
80 |
81 | CF_EXPORT CFCharacterSetKeyedCodingType _CFCharacterSetGetKeyedCodingType(CFCharacterSetRef cset);
82 | CF_EXPORT CFCharacterSetPredefinedSet _CFCharacterSetGetKeyedCodingBuiltinType(CFCharacterSetRef cset);
83 | CF_EXPORT CFRange _CFCharacterSetGetKeyedCodingRange(CFCharacterSetRef cset);
84 | CF_EXPORT CFStringRef _CFCharacterSetCreateKeyedCodingString(CFCharacterSetRef cset);
85 | CF_EXPORT bool _CFCharacterSetIsInverted(CFCharacterSetRef cset);
86 | CF_EXPORT void _CFCharacterSetSetIsInverted(CFCharacterSetRef cset, bool flag);
87 |
88 | CF_EXTERN_C_END
89 |
90 | #endif /* ! __COREFOUNDATION_CFCHARACTERSETPRIV__ */
91 |
92 |
--------------------------------------------------------------------------------
/CFMessagePort.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFMessagePort.h
25 | Copyright (c) 1998-2014, Apple Inc. All rights reserved.
26 | */
27 |
28 | #if !defined(__COREFOUNDATION_CFMESSAGEPORT__)
29 | #define __COREFOUNDATION_CFMESSAGEPORT__ 1
30 |
31 | #include
32 | #include
33 | #include
34 | #include
35 |
36 | CF_IMPLICIT_BRIDGING_ENABLED
37 | CF_EXTERN_C_BEGIN
38 |
39 | typedef struct CF_BRIDGED_MUTABLE_TYPE(NSMessagePort) __CFMessagePort * CFMessagePortRef;
40 |
41 | enum {
42 | kCFMessagePortSuccess = 0,
43 | kCFMessagePortSendTimeout = -1,
44 | kCFMessagePortReceiveTimeout = -2,
45 | kCFMessagePortIsInvalid = -3,
46 | kCFMessagePortTransportError = -4,
47 | kCFMessagePortBecameInvalidError = -5
48 | };
49 |
50 | typedef struct {
51 | CFIndex version;
52 | void * info;
53 | const void *(*retain)(const void *info);
54 | void (*release)(const void *info);
55 | CFStringRef (*copyDescription)(const void *info);
56 | } CFMessagePortContext;
57 |
58 | typedef CFDataRef (*CFMessagePortCallBack)(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void *info);
59 | /* If callout wants to keep a hold of the data past the return of the callout, it must COPY the data. This includes the case where the data is given to some routine which _might_ keep a hold of it; System will release returned CFData. */
60 | typedef void (*CFMessagePortInvalidationCallBack)(CFMessagePortRef ms, void *info);
61 |
62 | CF_EXPORT CFTypeID CFMessagePortGetTypeID(void);
63 |
64 | CF_EXPORT CFMessagePortRef CFMessagePortCreateLocal(CFAllocatorRef allocator, CFStringRef name, CFMessagePortCallBack callout, CFMessagePortContext *context, Boolean *shouldFreeInfo);
65 | CF_EXPORT CFMessagePortRef CFMessagePortCreateRemote(CFAllocatorRef allocator, CFStringRef name);
66 |
67 | CF_EXPORT Boolean CFMessagePortIsRemote(CFMessagePortRef ms);
68 | CF_EXPORT CFStringRef CFMessagePortGetName(CFMessagePortRef ms);
69 | CF_EXPORT Boolean CFMessagePortSetName(CFMessagePortRef ms, CFStringRef newName);
70 | CF_EXPORT void CFMessagePortGetContext(CFMessagePortRef ms, CFMessagePortContext *context);
71 | CF_EXPORT void CFMessagePortInvalidate(CFMessagePortRef ms);
72 | CF_EXPORT Boolean CFMessagePortIsValid(CFMessagePortRef ms);
73 | CF_EXPORT CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack(CFMessagePortRef ms);
74 | CF_EXPORT void CFMessagePortSetInvalidationCallBack(CFMessagePortRef ms, CFMessagePortInvalidationCallBack callout);
75 |
76 | /* NULL replyMode argument means no return value expected, dont wait for it */
77 | CF_EXPORT SInt32 CFMessagePortSendRequest(CFMessagePortRef remote, SInt32 msgid, CFDataRef data, CFTimeInterval sendTimeout, CFTimeInterval rcvTimeout, CFStringRef replyMode, CFDataRef *returnData);
78 |
79 | CF_EXPORT CFRunLoopSourceRef CFMessagePortCreateRunLoopSource(CFAllocatorRef allocator, CFMessagePortRef local, CFIndex order);
80 |
81 | CF_EXPORT void CFMessagePortSetDispatchQueue(CFMessagePortRef ms, dispatch_queue_t queue) CF_AVAILABLE(10_6, 4_0);
82 |
83 | CF_EXTERN_C_END
84 | CF_IMPLICIT_BRIDGING_DISABLED
85 |
86 | #endif /* ! __COREFOUNDATION_CFMESSAGEPORT__ */
87 |
88 |
--------------------------------------------------------------------------------
/CFSystemDirectories.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 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 | /* CFSystemDirectories.c
25 | Copyright (c) 1997-2014, Apple Inc. All rights reserved.
26 | Responsibility: Kevin Perry
27 | */
28 |
29 | /*
30 | This file defines CFCopySearchPathForDirectoriesInDomains().
31 | On MacOS 8, this function returns empty array.
32 | On Mach, it calls the System.framework enumeration functions.
33 | On Windows, it calls the enumeration functions defined here.
34 | */
35 |
36 | #include
37 | #include "CFInternal.h"
38 |
39 | #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED
40 |
41 | /* We use the System framework implementation on Mach.
42 | */
43 | #include
44 | #include
45 | #include
46 | #include
47 | #include
48 |
49 | CFSearchPathEnumerationState __CFStartSearchPathEnumeration(CFSearchPathDirectory dir, CFSearchPathDomainMask domainMask) {
50 | return NSStartSearchPathEnumeration(dir, domainMask);
51 | }
52 |
53 | CFSearchPathEnumerationState __CFGetNextSearchPathEnumeration(CFSearchPathEnumerationState state, uint8_t *path, CFIndex pathSize) {
54 | CFSearchPathEnumerationState result;
55 | // NSGetNextSearchPathEnumeration requires a MAX_PATH size
56 | if (pathSize < PATH_MAX) {
57 | uint8_t tempPath[PATH_MAX];
58 | result = NSGetNextSearchPathEnumeration(state, (char *)tempPath);
59 | strlcpy((char *)path, (char *)tempPath, pathSize);
60 | } else {
61 | result = NSGetNextSearchPathEnumeration(state, (char *)path);
62 | }
63 | return result;
64 | }
65 |
66 | #endif
67 |
68 |
69 | #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_WINDOWS
70 |
71 | CFArrayRef CFCopySearchPathForDirectoriesInDomains(CFSearchPathDirectory directory, CFSearchPathDomainMask domainMask, Boolean expandTilde) {
72 | CFMutableArrayRef array;
73 | CFSearchPathEnumerationState state;
74 | CFIndex homeLen = -1;
75 | char cPath[CFMaxPathSize], home[CFMaxPathSize];
76 |
77 | array = CFArrayCreateMutable(kCFAllocatorSystemDefault, 0, &kCFTypeArrayCallBacks);
78 | state = __CFStartSearchPathEnumeration(directory, domainMask);
79 | while ((state = __CFGetNextSearchPathEnumeration(state, (uint8_t *)cPath, sizeof(cPath)))) {
80 | CFURLRef url = NULL;
81 | if (expandTilde && (cPath[0] == '~')) {
82 | if (homeLen < 0) {
83 | CFURLRef homeURL = CFCopyHomeDirectoryURLForUser(NULL);
84 | if (homeURL) {
85 | CFURLGetFileSystemRepresentation(homeURL, true, (uint8_t *)home, CFMaxPathSize);
86 | homeLen = strlen(home);
87 | CFRelease(homeURL);
88 | }
89 | }
90 | if (homeLen + strlen(cPath) < CFMaxPathSize) {
91 | home[homeLen] = '\0';
92 | strlcat(home, &cPath[1], sizeof(home));
93 | url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (uint8_t *)home, strlen(home), true);
94 | }
95 | } else {
96 | url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (uint8_t *)cPath, strlen(cPath), true);
97 | }
98 | if (url) {
99 | CFArrayAppendValue(array, url);
100 | CFRelease(url);
101 | }
102 | }
103 | return array;
104 | }
105 |
106 | #endif
107 |
108 |
109 | #undef numDirs
110 | #undef numApplicationDirs
111 | #undef numLibraryDirs
112 | #undef numDomains
113 | #undef invalidDomains
114 | #undef invalidDomains
115 |
116 |
--------------------------------------------------------------------------------
/MakefileLinux:
--------------------------------------------------------------------------------
1 |
2 | include MakefileVersion
3 |
4 | MIN_MACOSX_VERSION=10.9
5 | MAX_MACOSX_VERSION=MAC_OS_X_VERSION_10_9
6 |
7 | OBJECTS = CFCharacterSet.o CFPreferences.o CFApplicationPreferences.o CFXMLPreferencesDomain.o CFStringEncodingConverter.o CFUniChar.o CFArray.o CFOldStylePList.o CFPropertyList.o CFStringEncodingDatabase.o CFUnicodeDecomposition.o CFBag.o CFData.o CFStringEncodings.o CFUnicodePrecomposition.o CFBase.o CFDate.o CFNumber.o CFRuntime.o CFStringScanner.o CFBinaryHeap.o CFDateFormatter.o CFNumberFormatter.o CFSet.o CFStringUtilities.o CFUtilities.o CFBinaryPList.o CFDictionary.o CFPlatform.o CFSystemDirectories.o CFVersion.o CFBitVector.o CFError.o CFPlatformConverters.o CFTimeZone.o CFBuiltinConverters.o CFURLEnumerator.o CFFileUtilities.o CFSortFunctions.o CFTree.o CFICUConverters.o CFURL.o CFLocale.o CFURLAccess.o CFCalendar.o CFLocaleIdentifier.o CFString.o CFUUID.o CFStorage.o CFLocaleKeys.o CFBigNumber.o CFBurstTrie.o
8 | OBJECTS += CFBasicHash.o
9 | HFILES = $(wildcard *.h)
10 | INTERMEDIATE_HFILES = $(addprefix $(OBJBASE)/CoreFoundation/,$(HFILES))
11 |
12 | PUBLIC_HEADERS=CFArray.h CFBag.h CFBase.h CFBinaryHeap.h CFBitVector.h CFByteOrder.h CFCalendar.h CFCharacterSet.h CFData.h CFDate.h CFDateFormatter.h CFDictionary.h CFError.h CFLocale.h CFMachPort.h CFNumber.h CFNumberFormatter.h CFPreferences.h CFURLEnumerator.h CFPropertyList.h CFSet.h CFString.h CFStringEncodingExt.h CFTimeZone.h CFTree.h CFURL.h CFURLAccess.h CFUUID.h CFAvailability.h CFUtilities.h CoreFoundation.h TargetConditionals.h
13 |
14 | PRIVATE_HEADERS= CFCharacterSetPriv.h CFError_Private.h CFLogUtilities.h CFPriv.h CFRuntime.h CFStorage.h CFStringDefaultEncoding.h CFStringEncodingConverter.h CFStringEncodingConverterExt.h CFUniChar.h CFUnicodeDecomposition.h CFUnicodePrecomposition.h ForFoundationOnly.h CFICULogging.h
15 |
16 | RESOURCES = CFCharacterSetBitmaps.bitmap CFUnicodeData-L.mapping CFUnicodeData-B.mapping
17 |
18 | OBJBASE_ROOT = CF-Objects
19 | OBJBASE = $(OBJBASE_ROOT)/$(STYLE)
20 | DSTBASE = /usr/local
21 |
22 | STYLE=normal
23 | STYLE_CFLAGS=-O0 -g
24 | STYLE_LFLAGS=
25 |
26 | CC = /usr/bin/clang
27 | AR = /usr/bin/ar
28 | RANLIB = /usr/bin/ranlib
29 |
30 | CFLAGS=-c -x c -fblocks -fpic -pipe -std=gnu11 -Wno-trigraphs -fexceptions -DCF_BUILDING_CF=1 -DDEPLOYMENT_TARGET_LINUX=1 -DMAC_OS_X_VERSION_MAX_ALLOWED=$(MAX_MACOSX_VERSION) -DU_SHOW_DRAFT_API=1 -DU_SHOW_CPLUSPLUS_API=0 -DOSSpinLock=pthread_mutex_t -DOS_SPINLOCK_INIT=PTHREAD_MUTEX_INITIALIZER -DOSSpinLockLock=pthread_mutex_lock -DOSSpinLockUnlock=pthread_mutex_unlock -I$(OBJBASE) -I$(OBJBASE)/CoreFoundation -DVERSION=$(VERSION) -include CoreFoundation_Prefix.h
31 |
32 | LFLAGS=-shared -fpic -Wl,--no-undefined,-soname,libCoreFoundation.so
33 |
34 | # Libs for open source version of ICU
35 | LIBS=-lc -lpthread -lm -lrt -licuuc -licudata -licui18n -lBlocksRuntime -ldispatch -lpthread_workqueue
36 |
37 | .PHONY: all install clean
38 | .PRECIOUS: $(OBJBASE)/CoreFoundation/%.h
39 |
40 | all: $(OBJBASE)/libCoreFoundation.so $(OBJBASE)/libCoreFoundation.a
41 |
42 | clean:
43 | -/bin/rm -rf $(OBJBASE_ROOT)
44 |
45 | $(OBJBASE)/CoreFoundation:
46 | /bin/mkdir -p $(OBJBASE)/CoreFoundation
47 |
48 | $(OBJBASE)/CoreFoundation/%.h: %.h $(OBJBASE)/CoreFoundation
49 | /bin/cp $< $@
50 |
51 | $(OBJBASE)/%.o: %.c $(INTERMEDIATE_HFILES)
52 | $(CC) $(STYLE_CFLAGS) $(CFLAGS) $< -o $@
53 |
54 | $(OBJBASE)/%.o: %.m $(INTERMEDIATE_HFILES)
55 | $(CC) $(STYLE_CFLAGS) $(CFLAGS) $< -o $@
56 |
57 | $(OBJBASE)/libCoreFoundation.a: $(addprefix $(OBJBASE)/,$(OBJECTS))
58 | $(AR) cru $(OBJBASE)/libCoreFoundation.a $^
59 | $(RANLIB) $(OBJBASE)/libCoreFoundation.a
60 |
61 | $(OBJBASE)/libCoreFoundation.so: $(addprefix $(OBJBASE)/,$(OBJECTS))
62 | $(CC) $(STYLE_LFLAGS) $(LFLAGS) $^ -L/usr/local/lib $(LIBS) -o $(OBJBASE)/libCoreFoundation.so
63 | @echo "Building done. 'sudo make install' to put the result into $(DSTBASE)/lib and $(DSTBASE)/include."
64 |
65 | install: $(OBJBASE)/libCoreFoundation.so $(OBJBASE)/libCoreFoundation.a
66 | /bin/mkdir -p $(DSTBASE)
67 | /bin/mkdir -p $(DSTBASE)/include/CoreFoundation
68 | /bin/mkdir -p $(DSTBASE)/share/CoreFoundation
69 | -/bin/rm $(DSTBASE)/include/CoreFoundation/*.h
70 | /bin/mkdir -p $(DSTBASE)/lib
71 | /bin/cp $(PRIVATE_HEADERS) $(DSTBASE)/include/CoreFoundation
72 | /bin/cp $(PUBLIC_HEADERS) $(DSTBASE)/include/CoreFoundation
73 | /bin/cp $(OBJBASE)/libCoreFoundation.so $(DSTBASE)/lib
74 | /bin/cp $(OBJBASE)/libCoreFoundation.a $(DSTBASE)/lib
75 | /bin/cp $(RESOURCES) $(DSTBASE)/share/CoreFoundation
76 | # this one goes outside the base directory
77 | /bin/cp TargetConditionals.h $(DSTBASE)/include
78 | /sbin/ldconfig -n $(DSTBASE)/lib
79 | @echo "Installing done. The library is in $(DSTBASE)/lib and the headers are in $(DSTBASE)/include/CoreFoundation"
80 |
--------------------------------------------------------------------------------
/Examples/plconvert.c:
--------------------------------------------------------------------------------
1 | // Mac OS X: clang -F -framework CoreFoundation Examples/plconvert.c -o plconvert
2 | // note: When running this sample, be sure to set the environment variable DYLD_FRAMEWORK_PATH to point to the directory containing your new version of CoreFoundation.
3 | // e.g.
4 | // DYLD_FRAMEWORK_PATH=/tmp/CF-Root ./plconvert