NeoMutt  2025-12-11-177-g48e272
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Function Dispatcher API

Prototype for a Function Dispatcher. More...

+ Collaboration diagram for Function Dispatcher API:

Topics

 Alias Function API
 Prototype for a Alias Function.
 
 Attachment Function API
 Prototype for an Attachment Function.
 
 Autocrypt Function API
 Prototype for a Autocrypt Function.
 
 Compose Function API
 Prototype for a Compose Function.
 
 Preview Function API
 Prototype for a Preview Function.
 
 Envelope Function API
 Prototype for a Envelope Function.
 
 Global Function API
 Prototype for a Global Function.
 
 History Function API
 Prototype for a History Function.
 
 Index Function API
 Prototype for an Index Function.
 
 Menu Function API
 Prototype for a Menu Function.
 
 Gpgme Function API
 Prototype for a Gpgme Function.
 
 Pgp Function API
 Prototype for a Pgp Function.
 
 Smime Function API
 Prototype for a Smime Function.
 
 Pager Function API
 Prototype for a Pager Function.
 
 Pattern Function API
 Prototype for a Pattern Function.
 
 Postpone Function API
 Prototype for a Postpone Function.
 
 Sidebar Function API
 Prototype for a Sidebar Function.
 

Functions

int alias_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Alias function - Implements function_dispatcher_t -.
 
int attach_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Attach function - Implements function_dispatcher_t -.
 
int autocrypt_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Autocrypt function - Implements function_dispatcher_t -.
 
int compose_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Compose function - Implements function_dispatcher_t -.
 
int preview_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a preview function - Implements function_dispatcher_t -.
 
int enter_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform an Enter function - Implements function_dispatcher_t -.
 
int env_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform an Envelope function - Implements function_dispatcher_t -.
 
int global_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Global function - Implements function_dispatcher_t -.
 
int history_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a History function - Implements function_dispatcher_t -.
 
int index_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform an Index function - Implements function_dispatcher_t -.
 
int menu_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Menu function - Implements function_dispatcher_t -.
 
int menu_tagging_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform tagging operations on the Menu - Implements function_dispatcher_t -.
 
int gpgme_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Gpgme function - Implements function_dispatcher_t -.
 
int pgp_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Pgp function - Implements function_dispatcher_t -.
 
int smime_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Smime function - Implements function_dispatcher_t -.
 
int pager_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Pager function - Implements function_dispatcher_t -.
 
int pattern_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Pattern function - Implements function_dispatcher_t -.
 
int postpone_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Postpone function - Implements function_dispatcher_t -.
 
int sb_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Sidebar function - Implements function_dispatcher_t -.
 

Detailed Description

Prototype for a Function Dispatcher.

Perform a NeoMutt function

Parameters
winWindow
eventEvent to act upon
Return values
numFunctionRetval

Function Documentation

◆ alias_function_dispatcher()

int alias_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Alias function - Implements function_dispatcher_t -.

Definition at line 489 of file functions.c.

490{
491 // The Dispatcher may be called on any Window in the Dialog
492 struct MuttWindow *dlg = dialog_find(win);
493 if (!event || !dlg || !dlg->wdata)
494 return FR_ERROR;
495
496 struct Menu *menu = dlg->wdata;
497 struct AliasMenuData *mdata = menu->mdata;
498 if (!mdata)
499 return FR_ERROR;
500
501 const int op = event->op;
502
503 int rc = FR_UNKNOWN;
504 for (size_t i = 0; AliasFunctions[i].op != OP_NULL; i++)
505 {
506 const struct AliasFunction *fn = &AliasFunctions[i];
507 if (fn->op == op)
508 {
509 rc = fn->function(mdata, event);
510 break;
511 }
512 }
513
514 if (rc == FR_UNKNOWN) // Not our function
515 return rc;
516
517 const char *result = dispatcher_get_retval_name(rc);
518 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
519
520 return rc;
521}
static const struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
Definition functions.c:463
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
Definition dispatcher.c:54
@ FR_UNKNOWN
Unknown function.
Definition dispatcher.h:34
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
@ LL_DEBUG1
Log at debug level 1.
Definition logging2.h:45
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition opcodes.c:48
#define NONULL(x)
Definition string2.h:44
A NeoMutt function.
Definition functions.h:56
int op
Op code, e.g. OP_SEARCH.
Definition functions.h:57
alias_function_t function
Function to call.
Definition functions.h:58
AliasView array wrapper with Pattern information -.
Definition gui.h:54
struct Menu * menu
Menu.
Definition gui.h:58
Definition lib.h:80
void * mdata
Private data.
Definition lib.h:149
void * wdata
Private data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attach_function_dispatcher()

int attach_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Attach function - Implements function_dispatcher_t -.

Definition at line 728 of file functions.c.

729{
730 // The Dispatcher may be called on any Window in the Dialog
731 struct MuttWindow *dlg = dialog_find(win);
732 if (!event || !dlg || !dlg->wdata)
733 return FR_ERROR;
734
735 struct Menu *menu = dlg->wdata;
736 struct AttachPrivateData *priv = menu->mdata;
737 if (!priv)
738 return FR_ERROR;
739
740 const int op = event->op;
741 int rc = FR_UNKNOWN;
742 for (size_t i = 0; AttachFunctions[i].op != OP_NULL; i++)
743 {
744 const struct AttachFunction *fn = &AttachFunctions[i];
745 if (fn->op == op)
746 {
747 rc = fn->function(priv, event);
748 break;
749 }
750 }
751
752 return rc;
753}
static const struct AttachFunction AttachFunctions[]
All the NeoMutt functions that the Attach supports.
Definition functions.c:691
A NeoMutt function.
Definition functions.h:49
attach_function_t function
Function to call.
Definition functions.h:51
int op
Op code, e.g. OP_ATTACHMENT_COLLAPSE.
Definition functions.h:50
Private state data for Attachments.
int op
Op returned from the Pager, e.g. OP_NEXT_ENTRY.
struct Menu * menu
Current Menu.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ autocrypt_function_dispatcher()

int autocrypt_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Autocrypt function - Implements function_dispatcher_t -.

Definition at line 225 of file functions.c.

226{
227 // The Dispatcher may be called on any Window in the Dialog
228 struct MuttWindow *dlg = dialog_find(win);
229 if (!event || !dlg || !dlg->wdata)
230 return FR_ERROR;
231
232 const int op = event->op;
233 struct Menu *menu = dlg->wdata;
234 struct AutocryptData *ad = menu->mdata;
235 if (!ad)
236 return FR_ERROR;
237
238 int rc = FR_UNKNOWN;
239 for (size_t i = 0; AutocryptFunctions[i].op != OP_NULL; i++)
240 {
241 const struct AutocryptFunction *fn = &AutocryptFunctions[i];
242 if (fn->op == op)
243 {
244 rc = fn->function(ad, event);
245 break;
246 }
247 }
248
249 if (rc == FR_UNKNOWN) // Not our function
250 return rc;
251
252 const char *result = dispatcher_get_retval_name(rc);
253 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
254
255 return rc;
256}
static const struct AutocryptFunction AutocryptFunctions[]
All the NeoMutt functions that the Autocrypt supports.
Definition functions.c:211
Data to pass to the Autocrypt Functions.
struct Menu * menu
Autocrypt Menu.
A NeoMutt function.
Definition functions.h:49
autocrypt_function_t function
Function to call.
Definition functions.h:51
int op
Op code, e.g. OP_AUTOCRYPT_CREATE_ACCT.
Definition functions.h:50
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compose_function_dispatcher()

int compose_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Compose function - Implements function_dispatcher_t -.

Definition at line 2180 of file functions.c.

2181{
2182 // The Dispatcher may be called on any Window in the Dialog
2183 struct MuttWindow *dlg = dialog_find(win);
2184 if (!event || !dlg || !dlg->wdata)
2185 return FR_ERROR;
2186
2187 const int op = event->op;
2188 int rc = FR_UNKNOWN;
2189 for (size_t i = 0; ComposeFunctions[i].op != OP_NULL; i++)
2190 {
2191 const struct ComposeFunction *fn = &ComposeFunctions[i];
2192 if (fn->op == op)
2193 {
2194 struct ComposeSharedData *shared = dlg->wdata;
2195 rc = fn->function(shared, event);
2196 break;
2197 }
2198 }
2199
2200 if (rc == FR_UNKNOWN) // Not our function
2201 return rc;
2202
2203 const char *result = dispatcher_get_retval_name(rc);
2204 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
2205
2206 return rc;
2207}
static const struct ComposeFunction ComposeFunctions[]
All the NeoMutt functions that the Compose supports.
Definition functions.c:2128
A NeoMutt function.
Definition functions.h:49
int op
Op code, e.g. OP_COMPOSE_WRITE_MESSAGE.
Definition functions.h:50
compose_function_t function
Function to call.
Definition functions.h:51
Shared Compose Data.
Definition shared_data.h:36
int rc
Return code to leave compose.
Definition shared_data.h:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ preview_function_dispatcher()

int preview_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a preview function - Implements function_dispatcher_t -.

Definition at line 412 of file preview.c.

413{
414 if (!event || !win || !win->wdata)
415 return FR_UNKNOWN;
416
417 const int op = event->op;
418 int rc = FR_UNKNOWN;
419 for (size_t i = 0; PreviewFunctions[i].op != OP_NULL; i++)
420 {
421 const struct PreviewFunction *fn = &PreviewFunctions[i];
422 if (fn->op == op)
423 {
424 struct PreviewWindowData *wdata = win->wdata;
425 rc = fn->function(wdata, event);
426 break;
427 }
428 }
429
430 if (rc == FR_UNKNOWN) // Not our function
431 return rc;
432
433 const char *result = dispatcher_get_retval_name(rc);
434 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
435
436 return rc;
437}
static const struct PreviewFunction PreviewFunctions[]
All the functions that the preview window supports.
Definition preview.c:401
A message preview function.
Definition preview.c:106
int op
Op code, e.g. OP_NEXT_PAGE.
Definition preview.c:107
preview_function_t function
Function to call.
Definition preview.c:108
Data to fill the Preview Window.
Definition preview.c:78
struct MuttWindow * win
Window holding the message preview.
Definition preview.c:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enter_function_dispatcher()

int enter_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform an Enter function - Implements function_dispatcher_t -.

Definition at line 496 of file functions.c.

497{
498 if (!event || !win || !win->wdata)
499 return FR_UNKNOWN;
500
501 const int op = event->op;
502 struct EnterWindowData *wdata = win->wdata;
503
504 int rc = FR_UNKNOWN;
505 for (size_t i = 0; EnterFunctions[i].op != OP_NULL; i++)
506 {
507 const struct EnterFunction *fn = &EnterFunctions[i];
508 if (fn->op == op)
509 {
510 rc = fn->function(wdata, event);
511 break;
512 }
513 }
514
515 if (rc == FR_UNKNOWN) // Not our function
516 return rc;
517
518 const char *result = dispatcher_get_retval_name(rc);
519 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
520
521 return rc;
522}
static const struct EnterFunction EnterFunctions[]
All the NeoMutt functions that Enter supports.
Definition functions.c:461
A NeoMutt function.
Definition functions.h:52
int op
Op code, e.g. OP_SEARCH.
Definition functions.h:53
enter_function_t function
Function to call.
Definition functions.h:54
Data to fill the Enter Window.
Definition wdata.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ env_function_dispatcher()

int env_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform an Envelope function - Implements function_dispatcher_t -.

Definition at line 536 of file functions.c.

537{
538 if (!event || !win || !win->wdata)
539 return FR_UNKNOWN;
540
541 const int op = event->op;
542 int rc = FR_UNKNOWN;
543 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
544 {
545 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
546 if (fn->op == op)
547 {
548 struct EnvelopeWindowData *wdata = win->wdata;
549 rc = fn->function(wdata, event);
550 break;
551 }
552 }
553
554 if (rc == FR_UNKNOWN) // Not our function
555 return rc;
556
557 const char *result = dispatcher_get_retval_name(rc);
558 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
559
560 return rc;
561}
static const struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition functions.c:512
A NeoMutt Envelope function.
Definition functions.h:49
int op
Op code, e.g. OP_ENVELOPE_EDIT_FROM.
Definition functions.h:50
envelope_function_t function
Function to call.
Definition functions.h:51
Data to fill the Envelope Window.
Definition wdata.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ global_function_dispatcher()

int global_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Global function - Implements function_dispatcher_t -.

Note
win Should be the currently focused Window

Definition at line 182 of file global.c.

183{
184 if (!event || !win)
185 return FR_UNKNOWN;
186
187 const int op = event->op;
188 int rc = FR_UNKNOWN;
189 for (size_t i = 0; GlobalFunctions[i].op != OP_NULL; i++)
190 {
191 const struct GlobalFunction *fn = &GlobalFunctions[i];
192 if (fn->op == op)
193 {
194 rc = fn->function(win, event);
195 break;
196 }
197 }
198
199 if (rc == FR_UNKNOWN) // Not our function
200 return rc;
201
202 const char *result = dispatcher_get_retval_name(rc);
203 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
204
205 return FR_SUCCESS; // Whatever the outcome, we handled it
206}
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
static const struct GlobalFunction GlobalFunctions[]
All the NeoMutt functions that the Global supports.
Definition global.c:164
A NeoMutt function.
Definition global.h:48
global_function_t function
Function to call.
Definition global.h:50
int op
Op code, e.g. OP_ENTER_COMMAND.
Definition global.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ history_function_dispatcher()

int history_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a History function - Implements function_dispatcher_t -.

Definition at line 81 of file functions.c.

82{
83 // The Dispatcher may be called on any Window in the Dialog
84 struct MuttWindow *dlg = dialog_find(win);
85 if (!event || !dlg || !dlg->wdata)
86 return FR_ERROR;
87
88 const int op = event->op;
89 struct Menu *menu = dlg->wdata;
90 struct HistoryData *hd = menu->mdata;
91 if (!hd)
92 return FR_ERROR;
93
94 int rc = FR_UNKNOWN;
95 for (size_t i = 0; HistoryFunctions[i].op != OP_NULL; i++)
96 {
97 const struct HistoryFunction *fn = &HistoryFunctions[i];
98 if (fn->op == op)
99 {
100 rc = fn->function(hd, event);
101 break;
102 }
103 }
104
105 if (rc == FR_UNKNOWN) // Not our function
106 return rc;
107
108 const char *result = dispatcher_get_retval_name(rc);
109 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
110
111 return rc;
112}
static const struct HistoryFunction HistoryFunctions[]
All the NeoMutt functions that the History supports.
Definition functions.c:69
Data to pass to the History Functions.
Definition functions.h:35
struct Menu * menu
History Menu.
Definition functions.h:39
A NeoMutt function.
Definition functions.h:62
history_function_t function
Function to call.
Definition functions.h:64
int op
Op code, e.g. OP_GENERIC_SELECT_ENTRY.
Definition functions.h:63
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index_function_dispatcher()

int index_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform an Index function - Implements function_dispatcher_t -.

Definition at line 3321 of file functions.c.

3322{
3323 // The Dispatcher may be called on any Window in the Dialog
3324 struct MuttWindow *dlg = dialog_find(win);
3325 if (!event || !dlg || !dlg->wdata || !win->parent || !win->parent->wdata)
3326 return FR_ERROR;
3327
3328 const int op = event->op;
3329 struct IndexPrivateData *priv = win->parent->wdata;
3330 struct IndexSharedData *shared = dlg->wdata;
3331
3332 int rc = FR_UNKNOWN;
3333 for (size_t i = 0; IndexFunctions[i].op != OP_NULL; i++)
3334 {
3335 const struct IndexFunction *fn = &IndexFunctions[i];
3336 if (fn->op == op)
3337 {
3338 if (!prereq(shared, priv->menu, fn->flags))
3339 {
3340 rc = FR_ERROR;
3341 break;
3342 }
3343 rc = fn->function(shared, priv, event);
3344 break;
3345 }
3346 }
3347
3348 if (rc == FR_UNKNOWN) // Not our function
3349 return rc;
3350
3351 const char *result = dispatcher_get_retval_name(rc);
3352 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
3353
3354 return rc;
3355}
static bool prereq(struct IndexSharedData *shared, struct Menu *menu, CheckFlags checks)
Check the pre-requisites for a function.
Definition functions.c:3127
static const struct IndexFunction IndexFunctions[]
All the NeoMutt functions that the Index supports.
Definition functions.c:3176
A NeoMutt function.
Definition functions.h:54
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition functions.h:55
index_function_t function
Function to call.
Definition functions.h:56
int flags
Prerequisites for the function, e.g. CHECK_IN_MAILBOX.
Definition functions.h:57
Private state data for the Index.
struct Menu * menu
Menu controlling the index.
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
struct MuttWindow * parent
Parent Window.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_function_dispatcher()

int menu_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Menu function - Implements function_dispatcher_t -.

Definition at line 318 of file functions.c.

319{
320 if (!event || !win || !win->wdata)
321 return FR_UNKNOWN;
322
323 const int op = event->op;
324 struct Menu *menu = win->wdata;
325
326 int rc = FR_UNKNOWN;
327 for (size_t i = 0; MenuFunctions[i].op != OP_NULL; i++)
328 {
329 const struct MenuFunction *fn = &MenuFunctions[i];
330 if (fn->op == op)
331 {
332 rc = fn->function(menu, event);
333 break;
334 }
335 }
336
337 if (rc == FR_UNKNOWN) // Not our function
338 return rc;
339
340 const char *result = dispatcher_get_retval_name(rc);
341 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
342
343 return rc;
344}
static const struct MenuFunction MenuFunctions[]
All the NeoMutt functions that the Menu supports.
Definition functions.c:278
A NeoMutt function.
Definition functions.h:49
menu_function_t function
Function to call.
Definition functions.h:51
int op
Op code, e.g. OP_SEARCH.
Definition functions.h:50
struct MuttWindow * win
Window holding the Menu.
Definition lib.h:88
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ menu_tagging_dispatcher()

int menu_tagging_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform tagging operations on the Menu - Implements function_dispatcher_t -.

Definition at line 230 of file tagging.c.

231{
232 if (!win || !win->wdata || !event)
233 return FR_ERROR;
234
235 struct Menu *menu = win->wdata;
236 const int op = event->op;
237
238 switch (op)
239 {
240 case OP_END_COND:
241 return op_end_cond(menu, op);
242 case OP_TAG:
243 return op_tag(menu, op);
244 case OP_TAG_PREFIX:
245 return op_tag_prefix(menu, op);
246 case OP_TAG_PREFIX_COND:
247 return op_tag_prefix_cond(menu, op);
248 case OP_ABORT:
249 return menu_abort(menu);
250 case OP_TIMEOUT:
251 return menu_timeout(menu);
252 default:
253 return menu_other(menu);
254 }
255}
#define OP_TIMEOUT
1 second with no events
Definition opcodes.h:35
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Definition opcodes.h:36
static int menu_other(struct Menu *menu)
Some non-tagging operation occurred.
Definition tagging.c:220
static int menu_abort(struct Menu *menu)
User aborted an operation.
Definition tagging.c:197
static int op_tag(struct Menu *menu, int op)
Tag the current entry.
Definition tagging.c:86
static int op_end_cond(struct Menu *menu, int op)
End of conditional execution (noop)
Definition tagging.c:73
static int op_tag_prefix_cond(struct Menu *menu, int op)
Apply next function ONLY to tagged messages.
Definition tagging.c:172
static int op_tag_prefix(struct Menu *menu, int op)
Apply next function to tagged messages.
Definition tagging.c:146
static int menu_timeout(struct Menu *menu)
Timeout waiting for a keypress.
Definition tagging.c:209
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gpgme_function_dispatcher()

int gpgme_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Gpgme function - Implements function_dispatcher_t -.

Definition at line 857 of file gpgme_functions.c.

858{
859 // The Dispatcher may be called on any Window in the Dialog
860 struct MuttWindow *dlg = dialog_find(win);
861 if (!event || !dlg || !dlg->wdata)
862 return FR_ERROR;
863
864 const int op = event->op;
865 struct Menu *menu = dlg->wdata;
866 struct GpgmeData *gd = menu->mdata;
867 if (!gd)
868 return FR_ERROR;
869
870 int rc = FR_UNKNOWN;
871 for (size_t i = 0; GpgmeFunctions[i].op != OP_NULL; i++)
872 {
873 const struct GpgmeFunction *fn = &GpgmeFunctions[i];
874 if (fn->op == op)
875 {
876 rc = fn->function(gd, event);
877 break;
878 }
879 }
880
881 if (rc == FR_UNKNOWN) // Not our function
882 return rc;
883
884 const char *result = dispatcher_get_retval_name(rc);
885 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
886
887 return rc;
888}
static const struct GpgmeFunction GpgmeFunctions[]
All the NeoMutt functions that the Gpgme supports.
Data to pass to the Gpgme Functions.
struct Menu * menu
Gpgme Menu.
A NeoMutt function.
gpgme_function_t function
Function to call.
int op
Op code, e.g. OP_GENERIC_SELECT_ENTRY.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pgp_function_dispatcher()

int pgp_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Pgp function - Implements function_dispatcher_t -.

Definition at line 222 of file pgp_functions.c.

223{
224 // The Dispatcher may be called on any Window in the Dialog
225 struct MuttWindow *dlg = dialog_find(win);
226 if (!event || !dlg || !dlg->wdata)
227 return FR_ERROR;
228
229 const int op = event->op;
230 struct Menu *menu = dlg->wdata;
231 struct PgpData *pd = menu->mdata;
232 if (!pd)
233 return FR_ERROR;
234
235 int rc = FR_UNKNOWN;
236 for (size_t i = 0; PgpFunctions[i].op != OP_NULL; i++)
237 {
238 const struct PgpFunction *fn = &PgpFunctions[i];
239 if (fn->op == op)
240 {
241 rc = fn->function(pd, event);
242 break;
243 }
244 }
245
246 if (rc == FR_UNKNOWN) // Not our function
247 return rc;
248
249 const char *result = dispatcher_get_retval_name(rc);
250 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
251
252 return rc;
253}
static const struct PgpFunction PgpFunctions[]
All the NeoMutt functions that the Pgp supports.
Data to pass to the Pgp Functions.
struct Menu * menu
Pgp Menu.
A NeoMutt function.
int op
Op code, e.g. OP_GENERIC_SELECT_ENTRY.
pgp_function_t function
Function to call.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ smime_function_dispatcher()

int smime_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Smime function - Implements function_dispatcher_t -.

Definition at line 110 of file smime_functions.c.

111{
112 // The Dispatcher may be called on any Window in the Dialog
113 struct MuttWindow *dlg = dialog_find(win);
114 if (!event || !dlg || !dlg->wdata)
115 return FR_ERROR;
116
117 const int op = event->op;
118 struct Menu *menu = dlg->wdata;
119 struct SmimeData *sd = menu->mdata;
120 if (!sd)
121 return FR_ERROR;
122
123 int rc = FR_UNKNOWN;
124 for (size_t i = 0; SmimeFunctions[i].op != OP_NULL; i++)
125 {
126 const struct SmimeFunction *fn = &SmimeFunctions[i];
127 if (fn->op == op)
128 {
129 rc = fn->function(sd, event);
130 break;
131 }
132 }
133
134 if (rc == FR_UNKNOWN) // Not our function
135 return rc;
136
137 const char *result = dispatcher_get_retval_name(rc);
138 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
139
140 return rc;
141}
static const struct SmimeFunction SmimeFunctions[]
All the NeoMutt functions that the Smime supports.
Data to pass to the Smime Functions.
struct Menu * menu
Smime Menu.
A NeoMutt function.
smime_function_t function
Function to call.
int op
Op code, e.g. OP_GENERIC_SELECT_ENTRY.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pager_function_dispatcher()

int pager_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Pager function - Implements function_dispatcher_t -.

Definition at line 1144 of file functions.c.

1145{
1146 if (!win || !event)
1147 {
1149 return FR_ERROR;
1150 }
1151
1152 struct PagerPrivateData *priv = win->parent->wdata;
1153 if (!priv)
1154 return FR_ERROR;
1155
1156 struct MuttWindow *dlg = dialog_find(win);
1157 if (!dlg || !dlg->wdata)
1158 return FR_ERROR;
1159
1160 const int op = event->op;
1161 int rc = FR_UNKNOWN;
1162 for (size_t i = 0; PagerFunctions[i].op != OP_NULL; i++)
1163 {
1164 const struct PagerFunction *fn = &PagerFunctions[i];
1165 if (fn->op == op)
1166 {
1167 struct IndexSharedData *shared = dlg->wdata;
1168 rc = fn->function(shared, priv, event);
1169 break;
1170 }
1171 }
1172
1173 if (rc == FR_UNKNOWN) // Not our function
1174 return rc;
1175
1176 const char *result = dispatcher_get_retval_name(rc);
1177 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
1178
1179 return rc;
1180}
#define mutt_error(...)
Definition logging2.h:94
#define _(a)
Definition message.h:28
static const char * Not_available_in_this_menu
Error message for unavailable functions.
Definition functions.c:61
static const struct PagerFunction PagerFunctions[]
All the NeoMutt functions that the Pager supports.
Definition functions.c:1115
A NeoMutt function.
Definition functions.h:55
pager_function_t function
Function to call.
Definition functions.h:57
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition functions.h:56
Private state data for the Pager.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pattern_function_dispatcher()

int pattern_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Pattern function - Implements function_dispatcher_t -.

Definition at line 83 of file functions.c.

84{
85 // The Dispatcher may be called on any Window in the Dialog
86 struct MuttWindow *dlg = dialog_find(win);
87 if (!event || !dlg || !dlg->wdata)
88 return FR_ERROR;
89
90 const int op = event->op;
91 struct Menu *menu = dlg->wdata;
92 struct PatternData *pd = menu->mdata;
93 if (!pd)
94 return FR_ERROR;
95
96 int rc = FR_UNKNOWN;
97 for (size_t i = 0; PatternFunctions[i].op != OP_NULL; i++)
98 {
99 const struct PatternFunction *fn = &PatternFunctions[i];
100 if (fn->op == op)
101 {
102 rc = fn->function(pd, event);
103 break;
104 }
105 }
106
107 if (rc == FR_UNKNOWN) // Not our function
108 return rc;
109
110 const char *result = dispatcher_get_retval_name(rc);
111 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
112
113 return rc;
114}
static const struct PatternFunction PatternFunctions[]
All the NeoMutt functions that the Pattern supports.
Definition functions.c:71
Data to pass to the Pattern Functions.
struct Menu * menu
Pattern Menu.
A NeoMutt function.
Definition functions.h:50
int op
Op code, e.g. OP_GENERIC_SELECT_ENTRY.
Definition functions.h:51
pattern_function_t function
Function to call.
Definition functions.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ postpone_function_dispatcher()

int postpone_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Postpone function - Implements function_dispatcher_t -.

Definition at line 190 of file functions.c.

191{
192 // The Dispatcher may be called on any Window in the Dialog
193 struct MuttWindow *dlg = dialog_find(win);
194 if (!event || !dlg || !dlg->wdata)
195 return FR_ERROR;
196
197 const int op = event->op;
198 struct Menu *menu = dlg->wdata;
199 struct PostponeData *pd = menu->mdata;
200 if (!pd)
201 return FR_ERROR;
202
203 int rc = FR_UNKNOWN;
204 for (size_t i = 0; PostponeFunctions[i].op != OP_NULL; i++)
205 {
206 const struct PostponeFunction *fn = &PostponeFunctions[i];
207 if (fn->op == op)
208 {
209 rc = fn->function(pd, event);
210 break;
211 }
212 }
213
214 if (rc == FR_UNKNOWN) // Not our function
215 return rc;
216
217 const char *result = dispatcher_get_retval_name(rc);
218 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
219
220 return rc;
221}
static const struct PostponeFunction PostponeFunctions[]
All the NeoMutt functions that the Postpone supports.
Definition functions.c:173
Data to pass to the Postpone Functions.
Definition functions.h:35
struct Menu * menu
Postponed Menu.
Definition functions.h:37
A NeoMutt function.
Definition functions.h:62
postpone_function_t function
Function to call.
Definition functions.h:64
int op
Op code, e.g. OP_DELETE.
Definition functions.h:63
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sb_function_dispatcher()

int sb_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Sidebar function - Implements function_dispatcher_t -.

Definition at line 422 of file functions.c.

423{
424 if (!event || !win || !win->wdata)
425 return FR_UNKNOWN;
426
427 const int op = event->op;
428 struct SidebarWindowData *wdata = win->wdata;
429 int rc = FR_UNKNOWN;
430 for (size_t i = 0; SidebarFunctions[i].op != OP_NULL; i++)
431 {
432 const struct SidebarFunction *fn = &SidebarFunctions[i];
433 if (fn->op == op)
434 {
435 rc = fn->function(wdata, event);
436 break;
437 }
438 }
439
440 if (rc == FR_UNKNOWN) // Not our function
441 return rc;
442
443 const char *result = dispatcher_get_retval_name(rc);
444 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
445
446 return FR_SUCCESS; // Whatever the outcome, we handled it
447}
static const struct SidebarFunction SidebarFunctions[]
All the NeoMutt functions that the Sidebar supports.
Definition functions.c:402
A NeoMutt function.
Definition functions.h:49
int op
Op code, e.g. OP_SIDEBAR_NEXT.
Definition functions.h:50
sidebar_function_t function
Function to call.
Definition functions.h:51
Sidebar private Window data -.
Definition private.h:87
struct MuttWindow * win
Sidebar Window.
Definition private.h:88
+ Here is the call graph for this function:
+ Here is the caller graph for this function: