|
ZXC 0.15.0
High-performance asymmetric lossless compression library
|
Push-based, single-threaded streaming compression and decompression. More...
Go to the source code of this file.
Data Structures | |
| struct | zxc_inbuf_t |
| Input buffer descriptor for push streaming. More... | |
| struct | zxc_outbuf_t |
| Output buffer descriptor for push streaming. More... | |
Typedefs | |
| typedef struct zxc_cstream_s | zxc_cstream |
| Opaque push-model compression stream (see zxc_cstream_create). | |
| typedef struct zxc_dstream_s | zxc_dstream |
| Opaque push-model decompression stream (see zxc_dstream_create). | |
Functions | |
| zxc_cstream * | zxc_cstream_create (const zxc_compress_opts_t *opts) |
| Creates a push compression stream. | |
| void | zxc_cstream_free (zxc_cstream *cs) |
| Releases a compression stream and all internal buffers. | |
| int64_t | zxc_cstream_compress (zxc_cstream *cs, zxc_outbuf_t *out, zxc_inbuf_t *in) |
| Pushes input bytes into the stream and drains compressed output. | |
| int64_t | zxc_cstream_end (zxc_cstream *cs, zxc_outbuf_t *out) |
| Finalises the stream: flushes pending data, writes EOF block + footer. | |
| size_t | zxc_cstream_in_size (const zxc_cstream *cs) |
| Suggested input chunk size for best throughput. | |
| size_t | zxc_cstream_out_size (const zxc_cstream *cs) |
| Suggested output chunk size that never triggers a partial drain. | |
| zxc_dstream * | zxc_dstream_create (const zxc_decompress_opts_t *opts) |
| Creates a push decompression stream. | |
| void | zxc_dstream_free (zxc_dstream *ds) |
| Releases a decompression stream. | |
| int64_t | zxc_dstream_decompress (zxc_dstream *ds, zxc_outbuf_t *out, zxc_inbuf_t *in) |
| Pushes compressed input and drains decompressed output. | |
| int | zxc_dstream_finished (const zxc_dstream *ds) |
| Reports whether the decoder has fully consumed a valid stream. | |
| size_t | zxc_dstream_in_size (const zxc_dstream *ds) |
| Suggested input chunk size for the decompressor. | |
| size_t | zxc_dstream_out_size (const zxc_dstream *ds) |
| Suggested output chunk size for the decompressor. | |
Push-based, single-threaded streaming compression and decompression.
The counterpart of the FILE*-based zxc_stream_compress / zxc_stream_decompress. Those own the pipeline (read until EOF, write until done); here the caller stays in control: feed input chunks when they arrive, drain output chunks when ready, finalise on demand. Nothing blocks.
That is what you want inside a callback-driven library, an asynchronous event loop, a non-seeking network protocol (HTTP chunked transfer, gRPC, your own binary protocol), or any pipeline with no FILE* to block on.
One context, one thread at a time. To compress a single file end-to-end across threads, use zxc_stream_compress instead.
FILE*-based pipeline. Definition in file zxc_pstream.h.