NeoMutt  2022-04-29-249-gaae397
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 "core/lib.h"
30
31struct Address;
32struct Buffer;
33struct Email;
34struct ListHead;
35
36typedef uint32_t HookFlags;
37#define MUTT_HOOK_NO_FLAGS 0
38#define MUTT_FOLDER_HOOK (1 << 0)
39#define MUTT_MBOX_HOOK (1 << 1)
40#define MUTT_SEND_HOOK (1 << 2)
41#define MUTT_FCC_HOOK (1 << 3)
42#define MUTT_SAVE_HOOK (1 << 4)
43#define MUTT_CHARSET_HOOK (1 << 5)
44#define MUTT_ICONV_HOOK (1 << 6)
45#define MUTT_MESSAGE_HOOK (1 << 7)
46#define MUTT_CRYPT_HOOK (1 << 8)
47#define MUTT_ACCOUNT_HOOK (1 << 9)
48#define MUTT_REPLY_HOOK (1 << 10)
49#define MUTT_SEND2_HOOK (1 << 11)
50#ifdef USE_COMP_MBOX
51#define MUTT_OPEN_HOOK (1 << 12)
52#define MUTT_APPEND_HOOK (1 << 13)
53#define MUTT_CLOSE_HOOK (1 << 14)
54#endif
55#define MUTT_IDXFMTHOOK (1 << 15)
56#define MUTT_TIMEOUT_HOOK (1 << 16)
57#define MUTT_STARTUP_HOOK (1 << 17)
58#define MUTT_SHUTDOWN_HOOK (1 << 18)
59#define MUTT_GLOBAL_HOOK (1 << 19)
60
61void mutt_account_hook(const char *url);
62void mutt_crypt_hook(struct ListHead *list, struct Address *addr);
63void mutt_default_save(char *path, size_t pathlen, struct Email *e);
65char *mutt_find_hook(HookFlags type, const char *pat);
66void mutt_folder_hook(const char *path, const char *desc);
67const char *mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e);
68void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type);
69enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
70enum CommandResult mutt_parse_charset_iconv_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
71enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
72enum CommandResult mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err);
73void mutt_select_fcc(struct Buffer *path, struct Email *e);
75void mutt_timeout_hook(void);
76
77#endif /* MUTT_HOOK_H */
CommandResult
Error codes for command_t parse functions.
Definition: command.h:34
Convenience wrapper for the core headers.
enum CommandResult mutt_parse_idxfmt_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'index-format-hook' command - Implements Command::parse() -.
Definition: hook.c:411
enum CommandResult mutt_parse_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'hook' family of commands - Implements Command::parse() -.
Definition: hook.c:128
enum CommandResult mutt_parse_charset_iconv_hook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse 'charset-hook' and 'iconv-hook' commands - Implements Command::parse() -.
Definition: hook.c:83
enum CommandResult mutt_parse_unhook(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse the 'unhook' command - Implements Command::parse() -.
Definition: hook.c:538
void mutt_timeout_hook(void)
Execute any timeout hooks.
Definition: hook.c:888
char * mutt_find_hook(HookFlags type, const char *pat)
Find a matching hook.
Definition: hook.c:637
void mutt_startup_shutdown_hook(HookFlags type)
Execute any startup/shutdown hooks.
Definition: hook.c:924
void mutt_delete_hooks(HookFlags type)
Delete matching hooks.
Definition: hook.c:367
uint32_t HookFlags
Flags for mutt_parse_hook(), e.g. MUTT_FOLDER_HOOK.
Definition: hook.h:36
void mutt_account_hook(const char *url)
Perform an account hook.
Definition: hook.c:843
const char * mutt_idxfmt_hook(const char *name, struct Mailbox *m, struct Email *e)
Get index-format-hook format string.
Definition: hook.c:954
void mutt_default_save(char *path, size_t pathlen, struct Email *e)
Find the default save path for an email.
Definition: hook.c:737
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Definition: hook.c:589
void mutt_select_fcc(struct Buffer *path, struct Email *e)
Select the FCC path for an email.
Definition: hook.c:776
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
Find crypto hooks for an Address.
Definition: hook.c:834
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:658
An email address.
Definition: address.h:36
String manipulation buffer.
Definition: buffer.h:34
The envelope/body of an email.
Definition: email.h:37
A mailbox.
Definition: mailbox.h:79