Open a compression context.
More...
Open a compression context.
- Parameters
-
[in] | level | The compression level |
- Return values
-
ptr | Success, Compression private data |
NULL | Otherwise |
◆ compr_lz4_open()
Open a compression context - Implements ComprOps::open() -.
Definition at line 79 of file lz4.c.
80{
82
84
86 {
90 }
91
93
94
96}
void ComprHandle
Opaque type for compression data.
const struct ComprOps compr_lz4_ops
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
#define MAX_COMP_LEVEL
Maximum compression level for lz4.
#define MIN_COMP_LEVEL
Minimum compression level for lz4.
static struct Lz4ComprData * lz4_cdata_new(void)
Create new Lz4 Compression Data.
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
const char * name
Compression name.
Private Lz4 Compression Data.
void * buf
Temporary buffer.
short level
Compression Level to be used.
◆ compr_zlib_open()
Open a compression context - Implements ComprOps::open() -.
Definition at line 79 of file zlib.c.
80{
82
84
86 {
90 }
91
93
94
96}
const struct ComprOps compr_zlib_ops
Private Zlib Compression Data.
short level
Compression Level to be used.
void * buf
Temporary buffer.
static struct ZlibComprData * zlib_cdata_new(void)
Create new Zlib Compression Data.
#define MAX_COMP_LEVEL
Maximum compression level for zlib.
#define MIN_COMP_LEVEL
Minimum compression level for zlib.
◆ compr_zstd_open()
Open a compression context - Implements ComprOps::open() -.
Definition at line 81 of file zstd.c.
82{
84
86 cdata->
cctx = ZSTD_createCCtx();
87 cdata->
dctx = ZSTD_createDCtx();
88
90 {
91
92 ZSTD_freeCCtx(cdata->
cctx);
93 ZSTD_freeDCtx(cdata->
dctx);
95 return NULL;
96
97 }
98
100 {
104 }
105
107
108
110}
const struct ComprOps compr_zstd_ops
Private Zstandard Compression Data.
short level
Compression Level to be used.
ZSTD_CCtx * cctx
Compression context.
ZSTD_DCtx * dctx
Decompression context.
void * buf
Temporary buffer.
void zstd_cdata_free(struct ZstdComprData **ptr)
Free Zstandard Compression Data.
static struct ZstdComprData * zstd_cdata_new(void)
Create new Zstandard Compression Data.
#define MAX_COMP_LEVEL
Maximum compression level for zstd.
#define MIN_COMP_LEVEL
Minimum compression level for zstd.