NeoMutt  2025-12-11-435-g4ac674
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#include "subjectrx.h"
37
38extern struct ConfigDef IndexVars[];
39
40extern const struct Command IndexCommands[];
41
45static bool index_init(struct NeoMutt *n)
46{
47 struct IndexModuleData *md = MUTT_MEM_CALLOC(1, struct IndexModuleData);
49
50 subjectrx_init(n, md);
51 return true;
52}
53
57static bool index_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
58{
60}
61
65static bool index_commands_register(struct NeoMutt *n, struct CommandArray *ca)
66{
68}
69
73static bool index_cleanup(struct NeoMutt *n)
74{
76 ASSERT(md);
77
79
80 FREE(&md);
81 return true;
82}
83
87const struct Module ModuleIndex = {
89 "index",
91 NULL, // config_define_types
94 NULL, // gui_init
95 NULL, // gui_cleanup
97};
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 ModuleIndex
Module for the Index library.
Definition module.c:87
const struct Command IndexCommands[]
Index Commands.
Definition commands.c:38
struct ConfigDef IndexVars[]
Config definitions for the Index.
Definition config.c:87
static bool index_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:57
static bool index_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:45
static bool index_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:65
static bool index_cleanup(struct NeoMutt *n)
Clean up a Module - Implements Module::cleanup()
Definition module.c:73
Index private Module data.
#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_INDEX
ModuleIndex, Index
Definition module_api.h:72
Convenience wrapper for the library headers.
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:599
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:585
#define ASSERT(COND)
Definition signal2.h:59
Container for lots of config items.
Definition set.h:250
Index private Module data.
Definition module_data.h:32
Container for Accounts, Notifications.
Definition neomutt.h:41
void subjectrx_init(struct NeoMutt *n, struct IndexModuleData *md)
Create new Subject Regex List.
Definition subjectrx.c:42
void subjectrx_cleanup(struct IndexModuleData *md)
Free the Subject Regex List.
Definition subjectrx.c:53
Parse Subject-regex Commands.