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 ImapVars[];
38extern struct ConfigDef ImapVarsZlib[];
39
40extern const struct Command ImapCommands[];
41
45static bool imap_init(struct NeoMutt *n)
46{
47 struct ImapModuleData *mod_data = MUTT_MEM_CALLOC(1, struct ImapModuleData);
49
50 mod_data->notify = notify_new();
51 notify_set_parent(mod_data->notify, n->notify);
52
53 mod_data->imap_max_cmdlen = 8192;
54
55 return true;
56}
57
61static bool imap_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
62{
63 bool rc = cs_register_variables(cs, ImapVars);
64
65#if defined(USE_ZLIB)
67#endif
68
69 return rc;
70}
71
75static bool imap_commands_register(struct NeoMutt *n, struct CommandArray *ca)
76{
78}
79
83static bool imap_cleanup(struct NeoMutt *n, void *data)
84{
85 struct ImapModuleData *mod_data = data;
86
87 notify_free(&mod_data->notify);
88
89 FREE(&mod_data);
90 return true;
91}
92
96const struct Module ModuleImap = {
98 "imap",
100 NULL, // config_define_types
103 NULL, // gui_init
104 NULL, // gui_cleanup
106};
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
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
Convenience wrapper for the core headers.
const struct Module ModuleImap
Module for the Imap library.
Definition module.c:96
struct ConfigDef ImapVars[]
Config definitions for the IMAP library.
Definition config.c:70
struct ConfigDef ImapVarsZlib[]
Config definitions for IMAP compression.
Definition config.c:146
static bool imap_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:75
static bool imap_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:61
static bool imap_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:83
static bool imap_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:45
Imap private Module data.
const struct Command ImapCommands[]
Imap Commands.
Definition imap.c:186
#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_IMAP
ModuleImap, Imap Mailbox
Definition module_api.h:71
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
Imap private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31
int imap_max_cmdlen
Maximum length of IMAP commands before split.
Definition module_data.h:32
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45