NeoMutt  2022-04-29-81-g9c5a59
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 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 }
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: 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 1969 of file functions.c.

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

◆ env_function_dispatcher()

int env_function_dispatcher ( struct MuttWindow win,
int  op 
)

Perform an Envelope function - Implements function_dispatcher_t -.

Definition at line 558 of file functions.c.

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

2810 {
2811  if (!win)
2812  {
2814  return FR_ERROR;
2815  }
2816 
2817  struct IndexPrivateData *priv = win->parent->wdata;
2818  if (!priv)
2819  return FR_ERROR;
2820 
2821  struct MuttWindow *dlg = dialog_find(win);
2822  if (!dlg || !dlg->wdata)
2823  return FR_ERROR;
2824 
2825  struct IndexSharedData *shared = dlg->wdata;
2826 
2827  int rc = FR_UNKNOWN;
2828  for (size_t i = 0; IndexFunctions[i].op != OP_NULL; i++)
2829  {
2830  const struct IndexFunction *fn = &IndexFunctions[i];
2831  if (fn->op == op)
2832  {
2833  if (!prereq(shared->mailboxview, priv->menu, fn->flags))
2834  {
2835  rc = FR_ERROR;
2836  break;
2837  }
2838  rc = fn->function(shared, priv, op);
2839  break;
2840  }
2841  }
2842 
2843  if (rc == FR_UNKNOWN) // Not our function
2844  return rc;
2845 
2846  const char *result = dispacher_get_retval_name(rc);
2847  mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
2848 
2849  return rc;
2850 }
static const char * Not_available_in_this_menu
Definition: functions.c:87
struct IndexFunction IndexFunctions[]
All the NeoMutt functions that the Index supports.
Definition: functions.c:2855
bool prereq(struct MailboxView *mv, struct Menu *menu, CheckFlags checks)
Check the pre-requisites for a function.
Definition: functions.c:2762
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 319 of file functions.c.

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

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

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