KEEL 1.0.0
Minimal C11 HTTP client/server library built on epoll/kqueue/io_uring/poll
Loading...
Searching...
No Matches
Data Fields
KlDecompress Struct Reference

#include <decompress.h>

Data Fields

int(* decompress )(KlDecompress *self, const char *in, size_t in_len, char **out, size_t *out_len, KlAllocator *alloc)
 Single-shot: decompress entire buffer into *out.
 
int(* dfeed )(KlDecompress *self, const char *data, size_t len, int flush, int(*emit)(void *ctx, const char *data, size_t len), void *emit_ctx)
 Streaming: feed compressed input, emit decompressed output.
 
const char *(* encoding )(KlDecompress *self)
 Content-Encoding value this decompressor handles, e.g. "gzip".
 
void(* reset )(KlDecompress *self)
 Reset for reuse (may be NULL if not reusable).
 
void(* destroy )(KlDecompress *self)
 Free all resources.
 

Field Documentation

◆ decompress

int(* KlDecompress::decompress) (KlDecompress *self, const char *in, size_t in_len, char **out, size_t *out_len, KlAllocator *alloc)

Single-shot: decompress entire buffer into *out.

Allocates output via alloc. Caller owns *out and must kl_free(alloc, *out, *out_len).

Parameters
selfDecompression session.
inCompressed input data.
in_lenInput length.
outReceives allocated decompressed output.
out_lenReceives decompressed output length.
allocAllocator for output buffer.
Returns
0 on success, -1 on error.

◆ dfeed

int(* KlDecompress::dfeed) (KlDecompress *self, const char *data, size_t len, int flush, int(*emit)(void *ctx, const char *data, size_t len), void *emit_ctx)

Streaming: feed compressed input, emit decompressed output.

Parameters
selfDecompression session.
dataCompressed input data (NULL when flush=1 for final).
lenInput length (0 when flush=1 for final).
flush0 for intermediate chunks, 1 for final (validate trailer).
emitCallback to receive decompressed output chunks.
emit_ctxContext passed to emit callback.
Returns
0 on success, -1 on error.

◆ encoding

const char *(* KlDecompress::encoding) (KlDecompress *self)

Content-Encoding value this decompressor handles, e.g. "gzip".

Returns
Static string, never NULL.

◆ reset

void(* KlDecompress::reset) (KlDecompress *self)

Reset for reuse (may be NULL if not reusable).

◆ destroy

void(* KlDecompress::destroy) (KlDecompress *self)

Free all resources.


The documentation for this struct was generated from the following file: