NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c
Go to the documentation of this file.
1
22
28
29#include "config.h"
30#include <stdbool.h>
31#include <stddef.h>
32#include "mutt/lib.h"
33#include "config/lib.h"
34#include "core/lib.h"
35#include "module_data.h"
36
37extern struct ConfigDef HcacheVars[];
38extern struct ConfigDef HcacheVarsComp[];
39
43static bool hcache_init(struct NeoMutt *n)
44{
45 struct HcacheModuleData *mod_data = MUTT_MEM_CALLOC(1, struct HcacheModuleData);
47
48 mod_data->notify = notify_new();
49 notify_set_parent(mod_data->notify, n->notify);
50
51 return true;
52}
53
57static bool hcache_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
58{
59 bool rc = true;
60
62
63#if defined(USE_HCACHE_COMPRESSION)
65#endif
66
67 return rc;
68}
69
73static bool hcache_cleanup(struct NeoMutt *n, void *data)
74{
75 struct HcacheModuleData *mod_data = data;
76
77 notify_free(&mod_data->notify);
78
79 FREE(&mod_data);
80 return true;
81}
82
86const struct Module ModuleHcache = {
88 "hcache",
90 NULL, // config_define_types
92 NULL, // commands_register
93 NULL, // gui_init
94 NULL, // gui_cleanup
96};
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
Convenience wrapper for the core headers.
const struct Module ModuleHcache
Module for the Hcache library.
Definition module.c:86
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
static bool hcache_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:57
static bool hcache_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:73
static bool hcache_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:43
Hcache private Module data.
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_HCACHE
ModuleHcache, Email Header Cache
Definition module_api.h:67
Convenience wrapper for the library headers.
struct Notify * notify_new(void)
Create a new notifications handler.
Definition notify.c:62
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition notify.c:95
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition notify.c:75
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:677
Container for lots of config items.
Definition set.h:251
Hcache private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45