NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c File Reference

Definition of the Hcache Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "module_data.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool hcache_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool hcache_config_define_variables (struct NeoMutt *n, struct ConfigSet *cs)
 Define the Config Variables - Implements Module::config_define_variables()
 
static bool hcache_cleanup (struct NeoMutt *n)
 Clean up a Module - Implements Module::cleanup()
 

Variables

struct ConfigDef HcacheVars []
 Config definitions for the Header Cache.
 
struct ConfigDef HcacheVarsComp []
 Config definitions for the Header Cache Compression.
 
const struct Module ModuleHcache
 Module for the Hcache library.
 

Detailed Description

Definition of the Hcache Module.

Authors
  • 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 module.c.

Function Documentation

◆ hcache_init()

static bool hcache_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 43 of file module.c.

44{
45 // struct HcacheModuleData *md = MUTT_MEM_CALLOC(1, struct HcacheModuleData);
46 // neomutt_set_module_data(n, MODULE_ID_HCACHE, md);
47
48 return true;
49}

◆ hcache_config_define_variables()

static bool hcache_config_define_variables ( struct NeoMutt * n,
struct ConfigSet * cs )
static

Define the Config Variables - Implements Module::config_define_variables()

Definition at line 54 of file module.c.

55{
56 bool rc = true;
57
59
60#if defined(USE_HCACHE_COMPRESSION)
62#endif
63
64 return rc;
65}
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
struct ConfigDef HcacheVars[]
Config definitions for the Header Cache.
Definition config.c:169
struct ConfigDef HcacheVarsComp[]
Config definitions for the Header Cache Compression.
Definition config.c:185
+ Here is the call graph for this function:

◆ hcache_cleanup()

static bool hcache_cleanup ( struct NeoMutt * n)
static

Clean up a Module - Implements Module::cleanup()

Definition at line 70 of file module.c.

71{
72 // struct HcacheModuleData *md = neomutt_get_module_data(n, MODULE_ID_HCACHE);
73 // ASSERT(md);
74
75 // FREE(&md);
76 return true;
77}

Variable Documentation

◆ HcacheVars

struct ConfigDef HcacheVars[]
extern

Config definitions for the Header Cache.

Definition at line 169 of file config.c.

169 {
170 // clang-format off
171 { "header_cache", DT_PATH, 0, 0, hcache_validator,
172 "(hcache) Directory/file for the header cache database"
173 },
174 { "header_cache_backend", DT_STRING, 0, 0, hcache_backend_validator,
175 "(hcache) Header cache backend to use"
176 },
177 { NULL },
178 // clang-format on
179};
static int hcache_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "header_cache" config variable - Implements ConfigDef::validator() -.
Definition config.c:44
static int hcache_backend_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "header_cache_backend" config variable - Implements ConfigDef::validator() -.
Definition config.c:62
@ DT_STRING
a string
Definition types.h:44
@ DT_PATH
a path to a file/directory
Definition types.h:39

◆ HcacheVarsComp

struct ConfigDef HcacheVarsComp[]
extern

Config definitions for the Header Cache Compression.

Definition at line 185 of file config.c.

185 {
186 // clang-format off
187 // These two are not in alphabetical order because `level`s validator depends on `method`
188 { "header_cache_compress_method", DT_STRING, 0, 0, compress_method_validator,
189 "(hcache) Enable generic hcache database compression"
190 },
191 { "header_cache_compress_level", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 1, 0, compress_level_validator,
192 "(hcache) Level of compression for method"
193 },
194 { NULL },
195 // clang-format on
196};
static int compress_method_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "header_cache_compress_method" config variable - Implements ConfigDef::validator() -.
Definition config.c:96
static int compress_level_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "header_cache_compress_level" config variable - Implements ConfigDef::validator() -.
Definition config.c:133
@ DT_NUMBER
a number
Definition types.h:38
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition types.h:101

◆ ModuleHcache

const struct Module ModuleHcache
Initial value:
= {
"hcache",
NULL,
NULL,
NULL,
NULL,
}
static bool hcache_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:54
static bool hcache_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:43
static bool hcache_cleanup(struct NeoMutt *n)
Clean up a Module - Implements Module::cleanup()
Definition module.c:70
@ MODULE_ID_HCACHE
ModuleHcache, Email Header Cache
Definition module_api.h:67

Module for the Hcache library.

Definition at line 82 of file module.c.

82 {
84 "hcache",
86 NULL, // config_define_types
88 NULL, // commands_register
89 NULL, // gui_init
90 NULL, // gui_cleanup
92};