NeoMutt  2022-04-29-145-g9b6a0e
Teaching an old dog new tricks
DOXYGEN
opcodes.c File Reference

All user-callable functions. More...

#include "config.h"
#include <stddef.h>
#include "opcodes.h"
+ Include dependency graph for opcodes.c:

Go to the source code of this file.

Macros

#define DEFINE_HELP_MESSAGE(opcode, op_string)   { #opcode, op_string },
 

Functions

const char * opcodes_get_name (int op)
 Get the name of an opcode. More...
 
const char * opcodes_get_description (int op)
 Get the description of an opcode. More...
 

Variables

const char * OpStrings [][2]
 

Detailed Description

All user-callable 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 opcodes.c.

Macro Definition Documentation

◆ DEFINE_HELP_MESSAGE

#define DEFINE_HELP_MESSAGE (   opcode,
  op_string 
)    { #opcode, op_string },

Definition at line 33 of file opcodes.c.

Function Documentation

◆ opcodes_get_name()

const char* opcodes_get_name ( int  op)

Get the name of an opcode.

Parameters
opOpcode, e.g. OP_HELP
Return values
strName of the opcode

Definition at line 46 of file opcodes.c.

47 {
48  if ((op < OP_TIMEOUT) || (op >= OP_MAX))
49  return "[UNKNOWN]";
50 
51  if (op == OP_ABORT)
52  return "OP_ABORT";
53  if (op == OP_TIMEOUT)
54  return "OP_TIMEOUT";
55 
56  return OpStrings[op][0];
57 }
const char * OpStrings[][2]
Definition: opcodes.c:35
#define OP_TIMEOUT
Definition: opcodes.h:32
#define OP_ABORT
Definition: opcodes.h:33
@ OP_MAX
Definition: opcodes.h:378
+ Here is the caller graph for this function:

◆ opcodes_get_description()

const char* opcodes_get_description ( int  op)

Get the description of an opcode.

Parameters
opOpcode, e.g. OP_HELP
Return values
strDescription of the opcode

Definition at line 64 of file opcodes.c.

65 {
66  if ((op < OP_TIMEOUT) || (op >= OP_MAX))
67  return "[UNKNOWN]";
68 
69  if (op == OP_ABORT)
70  return "abort the current action";
71  if (op == OP_TIMEOUT)
72  return "timeout occurred";
73 
74  return OpStrings[op][1];
75 }
+ Here is the caller graph for this function:

Variable Documentation

◆ OpStrings

const char* OpStrings[][2]
Initial value:
= {
OPS(DEFINE_HELP_MESSAGE){ NULL, NULL },
}
#define DEFINE_HELP_MESSAGE(opcode, op_string)
Definition: opcodes.c:33
#define OPS(_fmt)
Definition: opcodes.h:356

Definition at line 35 of file opcodes.c.