NeoMutt  2025-12-11-911-gd8d604
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 1442 of file functions.c.

1443{
1444 // The Dispatcher may be called on any Window in the Dialog
1445 struct MuttWindow *dlg = dialog_find(win);
1446 if (!dlg || !dlg->wdata)
1447 return FR_ERROR;
1448
1449 struct Menu *menu = dlg->wdata;
1450 struct BrowserPrivateData *priv = menu->mdata;
1451 if (!priv)
1452 return FR_ERROR;
1453
1454 int rc = FR_UNKNOWN;
1455 for (size_t i = 0; BrowserFunctions[i].op != OP_NULL; i++)
1456 {
1457 const struct BrowserFunction *fn = &BrowserFunctions[i];
1458 if (fn->op == event->op)
1459 {
1460 rc = fn->function(priv, event);
1461 break;
1462 }
1463 }
1464
1465 return rc;
1466}
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Definition functions.c:1404
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: