NeoMutt  2025-12-11-435-g4ac674
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, const struct KeyEvent *event)
 Select the current entry - Implements pattern_function_t -.
 
static int op_quit (struct PatternData *pd, const struct KeyEvent *event)
 Quit this menu - Implements pattern_function_t -.
 

Detailed Description

Prototype for a Pattern Function.

Parameters
menuMenu
eventEvent to process
Return values
enumFunctionRetval
Precondition
menu is not NULL
event is not NULL

Function Documentation

◆ op_generic_select_entry()

static int op_generic_select_entry ( struct PatternData * pd,
const struct KeyEvent * event )
static

Select the current entry - Implements pattern_function_t -.

Definition at line 43 of file functions.c.

44{
45 const int index = menu_get_index(pd->menu);
46 struct PatternEntry *entry = ARRAY_GET(&pd->entries, index);
47
48 if (entry)
49 buf_strcpy(pd->buf, entry->tag);
50
51 pd->done = true;
52 pd->selection = true;
53 return FR_SUCCESS;
54}
#define ARRAY_GET(head, idx)
Return the element at index.
Definition array.h:109
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:164
struct Menu * menu
Pattern Menu.
struct PatternEntryArray entries
Patterns for the Menu.
bool done
Should we close the Dialog?
struct Buffer * buf
Buffer for the results.
bool selection
Was a selection made?
A line in the Pattern Completion menu.
const char * tag
Copied to buffer if selected.
+ Here is the call graph for this function:

◆ op_quit()

static int op_quit ( struct PatternData * pd,
const struct KeyEvent * event )
static

Quit this menu - Implements pattern_function_t -.

Definition at line 59 of file functions.c.

60{
61 pd->done = true;
62 pd->selection = false;
63 return FR_SUCCESS;
64}