NeoMutt  2024-12-12-19-ge4b57e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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.
 
const char * opcodes_get_description (int op)
 Get the description of an opcode.
 

Variables

static const char * OpStrings [][2]
 Lookup table mapping an opcode to its name and description e.g.
 

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 48 of file opcodes.c.

49{
50 if ((op < OP_REPAINT) || (op >= OP_MAX))
51 return "[UNKNOWN]";
52
53 if (op == OP_ABORT)
54 return "OP_ABORT";
55 if (op == OP_TIMEOUT)
56 return "OP_TIMEOUT";
57 if (op == OP_PARTIAL_KEY)
58 return "OP_PARTIAL_KEY";
59 if (op == OP_REPAINT)
60 return "OP_REPAINT";
61
62 return OpStrings[op][0];
63}
static const char * OpStrings[][2]
Lookup table mapping an opcode to its name and description e.g.
Definition: opcodes.c:37
#define OP_TIMEOUT
1 second with no events
Definition: opcodes.h:36
#define OP_REPAINT
Repaint is needed.
Definition: opcodes.h:34
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Definition: opcodes.h:37
#define OP_PARTIAL_KEY
Incomplete keybinding.
Definition: opcodes.h:35
@ OP_MAX
Definition: opcodes.h:1006
+ 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 70 of file opcodes.c.

71{
72 if ((op < OP_REPAINT) || (op >= OP_MAX))
73 return "[UNKNOWN]";
74
75 if (op == OP_ABORT)
76 return "abort the current action";
77 if (op == OP_TIMEOUT)
78 return "timeout occurred";
79 if (op == OP_PARTIAL_KEY)
80 return "partial keybinding";
81 if (op == OP_REPAINT)
82 return "repaint required";
83
84 return OpStrings[op][1];
85}
+ Here is the caller graph for this function:

Variable Documentation

◆ OpStrings

const char* OpStrings[][2]
static
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:985

Lookup table mapping an opcode to its name and description e.g.

OpStrings[OP_EDIT_LABEL] = { "OP_EDIT_LABEL", "edit an email's label" }

Definition at line 37 of file opcodes.c.