Documentation Index
Fetch the complete documentation index at: https://docs.oxd.sh/llms.txt
Use this file to discover all available pages before exploring further.
Setup
Swift can call C functions directly via a bridging header or module map. No wrapper library needed.Option 1: Bridging header
Addoxaccel.h to your Xcode project and reference it in Build Settings → Objective-C Bridging Header:
Option 2: Module map (SPM / frameworks)
Create a module map for the C library:liboxaccel.a (static) or liboxaccel.dylib (shared) in your target’s build settings.
Usage
iOS static linking
For iOS, useliboxaccel.a (static). Add to your target:
- Drag
liboxaccel.ainto Xcode → Frameworks, Libraries, and Embedded Content - Set “Embed” to “Do Not Embed” (static libraries are linked at build time)
- Add linker flags in Build Settings → Other Linker Flags:
-loxaccel
Performance tips
Swift’s C interop has near-zero overhead (~5-10ns per call). The
withUnsafeBytes / withUnsafeMutableBytes pattern gives you a direct pointer to Data’s underlying buffer — no copies.- For maximum throughput, use
UnsafeRawBufferPointerdirectly instead ofData - Reuse receive buffers across calls to avoid repeated allocation
- On iOS, use the static library (
liboxaccel.a) to avoid framework embedding overhead