MESH ONLINECODENAME: Circus Maximus

C — Headers and Linking

The C surface is not one header. It is ten, spread across five shared libraries, and one of the pairings is mutually exclusive. This page is the map.

The one decision that bites

net.h and net.go.h share the NET_SDK_H include guard, so only one of them can be active in a translation unit. net.go.h is the broader surface — but it is not a strict superset: net_ingest_raw_ex, net_poll_ex and net_stats_ex exist only in net.h.

Pick one per translation unit based on the symbols you need. If you need both surfaces in one program, split them across separate translation units.

Every other header has its own guard and composes freely.

The headers

HeaderGuardSurfaceLibrary
net.hNET_SDK_HNarrow event bus — init / ingest / poll / stats / shutdownlibnet
net.go.hNET_SDK_HMesh + compute — sessions, channels, capabilities, NAT, daemon dispatch, placement filters, predicate helperslibnet
net_cortex.hNET_CORTEX_HRedEX logs, CortEX Tasks/Memories adapters, NetDb bundle + snapshotlibnet
net_transport.hNET_TRANSPORT_HBlob and directory transfer over the stream transportlibnet
net_rpc.hNET_RPC_HnRPC request/responselibnet_rpc
net_meshdb.hNET_MESHDB_HFederated query layer over capability queries + CortEX foldslibnet_meshdb
net_meshos.hNET_MESHOS_HDaemon-author SDK — operator handle + control-event channellibnet_meshos
net_deck.hNET_DECK_HDeck operator-side SDKlibnet_deck
net_org.hNET_ORG_HOrganization capability authlibnet_org
net_mcp.hNET_MCP_HMCP bridge helpers, graduated consent / pin surfacelibnet_mcp_ffi

net_cortex.h is deliberately self-contained — it depends only on <stdint.h> and <stddef.h>, so a consumer who wants just the storage slice can include it without dragging in the mesh and compute surface from net.go.h. Its symbols resolve when the cdylib is built with --features "netdb redex-disk".

net.go.h is the in-crate mirror of go/net.h at the repo root, and pulls in net_cortex.h for its storage half.

Building the libraries

code
# libnet — the main library, also serves net_cortex.h and net_transport.h
cargo build --release --features ffi,net
 
# The others, one crate each
cargo build --release -p net-compute-ffi     # libnet_compute
cargo build --release -p net-rpc-ffi         # libnet_rpc
cargo build --release -p net-meshdb-ffi      # libnet_meshdb
cargo build --release -p net-meshos-ffi      # libnet_meshos

Output lands in target/release/:

PlatformFilename
Linuxlibnet.so
macOSlibnet.dylib
Windowsnet.dll

Compiling against it

code
gcc -o app app.c -L target/release -lnet -lpthread -ldl -lm

Add -lnet_rpc, -lnet_meshdb, -lnet_meshos, -lnet_deck or -lnet_org for whichever additional surfaces you included.

At run time the loader has to find the library:

code
LD_LIBRARY_PATH=target/release ./app       # Linux
DYLD_LIBRARY_PATH=target/release ./app     # macOS

Examples in the repo

FileWhat it shows
include/examples/basic.cThe event-bus quickstart loop
include/examples/capability.cStateless capability, predicate and where-header helpers
include/examples/meshdb.cMeshDB factory AST, runner, iterator, sentinel-envelope decoder

Next