NeoMutt  2024-04-25-91-gb0e085
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 1140 of file functions.c.

1141{
1142 if (!win)
1143 {
1145 return FR_ERROR;
1146 }
1147
1148 struct BrowserPrivateData *priv = win->parent->wdata;
1149 if (!priv)
1150 return FR_ERROR;
1151
1152 int rc = FR_UNKNOWN;
1153 for (size_t i = 0; BrowserFunctions[i].op != OP_NULL; i++)
1154 {
1155 const struct BrowserFunction *fn = &BrowserFunctions[i];
1156 if (fn->op == op)
1157 {
1158 rc = fn->function(priv, op);
1159 break;
1160 }
1161 }
1162
1163 return rc;
1164}
static const char * Not_available_in_this_menu
Error message for unavailable functions.
Definition: functions.c:55
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Definition: functions.c:1102
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
#define mutt_error(...)
Definition: logging2.h:92
#define _(a)
Definition: message.h:28
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
void * wdata
Private data.
Definition: mutt_window.h:144
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:134
+ Here is the caller graph for this function: