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 "
config/lib.h
"
34
#include "
core/lib.h
"
35
#include "
module_data.h
"
36
37
extern
const
struct
ConfigSetType
CstExpando
;
38
42
static
bool
expando_init
(
struct
NeoMutt
*n)
43
{
44
struct
ExpandoModuleData
*mod_data =
MUTT_MEM_CALLOC
(1,
struct
ExpandoModuleData
);
45
neomutt_set_module_data
(n,
MODULE_ID_EXPANDO
, mod_data);
46
47
mod_data->
notify
=
notify_new
();
48
notify_set_parent
(mod_data->
notify
, n->
notify
);
49
50
return
true
;
51
}
52
56
static
bool
expando_config_define_types
(
struct
NeoMutt
*n,
struct
ConfigSet
*cs)
57
{
58
return
cs_register_type
(cs, &
CstExpando
);
59
}
60
64
static
bool
expando_cleanup
(
struct
NeoMutt
*n,
void
*data)
65
{
66
struct
ExpandoModuleData
*mod_data = data;
67
68
notify_free
(&mod_data->
notify
);
69
70
FREE
(&mod_data);
71
return
true
;
72
}
73
77
const
struct
Module
ModuleExpando
= {
78
MODULE_ID_EXPANDO
,
79
"expando"
,
80
expando_init
,
81
expando_config_define_types
,
82
NULL,
// config_define_variables
83
NULL,
// commands_register
84
NULL,
// gui_init
85
NULL,
// gui_cleanup
86
expando_cleanup
,
87
};
lib.h
Convenience wrapper for the config headers.
cs_register_type
bool cs_register_type(struct ConfigSet *cs, const struct ConfigSetType *cst)
Register a type of config item.
Definition
set.c:220
lib.h
Convenience wrapper for the core headers.
CstExpando
const struct ConfigSetType CstExpando
Config type representing an Expando.
Definition
config_type.c:339
expando_init
static bool expando_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init().
Definition
module.c:42
expando_cleanup
static bool expando_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup().
Definition
module.c:64
expando_config_define_types
static bool expando_config_define_types(struct NeoMutt *n, struct ConfigSet *cs)
Set up Config Types - Implements Module::config_define_types().
Definition
module.c:56
ModuleExpando
const struct Module ModuleExpando
Module for the Expando library.
Definition
module.c:77
module_data.h
Expando private Module data.
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_EXPANDO
@ MODULE_ID_EXPANDO
ModuleExpando, Parse Expando string
Definition
module_api.h:66
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
ConfigSetType
Definition
set.h:96
ConfigSet
Container for lots of config items.
Definition
set.h:251
ExpandoModuleData
Expando private Module data.
Definition
module_data.h:30
ExpandoModuleData::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