NeoMutt  2024-03-23-147-g885fbc
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 418 of file functions.c.

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

714{
715 if (!win)
716 {
718 return FR_ERROR;
719 }
720
721 struct Menu *menu = win->wdata;
722 struct AttachPrivateData *priv = menu->mdata;
723 if (!priv)
724 return FR_ERROR;
725
726 int rc = FR_UNKNOWN;
727 for (size_t i = 0; AttachFunctions[i].op != OP_NULL; i++)
728 {
729 const struct AttachFunction *fn = &AttachFunctions[i];
730 if (fn->op == op)
731 {
732 rc = fn->function(priv, op);
733 break;
734 }
735 }
736
737 return rc;
738}
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:676
@ 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:36
struct Menu * menu
Current Menu.
Definition: private_data.h:37
+ 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 2153 of file functions.c.

2154{
2155 if (!win)
2156 return FR_UNKNOWN;
2157
2158 struct MuttWindow *dlg = dialog_find(win);
2159 if (!dlg || !dlg->wdata)
2160 return FR_UNKNOWN;
2161
2162 int rc = FR_UNKNOWN;
2163 for (size_t i = 0; ComposeFunctions[i].op != OP_NULL; i++)
2164 {
2165 const struct ComposeFunction *fn = &ComposeFunctions[i];
2166 if (fn->op == op)
2167 {
2168 struct ComposeSharedData *shared = dlg->wdata;
2169 rc = fn->function(shared, op);
2170 break;
2171 }
2172 }
2173
2174 if (rc == FR_UNKNOWN) // Not our function
2175 return rc;
2176
2177 const char *result = dispatcher_get_retval_name(rc);
2178 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
2179
2180 return rc;
2181}
static const struct ComposeFunction ComposeFunctions[]
All the NeoMutt functions that the Compose supports.
Definition: functions.c:2101
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:45
+ 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 546 of file functions.c.

547{
548 if (!win || !win->wdata)
549 return FR_UNKNOWN;
550
551 int rc = FR_UNKNOWN;
552 for (size_t i = 0; EnvelopeFunctions[i].op != OP_NULL; i++)
553 {
554 const struct EnvelopeFunction *fn = &EnvelopeFunctions[i];
555 if (fn->op == op)
556 {
557 struct EnvelopeWindowData *wdata = win->wdata;
558 rc = fn->function(wdata, op);
559 break;
560 }
561 }
562
563 if (rc == FR_UNKNOWN) // Not our function
564 return rc;
565
566 const char *result = dispatcher_get_retval_name(rc);
567 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
568
569 return rc;
570}
static const struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:519
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 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 3256 of file functions.c.

3257{
3258 if (!win)
3259 {
3261 return FR_ERROR;
3262 }
3263
3264 struct MuttWindow *dlg = dialog_find(win);
3265 if (!dlg || !dlg->wdata || !win->parent || !win->parent->wdata)
3266 return FR_ERROR;
3267
3268 struct IndexPrivateData *priv = win->parent->wdata;
3269 struct IndexSharedData *shared = dlg->wdata;
3270
3271 int rc = FR_UNKNOWN;
3272 for (size_t i = 0; IndexFunctions[i].op != OP_NULL; i++)
3273 {
3274 const struct IndexFunction *fn = &IndexFunctions[i];
3275 if (fn->op == op)
3276 {
3277 if (!prereq(shared, priv->menu, fn->flags))
3278 {
3279 rc = FR_ERROR;
3280 break;
3281 }
3282 rc = fn->function(shared, priv, op);
3283 break;
3284 }
3285 }
3286
3287 if (rc == FR_UNKNOWN) // Not our function
3288 return rc;
3289
3290 const char *result = dispatcher_get_retval_name(rc);
3291 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
3292
3293 return rc;
3294}
static bool prereq(struct IndexSharedData *shared, struct Menu *menu, CheckFlags checks)
Check the pre-requisites for a function.
Definition: functions.c:3062
static const struct IndexFunction IndexFunctions[]
All the NeoMutt functions that the Index supports.
Definition: functions.c:3111
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
+ 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:

◆ 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 844 of file gpgme_functions.c.

845{
846 if (!win || !win->wdata)
847 return FR_UNKNOWN;
848
849 struct MuttWindow *dlg = dialog_find(win);
850 if (!dlg)
851 return FR_ERROR;
852
853 struct GpgmeData *gd = dlg->wdata;
854
855 int rc = FR_UNKNOWN;
856 for (size_t i = 0; GpgmeFunctions[i].op != OP_NULL; i++)
857 {
858 const struct GpgmeFunction *fn = &GpgmeFunctions[i];
859 if (fn->op == op)
860 {
861 rc = fn->function(gd, op);
862 break;
863 }
864 }
865
866 if (rc == FR_UNKNOWN) // Not our function
867 return rc;
868
869 const char *result = dispatcher_get_retval_name(rc);
870 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
871
872 return rc;
873}
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 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}
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 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 177 of file functions.c.

178{
179 if (!win || !win->wdata)
180 return FR_UNKNOWN;
181
182 struct MuttWindow *dlg = dialog_find(win);
183 if (!dlg)
184 return FR_ERROR;
185
186 struct PostponeData *pd = dlg->wdata;
187
188 int rc = FR_UNKNOWN;
189 for (size_t i = 0; PostponeFunctions[i].op != OP_NULL; i++)
190 {
191 const struct PostponeFunction *fn = &PostponeFunctions[i];
192 if (fn->op == op)
193 {
194 rc = fn->function(pd, op);
195 break;
196 }
197 }
198
199 if (rc == FR_UNKNOWN) // Not our function
200 return rc;
201
202 const char *result = dispatcher_get_retval_name(rc);
203 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
204
205 return rc;
206}
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
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: