NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
hook.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_HOOK_H
24 #define MUTT_HOOK_H
25 
26 #include "config.h"
27 #include <stdint.h>
28 #include <stdio.h>
29 #include "mutt_commands.h"
30 
31 struct Address;
32 struct Buffer;
33 struct Email;
34 struct ListHead;
35 struct Mailbox;
36 
37 typedef uint32_t HookFlags;
38 #define MUTT_HOOK_NO_FLAGS 0
39 #define MUTT_FOLDER_HOOK (1 << 0)
40 #define MUTT_MBOX_HOOK (1 << 1)
41 #define MUTT_SEND_HOOK (1 << 2)
42 #define MUTT_FCC_HOOK (1 << 3)
43 #define MUTT_SAVE_HOOK (1 << 4)
44 #define MUTT_CHARSET_HOOK (1 << 5)
45 #define MUTT_ICONV_HOOK (1 << 6)
46 #define MUTT_MESSAGE_HOOK (1 << 7)
47 #define MUTT_CRYPT_HOOK (1 << 8)
48 #define MUTT_ACCOUNT_HOOK (1 << 9)
49 #define MUTT_REPLY_HOOK (1 << 10)
50 #define MUTT_SEND2_HOOK (1 << 11)
51 #ifdef USE_COMP_MBOX
52 #define MUTT_OPEN_HOOK (1 << 12)
53 #define MUTT_APPEND_HOOK (1 << 13)
54 #define MUTT_CLOSE_HOOK (1 << 14)
55 #endif
56 #define MUTT_IDXFMTHOOK (1 << 15)
57 #define MUTT_TIMEOUT_HOOK (1 << 16)
58 #define MUTT_STARTUP_HOOK (1 << 17)
59 #define MUTT_SHUTDOWN_HOOK (1 << 18)
60 #define MUTT_GLOBAL_HOOK (1 << 19)
61 
62 void mutt_account_hook(const char *url);
63 void mutt_crypt_hook(struct ListHead *list, struct Address *addr);
64 void mutt_default_save(char *path, size_t pathlen, struct Email *e);
66 char *mutt_find_hook(HookFlags type, const char *pat);
67 void mutt_folder_hook(const char *path, const char *desc);
68 const char *mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e);
69 void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type);
70 enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
71 enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
72 enum CommandResult mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
73 void mutt_select_fcc(struct Buffer *path, struct Email *e);
75 void mutt_timeout_hook(void);
76 
77 #endif /* MUTT_HOOK_H */
enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the &#39;index-format-hook&#39; command - Implements Command::parse() -.
Definition: hook.c:372
enum MailboxType type
Mailbox type.
Definition: mailbox.h:105
void mutt_startup_shutdown_hook(HookFlags type)
Execute any startup/shutdown hooks.
Definition: hook.c:863
The envelope/body of an email.
Definition: email.h:37
void mutt_select_fcc(struct Buffer *path, struct Email *e)
Select the FCC path for an email.
Definition: hook.c:715
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:34
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
Find crypto hooks for an Address.
Definition: hook.c:773
void mutt_timeout_hook(void)
Execute any timeout hooks.
Definition: hook.c:827
String manipulation buffer.
Definition: buffer.h:33
enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the &#39;hook&#39; family of commands - Implements Command::parse() -This is used by &#39;account-hook&#39;...
Definition: hook.c:82
An email address.
Definition: address.h:35
uint32_t HookFlags
Flags for mutt_parse_hook(), e.g. MUTT_FOLDER_HOOK.
Definition: hook.h:35
void mutt_delete_hooks(HookFlags type)
Delete matching hooks.
Definition: hook.c:328
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:598
char * name
A short name for the Mailbox.
Definition: mailbox.h:85
void mutt_account_hook(const char *url)
Perform an account hook.
Definition: hook.c:782
char * mutt_find_hook(HookFlags type, const char *pat)
Find a matching hook.
Definition: hook.c:577
A mailbox.
Definition: mailbox.h:81
void mutt_default_save(char *path, size_t pathlen, struct Email *e)
Find the default save path for an email.
Definition: hook.c:677
Definitions of NeoMutt commands.
enum CommandResult mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the &#39;unhook&#39; command - Implements Command::parse() -.
Definition: hook.c:478
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Definition: hook.c:529
const char * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
Definition: hook.c:893