NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
dispatcher.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include <stddef.h>
31
#include "
mutt/lib.h
"
32
#include "
dispatcher.h
"
33
#include "
key/lib.h
"
34
36
static
const
struct
Mapping
RetvalNames
[] = {
37
// clang-format off
38
{
"continue"
,
FR_CONTINUE
},
39
{
"done"
,
FR_DONE
},
40
{
"error"
,
FR_ERROR
},
41
{
"no action"
,
FR_NO_ACTION
},
42
{
"not impl"
,
FR_NOT_IMPL
},
43
{
"success"
,
FR_SUCCESS
},
44
{
"unknown"
,
FR_UNKNOWN
},
45
{ NULL, 0 },
46
// clang-format on
47
};
48
55
const
char
*
dispatcher_get_retval_name
(
int
rv)
56
{
57
const
char
*
name
=
mutt_map_get_name
(rv,
RetvalNames
);
58
return
NONULL
(
name
);
59
}
60
65
void
dispatcher_flush_on_error
(
int
rv)
66
{
67
if
(rv ==
FR_ERROR
)
68
mutt_flushinp
();
69
}
dispatcher_get_retval_name
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
Definition
dispatcher.c:55
RetvalNames
static const struct Mapping RetvalNames[]
Lookup for function results.
Definition
dispatcher.c:36
dispatcher_flush_on_error
void dispatcher_flush_on_error(int rv)
Flush pending keys after a dispatch error.
Definition
dispatcher.c:65
dispatcher.h
Dispatcher of functions.
FR_SUCCESS
@ FR_SUCCESS
Valid function - successfully performed.
Definition
dispatcher.h:40
FR_DONE
@ FR_DONE
Exit the Dialog.
Definition
dispatcher.h:36
FR_UNKNOWN
@ FR_UNKNOWN
Unknown function.
Definition
dispatcher.h:34
FR_ERROR
@ FR_ERROR
Valid function - error occurred.
Definition
dispatcher.h:39
FR_NOT_IMPL
@ FR_NOT_IMPL
Invalid function - feature not enabled.
Definition
dispatcher.h:37
FR_CONTINUE
@ FR_CONTINUE
Remain in the Dialog.
Definition
dispatcher.h:35
FR_NO_ACTION
@ FR_NO_ACTION
Valid function - no action performed.
Definition
dispatcher.h:38
mutt_flushinp
void mutt_flushinp(void)
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
Definition
get.c:81
lib.h
Manage keymappings.
mutt_map_get_name
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition
mapping.c:42
lib.h
Convenience wrapper for the library headers.
NONULL
#define NONULL(x)
Definition
string2.h:44
Mapping
Mapping between user-readable string and a constant.
Definition
mapping.h:33
Mapping::name
const char * name
String value.
Definition
mapping.h:34