64 if (*line->
dptr ==
'#')
66 if (*line->
dptr ==
';')
73 const int token_len =
buf_len(token);
74 if ((token_len > 0) && (
buf_at(token, token_len - 1) ==
'?'))
76 token->
data[token_len - 1] =
'\0';
81 const struct Command **cp = NULL;
84 const struct Command *cmd = *cp;
97 rc = cmd->
parse(cmd, line, err);
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
int buf_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
void buf_seek(struct Buffer *buf, size_t offset)
Set current read/write position to offset from beginning.
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
char buf_at(const struct Buffer *buf, size_t offset)
Return the character at the given offset.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
@ MUTT_CMD_WARNING
Warning: Help given to the user.
@ MUTT_CMD_FINISH
Finish: Stop processing this file.
Convenience wrapper for the core headers.
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
static bool show_help(struct CliHelp *help)
Show the Help.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
@ NT_COMMAND
A Command has been executed, Command.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
enum CommandResult parse_rc_line(struct Buffer *line, struct Buffer *err)
Parse a line of user config.
String manipulation buffer.
char * dptr
Current read/write position.
char * data
Pointer to data.
enum CommandResult(* parse)(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
const char * proto
Command prototype.
const char * help
One-line description of the Command.
const char * path
Help path, relative to the NeoMutt Docs.
const char * name
Name of the command.
Container for Accounts, Notifications.
struct CommandArray commands
NeoMutt commands.
struct Notify * notify
Notifications handler.