NeoMutt  2024-04-25-89-g194907
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Pattern Function API

Prototype for a Pattern Function. More...

+ Collaboration diagram for Pattern Function API:

Functions

static int op_generic_select_entry (struct PatternData *pd, int op)
 Select the current entry - Implements pattern_function_t -.
 
static int op_quit (struct PatternData *pd, int op)
 Quit this menu - Implements pattern_function_t -.
 

Detailed Description

Prototype for a Pattern Function.

Parameters
menuMenu
opOperation to perform, e.g. OP_GENERIC_SELECT_ENTRY
Return values
enumFunctionRetval

Function Documentation

◆ op_generic_select_entry()

static int op_generic_select_entry ( struct PatternData pd,
int  op 
)
static

Select the current entry - Implements pattern_function_t -.

Definition at line 40 of file functions.c.

41{
42 const int index = menu_get_index(pd->menu);
43 struct PatternEntry *entry = ((struct PatternEntry *) pd->menu->mdata) + index;
44 mutt_str_copy(pd->buf, entry->tag, pd->buflen);
45
46 pd->done = true;
47 pd->selection = true;
48 return FR_SUCCESS;
49}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:160
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:581
void * mdata
Private data.
Definition: lib.h:147
char * buf
Buffer for the results.
Definition: functions.h:38
struct Menu * menu
Pattern Menu.
Definition: functions.h:40
bool done
Should we close the Dialog?
Definition: functions.h:36
size_t buflen
Length of the results buffer.
Definition: functions.h:39
bool selection
Was a selection made?
Definition: functions.h:37
A line in the Pattern Completion menu.
Definition: private.h:37
const char * tag
Copied to buffer if selected.
Definition: private.h:39
+ Here is the call graph for this function:

◆ op_quit()

static int op_quit ( struct PatternData pd,
int  op 
)
static

Quit this menu - Implements pattern_function_t -.

Definition at line 54 of file functions.c.

55{
56 pd->done = true;
57 pd->selection = false;
58 return FR_SUCCESS;
59}