193{
194 int rc = -1;
195 struct Progress *progress = NULL;
197
199 if (prompt)
200 {
203 {
205 return -1;
206 }
207 }
208
210
211 bool match_all = false;
212 struct PatternList *pat = NULL;
214 if (simple)
215 {
217 const char *pbuf = buf->
data;
218 while (*pbuf == ' ')
219 pbuf++;
221
224 if (!pat)
225 {
228 goto bail;
229 }
230 }
231 else
232 {
233 match_all = true;
234 }
235
238
239 int vcounter = 0;
242 {
244
245 if (match_all ||
247 {
248 switch (action)
249 {
252 break;
255 break;
258 vcounter++;
259 break;
260 }
261 }
262 else
263 {
264 switch (action)
265 {
268
269 break;
272 break;
273 }
274 }
275 }
277
279 if (!match_all)
280 {
281 mdata->
limit = simple;
282 simple = NULL;
283 }
284
286 {
287 menu->
max = vcounter;
289 }
290
292
293 rc = 0;
294
295bail:
299
300 return rc;
301}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_SIZE(head)
The number of elements stored.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's 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.
bool mutt_pattern_alias_exec(struct Pattern *pat, PatternExecFlags flags, struct AliasView *av, struct PatternCache *cache)
Match a pattern against an alias.
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(...)
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
const struct CompleteOps CompletePatternOps
Auto-Completion of Patterns.
#define MUTT_PC_FULL_MSG
Enable body and header matching.
@ PAA_VISIBLE
Set AliasView.is_visible and hide the rest.
@ PAA_TAG
Set AliasView.is_tagged, but don't touch the others.
@ PAA_UNTAG
Unset AliasView.is_tagged, but don't touch the others.
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
#define MUTT_ALIAS_SIMPLESEARCH
void mutt_check_simple(struct Buffer *buf, const char *simple)
Convert a simple search into a real request.
@ 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.
#define SLIST_FIRST(head)
GUI data wrapping an Alias.
bool is_visible
Is visible?
bool is_tagged
Is it tagged?
char * data
Pointer to data.