123 struct Hook *hook = NULL;
188 struct Hook *hook = NULL;
190 bool pat_not =
false;
191 struct PatternList *pat = NULL;
196 if (*line->
dptr ==
'!')
296 struct Hook *hook = NULL;
297 struct PatternList *pat = NULL;
359 bool pat_not =
false;
364 if (*line->
dptr ==
'!')
437 struct Hook *hook = NULL;
439 bool pat_not =
false;
445 if (*line->
dptr ==
'!')
497 regerror(rc2, rx, err->
data, err->
dsize);
532 struct Hook *hook = NULL;
534 bool pat_not =
false;
535 bool use_regex =
true;
541 if (*line->
dptr ==
'!')
588 buf_strcpy(err,
_(
"current mailbox shortcut '^' is unset"));
600 buf_strcpy(err,
_(
"mailbox shortcut expanded to empty regex"));
635 regerror(rc2, rx, err->
data, err->
dsize);
671 struct Hook *hook = NULL;
673 bool pat_not =
false;
679 if (*line->
dptr ==
'!')
731 regerror(rc2, rx, err->
data, err->
dsize);
766 struct Hook *hook = NULL;
768 bool pat_not =
false;
769 bool use_regex =
true;
775 if (*line->
dptr ==
'!')
822 buf_strcpy(err,
_(
"current mailbox shortcut '^' is unset"));
834 buf_strcpy(err,
_(
"mailbox shortcut expanded to empty regex"));
876 regerror(rc2, rx, err->
data, err->
dsize);
915 struct Hook *hook = NULL;
917 bool pat_not =
false;
923 if (*line->
dptr ==
'!')
958 buf_strcpy(err,
_(
"badly formatted command string"));
984 regerror(rc2, rx, err->
data, err->
dsize);
1016 struct Hook *h = NULL;
1017 struct Hook *tmp = NULL;
1034 struct HookList *hl = obj;
1035 struct Hook *h = NULL;
1036 struct Hook *tmp = NULL;
1073 bool pat_not =
false;
1089 if (*line->
dptr ==
'!')
1119 struct Hook *hook = NULL;
1205 buf_addstr(err,
_(
"unhook: Can't do unhook * from within a hook"));
1231 buf_printf(err,
_(
"unhook: Can't delete a %s from within a %s"),
const struct ExpandoDefinition IndexFormatDef[]
Expando definitions.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
char buf_at(const struct Buffer *buf, size_t offset)
Return the character at the given offset.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
@ CMD_SEND_HOOK
:send-hook
@ CMD_FCC_SAVE_HOOK
:fcc-save-hook
@ CMD_ICONV_HOOK
:iconv-hook
@ CMD_INDEX_FORMAT_HOOK
:index-format-hook
@ CMD_SEND2_HOOK
:send2-hook
@ CMD_CHARSET_HOOK
:charset-hook
@ CMD_SAVE_HOOK
:save-hook
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
const struct Command * command_find_by_name(const struct CommandArray *ca, const char *name)
Find a NeoMutt Command by its name.
struct PatternList * mutt_pattern_comp(struct MailboxView *mv, const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
int mutt_comp_valid_command(const char *cmd)
Is this command string allowed?
Compressed mbox local mailbox type.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
struct Expando * expando_parse(const char *str, const struct ExpandoDefinition *defs, struct Buffer *err)
Parse an Expando string.
void expando_free(struct Expando **ptr)
Free an Expando object.
int mutt_file_sanitize_regex(struct Buffer *dest, const char *src)
Escape any regex-magic characters in a string.
char * CurrentFolder
Currently selected mailbox.
enum CommandResult parse_pattern_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse pattern-based Hook commands - Implements Command::parse() -.
enum CommandResult parse_folder_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse folder hook command - Implements Command::parse() -.
enum CommandResult parse_compress_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse compress hook commands - Implements Command::parse() -.
enum CommandResult parse_regex_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse regex-based hook command - Implements Command::parse() -.
enum CommandResult parse_unhook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the unhook command - Implements Command::parse() -.
enum CommandResult parse_crypt_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse crypt hook commands - Implements Command::parse() -.
enum CommandResult parse_mailbox_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse mailbox pattern hook commands - Implements Command::parse() -.
enum CommandResult parse_charset_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse charset Hook commands - Implements Command::parse() -.
enum CommandResult parse_mbox_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse mbox hook command - Implements Command::parse() -.
enum CommandResult parse_global_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse global Hook commands - Implements Command::parse() -.
enum CommandResult parse_index_hook(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the index format hook command - Implements Command::parse() -.
static void idxfmt_hashelem_free(int type, void *obj, intptr_t data)
Free our hash table data - Implements hash_hdata_free_t -.
struct HashElem * mutt_hash_insert(struct HashTable *table, const char *strkey, void *data)
Add a new element to the Hash Table (with string keys)
void * mutt_hash_find(const struct HashTable *table, const char *strkey)
Find the HashElem data in a Hash Table element using a key.
struct HashTable * mutt_hash_new(size_t num_elems, HashFlags flags)
Create a new Hash Table (with string keys)
void mutt_hash_set_destructor(struct HashTable *table, hash_hdata_free_t fn, intptr_t fn_data)
Set the destructor for a Hash Table.
void mutt_hash_free(struct HashTable **ptr)
Free a hash table.
#define MUTT_HASH_STRDUP_KEYS
make a copy of the keys
void hook_free(struct Hook **ptr)
Free a Hook.
struct Hook * hook_new(void)
Create a Hook.
enum CommandId CurrentHookId
The ID of the Hook currently being executed, e.g. CMD_SAVE_HOOK.
struct HashTable * IdxFmtHooks
All Index Format hooks.
void mutt_delete_hooks(enum CommandId id)
Delete matching hooks.
static void delete_idxfmt_hooks(void)
Delete all the index-format-hooks.
enum CommandResult add_mailbox_hook(enum CommandId id, struct Buffer *mailbox, struct Buffer *pattern, bool pat_not, struct Buffer *err)
Add a Mailbox Hook.
struct HookList Hooks
All simple hooks, e.g. CMD_FOLDER_HOOK.
GUI manage the main index (list of emails)
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
#define FREE(x)
Free memory and set the pointer to NULL.
#define MUTT_MEM_CALLOC(n, type)
void mutt_ch_lookup_remove(void)
Remove all the character set lookups.
bool mutt_ch_lookup_add(enum LookupType type, const char *pat, const char *replace, struct Buffer *err)
Add a new character set lookup.
LookupType
Types of character set lookups.
@ MUTT_LOOKUP_ICONV
Character set conversion.
@ MUTT_LOOKUP_CHARSET
Alias for another character set.
Convenience wrapper for the library headers.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
void expand_path(struct Buffer *buf, bool regex)
Create the canonical path.
Some miscellaneous functions.
Match patterns to emails.
#define MUTT_PC_SEND_MODE_SEARCH
Allow send-mode body searching.
uint8_t PatternCompFlags
Flags for mutt_pattern_comp(), e.g. MUTT_PC_FULL_MSG.
#define MUTT_PC_FULL_MSG
Enable body and header matching.
void mutt_check_simple(struct Buffer *s, const char *simple)
Convert a simple search into a real request.
#define MUTT_PC_NO_FLAGS
No flags are set.
#define MUTT_PC_PATTERN_DYNAMIC
Enable runtime date range evaluation.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_FOREACH_SAFE(var, head, field, tvar)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_REMOVE(head, elm, field)
#define TAILQ_HEAD_INITIALIZER(head)
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
char * mutt_get_sourced_cwd(void)
Get the current file path that is being parsed.
String manipulation buffer.
char * dptr
Current read/write position.
size_t dsize
Length of data.
char * data
Pointer to data.
const char * name
Name of the Command.
enum CommandId id
ID of the Command.
Definition of a format string.
struct PatternList * pattern
Used for fcc,save,send-hook.
struct Regex regex
Regular expression.
char * command
Filename, command or pattern to execute.
struct Expando * expando
Used for format hooks.
enum CommandId id
Hook CommandId, e.g. CMD_FOLDER_HOOK.
char * source_file
Used for relative-directory source.
struct Mailbox * mailbox
Current Mailbox.
char * pattern
Limit pattern string.
Container for Accounts, Notifications.
struct CommandArray commands
NeoMutt commands.
struct ConfigSubset * sub
Inherited config items.
Context for config parsing (history/backtrace)
Detailed error information from config parsing.
struct Buffer * message
Error message.
char * pattern
printable version
regex_t * regex
compiled expression