NeoMutt  2022-04-29-249-gaae397
Teaching an old dog new tricks
DOXYGEN
History Function API

Prototype for a History Function. More...

+ Collaboration diagram for History Function API:

Functions

static int op_exit (struct HistoryData *hd, int op)
 Exit this menu - Implements history_function_t -. More...
 
static int op_generic_select_entry (struct HistoryData *hd, int op)
 Select the current entry - Implements history_function_t -. More...
 

Detailed Description

Prototype for a History Function.

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

Function Documentation

◆ op_exit()

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

Exit this menu - Implements history_function_t -.

Definition at line 40 of file functions.c.

41{
42 hd->done = true;
43 hd->selection = false;
44 return FR_SUCCESS;
45}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
bool done
Should we close the Dialog?
Definition: functions.h:36
bool selection
Was a selection made?
Definition: functions.h:37

◆ 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 50 of file functions.c.

51{
52 const int index = menu_get_index(hd->menu);
53 mutt_str_copy(hd->buf, hd->matches[index], hd->buflen);
54
55 hd->done = true;
56 hd->selection = true;
57 return FR_SUCCESS;
58}
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:154
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:652
size_t buflen
Length of the results buffer.
Definition: functions.h:39
struct Menu * menu
History Menu.
Definition: functions.h:40
char ** matches
History entries.
Definition: functions.h:41
char * buf
Buffer for the results.
Definition: functions.h:38
+ Here is the call graph for this function: