NeoMutt
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.
 
 Mixmaster Function API
 Prototype for a Mixmaster 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 mix_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Mixmaster function - 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 417 of file functions.c.

418{
419 if (!win || !win->wdata)
420 return FR_UNKNOWN;
421
422 struct Menu *menu = win->wdata;
423 struct AliasMenuData *mdata = menu->mdata;
424 int rc = FR_UNKNOWN;
425 for (size_t i = 0; AliasFunctions[i].op != OP_NULL; i++)
426 {
427 const struct AliasFunction *fn = &AliasFunctions[i];
428 if (fn->op == op)
429 {
430 rc = fn->function(mdata, op);
431 break;
432 }
433 }
434
435 if (rc == FR_UNKNOWN) // Not our function
436 return rc;
437
438 const char *result = dispatcher_get_retval_name(rc);
439 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
440
441 return rc;
442}
static const struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
Definition: functions.c:393
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
#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:52
struct Menu * menu
Menu.
Definition: gui.h:56
Definition: lib.h:70
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:77
void * mdata
Private data.
Definition: lib.h:137
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 727 of file functions.c.

728{
729 if (!win)
730 {
732 return FR_ERROR;
733 }
734
735 struct Menu *menu = win->wdata;
736 struct AttachPrivateData *priv = menu->mdata;
737 if (!priv)
738 return FR_ERROR;
739
740 int rc = FR_UNKNOWN;
741 for (size_t i = 0; AttachFunctions[i].op != OP_NULL; i++)
742 {
743 const struct AttachFunction *fn = &AttachFunctions[i];
744 if (fn->op == op)
745 {
746 rc = fn->function(priv, op);
747 break;
748 }
749 }
750
751 return rc;
752}
static const char * Not_available_in_this_menu
Error message for unavailable functions.
Definition: functions.c:55
static const struct AttachFunction AttachFunctions[]
All the NeoMutt functions that the Attach supports.
Definition: functions.c:686
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
#define mutt_error(...)
Definition: logging2.h:92
#define _(a)
Definition: message.h:28
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:35
struct Menu * menu
Current Menu.
Definition: private_data.h:36
+ 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 203 of file functions.c.

204{
205 if (!win || !win->wdata)
206 return FR_UNKNOWN;
207
208 struct MuttWindow *dlg = dialog_find(win);
209 if (!dlg)
210 return FR_ERROR;
211
212 struct AutocryptData *ad = dlg->wdata;
213
214 int rc = FR_UNKNOWN;
215 for (size_t i = 0; AutocryptFunctions[i].op != OP_NULL; i++)
216 {
217 const struct AutocryptFunction *fn = &AutocryptFunctions[i];
218 if (fn->op == op)
219 {
220 rc = fn->function(ad, op);
221 break;
222 }
223 }
224
225 if (rc == FR_UNKNOWN) // Not our function
226 return rc;
227
228 const char *result = dispatcher_get_retval_name(rc);
229 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
230
231 return rc;
232}
static const struct AutocryptFunction AutocryptFunctions[]
All the NeoMutt functions that the Autocrypt supports.
Definition: functions.c:189
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition: dialog.c:89
Data to pass to the Autocrypt Functions.
Definition: functions.h:34
A NeoMutt function.
Definition: functions.h:55
autocrypt_function_t function
Function to call.
Definition: functions.h:57
int op
Op code, e.g. OP_AUTOCRYPT_CREATE_ACCT.
Definition: functions.h:56
+ 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 2118 of file functions.c.

2119{
2120 if (!win)
2121 return FR_UNKNOWN;
2122
2123 struct MuttWindow *dlg = dialog_find(win);
2124 if (!dlg || !dlg->wdata)
2125 return FR_UNKNOWN;
2126
2127 int rc = FR_UNKNOWN;
2128 for (size_t i = 0; ComposeFunctions[i].op != OP_NULL; i++)
2129 {
2130 const struct ComposeFunction *fn = &ComposeFunctions[i];
2131 if (fn->op == op)
2132 {
2133 struct ComposeSharedData *shared = dlg->wdata;
2134 rc = fn->function(shared, op);
2135 break;
2136 }
2137 }
2138
2139 if (rc == FR_UNKNOWN) // Not our function
2140 return rc;
2141
2142 const char *result = dispatcher_get_retval_name(rc);
2143 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
2144
2145 return rc;
2146}
static const struct ComposeFunction ComposeFunctions[]
All the NeoMutt functions that the Compose supports.
Definition: functions.c:2069
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:33
int rc
Return code to leave compose.
Definition: shared_data.h:43
+ 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:59
int op
Op code, e.g. OP_SEARCH.
Definition: functions.h:60
enter_function_t function
Function to call.
Definition: functions.h:61
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 559 of file functions.c.

560{
561 if (!win || !win->wdata)
562 return FR_UNKNOWN;
563
564 int rc = FR_UNKNOWN;
565 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
566 {
567 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
568 if (fn->op == op)
569 {
570 struct EnvelopeWindowData *wdata = win->wdata;
571 rc = fn->function(wdata, op);
572 break;
573 }
574 }
575
576 if (rc == FR_UNKNOWN) // Not our function
577 return rc;
578
579 const char *result = dispatcher_get_retval_name(rc);
580 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
581
582 return rc;
583}
static const struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:526
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 166 of file global.c.

167{
168 int rc = FR_UNKNOWN;
169 for (size_t i = 0; GlobalFunctions[i].op != OP_NULL; i++)
170 {
171 const struct GlobalFunction *fn = &GlobalFunctions[i];
172 if (fn->op == op)
173 {
174 rc = fn->function(op);
175 break;
176 }
177 }
178
179 if (rc == FR_UNKNOWN) // Not our function
180 return rc;
181
182 const char *result = dispatcher_get_retval_name(rc);
183 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
184
185 return FR_SUCCESS; // Whatever the outcome, we handled it
186}
@ 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:148
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 75 of file functions.c.

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

3297{
3298 if (!win)
3299 {
3301 return FR_ERROR;
3302 }
3303
3304 struct MuttWindow *dlg = dialog_find(win);
3305 if (!dlg || !dlg->wdata || !win->parent || !win->parent->wdata)
3306 return FR_ERROR;
3307
3308 struct IndexPrivateData *priv = win->parent->wdata;
3309 struct IndexSharedData *shared = dlg->wdata;
3310
3311 int rc = FR_UNKNOWN;
3312 for (size_t i = 0; IndexFunctions[i].op != OP_NULL; i++)
3313 {
3314 const struct IndexFunction *fn = &IndexFunctions[i];
3315 if (fn->op == op)
3316 {
3317 if (!prereq(shared, priv->menu, fn->flags))
3318 {
3319 rc = FR_ERROR;
3320 break;
3321 }
3322 rc = fn->function(shared, priv, op);
3323 break;
3324 }
3325 }
3326
3327 if (rc == FR_UNKNOWN) // Not our function
3328 return rc;
3329
3330 const char *result = dispatcher_get_retval_name(rc);
3331 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
3332
3333 return rc;
3334}
static bool prereq(struct IndexSharedData *shared, struct Menu *menu, CheckFlags checks)
Check the pre-requisites for a function.
Definition: functions.c:3097
static const struct IndexFunction IndexFunctions[]
All the NeoMutt functions that the Index supports.
Definition: functions.c:3146
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:42
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 317 of file functions.c.

318{
319 if (!win || !win->wdata)
320 return FR_UNKNOWN;
321
322 struct Menu *menu = win->wdata;
323
324 int rc = FR_UNKNOWN;
325 for (size_t i = 0; MenuFunctions[i].op != OP_NULL; i++)
326 {
327 const struct MenuFunction *fn = &MenuFunctions[i];
328 if (fn->op == op)
329 {
330 rc = fn->function(menu, op);
331 break;
332 }
333 }
334
335 if (rc == FR_UNKNOWN) // Not our function
336 return rc;
337
338 const char *result = dispatcher_get_retval_name(rc);
339 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
340
341 return rc;
342}
static const struct MenuFunction MenuFunctions[]
All the NeoMutt functions that the Menu supports.
Definition: functions.c:277
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
+ 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:34
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Definition: opcodes.h:35
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:

◆ mix_function_dispatcher()

int mix_function_dispatcher ( struct MuttWindow win,
int  op 
)

Perform a Mixmaster function - Implements function_dispatcher_t -.

Definition at line 183 of file functions.c.

184{
185 if (!win || !win->wdata)
186 return FR_UNKNOWN;
187
188 struct MixmasterPrivateData *priv = win->wdata;
189 int rc = FR_UNKNOWN;
190 for (size_t i = 0; MixmasterFunctions[i].op != OP_NULL; i++)
191 {
192 const struct MixmasterFunction *fn = &MixmasterFunctions[i];
193 if (fn->op == op)
194 {
195 rc = fn->function(priv, op);
196 break;
197 }
198 }
199
200 if (rc == FR_UNKNOWN) // Not our function
201 return rc;
202
203 const char *result = dispatcher_get_retval_name(rc);
204 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
205
206 return rc;
207}
static const struct MixmasterFunction MixmasterFunctions[]
All the NeoMutt functions that the Mixmaster supports.
Definition: functions.c:166
A NeoMutt function.
Definition: functions.h:45
mixmaster_function_t function
Function to call.
Definition: functions.h:47
int op
Op code, e.g. OP_MIX_USE.
Definition: functions.h:46
Private state data for the Mixmaster.
Definition: private_data.h:30
+ 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 828 of file gpgme_functions.c.

829{
830 if (!win || !win->wdata)
831 return FR_UNKNOWN;
832
833 struct MuttWindow *dlg = dialog_find(win);
834 if (!dlg)
835 return FR_ERROR;
836
837 struct GpgmeData *gd = dlg->wdata;
838
839 int rc = FR_UNKNOWN;
840 for (size_t i = 0; GpgmeFunctions[i].op != OP_NULL; i++)
841 {
842 const struct GpgmeFunction *fn = &GpgmeFunctions[i];
843 if (fn->op == op)
844 {
845 rc = fn->function(gd, op);
846 break;
847 }
848 }
849
850 if (rc == FR_UNKNOWN) // Not our function
851 return rc;
852
853 const char *result = dispatcher_get_retval_name(rc);
854 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
855
856 return rc;
857}
static const struct GpgmeFunction GpgmeFunctions[]
All the NeoMutt functions that the Gpgme supports.
Data to pass to the Gpgme Functions.
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 207 of file pgp_functions.c.

208{
209 if (!win || !win->wdata)
210 return FR_UNKNOWN;
211
212 struct MuttWindow *dlg = dialog_find(win);
213 if (!dlg)
214 return FR_ERROR;
215
216 struct PgpData *pd = dlg->wdata;
217
218 int rc = FR_UNKNOWN;
219 for (size_t i = 0; PgpFunctions[i].op != OP_NULL; i++)
220 {
221 const struct PgpFunction *fn = &PgpFunctions[i];
222 if (fn->op == op)
223 {
224 rc = fn->function(pd, op);
225 break;
226 }
227 }
228
229 if (rc == FR_UNKNOWN) // Not our function
230 return rc;
231
232 const char *result = dispatcher_get_retval_name(rc);
233 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
234
235 return rc;
236}
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
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 106 of file smime_functions.c.

107{
108 if (!win || !win->wdata)
109 return FR_UNKNOWN;
110
111 struct MuttWindow *dlg = dialog_find(win);
112 if (!dlg)
113 return FR_ERROR;
114
115 struct SmimeData *sd = dlg->wdata;
116
117 int rc = FR_UNKNOWN;
118 for (size_t i = 0; SmimeFunctions[i].op != OP_NULL; i++)
119 {
120 const struct SmimeFunction *fn = &SmimeFunctions[i];
121 if (fn->op == op)
122 {
123 rc = fn->function(sd, op);
124 break;
125 }
126 }
127
128 if (rc == FR_UNKNOWN) // Not our function
129 return rc;
130
131 const char *result = dispatcher_get_retval_name(rc);
132 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
133
134 return rc;
135}
static const struct SmimeFunction SmimeFunctions[]
All the NeoMutt functions that the Smime supports.
Data to pass to the Smime Functions.
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 1077 of file functions.c.

1078{
1079 if (!win)
1080 {
1082 return FR_ERROR;
1083 }
1084
1085 struct PagerPrivateData *priv = win->parent->wdata;
1086 if (!priv)
1087 return FR_ERROR;
1088
1089 struct MuttWindow *dlg = dialog_find(win);
1090 if (!dlg || !dlg->wdata)
1091 return FR_ERROR;
1092
1093 int rc = FR_UNKNOWN;
1094 for (size_t i = 0; PagerFunctions[i].op != OP_NULL; i++)
1095 {
1096 const struct PagerFunction *fn = &PagerFunctions[i];
1097 if (fn->op == op)
1098 {
1099 struct IndexSharedData *shared = dlg->wdata;
1100 rc = fn->function(shared, priv, op);
1101 break;
1102 }
1103 }
1104
1105 if (rc == FR_UNKNOWN) // Not our function
1106 return rc;
1107
1108 const char *result = dispatcher_get_retval_name(rc);
1109 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
1110
1111 return rc;
1112}
static const struct PagerFunction PagerFunctions[]
All the NeoMutt functions that the Pager supports.
Definition: functions.c:1049
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 77 of file functions.c.

78{
79 if (!win || !win->wdata)
80 return FR_UNKNOWN;
81
82 struct MuttWindow *dlg = dialog_find(win);
83 if (!dlg)
84 return FR_ERROR;
85
86 struct PatternData *pd = dlg->wdata;
87
88 int rc = FR_UNKNOWN;
89 for (size_t i = 0; PatternFunctions[i].op != OP_NULL; i++)
90 {
91 const struct PatternFunction *fn = &PatternFunctions[i];
92 if (fn->op == op)
93 {
94 rc = fn->function(pd, 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 PatternFunction PatternFunctions[]
All the NeoMutt functions that the Pattern supports.
Definition: functions.c:66
Data to pass to the Pattern Functions.
Definition: functions.h:35
A NeoMutt function.
Definition: functions.h:59
int op
Op code, e.g. OP_GENERIC_SELECT_ENTRY.
Definition: functions.h:60
pattern_function_t function
Function to call.
Definition: functions.h:61
+ 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 176 of file functions.c.

177{
178 if (!win || !win->wdata)
179 return FR_UNKNOWN;
180
181 struct MuttWindow *dlg = dialog_find(win);
182 if (!dlg)
183 return FR_ERROR;
184
185 struct PostponeData *pd = dlg->wdata;
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:159
Data to pass to the Postpone Functions.
Definition: functions.h:34
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 374 of file functions.c.

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