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 const struct ConfigSetType CstAddress;
38#if defined(HAVE_LIBIDN)
39extern struct ConfigDef AddressVarsIdn[];
40#endif
41
45static bool address_init(struct NeoMutt *n)
46{
47 struct AddressModuleData *mod_data = MUTT_MEM_CALLOC(1, struct AddressModuleData);
49
50 mod_data->notify = notify_new();
51 notify_set_parent(mod_data->notify, n->notify);
52
53 return true;
54}
55
59static bool address_config_define_types(struct NeoMutt *n, struct ConfigSet *cs)
60{
61 return cs_register_type(cs, &CstAddress);
62}
63
67static bool address_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
68{
69 bool rc = true;
70
71#if defined(HAVE_LIBIDN)
73#endif
74
75 return rc;
76}
77
81static bool address_cleanup(struct NeoMutt *n, void *data)
82{
83 struct AddressModuleData *mod_data = data;
84
85 notify_free(&mod_data->notify);
86
87 FREE(&mod_data);
88 return true;
89}
90
94const struct Module ModuleAddress = {
96 "address",
100 NULL, // commands_register
101 NULL, // gui_init
102 NULL, // gui_cleanup
104};
struct ConfigDef AddressVarsIdn[]
IDN Config definitions.
Definition config.c:30
const struct ConfigSetType CstAddress
Config type representing an Email Address.
static bool address_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:67
const struct Module ModuleAddress
Module for the Address library.
Definition module.c:94
static bool address_config_define_types(struct NeoMutt *n, struct ConfigSet *cs)
Set up Config Types - Implements Module::config_define_types()
Definition module.c:59
static bool address_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:81
static bool address_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:45
Address private Module data.
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 cs_register_type(struct ConfigSet *cs, const struct ConfigSetType *cst)
Register a type of config item.
Definition set.c:220
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_ADDRESS
ModuleAddress, Address
Definition module_api.h:47
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
Address private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31
Container for lots of config items.
Definition set.h:251
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45