NeoMutt  2022-04-29-247-gc6aae8
Teaching an old dog new tricks
DOXYGEN
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 * dispacher_get_retval_name (int rv)
 Get the name of a return value. More...
 

Variables

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

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

◆ dispacher_get_retval_name()

const char * dispacher_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 *result = mutt_map_get_name(rv, RetvalNames);
57 return NONULL(result);
58}
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[]
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.