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 "
core/lib.h
"
33
#include "
memory.h
"
34
#include "
module_data.h
"
35
#include "
notify.h
"
36
#include "
signal2.h
"
37
41
static
bool
mutt_init
(
struct
NeoMutt
*n)
42
{
43
struct
MuttModuleData
*mod_data =
MUTT_MEM_CALLOC
(1,
struct
MuttModuleData
);
44
neomutt_set_module_data
(n,
MODULE_ID_MUTT
, mod_data);
45
46
mod_data->
notify
=
notify_new
();
47
notify_set_parent
(mod_data->
notify
, n->
notify
);
48
49
return
true
;
50
}
51
55
static
bool
mutt_cleanup
(
struct
NeoMutt
*n,
void
*data)
56
{
57
struct
MuttModuleData
*mod_data = data;
58
59
notify_free
(&mod_data->
notify
);
60
61
FREE
(&mod_data);
62
return
true
;
63
}
64
68
const
struct
Module
ModuleMutt
= {
69
MODULE_ID_MUTT
,
"mutt"
,
mutt_init
,
70
NULL,
// config_define_types
71
NULL,
// config_define_variables
72
NULL,
// commands_register
73
NULL,
// gui_init
74
NULL,
// gui_cleanup
75
mutt_cleanup
,
76
};
lib.h
Convenience wrapper for the core headers.
ModuleMutt
const struct Module ModuleMutt
Module for the Mutt library.
Definition
module.c:68
mutt_init
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:421
memory.h
Memory management wrappers.
FREE
#define FREE(x)
Free memory and set the pointer to NULL.
Definition
memory.h:68
MUTT_MEM_CALLOC
#define MUTT_MEM_CALLOC(n, type)
Definition
memory.h:52
MODULE_ID_MUTT
@ MODULE_ID_MUTT
ModuleMutt, Mutt
Definition
module_api.h:79
mutt_init
static bool mutt_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition
module.c:41
mutt_cleanup
static bool mutt_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition
module.c:55
module_data.h
Mutt private Module data.
notify_new
struct Notify * notify_new(void)
Create a new notifications handler.
Definition
notify.c:62
notify_set_parent
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition
notify.c:95
notify_free
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition
notify.c:75
notify.h
Notification API.
neomutt_set_module_data
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition
neomutt.c:677
signal2.h
Signal handling.
Module
Definition
module_api.h:102
MuttModuleData
Mutt private Module data.
Definition
module_data.h:30
MuttModuleData::notify
struct Notify * notify
Notifications.
Definition
module_data.h:31
NeoMutt
Container for Accounts, Notifications.
Definition
neomutt.h:41
NeoMutt::notify
struct Notify * notify
Notifications handler.
Definition
neomutt.h:45