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

Dispatcher of functions. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int(* function_dispatcher_t) (struct MuttWindow *win, int op)
 

Enumerations

enum  FunctionRetval {
  FR_UNKNOWN = -7 , FR_CONTINUE = -6 , FR_DONE = -5 , FR_NOT_IMPL = -4 ,
  FR_NO_ACTION = -3 , FR_ERROR = -2 , FR_SUCCESS = -1
}
 Possible return values for NeoMutt functions. More...
 

Functions

const char * dispatcher_get_retval_name (int rv)
 Get the name of a return value.
 

Detailed Description

Dispatcher of 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 dispatcher.h.

Typedef Documentation

◆ function_dispatcher_t

typedef int(* function_dispatcher_t) (struct MuttWindow *win, int op)

Definition at line 52 of file dispatcher.h.

Enumeration Type Documentation

◆ FunctionRetval

Possible return values for NeoMutt functions.

Enumerator
FR_UNKNOWN 

Unknown function.

FR_CONTINUE 

Remain in the Dialog.

FR_DONE 

Exit the Dialog.

FR_NOT_IMPL 

Invalid function - feature not enabled.

FR_NO_ACTION 

Valid function - no action performed.

FR_ERROR 

Valid function - error occurred.

FR_SUCCESS 

Valid function - successfully performed.

Definition at line 31 of file dispatcher.h.

32{
33 FR_UNKNOWN = -7,
34 FR_CONTINUE = -6,
35 FR_DONE = -5,
36 FR_NOT_IMPL = -4,
37 FR_NO_ACTION = -3,
38 FR_ERROR = -2,
39 FR_SUCCESS = -1,
40};
@ FR_SUCCESS
Valid function - successfully performed.
Definition: dispatcher.h:39
@ FR_DONE
Exit the Dialog.
Definition: dispatcher.h:35
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
@ FR_ERROR
Valid function - error occurred.
Definition: dispatcher.h:38
@ FR_NOT_IMPL
Invalid function - feature not enabled.
Definition: dispatcher.h:36
@ FR_CONTINUE
Remain in the Dialog.
Definition: dispatcher.h:34
@ FR_NO_ACTION
Valid function - no action performed.
Definition: dispatcher.h:37

Function Documentation

◆ dispatcher_get_retval_name()

const char * dispatcher_get_retval_name ( int  rv)

Get the name of a return value.

Parameters
rvReturn value, e.g. FR_ERROR
Return values
strName of the retval
""Error

Definition at line 54 of file dispatcher.c.

55{
56 const char *name = mutt_map_get_name(rv, RetvalNames);
57 return NONULL(name);
58}
static const struct Mapping RetvalNames[]
Lookup for function results.
Definition: dispatcher.c:35
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition: mapping.c:42
#define NONULL(x)
Definition: string2.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function: