12681e4b1b
Stacked on #222 (base `feat/c-abi-hub`), so the diff is just the additions on top of the hub foundation — no merge of #222 required. ## What this adds **Examples — full parity with rust/python/node (`examples/c/`)** - `streaming.c` upgraded to the multi-indicator (SMA/EMA/RSI/MACD + signals) demo - `backtest.c`, `multi_timeframe.c` (manual time-bucket resampling), `parallel_assets.c` (serial vs OpenMP fan-out, one handle per asset) - three educational strategies: `strategy_rsi_mean_reversion.c`, `strategy_macd_adx.c`, `strategy_bollinger_squeeze.c` - two network examples shelling out to `curl`: `fetch_btcusdt.c`, `live_binance.c` (REST poll) - two header-only helpers (`wickra_csv.h`, `wickra_strategy.h`) since the C ABI ships no IO layer - CMake builds all 11; the 9 offline ones run under `ctest` on 3 OS; the network two are built-only **Docs & metadata — surface the C ABI everywhere it was missing** - ARCHITECTURE diagram + crate table, SECURITY + THREAT_MODEL (the C ABI as the sole `unsafe` FFI surface), the three binding package READMEs, issue/PR templates, CHANGELOG, and the GitHub About template (live About + org description updated too) **Cleanup** - removed all references to the private generator tooling from public files (`bindings/c/src/lib.rs` header, `CONTRIBUTING.md`, `sync-about.yml`) Verified locally: `cargo build -p wickra-c --release`, `cmake + ctest` (9/9 pass), and `-Wall -Wextra -Wpedantic` clean on gcc 13.
wickra-c
C ABI for Wickra — streaming-first technical indicators with a Rust core. This crate is the hub: it compiles the core to a C-compatible shared/static library plus a generated header, so any C-capable language (C, C++, Go, C#, Java, R) links against one artifact instead of re-wiring every indicator natively.
The native Python, Node, and WebAssembly bindings are unaffected — this is additive, for the ecosystems without first-class Rust tooling.
Artifacts
cargo build -p wickra-c --release
target/release/libwickra.{so,dylib}/wickra.dll(+wickra.dll.libimport lib on Windows)target/release/libwickra.a/wickra.lib(static)include/wickra.h— generated by cbindgen, committed.
API shape
Each indicator is exposed as five extern "C" functions over an opaque handle:
struct Sma *wickra_sma_new(uintptr_t period); /* NULL on bad params */
double wickra_sma_update(struct Sma *h, double value); /* NaN during warmup */
void wickra_sma_batch(struct Sma *h, const double *in, double *out, uintptr_t n);
void wickra_sma_reset(struct Sma *h);
void wickra_sma_free(struct Sma *h); /* exactly once per _new */
Conventions:
- Opaque handles.
wickra_<ind>_newreturns aT *you must release with exactly onewickra_<ind>_free. There is no RAII across the boundary. - NaN sentinel. Scalar outputs return
NaNwhile warming up or on aNULLhandle, mirroring the other bindings — no error codes for the common path. - Caller-owned batch buffers.
wickra_<ind>_batchwrites one output per input into a buffer you provide; nothing is allocated across the boundary. - NULL-safe. Every function tolerates a
NULLhandle without crashing.
Header regeneration
The header is generated and committed; CI checks it is in sync:
cbindgen --config bindings/c/cbindgen.toml --crate wickra-c --output bindings/c/include/wickra.h
Examples
Runnable C examples (build via CMake or a direct compiler invocation) live in
examples/c.
License
MIT OR Apache-2.0, the same as the rest of Wickra.