NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
lib.h
Go to the documentation of this file.
1 
47 #ifndef MUTT_COMPRESS_LIB_H
48 #define MUTT_COMPRESS_LIB_H
49 
50 #include <stdlib.h>
51 
59 struct ComprOps
60 {
61  const char *name;
62  short min_level;
63  short max_level;
64 
74  void *(*open)(short level);
75 
91  void *(*compress)(void *cctx, const char *data, size_t dlen, size_t *clen);
92 
107  void *(*decompress)(void *cctx, const char *cbuf, size_t clen);
108 
119  void (*close)(void **cctx);
120 };
121 
122 extern const struct ComprOps compr_lz4_ops;
123 extern const struct ComprOps compr_zlib_ops;
124 extern const struct ComprOps compr_zstd_ops;
125 
126 const struct ComprOps *compress_get_ops(const char *compr);
127 const char * compress_list (void);
128 
129 #endif /* MUTT_COMPRESS_LIB_H */
const struct ComprOps compr_lz4_ops
short max_level
Maximum compression level.
Definition: lib.h:63
const char * name
Compression name.
Definition: lib.h:61
const struct ComprOps compr_zstd_ops
const struct ComprOps * compress_get_ops(const char *compr)
Get the API functions for a compress backend.
Definition: compress.c:80
const struct ComprOps compr_zlib_ops
Definition: lib.h:59
void(* close)(void **cctx)
Definition: lib.h:119
const char * compress_list(void)
Get a list of compression backend names.
Definition: compress.c:57
short min_level
Minimum compression level.
Definition: lib.h:62