NeoMutt  2025-12-11-980-ge38c27
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 "core/lib.h"
33#include "memory.h"
34#include "module_data.h"
35#include "notify.h"
36
40static bool mutt_init(struct NeoMutt *n)
41{
42 struct MuttModuleData *mod_data = MUTT_MEM_CALLOC(1, struct MuttModuleData);
44
45 mod_data->notify = notify_new();
46 notify_set_parent(mod_data->notify, n->notify);
47
48 return true;
49}
50
54static bool mutt_cleanup(struct NeoMutt *n, void *data)
55{
56 struct MuttModuleData *mod_data = data;
57
58 notify_free(&mod_data->notify);
59
60 FREE(&mod_data);
61 return true;
62}
63
67const struct Module ModuleMutt = {
69 NULL, // config_define_types
70 NULL, // config_define_variables
71 NULL, // commands_register
72 NULL, // gui_init
73 NULL, // gui_cleanup
75};
Convenience wrapper for the core headers.
const struct Module ModuleMutt
Module for the Mutt library.
Definition module.c:67
static int mutt_init(struct ConfigSet *cs, struct Buffer *dlevel, struct Buffer *dfile, bool skip_sys_rc, struct StringArray *user_files, struct StringArray *commands)
Initialise NeoMutt.
Definition main.c:420
Memory management wrappers.
#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_MUTT
ModuleMutt, Mutt
Definition module_api.h:81
static bool mutt_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:40
static bool mutt_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:54
Mutt private Module data.
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
Notification API.
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:680
Mutt 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