NeoMutt  2024-12-12-14-g7b49f7
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:

Modules

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

Detailed Description

Prototype for a Function Dispatcher.

Perform a NeoMutt function

Parameters
winWindow
opOperation to perform, e.g. OP_MAIN_LIMIT
Return values
numFunctionRetval

Function Documentation

◆ alias_function_dispatcher()

int alias_function_dispatcher ( struct MuttWindow win,
int  op 
)

Perform a Alias function - Implements function_dispatcher_t -.

Definition at line 467 of file functions.c.

468{
469 // The Dispatcher may be called on any Window in the Dialog
470 struct MuttWindow *dlg = dialog_find(win);
471 if (!dlg || !dlg->wdata)
472 return FR_ERROR;
473
474 struct Menu *menu = dlg->wdata;
475 struct AliasMenuData *mdata = menu->mdata;
476
477 int rc = FR_UNKNOWN;
478 for (size_t i = 0; AliasFunctions[i].op != OP_NULL; i++)
479 {
480 const struct AliasFunction *fn = &AliasFunctions[i];
481 if (fn->op == op)
482 {
483 rc = fn->function(mdata, op);
484 break;
485 }
486 }
487
488 if (rc == FR_UNKNOWN) // Not our function
489 return rc;
490
491 const char *result = dispatcher_get_retval_name(rc);
492 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
493
494 return rc;
495}
static const struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
Definition: functions.c:441
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:33
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:48
#define NONULL(x)
Definition: string2.h:37
A NeoMutt function.
Definition: functions.h:52
int op
Op code, e.g. OP_SEARCH.
Definition: functions.h:53
alias_function_t function
Function to call.
Definition: functions.h:54
AliasView array wrapper with Pattern information -.
Definition: gui.h:54
struct Menu * menu
Menu.
Definition: gui.h:58
Definition: lib.h:79
void * mdata
Private data.
Definition: lib.h:147
void * wdata
Private data.
Definition: mutt_window.h:145
+ 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,
int  op 
)

Perform a Attach function - Implements function_dispatcher_t -.

Definition at line 711 of file functions.c.

712{
713 // The Dispatcher may be called on any Window in the Dialog
714 struct MuttWindow *dlg = dialog_find(win);
715 if (!dlg || !dlg->wdata)
716 return FR_ERROR;
717
718 struct Menu *menu = dlg->wdata;
719 struct AttachPrivateData *priv = menu->mdata;
720 if (!priv)
721 return FR_ERROR;
722
723 int rc = FR_UNKNOWN;
724 for (size_t i = 0; AttachFunctions[i].op != OP_NULL; i++)
725 {
726 const struct AttachFunction *fn = &AttachFunctions[i];
727 if (fn->op == op)
728 {
729 rc = fn->function(priv, op);
730 break;
731 }
732 }
733
734 return rc;
735}
static const struct AttachFunction AttachFunctions[]
All the NeoMutt functions that the Attach supports.
Definition: functions.c:674
A NeoMutt function.
Definition: functions.h:45
attach_function_t function
Function to call.
Definition: functions.h:47
int op
Op code, e.g. OP_ATTACHMENT_COLLAPSE.
Definition: functions.h:46
Private state data for Attachments.
Definition: private_data.h:36
struct Menu * menu
Current Menu.
Definition: private_data.h:37
+ 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,
int  op 
)

Perform a Autocrypt function - Implements function_dispatcher_t -.

Definition at line 214 of file functions.c.

215{
216 // The Dispatcher may be called on any Window in the Dialog
217 struct MuttWindow *dlg = dialog_find(win);
218 if (!dlg || !dlg->wdata)
219 return FR_ERROR;
220
221 struct Menu *menu = dlg->wdata;
222 struct AutocryptData *ad = menu->mdata;
223
224 int rc = FR_UNKNOWN;
225 for (size_t i = 0; AutocryptFunctions[i].op != OP_NULL; i++)
226 {
227 const struct AutocryptFunction *fn = &AutocryptFunctions[i];
228 if (fn->op == op)
229 {
230 rc = fn->function(ad, op);
231 break;
232 }
233 }
234
235 if (rc == FR_UNKNOWN) // Not our function
236 return rc;
237
238 const char *result = dispatcher_get_retval_name(rc);
239 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
240
241 return rc;
242}
static const struct AutocryptFunction AutocryptFunctions[]
All the NeoMutt functions that the Autocrypt supports.
Definition: functions.c:200
Data to pass to the Autocrypt Functions.
struct Menu * menu
Autocrypt Menu.
A NeoMutt function.
Definition: functions.h:45
autocrypt_function_t function
Function to call.
Definition: functions.h:47
int op
Op code, e.g. OP_AUTOCRYPT_CREATE_ACCT.
Definition: functions.h:46
+ 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,
int  op 
)

Perform a Compose function - Implements function_dispatcher_t -.

Definition at line 2143 of file functions.c.

2144{
2145 // The Dispatcher may be called on any Window in the Dialog
2146 struct MuttWindow *dlg = dialog_find(win);
2147 if (!dlg || !dlg->wdata)
2148 return FR_ERROR;
2149
2150 int rc = FR_UNKNOWN;
2151 for (size_t i = 0; ComposeFunctions[i].op != OP_NULL; i++)
2152 {
2153 const struct ComposeFunction *fn = &ComposeFunctions[i];
2154 if (fn->op == op)
2155 {
2156 struct ComposeSharedData *shared = dlg->wdata;
2157 rc = fn->function(shared, op);
2158 break;
2159 }
2160 }
2161
2162 if (rc == FR_UNKNOWN) // Not our function
2163 return rc;
2164
2165 const char *result = dispatcher_get_retval_name(rc);
2166 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
2167
2168 return rc;
2169}
static const struct ComposeFunction ComposeFunctions[]
All the NeoMutt functions that the Compose supports.
Definition: functions.c:2091
A NeoMutt function.
Definition: functions.h:45
int op
Op code, e.g. OP_COMPOSE_WRITE_MESSAGE.
Definition: functions.h:46
compose_function_t function
Function to call.
Definition: functions.h:47
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,
int  op 
)

Perform a preview function - Implements function_dispatcher_t -.

Definition at line 405 of file preview.c.

406{
407 if (!win || !win->wdata)
408 return FR_UNKNOWN;
409
410 int rc = FR_UNKNOWN;
411 for (size_t i = 0; PreviewFunctions[i].op != OP_NULL; i++)
412 {
413 const struct PreviewFunction *fn = &PreviewFunctions[i];
414 if (fn->op == op)
415 {
416 struct PreviewWindowData *wdata = win->wdata;
417 rc = fn->function(wdata, op);
418 break;
419 }
420 }
421
422 if (rc == FR_UNKNOWN) // Not our function
423 return rc;
424
425 const char *result = dispatcher_get_retval_name(rc);
426 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
427
428 return rc;
429}
static const struct PreviewFunction PreviewFunctions[]
All the functions that the preview window supports.
Definition: preview.c:394
A message preview function.
Definition: preview.c:102
int op
Op code, e.g. OP_NEXT_PAGE.
Definition: preview.c:103
preview_function_t function
Function to call.
Definition: preview.c:104
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,
int  op 
)

Perform an Enter function - Implements function_dispatcher_t -.

Definition at line 482 of file functions.c.

483{
484 if (!win || !win->wdata)
485 return FR_UNKNOWN;
486
487 struct EnterWindowData *wdata = win->wdata;
488
489 int rc = FR_UNKNOWN;
490 for (size_t i = 0; EnterFunctions[i].op != OP_NULL; i++)
491 {
492 const struct EnterFunction *fn = &EnterFunctions[i];
493 if (fn->op == op)
494 {
495 rc = fn->function(wdata, op);
496 break;
497 }
498 }
499
500 if (rc == FR_UNKNOWN) // Not our function
501 return rc;
502
503 const char *result = dispatcher_get_retval_name(rc);
504 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
505
506 return rc;
507}
static const struct EnterFunction EnterFunctions[]
All the NeoMutt functions that Enter supports.
Definition: functions.c:447
A NeoMutt function.
Definition: functions.h:48
int op
Op code, e.g. OP_SEARCH.
Definition: functions.h:49
enter_function_t function
Function to call.
Definition: functions.h:50
Data to fill the Enter Window.
Definition: wdata.h:46
+ 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,
int  op 
)

Perform an Envelope function - Implements function_dispatcher_t -.

Definition at line 530 of file functions.c.

531{
532 if (!win || !win->wdata)
533 return FR_UNKNOWN;
534
535 int rc = FR_UNKNOWN;
536 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
537 {
538 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
539 if (fn->op == op)
540 {
541 struct EnvelopeWindowData *wdata = win->wdata;
542 rc = fn->function(wdata, op);
543 break;
544 }
545 }
546
547 if (rc == FR_UNKNOWN) // Not our function
548 return rc;
549
550 const char *result = dispatcher_get_retval_name(rc);
551 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
552
553 return rc;
554}
static const struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:506
A NeoMutt Envelope function.
Definition: functions.h:44
int op
Op code, e.g. OP_ENVELOPE_EDIT_FROM.
Definition: functions.h:45
envelope_function_t function
Function to call.
Definition: functions.h:46
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,
int  op 
)

Perform a Global function - Implements function_dispatcher_t -.

Note
win is not used

Definition at line 172 of file global.c.

173{
174 int rc = FR_UNKNOWN;
175 for (size_t i = 0; GlobalFunctions[i].op != OP_NULL; i++)
176 {
177 const struct GlobalFunction *fn = &GlobalFunctions[i];
178 if (fn->op == op)
179 {
180 rc = fn->function(op);
181 break;
182 }
183 }
184
185 if (rc == FR_UNKNOWN) // Not our function
186 return rc;
187
188 const char *result = dispatcher_get_retval_name(rc);
189 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
190
191 return FR_SUCCESS; // Whatever the outcome, we handled it
192}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
static const struct GlobalFunction GlobalFunctions[]
All the NeoMutt functions that the Global supports.
Definition: global.c:154
A NeoMutt function.
Definition: global.h:43
global_function_t function
Function to call.
Definition: global.h:45
int op
Op code, e.g. OP_GLOBAL_NEXT.
Definition: global.h:44
+ 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,
int  op 
)

Perform a History function - Implements function_dispatcher_t -.

Definition at line 79 of file functions.c.

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

Perform an Index function - Implements function_dispatcher_t -.

Definition at line 3259 of file functions.c.

3260{
3261 // The Dispatcher may be called on any Window in the Dialog
3262 struct MuttWindow *dlg = dialog_find(win);
3263 if (!dlg || !dlg->wdata || !win->parent || !win->parent->wdata)
3264 return FR_ERROR;
3265
3266 struct IndexPrivateData *priv = win->parent->wdata;
3267 struct IndexSharedData *shared = dlg->wdata;
3268
3269 int rc = FR_UNKNOWN;
3270 for (size_t i = 0; IndexFunctions[i].op != OP_NULL; i++)
3271 {
3272 const struct IndexFunction *fn = &IndexFunctions[i];
3273 if (fn->op == op)
3274 {
3275 if (!prereq(shared, priv->menu, fn->flags))
3276 {
3277 rc = FR_ERROR;
3278 break;
3279 }
3280 rc = fn->function(shared, priv, op);
3281 break;
3282 }
3283 }
3284
3285 if (rc == FR_UNKNOWN) // Not our function
3286 return rc;
3287
3288 const char *result = dispatcher_get_retval_name(rc);
3289 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
3290
3291 return rc;
3292}
static bool prereq(struct IndexSharedData *shared, struct Menu *menu, CheckFlags checks)
Check the pre-requisites for a function.
Definition: functions.c:3065
static const struct IndexFunction IndexFunctions[]
All the NeoMutt functions that the Index supports.
Definition: functions.c:3114
A NeoMutt function.
Definition: functions.h:49
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition: functions.h:50
index_function_t function
Function to call.
Definition: functions.h:51
int flags
Prerequisites for the function, e.g. CHECK_IN_MAILBOX.
Definition: functions.h:52
Private state data for the Index.
Definition: private_data.h:35
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:41
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
+ 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,
int  op 
)

Perform a Menu function - Implements function_dispatcher_t -.

Definition at line 318 of file functions.c.

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

Perform tagging operations on the Menu - Implements function_dispatcher_t -.

Definition at line 230 of file tagging.c.

231{
232 struct Menu *menu = win->wdata;
233
234 switch (op)
235 {
236 case OP_END_COND:
237 return op_end_cond(menu, op);
238 case OP_TAG:
239 return op_tag(menu, op);
240 case OP_TAG_PREFIX:
241 return op_tag_prefix(menu, op);
242 case OP_TAG_PREFIX_COND:
243 return op_tag_prefix_cond(menu, op);
244 case OP_ABORT:
245 return menu_abort(menu);
246 case OP_TIMEOUT:
247 return menu_timeout(menu);
248 default:
249 return menu_other(menu);
250 }
251}
#define OP_TIMEOUT
1 second with no events
Definition: opcodes.h:36
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Definition: opcodes.h:37
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,
int  op 
)

Perform a Gpgme function - Implements function_dispatcher_t -.

Definition at line 856 of file gpgme_functions.c.

857{
858 // The Dispatcher may be called on any Window in the Dialog
859 struct MuttWindow *dlg = dialog_find(win);
860 if (!dlg || !dlg->wdata)
861 return FR_ERROR;
862
863 struct Menu *menu = dlg->wdata;
864 struct GpgmeData *gd = menu->mdata;
865
866 int rc = FR_UNKNOWN;
867 for (size_t i = 0; GpgmeFunctions[i].op != OP_NULL; i++)
868 {
869 const struct GpgmeFunction *fn = &GpgmeFunctions[i];
870 if (fn->op == op)
871 {
872 rc = fn->function(gd, op);
873 break;
874 }
875 }
876
877 if (rc == FR_UNKNOWN) // Not our function
878 return rc;
879
880 const char *result = dispatcher_get_retval_name(rc);
881 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
882
883 return rc;
884}
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,
int  op 
)

Perform a Pgp function - Implements function_dispatcher_t -.

Definition at line 221 of file pgp_functions.c.

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

Perform a Smime function - Implements function_dispatcher_t -.

Definition at line 109 of file smime_functions.c.

110{
111 // The Dispatcher may be called on any Window in the Dialog
112 struct MuttWindow *dlg = dialog_find(win);
113 if (!dlg || !dlg->wdata)
114 return FR_ERROR;
115
116 struct Menu *menu = dlg->wdata;
117 struct SmimeData *sd = menu->mdata;
118
119 int rc = FR_UNKNOWN;
120 for (size_t i = 0; SmimeFunctions[i].op != OP_NULL; i++)
121 {
122 const struct SmimeFunction *fn = &SmimeFunctions[i];
123 if (fn->op == op)
124 {
125 rc = fn->function(sd, op);
126 break;
127 }
128 }
129
130 if (rc == FR_UNKNOWN) // Not our function
131 return rc;
132
133 const char *result = dispatcher_get_retval_name(rc);
134 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
135
136 return rc;
137}
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,
int  op 
)

Perform a Pager function - Implements function_dispatcher_t -.

Definition at line 1126 of file functions.c.

1127{
1128 if (!win)
1129 {
1131 return FR_ERROR;
1132 }
1133
1134 struct PagerPrivateData *priv = win->parent->wdata;
1135 if (!priv)
1136 return FR_ERROR;
1137
1138 struct MuttWindow *dlg = dialog_find(win);
1139 if (!dlg || !dlg->wdata)
1140 return FR_ERROR;
1141
1142 int rc = FR_UNKNOWN;
1143 for (size_t i = 0; PagerFunctions[i].op != OP_NULL; i++)
1144 {
1145 const struct PagerFunction *fn = &PagerFunctions[i];
1146 if (fn->op == op)
1147 {
1148 struct IndexSharedData *shared = dlg->wdata;
1149 rc = fn->function(shared, priv, op);
1150 break;
1151 }
1152 }
1153
1154 if (rc == FR_UNKNOWN) // Not our function
1155 return rc;
1156
1157 const char *result = dispatcher_get_retval_name(rc);
1158 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
1159
1160 return rc;
1161}
#define mutt_error(...)
Definition: logging2.h:92
#define _(a)
Definition: message.h:28
static const char * Not_available_in_this_menu
Error message for unavailable functions.
Definition: functions.c:62
static const struct PagerFunction PagerFunctions[]
All the NeoMutt functions that the Pager supports.
Definition: functions.c:1097
A NeoMutt function.
Definition: functions.h:50
pager_function_t function
Function to call.
Definition: functions.h:52
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition: functions.h:51
Private state data for the Pager.
Definition: private_data.h:41
+ 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,
int  op 
)

Perform a Pattern 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 (!dlg || !dlg->wdata)
86 return FR_ERROR;
87
88 struct Menu *menu = dlg->wdata;
89 struct PatternData *pd = menu->mdata;
90
91 int rc = FR_UNKNOWN;
92 for (size_t i = 0; PatternFunctions[i].op != OP_NULL; i++)
93 {
94 const struct PatternFunction *fn = &PatternFunctions[i];
95 if (fn->op == op)
96 {
97 rc = fn->function(pd, op);
98 break;
99 }
100 }
101
102 if (rc == FR_UNKNOWN) // Not our function
103 return rc;
104
105 const char *result = dispatcher_get_retval_name(rc);
106 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
107
108 return rc;
109}
static const struct PatternFunction PatternFunctions[]
All the NeoMutt functions that the Pattern supports.
Definition: functions.c:70
Data to pass to the Pattern Functions.
Definition: pattern_data.h:47
struct Menu * menu
Pattern Menu.
Definition: pattern_data.h:51
A NeoMutt function.
Definition: functions.h:46
int op
Op code, e.g. OP_GENERIC_SELECT_ENTRY.
Definition: functions.h:47
pattern_function_t function
Function to call.
Definition: functions.h:48
+ 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,
int  op 
)

Perform a Postpone function - Implements function_dispatcher_t -.

Definition at line 177 of file functions.c.

178{
179 // The Dispatcher may be called on any Window in the Dialog
180 struct MuttWindow *dlg = dialog_find(win);
181 if (!dlg || !dlg->wdata)
182 return FR_ERROR;
183
184 struct Menu *menu = dlg->wdata;
185 struct PostponeData *pd = menu->mdata;
186
187 int rc = FR_UNKNOWN;
188 for (size_t i = 0; PostponeFunctions[i].op != OP_NULL; i++)
189 {
190 const struct PostponeFunction *fn = &PostponeFunctions[i];
191 if (fn->op == op)
192 {
193 rc = fn->function(pd, op);
194 break;
195 }
196 }
197
198 if (rc == FR_UNKNOWN) // Not our function
199 return rc;
200
201 const char *result = dispatcher_get_retval_name(rc);
202 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
203
204 return rc;
205}
static const struct PostponeFunction PostponeFunctions[]
All the NeoMutt functions that the Postpone supports.
Definition: functions.c:160
Data to pass to the Postpone Functions.
Definition: functions.h:34
struct Menu * menu
Postponed Menu.
Definition: functions.h:36
A NeoMutt function.
Definition: functions.h:58
postpone_function_t function
Function to call.
Definition: functions.h:60
int op
Op code, e.g. OP_DELETE.
Definition: functions.h:59
+ 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,
int  op 
)

Perform a Sidebar function - Implements function_dispatcher_t -.

Definition at line 375 of file functions.c.

376{
377 if (!win || !win->wdata)
378 return FR_UNKNOWN;
379
380 struct SidebarWindowData *wdata = win->wdata;
381 int rc = FR_UNKNOWN;
382 for (size_t i = 0; SidebarFunctions[i].op != OP_NULL; i++)
383 {
384 const struct SidebarFunction *fn = &SidebarFunctions[i];
385 if (fn->op == op)
386 {
387 rc = fn->function(wdata, op);
388 break;
389 }
390 }
391
392 if (rc == FR_UNKNOWN) // Not our function
393 return rc;
394
395 const char *result = dispatcher_get_retval_name(rc);
396 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
397
398 return FR_SUCCESS; // Whatever the outcome, we handled it
399}
static const struct SidebarFunction SidebarFunctions[]
All the NeoMutt functions that the Sidebar supports.
Definition: functions.c:355
A NeoMutt function.
Definition: functions.h:44
int op
Op code, e.g. OP_SIDEBAR_NEXT.
Definition: functions.h:45
sidebar_function_t function
Function to call.
Definition: functions.h:46
Sidebar private Window data -.
Definition: private.h:88
struct MuttWindow * win
Sidebar Window.
Definition: private.h:89
+ Here is the call graph for this function:
+ Here is the caller graph for this function: