|
cwist
Modern C web framework with libttak runtime
|
Compression middleware with swappable backend interface. More...


Go to the source code of this file.
Classes | |
| struct | cwist_compress_backend |
| Compression backend vtable. More... | |
Typedefs | |
| typedef struct cwist_compress_backend | cwist_compress_backend |
| Compression backend vtable. | |
Functions | |
| void | cwist_compress_register_backend (const cwist_compress_backend *backend) |
| Register a compression backend. | |
| void | cwist_compress_unregister_all (void) |
| Unregister all compression backends. | |
| const cwist_compress_backend * | cwist_compress_backend_gzip (void) |
| Returns the built-in zlib/gzip backend. | |
| const cwist_compress_backend * | cwist_compress_backend_deflate (void) |
| Returns the built-in zlib/deflate backend. | |
| const cwist_compress_backend * | cwist_compress_backend_brotli (void) |
| Returns the built-in Brotli backend. | |
| const cwist_compress_backend * | cwist_compress_backend_zstd (void) |
| Returns the built-in Zstandard (zstd) backend. | |
| cwist_middleware_func | cwist_mw_compress (size_t min_body_size) |
| Compression middleware factory. | |
Compression middleware with swappable backend interface.
Definition in file compress.h.
Compression backend vtable.
Implementations provide init/compress/finish/cleanup lifecycle hooks. The middleware uses this interface so backends can be swapped or extended (e.g., Brotli, zstd) without changing middleware logic.
| const cwist_compress_backend * cwist_compress_backend_brotli | ( | void | ) |
Returns the built-in Brotli backend.
Returns the built-in Brotli backend.
Definition at line 350 of file compress.c.
| const cwist_compress_backend * cwist_compress_backend_deflate | ( | void | ) |
Returns the built-in zlib/deflate backend.
Returns the built-in zlib/deflate backend.
Definition at line 173 of file compress.c.
| const cwist_compress_backend * cwist_compress_backend_gzip | ( | void | ) |
Returns the built-in zlib/gzip backend.
Returns the built-in zlib/gzip backend.
Definition at line 165 of file compress.c.
| const cwist_compress_backend * cwist_compress_backend_zstd | ( | void | ) |
Returns the built-in Zstandard (zstd) backend.
Returns the built-in Zstandard (zstd) backend.
Definition at line 524 of file compress.c.
| void cwist_compress_register_backend | ( | const cwist_compress_backend * | backend | ) |
Register a compression backend.
| backend | Pointer to a statically-allocated backend descriptor. |
Register a compression backend.
| backend | Backend to append to the registry. Ignored if NULL or if the registry is already full (CWIST_MAX_BACKENDS entries). |
Definition at line 30 of file compress.c.
References CWIST_MAX_BACKENDS.
Unregister all compression backends.
Unregister all compression backends.
Definition at line 38 of file compress.c.
| cwist_middleware_func cwist_mw_compress | ( | size_t | min_body_size | ) |
Compression middleware factory.
Chooses a registered backend based on the request's Accept-Encoding header, runs the handler chain, then compresses the response body.
| min_body_size | Minimum uncompressed body size (in bytes) to trigger compression. Use 0 to compress all bodies. |
Compression middleware factory.
| min_body_size | Minimum body size, in bytes, for compression to apply. |
Definition at line 713 of file compress.c.
References cap.