NeoMutt  2022-04-29-215-gc12b98
Teaching an old dog new tricks
DOXYGEN
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 -. More...
 
int attach_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Attach function - Implements function_dispatcher_t -. More...
 
int autocrypt_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Autocrypt function - Implements function_dispatcher_t -. More...
 
int compose_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Compose function - Implements function_dispatcher_t -. More...
 
int enter_function_dispatcher (struct MuttWindow *win, int op)
 Perform an Enter function - Implements function_dispatcher_t -. More...
 
int env_function_dispatcher (struct MuttWindow *win, int op)
 Perform an Envelope function - Implements function_dispatcher_t -. More...
 
int global_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Global function - Implements function_dispatcher_t -. More...
 
int history_function_dispatcher (struct MuttWindow *win, int op)
 Perform a History function - Implements function_dispatcher_t -. More...
 
int index_function_dispatcher (struct MuttWindow *win, int op)
 Perform an Index function - Implements function_dispatcher_t -. More...
 
int menu_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Menu function - Implements function_dispatcher_t -. More...
 
int menu_tagging_dispatcher (struct MuttWindow *win, int op)
 Perform tagging operations on the Menu - Implements function_dispatcher_t -. More...
 
int mix_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Mixmaster function - Implements function_dispatcher_t -. More...
 
int gpgme_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Gpgme function - Implements function_dispatcher_t -. More...
 
int pgp_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Pgp function - Implements function_dispatcher_t -. More...
 
int smime_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Smime function - Implements function_dispatcher_t -. More...
 
int pager_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Pager function - Implements function_dispatcher_t -. More...
 
int pattern_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Pattern function - Implements function_dispatcher_t -. More...
 
int postpone_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Postpone function - Implements function_dispatcher_t -. More...
 
int sb_function_dispatcher (struct MuttWindow *win, int op)
 Perform a Sidebar function - Implements function_dispatcher_t -. More...
 

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 333 of file functions.c.

334{
335 if (!win || !win->wdata)
336 return FR_UNKNOWN;
337
338 struct Menu *menu = win->wdata;
339 struct AliasMenuData *mdata = menu->mdata;
340 int rc = FR_UNKNOWN;
341 for (size_t i = 0; AliasFunctions[i].op != OP_NULL; i++)
342 {
343 const struct AliasFunction *fn = &AliasFunctions[i];
344 if (fn->op == op)
345 {
346 rc = fn->function(mdata, op);
347 break;
348 }
349 }
350
351 if (rc == FR_UNKNOWN) // Not our function
352 return rc;
353
354 const char *result = dispacher_get_retval_name(rc);
355 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
356
357 return rc;
358}
struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
Definition: functions.c:309
const char * dispacher_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: logging.h:84
@ LL_DEBUG1
Log at debug level 1.
Definition: logging.h:40
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:46
#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:69
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
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 641 of file functions.c.

642{
643 if (!win)
644 {
646 return FR_ERROR;
647 }
648
649 struct Menu *menu = win->wdata;
650 struct AttachPrivateData *priv = menu->mdata;
651 if (!priv)
652 return FR_ERROR;
653
654 struct MuttWindow *dlg = dialog_find(win);
655 if (!dlg || !dlg->wdata)
656 return FR_ERROR;
657
658 int rc = FR_UNKNOWN;
659 for (size_t i = 0; AttachFunctions[i].op != OP_NULL; i++)
660 {
661 const struct AttachFunction *fn = &AttachFunctions[i];
662 if (fn->op == op)
663 {
664 rc = fn->function(priv, op);
665 break;
666 }
667 }
668
669 return rc;
670}
struct AttachFunction AttachFunctions[]
All the NeoMutt functions that the Attach supports.
Definition: functions.c:600
static const char * Not_available_in_this_menu
Definition: functions.c:50
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition: dialog.c:83
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
#define mutt_error(...)
Definition: logging.h:87
#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:34
struct Menu * menu
Current Menu.
Definition: private_data.h:35
+ 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 169 of file functions.c.

170{
171 if (!win || !win->wdata)
172 return FR_UNKNOWN;
173
174 struct MuttWindow *dlg = dialog_find(win);
175 if (!dlg)
176 return FR_ERROR;
177
178 struct AutocryptData *ad = dlg->wdata;
179
180 int rc = FR_UNKNOWN;
181 for (size_t i = 0; AutocryptFunctions[i].op != OP_NULL; i++)
182 {
183 const struct AutocryptFunction *fn = &AutocryptFunctions[i];
184 if (fn->op == op)
185 {
186 rc = fn->function(ad, op);
187 break;
188 }
189 }
190
191 if (rc == FR_UNKNOWN) // Not our function
192 return rc;
193
194 const char *result = dispacher_get_retval_name(rc);
195 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
196
197 return rc;
198}
struct AutocryptFunction AutocryptFunctions[]
All the NeoMutt functions that the Autocrypt supports.
Definition: functions.c:155
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 1970 of file functions.c.

1971{
1972 if (!win)
1973 return FR_UNKNOWN;
1974
1975 struct MuttWindow *dlg = dialog_find(win);
1976 if (!dlg || !dlg->wdata)
1977 return FR_UNKNOWN;
1978
1979 int rc = FR_UNKNOWN;
1980 for (size_t i = 0; ComposeFunctions[i].op != OP_NULL; i++)
1981 {
1982 const struct ComposeFunction *fn = &ComposeFunctions[i];
1983 if (fn->op == op)
1984 {
1985 struct ComposeSharedData *shared = dlg->wdata;
1986 rc = fn->function(shared, op);
1987 break;
1988 }
1989 }
1990
1991 if (rc == FR_UNKNOWN) // Not our function
1992 return rc;
1993
1994 const char *result = dispacher_get_retval_name(rc);
1995 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
1996
1997 return rc;
1998}
struct ComposeFunction ComposeFunctions[]
All the NeoMutt functions that the Compose supports.
Definition: functions.c:1921
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 702 of file functions.c.

703{
704 if (!win || !win->wdata)
705 return FR_UNKNOWN;
706
707 struct EnterWindowData *wdata = win->wdata;
708
709 int rc = FR_UNKNOWN;
710 for (size_t i = 0; EnterFunctions[i].op != OP_NULL; i++)
711 {
712 const struct EnterFunction *fn = &EnterFunctions[i];
713 if (fn->op == op)
714 {
715 rc = fn->function(wdata, op);
716 break;
717 }
718 }
719
720 if (rc == FR_UNKNOWN) // Not our function
721 return rc;
722
723 const char *result = dispacher_get_retval_name(rc);
724 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
725
726 return rc;
727}
struct EnterFunction EnterFunctions[]
All the NeoMutt functions that Enter supports.
Definition: functions.c:669
A NeoMutt function.
Definition: functions.h:46
int op
Op code, e.g. OP_SEARCH.
Definition: functions.h:47
enter_function_t function
Function to call.
Definition: functions.h:48
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 = dispacher_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}
struct EnvelopeFunction EnvelopeFunctions[]
All the NeoMutt functions that the Envelope supports.
Definition: functions.c:526
A NeoMutt Envelope function.
Definition: functions.h:45
int op
Op code, e.g. OP_ENVELOPE_EDIT_FROM.
Definition: functions.h:46
envelope_function_t function
Function to call.
Definition: functions.h:47
Data to fill the Envelope Window.
Definition: wdata.h:39
+ 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 164 of file global.c.

165{
166 int rc = FR_UNKNOWN;
167 for (size_t i = 0; GlobalFunctions[i].op != OP_NULL; i++)
168 {
169 const struct GlobalFunction *fn = &GlobalFunctions[i];
170 if (fn->op == op)
171 {
172 rc = fn->function(op);
173 break;
174 }
175 }
176
177 if (rc == FR_UNKNOWN) // Not our function
178 return rc;
179
180 const char *result = dispacher_get_retval_name(rc);
181 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
182
183 return FR_SUCCESS; // Whatever the outcome, we handled it
184}
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
struct GlobalFunction GlobalFunctions[]
All the NeoMutt functions that the Global supports.
Definition: global.c:146
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 76 of file functions.c.

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

2832{
2833 if (!win)
2834 {
2836 return FR_ERROR;
2837 }
2838
2839 struct IndexPrivateData *priv = win->parent->wdata;
2840 if (!priv)
2841 return FR_ERROR;
2842
2843 struct MuttWindow *dlg = dialog_find(win);
2844 if (!dlg || !dlg->wdata)
2845 return FR_ERROR;
2846
2847 struct IndexSharedData *shared = dlg->wdata;
2848
2849 int rc = FR_UNKNOWN;
2850 for (size_t i = 0; IndexFunctions[i].op != OP_NULL; i++)
2851 {
2852 const struct IndexFunction *fn = &IndexFunctions[i];
2853 if (fn->op == op)
2854 {
2855 if (!prereq(shared->mailboxview, priv->menu, fn->flags))
2856 {
2857 rc = FR_ERROR;
2858 break;
2859 }
2860 rc = fn->function(shared, priv, op);
2861 break;
2862 }
2863 }
2864
2865 if (rc == FR_UNKNOWN) // Not our function
2866 return rc;
2867
2868 const char *result = dispacher_get_retval_name(rc);
2869 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
2870
2871 return rc;
2872}
static const char * Not_available_in_this_menu
Definition: functions.c:88
struct IndexFunction IndexFunctions[]
All the NeoMutt functions that the Index supports.
Definition: functions.c:2877
bool prereq(struct MailboxView *mv, struct Menu *menu, CheckFlags checks)
Check the pre-requisites for a function.
Definition: functions.c:2784
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:43
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct MailboxView * mailboxview
Current Mailbox view.
Definition: shared_data.h:39
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 320 of file functions.c.

321{
322 if (!win || !win->wdata)
323 return FR_UNKNOWN;
324
325 struct Menu *menu = win->wdata;
326
327 int rc = FR_UNKNOWN;
328 for (size_t i = 0; MenuFunctions[i].op != OP_NULL; i++)
329 {
330 const struct MenuFunction *fn = &MenuFunctions[i];
331 if (fn->op == op)
332 {
333 rc = fn->function(menu, op);
334 break;
335 }
336 }
337
338 if (rc == FR_UNKNOWN) // Not our function
339 return rc;
340
341 const char *result = dispacher_get_retval_name(rc);
342 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
343
344 return rc;
345}
struct MenuFunction MenuFunctions[]
All the NeoMutt functions that the Menu supports.
Definition: functions.c:280
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 223 of file tagging.c.

224{
225 struct Menu *menu = win->wdata;
226
227 switch (op)
228 {
229 case OP_END_COND:
230 return op_end_cond(menu, op);
231 case OP_TAG:
232 return op_tag(menu, op);
233 case OP_TAG_PREFIX:
234 return op_tag_prefix(menu, op);
235 case OP_TAG_PREFIX_COND:
236 return op_tag_prefix_cond(menu, op);
237 case OP_ABORT:
238 return menu_abort(menu);
239 case OP_TIMEOUT:
240 return menu_timeout(menu);
241 default:
242 return menu_other(menu);
243 }
244}
#define OP_TIMEOUT
Definition: opcodes.h:32
#define OP_ABORT
Definition: opcodes.h:33
static int menu_other(struct Menu *menu)
Some non-tagging operation occurred.
Definition: tagging.c:213
static int menu_abort(struct Menu *menu)
User aborted an operation.
Definition: tagging.c:190
static int op_tag(struct Menu *menu, int op)
Tag the current entry.
Definition: tagging.c:81
static int op_end_cond(struct Menu *menu, int op)
End of conditional execution (noop)
Definition: tagging.c:68
static int op_tag_prefix_cond(struct Menu *menu, int op)
Apply next function ONLY to tagged messages.
Definition: tagging.c:165
static int op_tag_prefix(struct Menu *menu, int op)
Apply next function to tagged messages.
Definition: tagging.c:139
static int menu_timeout(struct Menu *menu)
Timeout waiting for a keypress.
Definition: tagging.c:202
+ 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 140 of file functions.c.

141{
142 if (!win || !win->wdata)
143 return FR_UNKNOWN;
144
145 struct MixmasterPrivateData *priv = win->wdata;
146 int rc = FR_UNKNOWN;
147 for (size_t i = 0; MixmasterFunctions[i].op != OP_NULL; i++)
148 {
149 const struct MixmasterFunction *fn = &MixmasterFunctions[i];
150 if (fn->op == op)
151 {
152 rc = fn->function(priv, op);
153 break;
154 }
155 }
156
157 if (rc == FR_UNKNOWN) // Not our function
158 return rc;
159
160 const char *result = dispacher_get_retval_name(rc);
161 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
162
163 return rc;
164}
struct MixmasterFunction MixmasterFunctions[]
All the NeoMutt functions that the Mixmaster supports.
Definition: functions.c:123
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 827 of file gpgme_functions.c.

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

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

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

790{
791 if (!win)
792 {
794 return FR_ERROR;
795 }
796
797 struct PagerPrivateData *priv = win->parent->wdata;
798 if (!priv)
799 return FR_ERROR;
800
801 struct MuttWindow *dlg = dialog_find(win);
802 if (!dlg || !dlg->wdata)
803 return FR_ERROR;
804
805 int rc = FR_UNKNOWN;
806 for (size_t i = 0; PagerFunctions[i].op != OP_NULL; i++)
807 {
808 const struct PagerFunction *fn = &PagerFunctions[i];
809 if (fn->op == op)
810 {
811 struct IndexSharedData *shared = dlg->wdata;
812 rc = fn->function(shared, priv, op);
813 break;
814 }
815 }
816
817 if (rc == FR_UNKNOWN) // Not our function
818 return rc;
819
820 const char *result = dispacher_get_retval_name(rc);
821 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
822
823 return rc;
824}
static const char * Not_available_in_this_menu
Definition: functions.c:55
struct PagerFunction PagerFunctions[]
All the NeoMutt functions that the Pager supports.
Definition: functions.c:761
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 78 of file functions.c.

79{
80 if (!win || !win->wdata)
81 return FR_UNKNOWN;
82
83 struct MuttWindow *dlg = dialog_find(win);
84 if (!dlg)
85 return FR_ERROR;
86
87 struct PatternData *pd = dlg->wdata;
88
89 int rc = FR_UNKNOWN;
90 for (size_t i = 0; PatternFunctions[i].op != OP_NULL; i++)
91 {
92 const struct PatternFunction *fn = &PatternFunctions[i];
93 if (fn->op == op)
94 {
95 rc = fn->function(pd, op);
96 break;
97 }
98 }
99
100 if (rc == FR_UNKNOWN) // Not our function
101 return rc;
102
103 const char *result = dispacher_get_retval_name(rc);
104 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
105
106 return rc;
107}
struct PatternFunction PatternFunctions[]
All the NeoMutt functions that the Pattern supports.
Definition: functions.c:67
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 129 of file functions.c.

130{
131 if (!win || !win->wdata)
132 return FR_UNKNOWN;
133
134 struct MuttWindow *dlg = dialog_find(win);
135 if (!dlg)
136 return FR_ERROR;
137
138 struct PostponeData *pd = dlg->wdata;
139
140 int rc = FR_UNKNOWN;
141 for (size_t i = 0; PostponeFunctions[i].op != OP_NULL; i++)
142 {
143 const struct PostponeFunction *fn = &PostponeFunctions[i];
144 if (fn->op == op)
145 {
146 rc = fn->function(pd, op);
147 break;
148 }
149 }
150
151 if (rc == FR_UNKNOWN) // Not our function
152 return rc;
153
154 const char *result = dispacher_get_retval_name(rc);
155 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
156
157 return rc;
158}
struct PostponeFunction PostponeFunctions[]
All the NeoMutt functions that the Postpone supports.
Definition: functions.c:112
Data to pass to the Postpone Functions.
Definition: functions.h:34
A NeoMutt function.
Definition: functions.h:57
postpone_function_t function
Function to call.
Definition: functions.h:59
int op
Op code, e.g. OP_DELETE.
Definition: functions.h:58
+ 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 = dispacher_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}
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:65
struct MuttWindow * win
Sidebar Window.
Definition: private.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function: