NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
History Function API

Prototype for a History Function. More...

+ Collaboration diagram for History Function API:

Functions

static int op_generic_select_entry (struct HistoryData *hd, const struct KeyEvent *event)
 Select the current entry - Implements history_function_t -.
 
static int op_quit (struct HistoryData *hd, const struct KeyEvent *event)
 Quit this menu - Implements history_function_t -.
 

Detailed Description

Prototype for a History 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 HistoryData * hd,
const struct KeyEvent * event )
static

Select the current entry - Implements history_function_t -.

Definition at line 41 of file functions.c.

42{
43 const int index = menu_get_index(hd->menu);
44
45 const char **pentry = ARRAY_GET(hd->matches, index);
46 if (pentry)
47 buf_strcpy(hd->buf, *pentry);
48
49 hd->done = true;
50 hd->selection = true;
51 return FR_SUCCESS;
52}
#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
History Menu.
Definition functions.h:39
struct Buffer * buf
Buffer for the results.
Definition functions.h:38
struct StringArray * matches
History entries.
Definition functions.h:40
bool done
Should we close the Dialog?
Definition functions.h:36
bool selection
Was a selection made?
Definition functions.h:37
+ Here is the call graph for this function:

◆ op_quit()

static int op_quit ( struct HistoryData * hd,
const struct KeyEvent * event )
static

Quit this menu - Implements history_function_t -.

Definition at line 57 of file functions.c.

58{
59 hd->done = true;
60 hd->selection = false;
61 return FR_SUCCESS;
62}