How barabol/crest works
Crest is a small C REST API framework: an application registers method-and-path handlers, starts the server, and each client request is parsed and dispatched to a callback that returns a response. The framework also exposes path/query/header/cookie access and response-header/cookie helpers, plus in-memory user-defined sessions. The excerpts show the request callback and response-send path; some parser and startup details are omitted, so the graph leaves uncertain internal wiring out.
Main entry points: crest.c Request dispatch · crest.h Request fields
Components 15
HTTP server
- Server startup
crest.c - Socket and workers
crest.c - Request dispatch
crest.c
Endpoint routing
- Handler registration
crest.c - Route and method tables
crest.c
Request and response
- Request parsing
crest.c - Request fields
crest.h - Request accessors
crest.c - Response helpers
crest.c - Response fields
crest.h - Response serialization
crest.c
Session state
- Session API
crest.c - Session store
crest.c
Other components
- HTTP client
- Application handler
Connections 18
- HTTP client → Socket and workers: connects
- Server startup → Socket and workers: starts
- Socket and workers → Request parsing: receives request
- Request parsing → Request fields: populates
- Request parsing → Request dispatch: dispatches
- Handler registration → Route and method tables: registers routes
- Request dispatch → Route and method tables: looks up route
- Request dispatch → Application handler: invokes
- Request dispatch → Request fields: passes request
- Application handler → Request accessors: reads request
- Request accessors → Request fields: reads fields
- Application handler → Response helpers: builds response
- Response helpers → Response fields: creates
- Application handler → Session API: uses sessions
- Session API → Session store: reads or writes
- Request dispatch → Response serialization: sends response
- Response serialization → Response fields: serializes
- Response serialization → HTTP client: returns HTTP response