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 "lib.h"
36#include "module_data.h"
37
38extern struct ConfigDef HistoryVars[];
39
43static bool history_init(struct NeoMutt *n)
44{
45 struct HistoryModuleData *mod_data = MUTT_MEM_CALLOC(1, struct HistoryModuleData);
47
48 mod_data->notify = notify_new();
49 notify_set_parent(mod_data->notify, n->notify);
50
51 return true;
52}
53
57static bool history_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
58{
60}
61
65static bool history_cleanup(struct NeoMutt *n, void *data)
66{
67 struct HistoryModuleData *mod_data = data;
68
69 notify_free(&mod_data->notify);
70
71 FREE(&mod_data);
72 return true;
73}
74
78static bool history_gui_init(struct NeoMutt *n)
79{
81 mutt_hist_init(mod_data);
83 return true;
84}
85
89static void history_gui_cleanup(struct NeoMutt *n)
90{
92 mutt_hist_cleanup(mod_data);
93}
94
98const struct Module ModuleHistory = {
100 "history",
102 NULL, // config_define_types
104 NULL, // commands_register
108};
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
Convenience wrapper for the core headers.
const struct Module ModuleHistory
Module for the History library.
Definition module.c:98
struct ConfigDef HistoryVars[]
Config definitions for the command history.
Definition config.c:56
Read/write command history from/to a file.
static bool history_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:57
static bool history_gui_init(struct NeoMutt *n)
Initialise the GUI - Implements Module::gui_init()
Definition module.c:78
static bool history_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:43
static bool history_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:65
static void history_gui_cleanup(struct NeoMutt *n)
Clean up the GUI - Implements Module::gui_cleanup()
Definition module.c:89
History private Module data.
void mutt_hist_init(struct HistoryModuleData *mod_data)
Create a set of empty History ring buffers.
Definition history.c:451
void mutt_hist_read_file(void)
Read the History from a file.
Definition history.c:579
void mutt_hist_cleanup(struct HistoryModuleData *mod_data)
Free all the history lists.
Definition history.c:427
#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_HISTORY
ModuleHistory, History
Definition module_api.h:69
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
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
Container for lots of config items.
Definition set.h:251
History private Module data.
Definition module_data.h:44
struct Notify * notify
Notifications.
Definition module_data.h:45
Container for Accounts, Notifications.
Definition neomutt.h:41
struct Notify * notify
Notifications handler.
Definition neomutt.h:45