48#define MUTT_SEARCH_UP 1
49#define MUTT_SEARCH_DOWN 2
70 if (!(search_buf && *search_buf) || ((op != OP_SEARCH_NEXT) && (op != OP_SEARCH_OPPOSITE)))
72 buf_strcpy(buf, search_buf && (search_buf[0] !=
'\0') ? search_buf :
"");
73 if ((
mw_get_field(((op == OP_SEARCH) || (op == OP_SEARCH_NEXT)) ?
_(
"Search for: ") :
_(
"Reverse search for: "),
84 menu->
search_dir = ((op == OP_SEARCH) || (op == OP_SEARCH_NEXT)) ?
90 if (op == OP_SEARCH_OPPOSITE)
91 search_dir = -search_dir;
96 rc =
REG_COMP(&re, search_buf, REG_NOSUB | flags);
101 regerror(rc, &re, buf->
data, buf->
dsize);
107 rc = menu->
current + search_dir;
111 while ((rc >= 0) && (rc < menu->max))
113 if (menu->
search(menu, &re, rc) == 0)
123 if (c_wrap_search && (wrap++ == 0))
125 rc = (search_dir == 1) ? 0 : menu->
max - 1;
150 case OP_CURRENT_BOTTOM:
154 case OP_CURRENT_MIDDLE:
222 int index =
search(menu, event->
op);
250 const int digit =
event->op - OP_JUMP;
261 if (mutt_str_atoi_full(
buf_string(buf), &n) && (n > 0) && (n < (menu->
max + 1)))
322 if (!event || !win || !win->
wdata)
325 const int op =
event->op;
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
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.
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_UNKNOWN
Unknown function.
#define MUTT_COMP_NO_FLAGS
No flags are set.
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
void mutt_unget_ch(int ch)
Return a keystroke to the input buffer.
int menu_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Menu function - Implements function_dispatcher_t -.
static int op_help(struct EnterWindowData *wdata, const struct KeyEvent *event)
Display Help - Implements enter_function_t -.
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 -.
static int op_jump(struct IndexSharedData *shared, struct IndexPrivateData *priv, const struct KeyEvent *event)
Jump to an index number - Implements index_function_t -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
void mutt_help(const struct MenuDefinition *md)
Display the Help Page.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
@ LL_DEBUG1
Log at debug level 1.
bool mutt_mb_is_lower(const char *s)
Does a multi-byte string contain only lowercase characters?
Convenience wrapper for the library headers.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Many unsorted constants and some structs.
const char * opcodes_get_name(int op)
Get the name of an opcode.
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 REG_COMP(preg, regex, cflags)
Compile a regular expression.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
void * wdata
Private data.