NeoMutt  2021-02-05-89-gabe350
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 */
ComprOps::min_level
short min_level
Minimum compression level.
Definition: lib.h:58
ComprOps::name
const char * name
Compression name.
Definition: lib.h:57
compr_lz4_ops
const struct ComprOps compr_lz4_ops
compr_zlib_ops
const struct ComprOps compr_zlib_ops
ComprOps::max_level
short max_level
Maximum compression level.
Definition: lib.h:59
compress_get_ops
const struct ComprOps * compress_get_ops(const char *compr)
Get the API functions for a compress backend.
Definition: compress.c:81
ComprOps
Header Cache Compression API.
Definition: lib.h:55
compr_zstd_ops
const struct ComprOps compr_zstd_ops
compress_list
const char * compress_list(void)
Get a list of compression backend names.
Definition: compress.c:58
ComprOps::close
void(* close)(void **cctx)
Close a compression context.
Definition: lib.h:103