Repository navigation
API Quick Reference
Lee Yunjin edited this page Oct 7, 2026
·
1 revision
cwist_error_t make_error(cwist_errtype_t type)- Creates a
cwist_error_twith the requested error type.
static inline bool cwist_error_is_ok(const cwist_error_t *err)bool cwist_error_is_ok_extern(const cwist_error_t *err)- True when the active channel holds its zero/empty value (NULL counts as success). The
_externform is the same check as a real symbol, for callers that cannot use astatic inlinefunction, such as bindings generated from the headers.
-
bool cwist_endpoint_has_extern(cwist_endpoint_opt_t opts, cwist_endpoint_opt_t flag)is the out-of-linecwist_endpoint_has(). - Every
static inlinehelper ininclude/cwist/is either exported this way or listed with a reason inscripts/ci/check_inline_exports.py, which CI runs.
cwist_sstring *cwist_sstring_create(void)void cwist_sstring_destroy(cwist_sstring *str)cwist_error_t cwist_sstring_init(cwist_sstring *str)
size_t cwist_sstring_get_size(cwist_sstring *str)cwist_error_t cwist_sstring_change_size(cwist_sstring *str, size_t size, bool blow_data)cwist_error_t cwist_sstring_assign(cwist_sstring *str, char *data)
cwist_error_t cwist_sstring_ltrim(cwist_sstring *str)cwist_error_t cwist_sstring_rtrim(cwist_sstring *str)cwist_error_t cwist_sstring_trim(cwist_sstring *str)
cwist_error_t cwist_sstring_append(cwist_sstring *str, const char *data)cwist_error_t cwist_sstring_append_sstring(cwist_sstring *str, const cwist_sstring *from)cwist_error_t cwist_sstring_copy(cwist_sstring *origin, char *destination)cwist_error_t cwist_sstring_copy_sstring(cwist_sstring *origin, const cwist_sstring *from)
int cwist_sstring_compare(cwist_sstring *str, const char *compare_to)int cwist_sstring_compare_sstring(cwist_sstring *left, const cwist_sstring *right)cwist_error_t cwist_sstring_seek(cwist_sstring *str, char *substr, int location)cwist_sstring *cwist_sstring_substr(cwist_sstring *str, int start, int length)
cwist_http_request *cwist_http_request_create(void)void cwist_http_request_destroy(cwist_http_request *req)cwist_http_request *cwist_http_parse_request(const char *raw_request)
cwist_http_response *cwist_http_response_create(void)void cwist_http_response_destroy(cwist_http_response *res)cwist_error_t cwist_http_send_response(int client_fd, cwist_http_response *res)
cwist_error_t cwist_http_header_add(cwist_http_header_node **head, const char *key, const char *value)char *cwist_http_header_get(cwist_http_header_node *head, const char *key)void cwist_http_header_free_all(cwist_http_header_node *head)
const char *cwist_http_method_to_string(cwist_http_method_t method)cwist_http_method_t cwist_http_string_to_method(const char *method_str)
int cwist_make_socket_ipv4(struct sockaddr_in *sockv4, const char *address, uint16_t port, uint16_t backlog)cwist_error_t cwist_accept_socket(int server_fd, struct sockaddr *sockv4, void (*handler_func)(int client_fd))cwist_error_t cwist_http_server_loop(int server_fd, cwist_server_config *config, void (*handler)(int))
void session_arena_init(struct session_arena *arena, uint8_t *buffer, size_t capacity)void *session_arena_alloc(struct session_arena *arena, size_t size)void session_arena_reset(struct session_arena *arena)
void session_rc_init(struct session_rc_header *header, void (*destructor)(void *))void *session_shared_alloc(size_t payload_size, void (*destructor)(void *))void session_shared_inc(void *payload)void session_shared_dec(void *payload)
void session_manager_init(struct session_manager *manager, uint8_t *buffer, size_t capacity)void session_manager_reset(struct session_manager *manager)
Source: docs/api-quickref.md on dev. Edit the source file in the repository; this page is regenerated from it.
CWIST wiki, written against the dev branch of c4punks/CWIST. Pages marked "Source:" are generated from files under docs/; fix those in the repository. Questions: Discord.
Getting started
- Installation
- Quick Start
- Linking
- Server Modes
- Configuration and Environment
- Project CLI
- Tutorial / Korean
- Examples and Tutorials
Guides
Core
- API Reference
- Application
- Routing
- Middleware
- Requests and Responses
- Async Handlers
- Streaming Responses
- Error Handling
- Graceful Shutdown
- Multiport
Protocols
- HTTPS and TLS
- HTTP/2
- HTTP/3 and QUIC
- WebTransport
- WebSocket
- Server-Sent Events
- gRPC Server
- gRPC Client
- Protobuf and Codegen
- GraphQL
- WebRTC DataChannels
- HTTP Clients
Web features
- Static Files and Assets
- Big Dumb Reply Cache
- Compression
- Cookies
- Sessions and Flash
- Query Maps
- Multipart Uploads
- HTML Components
- Templates
- JSON
- Validation
- OpenAPI
Security
Data
Runtime
- Memory Management
- Full GC
- Async GC Ownership
- SString
- Reactor and I/O
- Metrics and Health
- Logging
- Testing
Platforms
Performance notes
- Benchmark Methodology
- C1M File Limits
- Reactor Fairness
- Cooperative Queuing
- Classic Pool Starvation
- Reactor Wakeup
- wrk Dual Histogram
- FIXED Endpoint Cache
- ADR-0001
- Durable Queue Gate
- Mux References
Project