compress: add byte-wise (de)compression stream data structure
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#ifndef BLUELIB_COMPRESS_CSTREAM_H_
|
||||
#define BLUELIB_COMPRESS_CSTREAM_H_
|
||||
|
||||
#include <blue/compress/function.h>
|
||||
#include <blue/core/stream.h>
|
||||
|
||||
typedef struct b_cstream b_cstream;
|
||||
|
||||
BLUE_API b_status b_cstream_open(
|
||||
b_stream *endpoint, const b_compression_function *func,
|
||||
b_compression_mode mode, b_cstream **out);
|
||||
BLUE_API b_status b_cstream_close(b_cstream *stream);
|
||||
|
||||
BLUE_API b_status b_cstream_read(
|
||||
b_cstream *stream, void *buf, size_t count, size_t *nr_read);
|
||||
BLUE_API b_status b_cstream_write(
|
||||
b_cstream *stream, const void *buf, size_t count, size_t *nr_written);
|
||||
|
||||
BLUE_API b_status b_cstream_begin_compressed_section(
|
||||
b_cstream *stream, size_t *tx_uncompressed_bytes);
|
||||
BLUE_API b_status b_cstream_end_compressed_section(
|
||||
b_cstream *stream, size_t *tx_compressed_bytes,
|
||||
size_t *tx_uncompressed_bytes);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user