Feature flagsMock, off by default

Mock is a cargo feature on medius-capi and a matching #ifdef in the header.

Cargo featureHeader macroDeclaresEffect
mockMEDIUS_FEATURE_MOCKMediusMockBox, the medius_mock_* calls, medius_device_with_mock / _open_mockA scriptable fake box for tests. See Mock box.
EXAMPLE
# build the library with mock
cargo build -p medius-capi --release --features mock

# define the matching macro when compiling
cc app.c -DMEDIUS_FEATURE_MOCK \
   -I medius-capi/include -L target/release -lmedius_capi -lpthread -o app

The prebuilt tarball is built without mock. The macro without the feature is a link error; the feature without the macro leaves the declarations hidden.

Linking & loadingHeader, library, and their flags

Get the two files from a release tarball, or build the crate with the Rust toolchain (cargo build -p medius-capi --release writes the library to target/release/; the header is medius-capi/include/medius.h).

  compile  ──▶  needs your code + medius.h
  link     ──▶  adds libmedius_capi
  run      ──▶  loads libmedius_capi
FlagPoints atExample
-I<dir>the directory holding medius.h-I medius-capi/include
-L<dir>the directory holding the library-L target/release
-lmedius_capithe library (the linker adds the lib prefix and extension)resolves libmedius_capi.so
-lpthreadLinux only; the core spawns reader/keepalive threadsappend after -lmedius_capi
LIBRARY FILENAMES
OSShared libraryStatic libraryNote
Linuxlibmedius_capi.solibmedius_capi.aadd -lpthread
macOSlibmedius_capi.dyliblibmedius_capi.anone
Windowsmedius_capi.dllmedius_capi.liblink medius_capi.dll.lib (import) or .lib (static); no lib prefix
SANITY CHECK
// hello.c: proves the library links and loads
#include <medius.h>
#include <stdio.h>

int main(void) {
    printf("medius %s, abi %u\n", medius_version_string(), medius_abi_version());
    return 0;
}
cc hello.c -I medius-capi/include -L target/release -lmedius_capi -lpthread -o hello
LD_LIBRARY_PATH=target/release ./hello
# medius 3.4.6, abi 10

-L is link-time only. At run time the loader finds the shared library through LD_LIBRARY_PATH or an rpath on Linux, DYLD_LIBRARY_PATH or @rpath on macOS, and the .dll next to the exe or on PATH on Windows.

Or link the static library (.a / .lib) into the binary.

PackagingPrebuilt tarballs, no vcpkg or Conan port

Each GitHub Release attaches one tarball per platform, medius-capi-<target-triple>.tar.gz. Unpack it and use the flags above.

Inside the tarballContents
include/medius.hthe header (mock declarations gated by the macro)
lib/the prebuilt libmedius_capi, shared and static, with mock off

No vcpkg or Conan port: both build from source, and neither supplies a Rust toolchain. Python uses the prebuilt wheel.