This is used by 'account-hook', 'append-hook' and many more.
88 struct Hook *hook = NULL;
92 struct PatternList *pat = NULL;
190 if (
data & MUTT_GLOBAL_HOOK)
254 else if (~
data & MUTT_GLOBAL_HOOK)
259 ((
data & MUTT_CRYPT_HOOK) ? REG_ICASE : 0));
262 regerror(rc2, rx, err->
data, err->
dsize);
#define MUTT_SEND_HOOK
send-hook: when composing a new email
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
static struct HookList Hooks
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
#define MUTT_SHUTDOWN_HOOK
shutdown-hook: run when leaving NeoMutt
#define TAILQ_FOREACH(var, head, field)
Error: Can't help the user.
size_t mutt_buffer_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
char * mutt_buffer_strdup(const struct Buffer *buf)
Copy a Buffer's string.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
regex_t * regex
compiled expression
String manipulation buffer.
struct PatternList * mutt_pattern_comp(const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
#define MUTT_CHARSET_HOOK
charset-hook: create a charset alias for malformed emails
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
#define MUTT_MESSAGE_HOOK
message-hook: run before displaying a message
void mutt_check_simple(struct Buffer *s, const char *simple)
Convert a simple search into a real request.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
#define MUTT_CRYPT_HOOK
crypt-hook: automatically select a PGP/SMIME key
void mutt_buffer_expand_path_regex(struct Buffer *buf, bool regex)
Create the canonical path (with regex char escaping)
Character set conversion.
char * command
Filename, command or pattern to execute.
size_t dsize
Length of data.
#define MUTT_ICONV_HOOK
iconv-hook: create a system charset alias
#define MUTT_PC_SEND_MODE_SEARCH
Allow send-mode body searching.
struct Regex regex
Regular expression.
#define MUTT_APPEND_HOOK
append-hook: append to a compressed mailbox
#define MUTT_MBOX_HOOK
mbox-hook: move messages after reading them
#define MUTT_GLOBAL_HOOK
Hooks which don't take a regex.
Alias for another character set.
#define MUTT_SAVE_HOOK
save-hook: set a default folder when saving an email
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
#define MUTT_CLOSE_HOOK
close-hook: write to a compressed mailbox
char * dptr
Current read/write position.
#define MUTT_TOKEN_SPACE
Don't treat whitespace as a term.
#define MUTT_PC_NO_FLAGS
No flags are set.
char * data
Pointer to data.
int mutt_comp_valid_command(const char *cmd)
Is this command string allowed?
#define TAILQ_INSERT_TAIL(head, elm, field)
#define MUTT_OPEN_HOOK
open-hook: to read a compressed mailbox
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
#define MUTT_TIMEOUT_HOOK
timeout-hook: run a command periodically
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
Warning: Help given to the user.
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
WHERE char * CurrentFolder
Currently selected mailbox.
#define MUTT_REPLY_HOOK
reply-hook: when replying to an email
char * C_DefaultHook
Config: Pattern to use for hooks that only have a simple regex.
char * pattern
printable version
#define MUTT_PC_FULL_MSG
Enable body and header matching.
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
#define MUTT_STARTUP_HOOK
startup-hook: run when starting NeoMutt
LookupType
Types of character set lookups.
#define MUTT_FCC_HOOK
fcc-hook: to save outgoing email
struct PatternList * pattern
Used for fcc,save,send-hook.
uint8_t PatternCompFlags
Flags for mutt_pattern_comp(), e.g. MUTT_PC_FULL_MSG.
#define MUTT_ACCOUNT_HOOK
account-hook: when changing between accounts
bool mutt_ch_lookup_add(enum LookupType type, const char *pat, const char *replace, struct Buffer *err)
Add a new character set lookup.
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
#define MUTT_FOLDER_HOOK
folder-hook: when entering a mailbox