API overview
libsig’s public headers live under include/sig/ and host/include/. This page
groups them the same way the API reference
does, with one section per area. Each header name links to its generated
reference page.
Capsules
Section titled “Capsules”Defines what a capsule is: its name, input and output terminal tables, and the table of properties it accepts, plus the capsule instance API a handler uses to read properties, notify output terminals and schedule periodic work. Start with sig_capsule.h when writing a capsule; Writing capsules walks through it.
Service
Section titled “Service”A service owns a signal queue, a worker thread and a set of capsule instances, and delivers signals between them. sig_service.h documents the threading contract, including when start and stop hooks run and how scheduled jobs behave.
Runtime
Section titled “Runtime”A runtime owns a loaded project and the optional runtime modules, and drives the start and stop lifecycle. sig_runtime.h is the entry point; sig_loop.h provides the event loop used by a single-threaded host; sig_tap.h lets code observe every signal crossing a terminal.
Project
Section titled “Project”A project is a set of capsule configurations and services loaded from a persistence store and wired together; sig_project.h also applies validated edits. sig_config.h is the JSON parsing layer underneath it. See Configuration for the file formats.
Persistence
Section titled “Persistence”A pluggable store of opaque blobs under a namespace and key, which the project loads from and saves to. sig_persistence.h defines the interface; sig_persistence_file.h is the file backend that maps the store onto a directory of .cfg files.
The optional HTTP pieces. sig_http_server.h is the shared HTTP/1.1 server that other runtime modules register path prefixes with. sig_http_client.h is the blocking GET client (libcurl) that the weather capsule uses. sig_ws.h holds WebSocket handshake and framing primitives.
Management
Section titled “Management”Operations for inspecting and controlling a running project, expressed as plain C calls with no transport. sig_mgmt.h defines them; sig_mgmt_http.h serves them over HTTP as the REST API. See the Management API and REST API pages.
Signal feed
Section titled “Signal feed”The optional live signal feed: it streams the signals crossing chosen terminals to WebSocket clients on the HTTP server’s /feed path. sig_signal_feed.h documents the module and its wire protocol; the Signal feed page covers delivery rules and limits.
Platform
Section titled “Platform”Thin layers that isolate the rest of the code from the operating system. sig_thread.h and sig_time.h cover threads, mutexes, conditions and time; sig_poller.h is the readiness poller under the event loop; sig_net.h is the minimal TCP socket layer used by the HTTP server.
Foundation
Section titled “Foundation”The base and value headers that everything else uses. sig_value.h is the tagged value type (int, bool, double, string, bytes, nested map and list); sig_value_json.h and sig_json.h read and write JSON; sig_status.h defines status codes, sig_log.h logging and sig_alloc.h allocation. The area also has sig_atomic.h, sig_ht.h, sig_ll.h, sig_portability.h, sig_expr.h and sig_value_python.h.
The portable boot sequence of a host program: open the store, create a runtime, register modules, wait for shutdown, then stop and destroy. sig_host.h is the header; sighost is built on it.