NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dispatcher.c
Go to the documentation of this file.
1
29#include "config.h"
30#include <stddef.h>
31#include "mutt/lib.h"
32#include "dispatcher.h"
33
35static const struct Mapping RetvalNames[] = {
36 // clang-format off
37 { "continue", FR_CONTINUE },
38 { "done", FR_DONE },
39 { "error", FR_ERROR },
40 { "no action", FR_NO_ACTION },
41 { "not impl", FR_NOT_IMPL },
42 { "success", FR_SUCCESS },
43 { "unknown", FR_UNKNOWN },
44 { NULL, 0 },
45 // clang-format on
46};
47
54const char *dispatcher_get_retval_name(int rv)
55{
56 const char *name = mutt_map_get_name(rv, RetvalNames);
57 return NONULL(name);
58}
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
Definition: dispatcher.c:54
static const struct Mapping RetvalNames[]
Lookup for function results.
Definition: dispatcher.c:35
Dispatcher of functions.
@ 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
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Definition: mapping.c:42
Convenience wrapper for the library headers.
#define NONULL(x)
Definition: string2.h:37
Mapping between user-readable string and a constant.
Definition: mapping.h:33
const char * name
String value.
Definition: mapping.h:34