API reference

The Zig reference is generated from the library’s declarations each time the site builds. The C headers are generated too, and a build check rejects a stale one. To choose an API, start with Choose an API. To build a first client, use Start building.

The Zig API

The Zig API reference documents the public glowcap module imported by applications. Ownership and lifetime notes live with the declarations they govern. The modules explains how those declarations are divided by responsibility.

The C ABI

The C ABI is split into composable archives. Each generated header describes one archive and includes only the shared definitions it needs.

ArchiveHeaderWhat it carries
libglowcap_ocapnglowcap_ocapn.hshared contexts, frames, values, locators, and URI helpers
libglowcap_hostglowcap_host.hthe Host, which your program feeds bytes (glowcap_host_*)
libglowcap_driverglowcap_driver.hthe C driver loop, which adopts a Host from libglowcap_host through glowcap_driver_take_host. It exports only glowcap_driver_*
libglowcap_loamglowcap_loam.hstorage core for objects and names on an existing Host, using a storage archive or callbacks supplied by your application
libglowcap_loam_lmdbglowcap_loam_lmdb.hoptional LMDB storage for Loam. It creates or reopens the database at startup and runs the storage work you hand it
libglowcap_loam_sqliteglowcap_loam_sqlite.hoptional SQLite storage for Loam, with the same verbs as the LMDB archive. It creates or reopens the database file at startup and runs the storage work you hand it
libglowcap_loam_volatileglowcap_loam_volatile.hoptional in-memory storage for Loam, with the same verbs as the LMDB archive. It takes no path, and its store ends at release
libglowcap_net_transport_irohglowcap_net_transport_iroh.hencrypted QUIC. It is optional and links a Rust library.
libglowcap_net_transport_webrtcglowcap_net_transport_webrtc.hpeer-to-peer WebRTC DataChannel. It is optional and links a Rust library.
libglowcap_net_transport_onionglowcap_net_transport_onion.hTor onion services over a daemon you run
libglowcap_net_transport_relayglowcap_net_transport_relay.hthe keyed-relay and end-to-end sealed noise-relay transports
libglowcap_net_transport_tcpglowcap_net_transport_tcp.hthe noise-tcp, keyed-tcp, and testing tcp transports, plus low-level framed TCP endpoints
libglowcap_net_transport_inprocglowcap_net_transport_inproc.hin-process byte pipes, no sockets

Each driver and transport header #includes glowcap_ocapn.h, declares only its own functions, and expects its archive to be linked alongside libglowcap_ocapn. For build instructions and a complete C program, read consuming glowcap from C.