100 if ((*str ==
'\\') || (*str ==
'"'))
114 bool do_simple =
true;
116 for (
const char *p =
buf_string(buf); p && (p[0] !=
'\0'); p++)
118 if ((p[0] ==
'\\') && (p[1] !=
'\0'))
122 else if ((p[0] ==
'~') || (p[0] ==
'=') || (p[0] ==
'%'))
193 struct Progress *progress = NULL;
209 bool match_all =
false;
210 struct PatternList *pat = NULL;
215 const char *pbuf = buf->
data;
259 mdata->
limit = simple;
265 menu->
max = vcounter;
296 struct Buffer *err = NULL;
298 struct Progress *progress = NULL;
300 bool interrupted =
false;
318 const char *pbuf = buf->
data;
378 for (
int i = 0; i < m->
vcount; i++)
459 struct Progress *progress = NULL;
464 bool pattern_changed =
false;
497 pattern_changed =
true;
518 int incr = state->
reverse ? -1 : 1;
526 for (
int i = cur + incr, j = 0; j != m->
vcount; j++)
528 const char *msg = NULL;
535 msg =
_(
"Search wrapped to top");
548 msg =
_(
"Search wrapped to bottom");
617 struct Progress *progress = NULL;
619 const struct AliasViewArray *ava = &mdata->
ava;
621 bool pattern_changed =
false;
625 if ((
mw_get_field((flags & OP_SEARCH_REVERSE) ?
_(
"Reverse search for: ") :
_(
"Search for: "),
652 pattern_changed =
true;
674 int incr = state->
reverse ? -1 : 1;
682 for (
int i = cur + incr, j = 0; j !=
ARRAY_SIZE(ava); j++)
684 const char *msg = NULL;
691 msg =
_(
"Search wrapped to top");
704 msg =
_(
"Search wrapped to bottom");
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_SIZE(head)
The number of elements stored.
#define ARRAY_GET(head, idx)
Return the element at index.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
void buf_free(struct Buffer **ptr)
Deallocates a buffer.
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
bool buf_str_equal(const struct Buffer *a, const struct Buffer *b)
Return if two buffers are equal.
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".
struct PatternList * mutt_pattern_comp(struct MailboxView *mv, struct Menu *menu, const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
@ MUTT_IMAP
'IMAP' Mailbox type
Structs that make up an email.
bool mutt_pattern_alias_exec(struct Pattern *pat, PatternExecFlags flags, struct AliasView *av, struct PatternCache *cache)
Match a pattern against an alias.
bool mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct PatternCache *cache)
Match a pattern against an email header.
void mutt_file_expand_fmt(struct Buffer *dest, const char *fmt, const char *src)
Replace s in a string with a filename.
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
#define mutt_message(...)
Convenience wrapper for the gui headers.
Shared code for the Alias and Query Dialogs.
Read/write command history from/to a file.
bool imap_search(struct Mailbox *m, const struct PatternList *pat)
Find messages in mailbox matching a pattern.
Convenience wrapper for the library headers.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Many unsorted constants and some structs.
@ MUTT_UNDELETE
Messages to be un-deleted.
@ MUTT_LIMIT
Messages in limited view.
@ MUTT_UNTAG
Messages to be un-tagged.
@ MUTT_PURGE
Messages to be purged (bypass trash)
@ MUTT_TAG
Tagged messages.
@ MUTT_DELETE
Messages to be deleted.
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
int mx_msg_padding_size(struct Mailbox *m)
Bytes of padding between messages - Wrapper for MxOps::msg_padding_size()
const struct CompleteOps CompletePatternOps
Auto-Completion of Patterns.
uint8_t PatternCompFlags
Flags for mutt_pattern_comp(), e.g. MUTT_PC_FULL_MSG.
#define MUTT_PC_FULL_MSG
Enable body and header matching.
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
#define MUTT_ALIAS_SIMPLESEARCH
@ RANGE_K_REL
Relative range.
@ RANGE_K_ABS
Absolute range.
@ RANGE_K_LT
Less-than range.
@ RANGE_K_BARE
Single symbol.
@ RANGE_K_GT
Greater-than range.
bool(* eat_arg_t)(struct Pattern *pat, PatternCompFlags flags, struct Buffer *s, struct Buffer *err)
static void quote_simple(const char *str, struct Buffer *buf)
Apply simple quoting to a string.
int mutt_search_command(struct MailboxView *mv, struct Menu *menu, int cur, struct SearchState *state, SearchFlags flags)
Perform a search.
struct RangeRegex RangeRegexes[]
Set of Regexes for various range types.
int mutt_search_alias_command(struct Menu *menu, int cur, struct SearchState *state, SearchFlags flags)
Perform a search.
int mutt_pattern_alias_func(char *prompt, struct AliasMenuData *mdata, struct Menu *menu)
Perform some Pattern matching for Alias.
void mutt_check_simple(struct Buffer *buf, const char *simple)
Convert a simple search into a real request.
int mutt_pattern_func(struct MailboxView *mv, int op, char *prompt)
Perform some Pattern matching.
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.
@ MUTT_PROGRESS_READ
Progress tracks elements, according to $read_inc
struct Progress * progress_new(enum ProgressType type, size_t size)
Create a new Progress Bar.
void progress_free(struct Progress **ptr)
Free a Progress Bar.
void progress_set_message(struct Progress *progress, const char *fmt,...) __attribute__((__format__(__printf__
bool progress_update(struct Progress *progress, size_t pos, int percent)
Update the state of the progress bar.
Prototypes for many functions.
#define SLIST_FIRST(head)
#define SEARCH_OPPOSITE
Search in the opposite direction.
uint8_t SearchFlags
Flags for a specific search, e.g. SEARCH_PROMPT.
#define SEARCH_PROMPT
Ask for search input.
volatile sig_atomic_t SigInt
true after SIGINT is received
GUI data wrapping an Alias.
bool is_visible
Is visible?
bool is_matched
Search matches this Alias.
bool is_searched
Alias has been searched.
LOFF_T offset
offset where the actual data begins
LOFF_T length
length (in bytes) of attachment
long hdr_offset
Offset in stream where the headers begin.
String manipulation buffer.
char * data
Pointer to data.
The envelope/body of an email.
bool searched
Email has been searched.
bool matched
Search matches this Email.
bool visible
Is this message part of the view?
bool limit_visited
Has the limit pattern been applied to this message?
bool collapsed
Is this message part of a collapsed thread?
struct Body * body
List of MIME parts.
size_t num_hidden
Number of hidden messages in this view (only valid when collapsed is set)
int vnum
Virtual message number.
bool collapsed
Are all threads collapsed?
struct Menu * menu
Needed for pattern compilation.
off_t vsize
Size (in bytes) of the messages shown.
struct PatternList * limit_pattern
Compiled limit pattern.
struct Mailbox * mailbox
Current Mailbox.
char * pattern
Limit pattern string.
int vcount
The number of virtual messages.
int * v2r
Mapping from virtual to real msgno.
int msg_count
Total number of messages.
enum MailboxType type
Mailbox type.
struct Email ** emails
Array of Emails.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
A simple (non-regex) pattern.
Regular expression representing a range.
struct Buffer * string
search string
struct Buffer * string_expn
expanded search string
bool reverse
search backwards
struct PatternList * pattern
compiled search pattern