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 "mutt/lib.h"
33#include "config/lib.h"
34#include "core/lib.h"
35#include "module_data.h"
36
37extern struct ConfigDef SendVars[];
38
39extern const struct Command SendCommands[];
40
44static bool send_init(struct NeoMutt *n)
45{
46 struct SendModuleData *mod_data = MUTT_MEM_CALLOC(1, struct SendModuleData);
48
49 mod_data->notify = notify_new();
50 notify_set_parent(mod_data->notify, n->notify);
51
52 STAILQ_INIT(&mod_data->user_header);
53
54 return true;
55}
56
60static bool send_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
61{
63}
64
68static bool send_commands_register(struct NeoMutt *n, struct CommandArray *ca)
69{
71}
72
76static bool send_cleanup(struct NeoMutt *n, void *data)
77{
78 struct SendModuleData *mod_data = data;
79
80 notify_free(&mod_data->notify);
81
82 mutt_list_free(&mod_data->user_header);
83
84 FREE(&mod_data);
85 return true;
86}
87
91const struct Module ModuleSend = {
93 "send",
95 NULL, // config_define_types
98 NULL, // gui_init
99 NULL, // gui_cleanup
101};
Convenience wrapper for the config headers.
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
Convenience wrapper for the core headers.
const struct Module ModuleSend
Module for the Send library.
Definition module.c:91
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition list.c:123
#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_SEND
ModuleSend, Send
Definition module_api.h:90
Convenience wrapper for the library headers.
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
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:677
#define STAILQ_INIT(head)
Definition queue.h:410
const struct Command SendCommands[]
Send Commands.
Definition commands.c:38
struct ConfigDef SendVars[]
Config definitions for the send library.
Definition config.c:161
static bool send_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:60
static bool send_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:68
static bool send_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:44
static bool send_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:76
Send private Module data.
Container for lots of config items.
Definition set.h:251
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
Send private Module data.
Definition module_data.h:33
struct ListHead user_header
Custom headers to add to outgoing emails.
Definition module_data.h:35
struct Notify * notify
Notifications.
Definition module_data.h:34