NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.h File Reference

Browser functions. More...

+ 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, int op)
 

Functions

int browser_function_dispatcher (struct MuttWindow *win, int op)
 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, int op)

Definition at line 38 of file functions.h.

Function Documentation

◆ browser_function_dispatcher()

int browser_function_dispatcher ( struct MuttWindow win,
int  op 
)

Perform a Browser function.

Parameters
winWindow for the Browser
opOperation to perform, e.g. OP_GOTO_PARENT
Return values
numFunctionRetval, e.g. FR_SUCCESS

Definition at line 1126 of file functions.c.

1127{
1128 // The Dispatcher may be called on any Window in the Dialog
1129 struct MuttWindow *dlg = dialog_find(win);
1130 if (!dlg || !dlg->wdata)
1131 return FR_ERROR;
1132
1133 struct Menu *menu = dlg->wdata;
1134 struct BrowserPrivateData *priv = menu->mdata;
1135 if (!priv)
1136 return FR_ERROR;
1137
1138 int rc = FR_UNKNOWN;
1139 for (size_t i = 0; BrowserFunctions[i].op != OP_NULL; i++)
1140 {
1141 const struct BrowserFunction *fn = &BrowserFunctions[i];
1142 if (fn->op == op)
1143 {
1144 rc = fn->function(priv, op);
1145 break;
1146 }
1147 }
1148
1149 return rc;
1150}
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Definition: functions.c:1088
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:33
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
A NeoMutt function.
Definition: functions.h:44
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition: functions.h:45
browser_function_t function
Function to call.
Definition: functions.h:46
Private state data for the Browser.
Definition: private_data.h:34
struct Menu * menu
Menu.
Definition: private_data.h:43
Definition: lib.h:79
void * mdata
Private data.
Definition: lib.h:147
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: