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 "core/lib.h"
34#include "module_data.h"
35
36extern const struct Command CommandsCommands[];
37
41static bool commands_init(struct NeoMutt *n)
42{
43 struct CommandsModuleData *mod_data = MUTT_MEM_CALLOC(1, struct CommandsModuleData);
44 STAILQ_INIT(&mod_data->muttrc_stack);
46
47 mod_data->notify = notify_new();
48 notify_set_parent(mod_data->notify, n->notify);
49
50 return true;
51}
52
56static bool commands_commands_register(struct NeoMutt *n, struct CommandArray *ca)
57{
59}
60
64static bool commands_cleanup(struct NeoMutt *n, void *data)
65{
66 struct CommandsModuleData *mod_data = data;
67
68 notify_free(&mod_data->notify);
69
70 mutt_list_free(&mod_data->muttrc_stack);
71 FREE(&mod_data);
72 return true;
73}
74
78const struct Module ModuleCommands = {
80 "commands",
82 NULL, // config_define_types
83 NULL, // config_define_variables
85 NULL, // gui_init
86 NULL, // gui_cleanup
88};
const struct Command CommandsCommands[]
General NeoMutt Commands.
Definition commands.c:43
static bool commands_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:64
const struct Module ModuleCommands
Module for the Commands library.
Definition module.c:78
static bool commands_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:56
static bool commands_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:41
Commands private Module data.
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.
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_COMMANDS
ModuleCommands, NeoMutt Commands
Definition module_api.h:54
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
Commands private Module data.
Definition module_data.h:32
struct ListHead muttrc_stack
LIFO of sourced config files (avoid cycles)
Definition module_data.h:34
struct Notify * notify
Notifications.
Definition module_data.h:33
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45