NeoMutt  2023-05-17-33-gce4425
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 332 of file functions.c.

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

651{
652 if (!win)
653 {
655 return FR_ERROR;
656 }
657
658 struct Menu *menu = win->wdata;
659 struct AttachPrivateData *priv = menu->mdata;
660 if (!priv)
661 return FR_ERROR;
662
663 int rc = FR_UNKNOWN;
664 for (size_t i = 0; AttachFunctions[i].op != OP_NULL; i++)
665 {
666 const struct AttachFunction *fn = &AttachFunctions[i];
667 if (fn->op == op)
668 {
669 rc = fn->function(priv, op);
670 break;
671 }
672 }
673
674 return rc;
675}
static const char * Not_available_in_this_menu
Error message for unavailable functions.
Definition: functions.c:51
static const struct AttachFunction AttachFunctions[]
All the NeoMutt functions that the Attach supports.
Definition: functions.c:609
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
#define mutt_error(...)
Definition: logging2.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 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}
static const struct AutocryptFunction AutocryptFunctions[]
All the NeoMutt functions that the Autocrypt supports.
Definition: functions.c:155
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition: dialog.c:83
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 1966 of file functions.c.

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

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

3018{
3019 if (!win)
3020 {
3022 return FR_ERROR;
3023 }
3024
3025 struct IndexPrivateData *priv = win->parent->wdata;
3026 if (!priv)
3027 return FR_ERROR;
3028
3029 struct MuttWindow *dlg = dialog_find(win);
3030 if (!dlg || !dlg->wdata)
3031 return FR_ERROR;
3032
3033 struct IndexSharedData *shared = dlg->wdata;
3034
3035 int rc = FR_UNKNOWN;
3036 for (size_t i = 0; IndexFunctions[i].op != OP_NULL; i++)
3037 {
3038 const struct IndexFunction *fn = &IndexFunctions[i];
3039 if (fn->op == op)
3040 {
3041 if (!prereq(shared->mailbox_view, priv->menu, fn->flags))
3042 {
3043 rc = FR_ERROR;
3044 break;
3045 }
3046 rc = fn->function(shared, priv, op);
3047 break;
3048 }
3049 }
3050
3051 if (rc == FR_UNKNOWN) // Not our function
3052 return rc;
3053
3054 const char *result = dispacher_get_retval_name(rc);
3055 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
3056
3057 return rc;
3058}
static const char * Not_available_in_this_menu
Error message for unavailable functions.
Definition: functions.c:89
static bool prereq(struct MailboxView *mv, struct Menu *menu, CheckFlags checks)
Check the pre-requisites for a function.
Definition: functions.c:2820
static const struct IndexFunction IndexFunctions[]
All the NeoMutt functions that the Index supports.
Definition: functions.c:2867
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 * mailbox_view
Current Mailbox view.
Definition: shared_data.h:40
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 = dispacher_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 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}
static const 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 829 of file gpgme_functions.c.

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

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

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

135{
136 if (!win || !win->wdata)
137 return FR_UNKNOWN;
138
139 struct MuttWindow *dlg = dialog_find(win);
140 if (!dlg)
141 return FR_ERROR;
142
143 struct PostponeData *pd = dlg->wdata;
144
145 int rc = FR_UNKNOWN;
146 for (size_t i = 0; PostponeFunctions[i].op != OP_NULL; i++)
147 {
148 const struct PostponeFunction *fn = &PostponeFunctions[i];
149 if (fn->op == op)
150 {
151 rc = fn->function(pd, op);
152 break;
153 }
154 }
155
156 if (rc == FR_UNKNOWN) // Not our function
157 return rc;
158
159 const char *result = dispacher_get_retval_name(rc);
160 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
161
162 return rc;
163}
static const struct PostponeFunction PostponeFunctions[]
All the NeoMutt functions that the Postpone supports.
Definition: functions.c:117
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}
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: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: