NeoMutt  2025-12-11-58-g09398d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
hook.h
Go to the documentation of this file.
1
22
23#ifndef MUTT_HOOK_H
24#define MUTT_HOOK_H
25
26#include "config.h"
27#include <stdint.h>
28#include "core/lib.h"
29
30struct Address;
31struct Buffer;
32struct Email;
33struct ListHead;
34
35typedef uint32_t HookFlags;
36#define MUTT_HOOK_NO_FLAGS 0
37#define MUTT_FOLDER_HOOK (1 << 0)
38#define MUTT_MBOX_HOOK (1 << 1)
39#define MUTT_SEND_HOOK (1 << 2)
40#define MUTT_FCC_HOOK (1 << 3)
41#define MUTT_SAVE_HOOK (1 << 4)
42#define MUTT_CHARSET_HOOK (1 << 5)
43#define MUTT_ICONV_HOOK (1 << 6)
44#define MUTT_MESSAGE_HOOK (1 << 7)
45#define MUTT_CRYPT_HOOK (1 << 8)
46#define MUTT_ACCOUNT_HOOK (1 << 9)
47#define MUTT_REPLY_HOOK (1 << 10)
48#define MUTT_SEND2_HOOK (1 << 11)
49#define MUTT_OPEN_HOOK (1 << 12)
50#define MUTT_APPEND_HOOK (1 << 13)
51#define MUTT_CLOSE_HOOK (1 << 14)
52#define MUTT_IDXFMTHOOK (1 << 15)
53#define MUTT_TIMEOUT_HOOK (1 << 16)
54#define MUTT_STARTUP_HOOK (1 << 17)
55#define MUTT_SHUTDOWN_HOOK (1 << 18)
56
57void hooks_init(void);
58
59enum CommandResult parse_hook_charset (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
60enum CommandResult parse_hook_compress(const struct Command *cmd, struct Buffer *line, struct Buffer *err);
61enum CommandResult parse_hook_crypt (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
62enum CommandResult parse_hook_folder (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
63enum CommandResult parse_hook_global (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
64enum CommandResult parse_hook_index (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
65enum CommandResult parse_hook_mailbox (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
66enum CommandResult parse_hook_mbox (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
67enum CommandResult parse_hook_pattern (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
68enum CommandResult parse_hook_regex (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
69enum CommandResult parse_unhook (const struct Command *cmd, struct Buffer *line, struct Buffer *err);
70
71void mutt_account_hook (const char *url);
72void mutt_crypt_hook (struct ListHead *list, struct Address *addr);
73void mutt_default_save (struct Buffer *path, struct Email *e);
75char * mutt_find_hook (HookFlags type, const char *pat);
76void mutt_folder_hook (const char *path, const char *desc);
77const struct Expando *mutt_idxfmt_hook (const char *name, struct Mailbox *m, struct Email *e);
78void mutt_message_hook (struct Mailbox *m, struct Email *e, HookFlags type);
79void mutt_select_fcc (struct Buffer *path, struct Email *e);
81void mutt_timeout_hook (void);
82
83
84#endif /* MUTT_HOOK_H */
CommandResult
Error codes for command_t parse functions.
Definition command.h:35
Convenience wrapper for the core headers.
enum CommandResult parse_hook_folder(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse folder hook command - Implements Command::parse() -.
Definition hook.c:550
enum CommandResult parse_unhook(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the unhook command - Implements Command::parse() -.
Definition hook.c:1223
enum CommandResult parse_hook_pattern(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse pattern-based hook commands - Implements Command::parse() -.
Definition hook.c:241
enum CommandResult parse_hook_regex(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse regex-based hook command - Implements Command::parse() -.
Definition hook.c:457
enum CommandResult parse_hook_compress(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse compress hook commands - Implements Command::parse() -.
Definition hook.c:927
enum CommandResult parse_hook_index(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the index format hook command - Implements Command::parse() -.
Definition hook.c:1076
enum CommandResult parse_hook_mailbox(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse mailbox pattern hook commands - Implements Command::parse() -.
Definition hook.c:348
enum CommandResult parse_hook_global(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse global hook commands - Implements Command::parse() -.
Definition hook.c:178
enum CommandResult parse_hook_charset(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse charset hook commands - Implements Command::parse() -.
Definition hook.c:126
enum CommandResult parse_hook_crypt(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse crypt hook commands - Implements Command::parse() -.
Definition hook.c:687
enum CommandResult parse_hook_mbox(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse mbox hook command - Implements Command::parse() -.
Definition hook.c:780
void mutt_default_save(struct Buffer *path, struct Email *e)
Find the default save path for an email.
Definition hook.c:1438
void mutt_timeout_hook(void)
Execute any timeout hooks.
Definition hook.c:1592
char * mutt_find_hook(HookFlags type, const char *pat)
Find a matching hook.
Definition hook.c:1339
void mutt_startup_shutdown_hook(HookFlags type)
Execute any startup/shutdown hooks.
Definition hook.c:1624
void mutt_delete_hooks(HookFlags type)
Delete matching hooks.
Definition hook.c:1029
uint32_t HookFlags
Flags for parse_hook(), e.g. MUTT_FOLDER_HOOK.
Definition hook.h:35
void mutt_account_hook(const char *url)
Perform an account hook.
Definition hook.c:1547
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Definition hook.c:1291
void mutt_select_fcc(struct Buffer *path, struct Email *e)
Select the FCC path for an email.
Definition hook.c:1476
const struct Expando * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
Definition hook.c:1651
void hooks_init(void)
Setup feature commands.
Definition hook.c:1769
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
Find crypto hooks for an Address.
Definition hook.c:1538
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition hook.c:1360
An email address.
Definition address.h:35
String manipulation buffer.
Definition buffer.h:36
The envelope/body of an email.
Definition email.h:39
Parsed Expando trees.
Definition expando.h:41
A mailbox.
Definition mailbox.h:79