NeoMutt  2025-12-11-860-g80c9cc
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c File Reference

Definition of the Compmbox Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "core/lib.h"
#include "module_data.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool compmbox_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool compmbox_commands_register (struct NeoMutt *n, struct CommandArray *ca)
 Register NeoMutt Commands - Implements Module::commands_register()
 
static bool compmbox_cleanup (struct NeoMutt *n, void *data)
 Clean up a Module - Implements Module::cleanup()
 

Variables

const struct Command CompCommands []
 Compression Commands.
 
const struct Module ModuleCompmbox
 Module for the Compmbox library.
 

Detailed Description

Definition of the Compmbox Module.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file module.c.

Function Documentation

◆ compmbox_init()

static bool compmbox_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 41 of file module.c.

42{
43 struct CompmboxModuleData *mod_data = MUTT_MEM_CALLOC(1, struct CompmboxModuleData);
45
46 mod_data->notify = notify_new();
47 notify_set_parent(mod_data->notify, n->notify);
48
49 return true;
50}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_COMPMBOX
ModuleCompmbox, Compressed Mailbox
Definition module_api.h:56
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 neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:677
Compmbox private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
+ Here is the call graph for this function:

◆ compmbox_commands_register()

static bool compmbox_commands_register ( struct NeoMutt * n,
struct CommandArray * ca )
static

Register NeoMutt Commands - Implements Module::commands_register()

Definition at line 55 of file module.c.

56{
58}
const struct Command CompCommands[]
Compression Commands.
Definition compress.c:62
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
+ Here is the call graph for this function:

◆ compmbox_cleanup()

static bool compmbox_cleanup ( struct NeoMutt * n,
void * data )
static

Clean up a Module - Implements Module::cleanup()

Definition at line 63 of file module.c.

64{
65 struct CompmboxModuleData *mod_data = data;
66
67 notify_free(&mod_data->notify);
68
69 FREE(&mod_data);
70 return true;
71}
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition notify.c:75
+ Here is the call graph for this function:

Variable Documentation

◆ CompCommands

const struct Command CompCommands[]
extern

Compression Commands.

Definition at line 62 of file compress.c.

62 {
63 // clang-format off
64 { "append-hook", CMD_APPEND_HOOK, parse_compress_hook,
65 N_("Define command to append to a compressed mailbox"),
66 N_("append-hook <regex> <shell-command>"),
67 "optionalfeatures.html#append-hook" },
68 { "close-hook", CMD_CLOSE_HOOK, parse_compress_hook,
69 N_("Define command to close a compressed mailbox"),
70 N_("close-hook <regex> <shell-command>"),
71 "optionalfeatures.html#close-hook" },
72 { "open-hook", CMD_OPEN_HOOK, parse_compress_hook,
73 N_("Define command to open a compressed mailbox"),
74 N_("open-hook <regex> <shell-command>"),
75 "optionalfeatures.html#open-hook" },
76
77 { NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NO_FLAGS },
78 // clang-format on
79};
#define CF_NO_FLAGS
No flags are set.
Definition command.h:48
@ CMD_CLOSE_HOOK
:close-hook
Definition command.h:70
@ CMD_NONE
No Command.
Definition command.h:59
@ CMD_OPEN_HOOK
:open-hook
Definition command.h:100
@ CMD_APPEND_HOOK
:append-hook
Definition command.h:64
enum CommandResult parse_compress_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse compress hook commands - Implements Command::parse() -.
Definition parse.c:913
#define N_(a)
Definition message.h:32

◆ ModuleCompmbox

const struct Module ModuleCompmbox
Initial value:
= {
"compmbox",
NULL,
NULL,
NULL,
NULL,
}
static bool compmbox_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:55
static bool compmbox_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:63
static bool compmbox_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:41

Module for the Compmbox library.

Definition at line 76 of file module.c.

76 {
78 "compmbox",
80 NULL, // config_define_types
81 NULL, // config_define_variables
83 NULL, // gui_init
84 NULL, // gui_cleanup
86};