|
KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
|
#include <compress.h>
Data Fields | |
| int(* | compress )(KlCompress *self, const char *in, size_t in_len, char **out, size_t *out_len, KlAllocator *alloc) |
| Single-shot: compress entire buffer into *out. | |
| int(* | feed )(KlCompress *self, const char *data, size_t len, int flush, int(*emit)(void *ctx, const char *data, size_t len), void *emit_ctx) |
| Streaming: feed input, emit compressed output via callback. | |
| const char *(* | encoding )(KlCompress *self) |
| Content-Encoding value, e.g. "gzip", "deflate", "zstd". | |
| void(* | reset )(KlCompress *self) |
| Reset for reuse (may be NULL if not reusable). | |
| void(* | destroy )(KlCompress *self) |
| Free all resources. | |
| int(* KlCompress::compress) (KlCompress *self, const char *in, size_t in_len, char **out, size_t *out_len, KlAllocator *alloc) |
Single-shot: compress entire buffer into *out.
Allocates output via alloc. Caller owns *out and must kl_free(alloc, *out, *out_len).
| self | Compression session. |
| in | Input data. |
| in_len | Input length. |
| out | Receives allocated compressed output. |
| out_len | Receives compressed output length. |
| alloc | Allocator for output buffer. |
| int(* KlCompress::feed) (KlCompress *self, const char *data, size_t len, int flush, int(*emit)(void *ctx, const char *data, size_t len), void *emit_ctx) |
Streaming: feed input, emit compressed output via callback.
| self | Compression session. |
| data | Input data (NULL when flush=1 for final). |
| len | Input length (0 when flush=1 for final). |
| flush | 0 for intermediate chunks, 1 for final flush + trailer. |
| emit | Callback to receive compressed output chunks. |
| emit_ctx | Context passed to emit callback. |
| const char *(* KlCompress::encoding) (KlCompress *self) |
Content-Encoding value, e.g. "gzip", "deflate", "zstd".
| void(* KlCompress::reset) (KlCompress *self) |
Reset for reuse (may be NULL if not reusable).
| void(* KlCompress::destroy) (KlCompress *self) |
Free all resources.