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

Zstandard (zstd) compression. More...

#include "config.h"
#include <stdio.h>
#include <zstd.h>
#include "private.h"
#include "mutt/lib.h"
#include "lib.h"
+ Include dependency graph for zstd.c:

Go to the source code of this file.

Data Structures

struct  ZstdComprData
 Private Zstandard Compression Data. More...
 

Macros

#define MIN_COMP_LEVEL   1
 Minimum compression level for zstd.
 
#define MAX_COMP_LEVEL   22
 Maximum compression level for zstd.
 

Functions

void zstd_cdata_free (struct ZstdComprData **ptr)
 Free Zstandard Compression Data.
 
static struct ZstdComprDatazstd_cdata_new (void)
 Create new Zstandard Compression Data.
 
static ComprHandlecompr_zstd_open (short level)
 Open a compression context - Implements ComprOps::open() -.
 
static void * compr_zstd_compress (ComprHandle *handle, const char *data, size_t dlen, size_t *clen)
 Compress header cache data - Implements ComprOps::compress() -.
 
static void * compr_zstd_decompress (ComprHandle *handle, const char *cbuf, size_t clen)
 Decompress header cache data - Implements ComprOps::decompress() -.
 
static void compr_zstd_close (ComprHandle **ptr)
 Close a compression context - Implements ComprOps::close() -.
 

Detailed Description

Zstandard (zstd) compression.

Authors
  • Tino Reichardt
  • Pietro Cerutti
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file zstd.c.

Macro Definition Documentation

◆ MIN_COMP_LEVEL

#define MIN_COMP_LEVEL   1

Minimum compression level for zstd.

Definition at line 39 of file zstd.c.

◆ MAX_COMP_LEVEL

#define MAX_COMP_LEVEL   22

Maximum compression level for zstd.

Definition at line 40 of file zstd.c.

Function Documentation

◆ zstd_cdata_free()

void zstd_cdata_free ( struct ZstdComprData **  ptr)

Free Zstandard Compression Data.

Parameters
ptrZstandard Compression Data to free

Definition at line 58 of file zstd.c.

59{
60 if (!ptr || !*ptr)
61 return;
62
63 struct ZstdComprData *cdata = *ptr;
64 FREE(&cdata->buf);
65
66 FREE(ptr);
67}
#define FREE(x)
Definition: memory.h:55
Private Zstandard Compression Data.
Definition: zstd.c:46
void * buf
Temporary buffer.
Definition: zstd.c:47
+ Here is the caller graph for this function:

◆ zstd_cdata_new()

static struct ZstdComprData * zstd_cdata_new ( void  )
static

Create new Zstandard Compression Data.

Return values
ptrNew Zstandard Compression Data

Definition at line 73 of file zstd.c.

74{
75 return MUTT_MEM_CALLOC(1, struct ZstdComprData);
76}
#define MUTT_MEM_CALLOC(n, type)
Definition: memory.h:40
+ Here is the caller graph for this function: