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

LZ4 compression. More...

#include "config.h"
#include <limits.h>
#include <lz4.h>
#include <stddef.h>
#include "private.h"
#include "mutt/lib.h"
#include "lib.h"
+ Include dependency graph for lz4.c:

Go to the source code of this file.

Data Structures

struct  Lz4ComprData
 Private Lz4 Compression Data. More...
 

Macros

#define MIN_COMP_LEVEL   1
 Minimum compression level for lz4.
 
#define MAX_COMP_LEVEL   12
 Maximum compression level for lz4.
 

Functions

void lz4_cdata_free (struct Lz4ComprData **ptr)
 Free Lz4 Compression Data.
 
static struct Lz4ComprDatalz4_cdata_new (void)
 Create new Lz4 Compression Data.
 
static ComprHandlecompr_lz4_open (short level)
 Open a compression context - Implements ComprOps::open() -.
 
static void * compr_lz4_compress (ComprHandle *handle, const char *data, size_t dlen, size_t *clen)
 Compress header cache data - Implements ComprOps::compress() -.
 
static void * compr_lz4_decompress (ComprHandle *handle, const char *cbuf, size_t clen)
 Decompress header cache data - Implements ComprOps::decompress() -.
 
static void compr_lz4_close (ComprHandle **ptr)
 Close a compression context - Implements ComprOps::close() -.
 

Detailed Description

LZ4 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 lz4.c.

Macro Definition Documentation

◆ MIN_COMP_LEVEL

#define MIN_COMP_LEVEL   1

Minimum compression level for lz4.

Definition at line 40 of file lz4.c.

◆ MAX_COMP_LEVEL

#define MAX_COMP_LEVEL   12

Maximum compression level for lz4.

Definition at line 41 of file lz4.c.

Function Documentation

◆ lz4_cdata_free()

void lz4_cdata_free ( struct Lz4ComprData **  ptr)

Free Lz4 Compression Data.

Parameters
ptrLz4 Compression Data to free

Definition at line 56 of file lz4.c.

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

◆ lz4_cdata_new()

static struct Lz4ComprData * lz4_cdata_new ( void  )
static

Create new Lz4 Compression Data.

Return values
ptrNew Lz4 Compression Data

Definition at line 71 of file lz4.c.

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