Search a menu for a item matching a regex.
More...
Search a menu for a item matching a regex.
- Parameters
-
- Return values
-
0 | Success |
>0 | Error, e.g. REG_NOMATCH |
◆ select_file_search()
static int select_file_search |
( |
struct Menu * |
menu, |
|
|
regex_t * |
rx, |
|
|
int |
line |
|
) |
| |
|
static |
Menu search callback for matching files - Implements Menu::search() -.
Definition at line 931 of file dlg_browser.c.
932{
934 struct BrowserEntryArray *entry = &priv->
state.
entry;
936 return regexec(rx,
ARRAY_GET(entry, line)->desc, 0, NULL, 0);
939
940 return regexec(rx, search_on, 0, NULL, 0);
941}
#define ARRAY_GET(head, idx)
Return the element at index.
bool OptNews
(pseudo) used to change reader mode
Private state data for the Browser.
struct BrowserState state
State containing list of files/dir/mailboxes.
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Browser entry representing a folder/dir.
char * name
Name of file/dir/mailbox.
char * desc
Description of mailbox.
◆ generic_search()
static int generic_search |
( |
struct Menu * |
menu, |
|
|
regex_t * |
rx, |
|
|
int |
line |
|
) |
| |
|
static |
Search a menu for a item matching a regex - Implements Menu::search() -.
Definition at line 56 of file menu.c.
57{
59
61 int rc = regexec(rx, buf->
data, 0, NULL, 0);
63
64 return rc;
65}
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.
String manipulation buffer.
char * data
Pointer to data.