172{
173 int rc = -1;
174 struct Progress *progress = NULL;
176
178 if (prompt)
179 {
182 {
184 return -1;
185 }
186 }
187
189
190
191
192 bool match_all = false;
193 struct PatternList *pat = NULL;
195 if (simple)
196 {
198 const char *pbuf = buf->
data;
199 while (*pbuf == ' ')
200 pbuf++;
202
205 if (!pat)
206 {
209 goto bail;
210 }
212 }
213 else
214 {
215 match_all = true;
216 }
217
220
221
222
223 int vcounter = 0;
226 {
228
229 if (match_all ||
231 {
232 switch (action)
233 {
236 break;
239 break;
242 vcounter++;
243 break;
244 }
245 }
246 else
247 {
248 switch (action)
249 {
252
253 break;
256 break;
257 }
258 }
259 }
261
263 if (!match_all)
264 {
265 mdata->
limit = simple;
266 simple = NULL;
267 }
268
270 {
271 menu->
max = vcounter;
273 }
274
276
277 rc = 0;
278
279bail:
283
284 return rc;
285}
#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, const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
@ MUTT_COMP_CLEAR
Clear input if printable character is pressed.
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 FREE(x)
Free memory and set the pointer to NULL.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
const struct CompleteOps CompletePatternOps
Auto-Completion of Patterns.
bool mutt_pattern_alias_exec(struct Pattern *pat, PatternExecFlags flags, struct AliasView *av, struct PatternCache *cache)
Match a pattern against an alias.
@ MUTT_MATCH_FULL_ADDRESS
Match the full address.
@ 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_ALIAS_SIMPLESEARCH
Simple search pattern for aliases (from/to/cc fields)
@ MUTT_PC_FULL_MSG
Enable body and header matching.
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.