NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
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 "
core/lib.h
"
34
#include "
module_data.h
"
// IWYU pragma: keep
35
39
static
bool
store_init
(
struct
NeoMutt
*n)
40
{
41
struct
StoreModuleData
*mod_data =
MUTT_MEM_CALLOC
(1,
struct
StoreModuleData
);
42
neomutt_set_module_data
(n,
MODULE_ID_STORE
, mod_data);
43
44
mod_data->
notify
=
notify_new
();
45
notify_set_parent
(mod_data->
notify
, n->
notify
);
46
47
return
true
;
48
}
49
53
static
bool
store_cleanup
(
struct
NeoMutt
*n,
void
*data)
54
{
55
struct
StoreModuleData
*mod_data = data;
56
57
notify_free
(&mod_data->
notify
);
58
59
FREE
(&mod_data);
60
return
true
;
61
}
62
66
const
struct
Module
ModuleStore
= {
67
MODULE_ID_STORE
,
68
"store"
,
69
store_init
,
70
NULL,
// config_define_types
71
NULL,
// config_define_variables
72
NULL,
// commands_register
73
NULL,
// gui_init
74
NULL,
// gui_cleanup
75
store_cleanup
,
76
};
lib.h
Convenience wrapper for the core headers.
ModuleStore
const struct Module ModuleStore
Module for the Store library.
Definition
module.c:66
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_STORE
@ MODULE_ID_STORE
ModuleStore, Store
Definition
module_api.h:94
lib.h
Convenience wrapper for the library headers.
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
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:680
store_cleanup
static bool store_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup().
Definition
module.c:53
store_init
static bool store_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init().
Definition
module.c:39
module_data.h
Store private Module data.
Module
Definition
module_api.h:104
NeoMutt
Container for Accounts, Notifications.
Definition
neomutt.h:41
NeoMutt::notify
struct Notify * notify
Notifications handler.
Definition
neomutt.h:45
StoreModuleData
Store private Module data.
Definition
module_data.h:30
StoreModuleData::notify
struct Notify * notify
Notifications.
Definition
module_data.h:31