NeoMutt  2025-12-11-435-g4ac674
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 "alias.h"
36#include "module_data.h"
37#include "reverse.h"
38
39extern struct ConfigDef AliasVars[];
40
41extern const struct Command AliasCommands[];
42
46static bool alias_init(struct NeoMutt *n)
47{
48 struct AliasModuleData *md = MUTT_MEM_CALLOC(1, struct AliasModuleData);
50
53
56
57 ARRAY_INIT(&md->aliases);
59
60 return true;
61}
62
66static bool alias_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
67{
69}
70
74static bool alias_commands_register(struct NeoMutt *n, struct CommandArray *ca)
75{
77}
78
82static bool alias_cleanup(struct NeoMutt *n)
83{
85 ASSERT(md);
86
88
91
92 struct Alias **ap = NULL;
93 ARRAY_FOREACH(ap, &md->aliases)
94 {
96 }
98
100
101 FREE(&md);
102 return true;
103}
104
108const struct Module ModuleAlias = {
110 "alias",
112 NULL, // config_define_types
115 NULL, // gui_init
116 NULL, // gui_cleanup
118};
const struct Command AliasCommands[]
Alias Commands.
Definition commands.c:321
struct ConfigDef AliasVars[]
Config definitions for the alias library.
Definition config.c:112
void alias_cleanup(void)
void alias_init(void)
static bool alias_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:74
static bool alias_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:66
const struct Module ModuleAlias
Module for the Alias library.
Definition module.c:108
Alias private Module data.
void aliaslist_clear(struct AliasArray *aa)
Empty a List of Aliases.
Definition alias.c:698
Representation of a single alias to an email address.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:223
#define ARRAY_INIT(head)
Initialize an array.
Definition array.h:65
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.
#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_ALIAS
ModuleAlias, Alias
Definition module_api.h:48
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 mutt_regexlist_free(struct RegexList *rl)
Free a RegexList object.
Definition regex.c:179
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:599
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:585
#define STAILQ_INIT(head)
Definition queue.h:410
void alias_reverse_cleanup(struct HashTable **reverse)
Clear up the Reverse Alias Hash Table.
Definition reverse.c:53
struct HashTable * alias_reverse_init(void)
Set up the Reverse Alias Hash Table.
Definition reverse.c:43
void alias_reverse_delete(struct Alias *alias)
Remove an email address lookup for an Alias.
Definition reverse.c:87
Manage alias reverse lookups.
#define ASSERT(COND)
Definition signal2.h:59
Alias private Module data.
Definition module_data.h:33
struct AliasArray aliases
User's email aliases.
Definition module_data.h:34
struct HashTable * reverse_aliases
Hash Table of aliases (email address -> alias)
Definition module_data.h:35
struct RegexList unalternates
Regexes to exclude false matches in alternates.
Definition module_data.h:38
struct Notify * alternates_notify
Notifications: NotifyAlternates.
Definition module_data.h:39
struct RegexList alternates
Regexes to match the user's alternate email addresses.
Definition module_data.h:37
A shortcut for an email address or addresses.
Definition alias.h:35
Container for lots of config items.
Definition set.h:250
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45