NeoMutt
2025-12-11-1039-g550ac6
Teaching an old dog new tricks
DOXYGEN
Toggle main menu visibility
Loading...
Searching...
No Matches
opcodes.c
Go to the documentation of this file.
1
22
28
29
#include "config.h"
30
#include <stddef.h>
31
#include "
opcodes.h
"
32
33
#define DEFINE_HELP_MESSAGE(opcode, op_string) { #opcode, op_string },
34
37
static
const
char
*
OpStrings
[][2] = {
38
OPS
(
DEFINE_HELP_MESSAGE
){ NULL, NULL },
39
};
40
41
#undef DEFINE_HELP_MESSAGE
42
48
const
char
*
opcodes_get_name
(
int
op)
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_REPAINT
)
58
return
"OP_REPAINT"
;
59
60
return
OpStrings
[op][0];
61
}
62
68
const
char
*
opcodes_get_description
(
int
op)
69
{
70
if
((op <
OP_REPAINT
) || (op >=
OP_MAX
))
71
return
"[UNKNOWN]"
;
72
73
if
(op ==
OP_ABORT
)
74
return
"Abort the current action"
;
75
if
(op ==
OP_TIMEOUT
)
76
return
"Timeout occurred"
;
77
if
(op ==
OP_REPAINT
)
78
return
"Repaint required"
;
79
80
return
OpStrings
[op][1];
81
}
DEFINE_HELP_MESSAGE
#define DEFINE_HELP_MESSAGE(opcode, op_string)
Definition
opcodes.c:33
opcodes_get_description
const char * opcodes_get_description(int op)
Get the description of an opcode.
Definition
opcodes.c:68
OpStrings
static const char * OpStrings[][2]
Lookup table mapping an opcode to its name and description e.g.
Definition
opcodes.c:37
opcodes_get_name
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition
opcodes.c:48
opcodes.h
All user-callable functions.
OP_TIMEOUT
#define OP_TIMEOUT
1 second with no events
Definition
opcodes.h:35
OPS
#define OPS(_fmt)
Definition
opcodes.h:677
OP_REPAINT
#define OP_REPAINT
Repaint is needed.
Definition
opcodes.h:34
OP_ABORT
#define OP_ABORT
$abort_key pressed (Ctrl-G)
Definition
opcodes.h:36
OP_MAX
@ OP_MAX
Definition
opcodes.h:698