|
cwist
Modern C web framework with libttak runtime
|
Compression backend vtable. More...
#include <compress.h>
Public Attributes | |
| const char * | encoding_name |
| int(* | init )(void **state) |
| Initialize compressor state. | |
| int(* | compress )(void *state, const char *in, size_t in_len, char *out, size_t *out_len, int flush) |
| Compress one chunk. | |
| int(* | finish )(void *state, char *out, size_t *out_len) |
| Finish compression and write any trailing bytes. | |
| void(* | cleanup )(void *state) |
| Clean up compressor state. | |
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.
Definition at line 23 of file compress.h.
Clean up compressor state.
Definition at line 52 of file compress.h.
| int(* cwist_compress_backend::compress) (void *state, const char *in, size_t in_len, char *out, size_t *out_len, int flush) |
Compress one chunk.
| state | Opaque state from init(). |
| in | Input bytes. |
| in_len | Input length. |
| out | Output buffer. |
| out_len | In: capacity. Out: bytes written. |
| flush | Non-zero on final chunk. |
Definition at line 39 of file compress.h.
e.g. "gzip", "deflate"
Definition at line 24 of file compress.h.
Finish compression and write any trailing bytes.
| state | Opaque state from init(). |
| out | Output buffer. |
| out_len | In: capacity. Out: bytes written. |
Definition at line 49 of file compress.h.
Initialize compressor state.
Definition at line 27 of file compress.h.