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
"
35
36
extern
const
struct
Command
CompCommands
[];
37
41
static
bool
compmbox_init
(
struct
NeoMutt
*n)
42
{
43
struct
CompmboxModuleData
*mod_data =
MUTT_MEM_CALLOC
(1,
struct
CompmboxModuleData
);
44
neomutt_set_module_data
(n,
MODULE_ID_COMPMBOX
, 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
compmbox_commands_register
(
struct
NeoMutt
*n,
struct
CommandArray *ca)
56
{
57
return
commands_register
(ca,
CompCommands
);
58
}
59
63
static
bool
compmbox_cleanup
(
struct
NeoMutt
*n,
void
*data)
64
{
65
struct
CompmboxModuleData
*mod_data = data;
66
67
notify_free
(&mod_data->
notify
);
68
69
FREE
(&mod_data);
70
return
true
;
71
}
72
76
const
struct
Module
ModuleCompmbox
= {
77
MODULE_ID_COMPMBOX
,
78
"compmbox"
,
79
compmbox_init
,
80
NULL,
// config_define_types
81
NULL,
// config_define_variables
82
compmbox_commands_register
,
83
NULL,
// gui_init
84
NULL,
// gui_cleanup
85
compmbox_cleanup
,
86
};
CompCommands
const struct Command CompCommands[]
Compression Commands.
Definition
compress.c:62
compmbox_commands_register
static bool compmbox_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register().
Definition
module.c:55
compmbox_cleanup
static bool compmbox_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup().
Definition
module.c:63
ModuleCompmbox
const struct Module ModuleCompmbox
Module for the Compmbox library.
Definition
module.c:76
compmbox_init
static bool compmbox_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init().
Definition
module.c:41
module_data.h
Compmbox private Module data.
commands_register
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition
command.c:51
lib.h
Convenience wrapper for the core headers.
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_COMPMBOX
@ MODULE_ID_COMPMBOX
ModuleCompmbox, Compressed Mailbox
Definition
module_api.h:56
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
Command
Definition
command.h:161
CompmboxModuleData
Compmbox private Module data.
Definition
module_data.h:30
CompmboxModuleData::notify
struct Notify * notify
Notifications.
Definition
module_data.h:31
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