NeoMutt  2020-08-07-1-gab41a1
Teaching an old dog new tricks
DOXYGEN
config.c
Go to the documentation of this file.
1 
29 #include "config.h"
30 #include <stddef.h>
31 #include <config/lib.h>
32 #include <stdbool.h>
33 #include "mutt/lib.h"
34 #include "init.h"
35 
36 // clang-format off
39 #ifdef USE_HCACHE_COMPRESSION
42 #endif
44 // clang-format on
45 
46 bool C_HeaderCacheCompress = false;
47 #if defined(HAVE_GDBM) || defined(HAVE_BDB)
49 #endif
50 
51 struct ConfigDef HcacheVars[] = {
52  // clang-format off
53  { "header_cache", DT_PATH, &C_HeaderCache, 0, 0, NULL,
54  "(hcache) Directory/file for the header cache database"
55  },
56  { "header_cache_backend", DT_STRING, &C_HeaderCacheBackend, 0, 0, hcache_validator,
57  "(hcache) Header cache backend to use"
58  },
59 #if defined(USE_HCACHE_COMPRESSION)
60  { "header_cache_compress_level", DT_NUMBER|DT_NOT_NEGATIVE, &C_HeaderCacheCompressLevel, 1, 0, compress_level_validator,
61  "(hcache) Level of compression for method"
62  },
63  { "header_cache_compress_method", DT_STRING, &C_HeaderCacheCompressMethod, 0, 0, compress_method_validator,
64  "(hcache) Enable generic hcache database compression"
65  },
66  { "maildir_header_cache_verify", DT_BOOL, &C_MaildirHeaderCacheVerify, true, 0, NULL,
67  "(hcache) Check for maildir changes when opening mailbox"
68  },
69 #endif
70 #if defined(HAVE_QDBM) || defined(HAVE_TC) || defined(HAVE_KC)
71  { "header_cache_compress", DT_DEPRECATED|DT_BOOL, &C_HeaderCacheCompress, false, 0, NULL, NULL },
72 #endif
73 #if defined(HAVE_GDBM) || defined(HAVE_BDB)
74  { "header_cache_pagesize", DT_DEPRECATED|DT_LONG, &C_HeaderCachePagesize, 0, 0, NULL, NULL },
75 #endif
76  { NULL, 0, NULL, 0, 0, NULL, NULL },
77  // clang-format on
78 };
79 
83 bool config_init_hcache(struct ConfigSet *cs)
84 {
85  return cs_register_variables(cs, HcacheVars, 0);
86 }
char * C_HeaderCacheCompressMethod
Config: (hcache) Enable generic hcache database compression.
Definition: config.c:41
Container for lots of config items.
Definition: set.h:227
#define DT_LONG
a number (long)
Definition: types.h:33
Config/command parsing.
char * C_HeaderCache
Config: (hcache) Directory/file for the header cache database.
Definition: config.c:37
long C_HeaderCachePagesize
Definition: config.c:48
bool C_HeaderCacheCompress
Definition: config.c:46
bool C_MaildirHeaderCacheVerify
Config: (hcache) Check for maildir changes when opening mailbox.
Definition: config.c:43
#define DT_NOT_NEGATIVE
Negative numbers are not allowed.
Definition: types.h:47
int compress_level_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "header_cache_compress_level" config variable - Implements ConfigDef::validator() ...
Definition: init.c:1618
Config item definition.
Definition: set.h:61
Convenience wrapper for the config headers.
bool config_init_hcache(struct ConfigSet *cs)
Register hcache config variables.
Definition: config.c:83
short C_HeaderCacheCompressLevel
Config: (hcache) Level of compression for method.
Definition: config.c:40
int hcache_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "header_cache_backend" config variable - Implements ConfigDef::validator() ...
Definition: init.c:1582
#define DT_STRING
a string
Definition: types.h:41
#define DT_PATH
a path to a file/directory
Definition: types.h:36
#define DT_DEPRECATED
Config item shouldn&#39;t be used any more.
Definition: types.h:79
int compress_method_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "header_cache_compress_method" config variable - Implements ConfigDef::validator() ...
Definition: init.c:1601
char * C_HeaderCacheBackend
Config: (hcache) Header cache backend to use.
Definition: config.c:38
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[], int flags)
Register a set of config items.
Definition: set.c:287
Convenience wrapper for the library headers.
#define DT_NUMBER
a number
Definition: types.h:35
#define DT_BOOL
boolean option
Definition: types.h:30