zerodds_sys/lib.rs
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2026 ZeroDDS Contributors
3
4//! Stable C-ABI, basis for non-Rust bindings
5//!
6//! Crate `zerodds-sys`.
7//!
8//! Safety classification: **SAFE (core) / BINDING (FFI module)**.
9//! See `docs/architecture/02_architecture.md §3`, §4.4.3, §4.4.4 and
10//! `docs/architecture/04_safety_by_architecture.md §2`.
11//!
12//! The `lib.rs` core is safe/no_std and `#![forbid(unsafe_code)]`. The
13//! actual C-ABI surface (`extern "C"` exports, `#[no_mangle]`
14//! symbols) is placed in a separate `mod ffi;`, which carries the
15//! exception locally via `#![allow(unsafe_code)]`. Safe audits of the
16//! core do not cover the FFI module.
17
18#![cfg_attr(not(feature = "std"), no_std)]
19#![forbid(unsafe_code)]
20#![warn(missing_docs)]
21
22#[cfg(feature = "alloc")]
23extern crate alloc;
24
25// The zerodds-sys crate is the historical C-ABI surface. With the
26// release of `zerodds-c-api` (Layer 6, RC1), the complete
27// spec-compliant C-FFI interface is bundled there
28// (~115 functions, ~4100 LOC, spec-compliant DDS 1.4 §2.2.2 +
29// DDS-PSM-Cxx 1.0 §7.5).
30//
31// This crate remains a workspace member but exports no
32// symbols — consumers link against
33// `zerodds-c-api` instead (cdylib `libzerodds.dylib` / `.so` / `.dll`).
34//
35// See `crates/zerodds-c-api/include/zerodds.h` and
36// `docs/specs/zerodds-c-api-1.0.md` for the complete API.
37
38/// Marker constant: points to the fully spec-compliant C-FFI in
39/// `zerodds-c-api`.
40pub const REFERENCE_C_API_CRATE: &str = "zerodds-c-api";
41
42#[cfg(test)]
43mod tests {
44 use super::*;
45
46 #[test]
47 fn references_c_api_crate() {
48 assert_eq!(REFERENCE_C_API_CRATE, "zerodds-c-api");
49 }
50}