NeoMutt  2024-10-02-34-g9dd811
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 39 of file functions.c.

40{
41 const int index = menu_get_index(hd->menu);
42 mutt_str_copy(hd->buf, hd->matches[index], hd->buflen);
43
44 hd->done = true;
45 hd->selection = true;
46 return FR_SUCCESS;
47}
@ 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
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
bool done
Should we close the Dialog?
Definition: functions.h:36
char * buf
Buffer for the results.
Definition: functions.h:38
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,
int  op 
)
static

Quit this menu - Implements history_function_t -.

Definition at line 52 of file functions.c.

53{
54 hd->done = true;
55 hd->selection = false;
56 return FR_SUCCESS;
57}