NeoMutt  2024-11-14-34-g5aaf0d
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.
 
 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 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 462 of file functions.c.

463{
464 // The Dispatcher may be called on any Window in the Dialog
465 struct MuttWindow *dlg = dialog_find(win);
466 if (!dlg || !dlg->wdata)
467 return FR_ERROR;
468
469 struct Menu *menu = dlg->wdata;
470 struct AliasMenuData *mdata = menu->mdata;
471
472 int rc = FR_UNKNOWN;
473 for (size_t i = 0; AliasFunctions[i].op != OP_NULL; i++)
474 {
475 const struct AliasFunction *fn = &AliasFunctions[i];
476 if (fn->op == op)
477 {
478 rc = fn->function(mdata, op);
479 break;
480 }
481 }
482
483 if (rc == FR_UNKNOWN) // Not our function
484 return rc;
485
486 const char *result = dispatcher_get_retval_name(rc);
487 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
488
489 return rc;
490}
static const struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
Definition: functions.c:436
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:144
+ 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 213 of file functions.c.

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

2137{
2138 // The Dispatcher may be called on any Window in the Dialog
2139 struct MuttWindow *dlg = dialog_find(win);
2140 if (!dlg || !dlg->wdata)
2141 return FR_ERROR;
2142
2143 int rc = FR_UNKNOWN;
2144 for (size_t i = 0; ComposeFunctions[i].op != OP_NULL; i++)
2145 {
2146 const struct ComposeFunction *fn = &ComposeFunctions[i];
2147 if (fn->op == op)
2148 {
2149 struct ComposeSharedData *shared = dlg->wdata;
2150 rc = fn->function(shared, op);
2151 break;
2152 }
2153 }
2154
2155 if (rc == FR_UNKNOWN) // Not our function
2156 return rc;
2157
2158 const char *result = dispatcher_get_retval_name(rc);
2159 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
2160
2161 return rc;
2162}
static const struct ComposeFunction ComposeFunctions[]
All the NeoMutt functions that the Compose supports.
Definition: functions.c:2084
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:35
int rc
Return code to leave compose.
Definition: shared_data.h:44
+ 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 78 of file functions.c.

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

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

1126{
1127 if (!win)
1128 {
1130 return FR_ERROR;
1131 }
1132
1133 struct PagerPrivateData *priv = win->parent->wdata;
1134 if (!priv)
1135 return FR_ERROR;
1136
1137 struct MuttWindow *dlg = dialog_find(win);
1138 if (!dlg || !dlg->wdata)
1139 return FR_ERROR;
1140
1141 int rc = FR_UNKNOWN;
1142 for (size_t i = 0; PagerFunctions[i].op != OP_NULL; i++)
1143 {
1144 const struct PagerFunction *fn = &PagerFunctions[i];
1145 if (fn->op == op)
1146 {
1147 struct IndexSharedData *shared = dlg->wdata;
1148 rc = fn->function(shared, priv, op);
1149 break;
1150 }
1151 }
1152
1153 if (rc == FR_UNKNOWN) // Not our function
1154 return rc;
1155
1156 const char *result = dispatcher_get_retval_name(rc);
1157 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
1158
1159 return rc;
1160}
#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:1096
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: