NeoMutt  2024-10-02-19-gb00cc4
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dispatcher.c File Reference

Dispatcher of functions. More...

#include "config.h"
#include <stddef.h>
#include "mutt/lib.h"
#include "dispatcher.h"
+ Include dependency graph for dispatcher.c:

Go to the source code of this file.

Functions

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

Variables

static const struct Mapping RetvalNames []
 Lookup for function results.
 

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.c.

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:

Variable Documentation

◆ RetvalNames

const struct Mapping RetvalNames[]
static
Initial value:
= {
{ "continue", FR_CONTINUE },
{ "done", FR_DONE },
{ "error", FR_ERROR },
{ "no action", FR_NO_ACTION },
{ "not impl", FR_NOT_IMPL },
{ "success", FR_SUCCESS },
{ "unknown", FR_UNKNOWN },
{ NULL, 0 },
}
@ 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

Lookup for function results.

Definition at line 35 of file dispatcher.c.