NeoMutt  2018-07-16 +2481-68dcde
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 <stdbool.h>
28 #include <stdint.h>
29 #include <stdio.h>
30 #include "mutt_commands.h"
31 
32 struct Address;
33 struct Buffer;
34 struct Email;
35 struct ListHead;
36 struct Mailbox;
37 
38 /* These Config Variables are only used in hook.c */
39 extern char *C_DefaultHook;
40 extern bool C_ForceName;
41 extern bool C_SaveName;
42 
43 typedef uint32_t HookFlags;
44 #define MUTT_HOOK_NO_FLAGS 0
45 #define MUTT_FOLDER_HOOK (1 << 0)
46 #define MUTT_MBOX_HOOK (1 << 1)
47 #define MUTT_SEND_HOOK (1 << 2)
48 #define MUTT_FCC_HOOK (1 << 3)
49 #define MUTT_SAVE_HOOK (1 << 4)
50 #define MUTT_CHARSET_HOOK (1 << 5)
51 #define MUTT_ICONV_HOOK (1 << 6)
52 #define MUTT_MESSAGE_HOOK (1 << 7)
53 #define MUTT_CRYPT_HOOK (1 << 8)
54 #define MUTT_ACCOUNT_HOOK (1 << 9)
55 #define MUTT_REPLY_HOOK (1 << 10)
56 #define MUTT_SEND2_HOOK (1 << 11)
57 #ifdef USE_COMPRESSED
58 #define MUTT_OPEN_HOOK (1 << 12)
59 #define MUTT_APPEND_HOOK (1 << 13)
60 #define MUTT_CLOSE_HOOK (1 << 14)
61 #endif
62 #define MUTT_IDXFMTHOOK (1 << 15)
63 #define MUTT_TIMEOUT_HOOK (1 << 16)
64 #define MUTT_STARTUP_HOOK (1 << 17)
65 #define MUTT_SHUTDOWN_HOOK (1 << 18)
66 #define MUTT_GLOBAL_HOOK (1 << 19)
67 
68 void mutt_account_hook(const char *url);
69 void mutt_crypt_hook(struct ListHead *list, struct Address *addr);
70 void mutt_default_save(char *path, size_t pathlen, struct Email *e);
71 void mutt_delete_hooks(HookFlags type);
72 char *mutt_find_hook(HookFlags type, const char *pat);
73 void mutt_folder_hook(const char *path, const char *desc);
74 const char *mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e);
75 void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type);
76 enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
77 enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
78 enum CommandResult mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err);
79 void mutt_select_fcc(char *path, size_t pathlen, struct Email *e);
81 void mutt_timeout_hook(void);
82 
83 #endif /* MUTT_HOOK_H */
void mutt_startup_shutdown_hook(HookFlags type)
Execute any startup/shutdown hooks.
Definition: hook.c:845
The envelope/body of an email.
Definition: email.h:39
CommandResult
Error codes for command_t parse functions.
Definition: mutt_commands.h:33
enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err)
Parse the &#39;hook&#39; family of commands - Implements command_t.
Definition: hook.c:85
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
Find crypto hooks for an Address.
Definition: hook.c:748
void mutt_timeout_hook(void)
Execute any timeout hooks.
Definition: hook.c:806
enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err)
Parse the &#39;index-format-hook&#39; command - Implements command_t.
Definition: hook.c:363
String manipulation buffer.
Definition: buffer.h:33
An email address.
Definition: address.h:34
uint32_t HookFlags
Flags for mutt_parse_hook(), e.g. MUTT_FOLDER_HOOK.
Definition: hook.h:43
void mutt_delete_hooks(HookFlags type)
Delete matching hooks.
Definition: hook.c:316
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:579
bool C_ForceName
Config: Save outgoing mail in a folder of their name.
Definition: hook.c:59
const char * name
Definition: pgpmicalg.c:45
void mutt_account_hook(const char *url)
Perform an account hook.
Definition: hook.c:758
char * mutt_find_hook(HookFlags type, const char *pat)
Find a matching hook.
Definition: hook.c:558
A mailbox.
Definition: mailbox.h:92
char * C_DefaultHook
Config: Pattern to use for hooks that only have a simple regex.
Definition: hook.c:58
void mutt_default_save(char *path, size_t pathlen, struct Email *e)
Find the default save path for an email.
Definition: hook.c:662
Mapping from user command name to function.
void mutt_select_fcc(char *path, size_t pathlen, struct Email *e)
Select the FCC path for an email.
Definition: hook.c:700
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Definition: hook.c:516
enum CommandResult mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, unsigned long data, struct Buffer *err)
Parse the &#39;unhook&#39; command - Implements command_t.
Definition: hook.c:465
bool C_SaveName
Config: Save outgoing message to mailbox of recipient&#39;s name if it exists.
Definition: hook.c:60
const char * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
Definition: hook.c:878