NeoMutt  2020-09-25
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 
55 struct ComprOps
56 {
57  const char *name;
58  short min_level;
59  short max_level;
60 
67  void *(*open)(short level);
68 
81  void *(*compress)(void *cctx, const char *data, size_t dlen, size_t *clen);
82 
94  void *(*decompress)(void *cctx, const char *cbuf, size_t clen);
95 
103  void (*close)(void **cctx);
104 };
105 
106 extern const struct ComprOps compr_lz4_ops;
107 extern const struct ComprOps compr_zlib_ops;
108 extern const struct ComprOps compr_zstd_ops;
109 
110 const struct ComprOps *compress_get_ops(const char *compr);
111 const char * compress_list (void);
112 
113 #endif /* MUTT_COMPRESS_LIB_H */
const struct ComprOps compr_lz4_ops
short max_level
Maximum compression level.
Definition: lib.h:59
const char * name
Compression name.
Definition: lib.h:57
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:81
const struct ComprOps compr_zlib_ops
Header Cache Compression API.
Definition: lib.h:55
void(* close)(void **cctx)
Close a compression context.
Definition: lib.h:103
const char * compress_list(void)
Get a list of compression backend names.
Definition: compress.c:58
short min_level
Minimum compression level.
Definition: lib.h:58