NeoMutt  2025-12-11-980-ge38c27
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.h File Reference

Browser functions. More...

#include "key/lib.h"
+ Include dependency graph for functions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  BrowserFunction
 A NeoMutt function. More...
 

Typedefs

typedef int(* browser_function_t) (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 

Functions

int browser_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Browser function.
 

Detailed Description

Browser functions.

Authors
  • Richard Russon

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file functions.h.

Typedef Documentation

◆ browser_function_t

typedef int(* browser_function_t) (struct BrowserPrivateData *priv, const struct KeyEvent *event)

Definition at line 43 of file functions.h.

Function Documentation

◆ browser_function_dispatcher()

int browser_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Browser function.

Parameters
winWindow for the Browser
eventEvent to process
Return values
numFunctionRetval, e.g. FR_SUCCESS

Definition at line 1441 of file functions.c.

1442{
1443 // The Dispatcher may be called on any Window in the Dialog
1444 struct MuttWindow *dlg = dialog_find(win);
1445 if (!dlg || !dlg->wdata)
1446 return FR_ERROR;
1447
1448 struct Menu *menu = dlg->wdata;
1449 struct BrowserPrivateData *priv = menu->mdata;
1450 if (!priv)
1451 return FR_ERROR;
1452
1453 int rc = FR_UNKNOWN;
1454 for (size_t i = 0; BrowserFunctions[i].op != OP_NULL; i++)
1455 {
1456 const struct BrowserFunction *fn = &BrowserFunctions[i];
1457 if (fn->op == event->op)
1458 {
1459 rc = fn->function(priv, event);
1460 break;
1461 }
1462 }
1463
1464 return rc;
1465}
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Definition functions.c:1402
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
@ FR_UNKNOWN
Unknown function.
Definition dispatcher.h:34
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
A NeoMutt function.
Definition functions.h:49
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition functions.h:50
browser_function_t function
Function to call.
Definition functions.h:51
Private state data for the Browser.
struct Menu * menu
Menu.
int op
Function opcode, e.g. OP_HELP.
Definition get.h:77
Definition lib.h:86
void * mdata
Private data.
Definition lib.h:155
void * wdata
Private data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function: