NeoMutt  2024-12-12-19-ge4b57e
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, int op)
 Select the current entry - Implements history_function_t -.
 
static int op_quit (struct HistoryData *hd, int op)
 Quit this menu - Implements history_function_t -.
 

Detailed Description

Prototype for a History 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 HistoryData hd,
int  op 
)
static

Select the current entry - Implements history_function_t -.

Definition at line 40 of file functions.c.

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

◆ op_quit()

static int op_quit ( struct HistoryData hd,
int  op 
)
static

Quit this menu - Implements history_function_t -.

Definition at line 56 of file functions.c.

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