Thanks to visit codestin.com
Credit goes to code.neomutt.org

NeoMutt  2025-12-11-189-gceedb6
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
command.h
Go to the documentation of this file.
1
22
23#ifndef MUTT_CORE_COMMAND_H
24#define MUTT_CORE_COMMAND_H
25
26#include "config.h"
27#include <stdbool.h>
28#include <stdint.h>
29#include "mutt/lib.h"
30
41
45typedef uint8_t CommandFlags;
46#define CF_NO_FLAGS 0
47#define CF_SYNONYM (1 << 0)
48#define CF_DEPRECATED (1 << 1)
49
56{
146};
147
148#define CMD_NO_DATA 0
149
158{
159 const char *name;
161
176 enum CommandResult (*parse)(const struct Command *cmd, struct Buffer *line, struct Buffer *err);
177
178 intptr_t data;
179
180 const char *help;
181 const char *proto;
182 const char *path;
183
185};
186ARRAY_HEAD(CommandArray, const struct Command *);
187
188const struct Command *commands_get (struct CommandArray *ca, const char *name);
189void commands_clear (struct CommandArray *ca);
190bool commands_register(struct CommandArray *ca, const struct Command *cmds);
191
192#endif /* MUTT_CORE_COMMAND_H */
#define ARRAY_HEAD(name, T)
Define a named struct for arrays of elements of a certain type.
Definition array.h:47
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
const struct Command * commands_get(struct CommandArray *ca, const char *name)
Get a Command by its name.
Definition command.c:82
void commands_clear(struct CommandArray *ca)
Clear an Array of Commands.
Definition command.c:70
CommandId
ID of Command.
Definition command.h:56
@ CMD_CLOSE_HOOK
:close-hook
Definition command.h:68
@ CMD_MIME_LOOKUP
:mime-lookup
Definition command.h:93
@ CMD_SPAM
:spam
Definition command.h:112
@ CMD_SUBSCRIBE
:subscribe
Definition command.h:115
@ CMD_UNSUBSCRIBE
:unsubscribe
Definition command.h:143
@ CMD_UNALIAS
:unalias
Definition command.h:121
@ CMD_IGNORE
:ignore
Definition command.h:83
@ CMD_GROUP
:group
Definition command.h:77
@ CMD_SEND_HOOK
:send-hook
Definition command.h:105
@ CMD_CD
:cd
Definition command.h:66
@ CMD_TAG_TRANSFORMS
:tag-transforms
Definition command.h:118
@ CMD_FCC_SAVE_HOOK
:fcc-save-hook
Definition command.h:74
@ CMD_LUA_SOURCE
:lua-source
Definition command.h:87
@ CMD_ICONV_HOOK
:iconv-hook
Definition command.h:80
@ CMD_ALIAS
:alias
Definition command.h:59
@ CMD_IFNDEF
:ifndef
Definition command.h:82
@ CMD_UNCOLOR
:uncolor
Definition command.h:127
@ CMD_COLOR
:color
Definition command.h:69
@ CMD_EXEC
:exec
Definition command.h:72
@ CMD_INDEX_FORMAT_HOOK
:index-format-hook
Definition command.h:84
@ CMD_UNMACRO
:unmacro
Definition command.h:133
@ CMD_UNSUBJECT_REGEX
:unsubject-regex
Definition command.h:142
@ CMD_SIDEBAR_PIN
:sidebar-pin
Definition command.h:109
@ CMD_SCORE
:score
Definition command.h:103
@ CMD_SHUTDOWN_HOOK
:shutdown-hook
Definition command.h:108
@ CMD_SETENV
:setenv
Definition command.h:107
@ CMD_IFDEF
:ifdef
Definition command.h:81
@ CMD_UNSUBSCRIBE_FROM
:unsubscribe-from
Definition command.h:144
@ CMD_MACRO
:macro
Definition command.h:88
@ CMD_MAILTO_ALLOW
:mailto-allow
Definition command.h:90
@ CMD_MY_HEADER
:my-header
Definition command.h:95
@ CMD_SOURCE
:source
Definition command.h:111
@ CMD_FCC_HOOK
:fcc-hook
Definition command.h:73
@ CMD_SIDEBAR_UNPIN
:sidebar-unpin
Definition command.h:110
@ CMD_LISTS
:lists
Definition command.h:85
@ CMD_MESSAGE_HOOK
:message-hook
Definition command.h:92
@ CMD_SEND2_HOOK
:send2-hook
Definition command.h:104
@ CMD_ATTACHMENTS
:attachments
Definition command.h:63
@ CMD_ECHO
:echo
Definition command.h:71
@ CMD_SUBSCRIBE_TO
:subscribe-to
Definition command.h:116
@ CMD_UNMIME_LOOKUP
:unmime-lookup
Definition command.h:136
@ CMD_PUSH
:push
Definition command.h:99
@ CMD_REPLY_HOOK
:reply-hook
Definition command.h:100
@ CMD_VERSION
:version
Definition command.h:145
@ CMD_LUA
:lua
Definition command.h:86
@ CMD_STARTUP_HOOK
:startup-hook
Definition command.h:113
@ CMD_AUTO_VIEW
:auto-view
Definition command.h:64
@ CMD_UNALTERNATIVE_ORDER
:unalternative-order
Definition command.h:123
@ CMD_UNAUTO_VIEW
:unauto-view
Definition command.h:125
@ CMD_CHARSET_HOOK
:charset-hook
Definition command.h:67
@ CMD_UNHEADER_ORDER
:unheader-order
Definition command.h:129
@ CMD_HOOKS
:hooks
Definition command.h:79
@ CMD_NOSPAM
:nospam
Definition command.h:97
@ CMD_UNGROUP
:ungroup
Definition command.h:128
@ CMD_NONE
No Command.
Definition command.h:57
@ CMD_TAG_FORMATS
:tag-formats
Definition command.h:117
@ CMD_MAILBOXES
:mailboxes
Definition command.h:89
@ CMD_ALTERNATES
:alternates
Definition command.h:60
@ CMD_UNIGNORE
:unignore
Definition command.h:131
@ CMD_UNLISTS
:unlists
Definition command.h:132
@ CMD_SAVE_HOOK
:save-hook
Definition command.h:102
@ CMD_FINISH
:finish
Definition command.h:75
@ CMD_ALTERNATIVE_ORDER
:alternative-order
Definition command.h:61
@ CMD_TIMEOUT_HOOK
:timeout-hook
Definition command.h:119
@ CMD_ACCOUNT_HOOK
:account-hook
Definition command.h:58
@ CMD_BIND
:bind
Definition command.h:65
@ CMD_MONO
:mono
Definition command.h:94
@ CMD_CRYPT_HOOK
:crypt-hook
Definition command.h:70
@ CMD_UNSETENV
:unsetenv
Definition command.h:141
@ CMD_UNALTERNATES
:unalternates
Definition command.h:122
@ CMD_MBOX_HOOK
:mbox-hook
Definition command.h:91
@ CMD_UNSCORE
:unscore
Definition command.h:139
@ CMD_UNMAILBOXES
:unmailboxes
Definition command.h:134
@ CMD_UNATTACHMENTS
:unattachments
Definition command.h:124
@ CMD_FOLDER_HOOK
:folder-hook
Definition command.h:76
@ CMD_UNMONO
:unmono
Definition command.h:137
@ CMD_SUBJECT_REGEX
:subject-regex
Definition command.h:114
@ CMD_HEADER_ORDER
:header-order
Definition command.h:78
@ CMD_UNHOOK
:unhook
Definition command.h:130
@ CMD_UNBIND
:unbind
Definition command.h:126
@ CMD_UNMAILTO_ALLOW
:unmailto-allow
Definition command.h:135
@ CMD_RESET
:reset
Definition command.h:101
@ CMD_NAMED_MAILBOXES
:named-mailboxes
Definition command.h:96
@ CMD_TOGGLE
:toggle
Definition command.h:120
@ CMD_UNSET
:unset
Definition command.h:140
@ CMD_SET
:set
Definition command.h:106
@ CMD_OPEN_HOOK
:open-hook
Definition command.h:98
@ CMD_APPEND_HOOK
:append-hook
Definition command.h:62
@ CMD_UNMY_HEADER
:unmy-header
Definition command.h:138
CommandResult
Error codes for command_t parse functions.
Definition command.h:35
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition command.h:38
@ MUTT_CMD_ERROR
Error: Can't help the user.
Definition command.h:36
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Definition command.h:37
@ MUTT_CMD_FINISH
Finish: Stop processing this file.
Definition command.h:39
uint8_t CommandFlags
Special characters that end a text string.
Definition command.h:45
Convenience wrapper for the library headers.
String manipulation buffer.
Definition buffer.h:36
enum CommandResult(* parse)(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Definition command.h:176
CommandFlags flags
Command flags, e.g. CF_SYNONYM.
Definition command.h:184
const char * proto
Command prototype.
Definition command.h:181
const char * help
One-line description of the Command.
Definition command.h:180
const char * path
Help path, relative to the NeoMutt Docs.
Definition command.h:182
intptr_t data
Data or flags to pass to the command.
Definition command.h:178
const char * name
Name of the Command.
Definition command.h:159
enum CommandId id
ID of the Command.
Definition command.h:160