NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches

Close a compression context. More...

+ Collaboration diagram for close():

Functions

static void compr_lz4_close (ComprHandle **ptr)
 Close a compression context - Implements ComprOps::close() -.
 
static void compr_zlib_close (ComprHandle **ptr)
 Close a compression context - Implements ComprOps::close() -.
 
static void compr_zstd_close (ComprHandle **ptr)
 Close a compression context - Implements ComprOps::close() -.
 

Detailed Description

Close a compression context.

Parameters
[out]ptrPointer to Compression handle
Note
This function will free all allocated resources, which were allocated by open(), compress() or decompress()

Function Documentation

◆ compr_lz4_close()

static void compr_lz4_close ( ComprHandle **  ptr)
static

Close a compression context - Implements ComprOps::close() -.

Definition at line 169 of file lz4.c.

170{
171 if (!ptr || !*ptr)
172 return;
173
174 // Decloak an opaque pointer
175 lz4_cdata_free((struct Lz4ComprData **) ptr);
176}
void lz4_cdata_free(struct Lz4ComprData **ptr)
Free Lz4 Compression Data.
Definition: lz4.c:56
Private Lz4 Compression Data.
Definition: lz4.c:47
+ Here is the call graph for this function:

◆ compr_zlib_close()

static void compr_zlib_close ( ComprHandle **  ptr)
static

Close a compression context - Implements ComprOps::close() -.

Definition at line 164 of file zlib.c.

165{
166 if (!ptr || !*ptr)
167 return;
168
169 // Decloak an opaque pointer
170 zlib_cdata_free((struct ZlibComprData **) ptr);
171}
Private Zlib Compression Data.
Definition: zlib.c:47
void zlib_cdata_free(struct ZlibComprData **ptr)
Free Zlib Compression Data.
Definition: zlib.c:56
+ Here is the call graph for this function:

◆ compr_zstd_close()

static void compr_zstd_close ( ComprHandle **  ptr)
static

Close a compression context - Implements ComprOps::close() -.

Definition at line 166 of file zstd.c.

167{
168 if (!ptr || !*ptr)
169 return;
170
171 // Decloak an opaque pointer
172 struct ZstdComprData *cdata = *ptr;
173
174 if (cdata->cctx)
175 ZSTD_freeCCtx(cdata->cctx);
176
177 if (cdata->dctx)
178 ZSTD_freeDCtx(cdata->dctx);
179
180 zstd_cdata_free((struct ZstdComprData **) ptr);
181}
Private Zstandard Compression Data.
Definition: zstd.c:46
ZSTD_CCtx * cctx
Compression context.
Definition: zstd.c:50
ZSTD_DCtx * dctx
Decompression context.
Definition: zstd.c:51
void zstd_cdata_free(struct ZstdComprData **ptr)
Free Zstandard Compression Data.
Definition: zstd.c:58
+ Here is the call graph for this function: