Core Foundation
Developer(s) | Apple Inc. |
---|---|
Repository | github |
Written in | Swift, Objective-C, C |
Operating system | |
Type | System library |
License | APSL 2.0 |
Website | developer.apple.com |
Core Foundation (also called CF) is a
The most prevalent use of Core Foundation is for passing its own primitive types for data, including raw
CFMachPort
and CFNotificationCenter
, and a basic graphical user interfaceCFUserNotification
.
Other parts of the API include utility routines and wrappers around existing APIs for ease of use. Utility routines perform such actions as
translation (Byte Order Utilities). Some examples of wrapper routines include those for Core Foundation's wrapper routines for Unix sockets, the CFSocket API.Some types in Core Foundation are "toll-free bridged", or interchangeable with a simple cast, with those of their Foundation Kit counterparts. For example, one could create a CFDictionaryRef
Core Foundation type, and then later simply use a standard C cast to convert it to its Objective-C counterpart, NSDictionary *
, and then use the desired Objective-C methods on that object as one normally would.
Core Foundation has a plug-in model (CFPlugin) that is based on the Microsoft Component Object Model.[2]
Open source availability
Apple used to release most of CF as an open-source project called CFLite that can be used to write cross-platform applications for macOS, Linux, and Windows.[3]
A third-party open-source implementation called OpenCFLite extends the Apple CFLite for building on 32-bit Windows and Linux environments. It is maintained by one of the WebKit developers, but was stalled by 2015.[4] The karaoke platform KJams maintains a fork since 2017. This version, by its programmer David M. Cotter, supports 64-bit systems and has a CFNetwork implementation with LibreSSL-based TLS.[5] A fork of OpenCFLite was created by Grant Erickson (an original collaborator with Brent Fulgham on the SourceForge version) in 2021[6] with a companion port of the CFHost
portion of CFNetwork, as OpenCFNetwork.[7]
The Swift Corelib Foundation, a fallback version of the
GNUstep includes a version of the Core Foundation called "libs-corebase".[9]
See also
- GLib – the GNOME Project equivalent
References
- ^ ridiculous_fish (2006). "Bridge".
- ^ "Plug-ins and Microsoft's COM". Mac Developer Library. Apple Inc. Archived from the original on September 1, 2014. Retrieved March 25, 2015.
- ^ "Source Browser".
- ^ OpenCFLite project on SourceForge.
- ^ "CFLite". KJams. Retrieved February 19, 2020.
- ^ "OpenCFLite project on GitHub". Retrieved November 30, 2021.
- ^ "OpenCFNetwork project on GitHub". Retrieved November 30, 2021.
- ^ "swift-corelibs-foundation". GitHub. October 14, 2021.
- ^ "gnustep/libs-corebase: The GNUstep CoreBase Library is a library of general-purpose, non-graphical C objects". GitHub. GNUstep. November 19, 2019.
External links
- Core Foundation reference at Apple Developer
- OpenCFLite at SourceForge
- CFLite including CFNetwork works in 64bit, uses LibreSSL (TLS 1.1, 1.2)