Files
swift-mirror/stdlib/stdlib.docc/c-interoperability.md
T
Graham Lee 9ead8781d4 Add .docc catalog to publish stdlib docs on swift.org
Co-authored-by: Alex Martini <amartini@apple.com>
Co-authored-by: Graham Lee <glee23@apple.com>
Co-authored-by: Chris Adamson <cadamson@apple.com>
Co-authored-by: Kirby Turner <kirby_turner@apple.com>
Co-authored-by: Paris Pinkney <ppinkney@apple.com>
Co-authored-by: Dave Spector <dspector@apple.com>
Co-authored-by: Sofia Rodriguez Morales <sofia_rodriguez@apple.com>
Co-authored-by: Ethan Kusters <ekusters@apple.com>
Co-authored-by: Goli Mohammadi <g_mohammadi@apple.com>
Co-authored-by: Adora Vaz <a_vaz@apple.com>
Co-authored-by: David Rönnqvist <ronnqvist@apple.com>
Co-authored-by: Nate Merseth Cook <natecook@apple.com>
Co-authored-by: Susan Conant <susan_c@apple.com>
2026-04-10 10:04:56 -04:00

52 lines
1.1 KiB
Markdown

# C Interoperability
Use imported C types or call C variadic functions.
## Topics
### C Pointers
- ``Swift/OpaquePointer``
- ``Swift/AutoreleasingUnsafeMutablePointer``
### C Variadic Functions
- ``Swift/withVaList(_:_:)``
- ``Swift/CVaListPointer``
- ``Swift/CVarArg``
- ``Swift/getVaList(_:)``
### Pointers to Values
Access a pointer to a variable in memory for explicit passing to C functions.
- ``Swift/withUnsafePointer(to:_:)-9fjn6``
- ``Swift/withUnsafePointer(to:_:)-35wrn``
- ``Swift/withUnsafeMutablePointer(to:_:)``
- ``Swift/withUnsafeBytes(of:_:)-5zxtl``
- ``Swift/withUnsafeBytes(of:_:)-5gesg``
- ``Swift/withUnsafeMutableBytes(of:_:)``
### Aliases for Imported C Types
- ``Swift/CBool``
- ``Swift/CChar``
- ``Swift/CChar8``
- ``Swift/CChar16``
- ``Swift/CChar32``
- ``Swift/CDouble``
- ``Swift/CLongDouble``
- ``Swift/CFloat``
- ``Swift/CFloat16``
- ``Swift/CInt``
- ``Swift/CLong``
- ``Swift/CLongLong``
- ``Swift/CShort``
- ``Swift/CSignedChar``
- ``Swift/CUnsignedChar``
- ``Swift/CUnsignedInt``
- ``Swift/CUnsignedLong``
- ``Swift/CUnsignedLongLong``
- ``Swift/CUnsignedShort``
- ``Swift/CWideChar``