80 if (!line || (*line ==
'\0') || !err)
94 for (
size_t i = 0; ICommandList[i].
name; i++)
99 rc = ICommandList[i].
parse(token, &expn, ICommandList[i].
data, err);
120 char key_binding[32];
121 const char *fn_name = NULL;
124 if (map->
op == OP_NULL)
188 struct Keymap *map = NULL;
192 if (bind && (map->
op != OP_MACRO))
197 else if (!bind && (map->
op == OP_MACRO))
217 struct Mapping menu = { menu_name, i };
219 const bool empty =
dump_menu(buf, &menu, bind);
222 if (!empty && (i < (MENU_MAX - 1)))
231 intptr_t data,
struct Buffer *err)
235 bool dump_all =
false, bind = (data == 0);
257 if (menu_index == -1)
273 mutt_buffer_printf(err, bind ?
_(
"%s: no binds for this menu") :
_(
"%s: no macros for this menu"),
274 dump_all ?
"all" : buf->
data);
288 fputs(filebuf.
data, fp_out);
307 intptr_t data,
struct Buffer *err)
312 if (!
set && !set_all)
341 intptr_t data,
struct Buffer *err)
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Convenience wrapper for the gui headers.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
CommandResult
Error codes for command_t parse functions.
#define CS_DUMP_ONLY_CHANGED
Only show config that the user has changed.
struct KeymapList Keymaps[MENU_MAX]
Array of Keymap keybindings, one for each Menu.
Error: Can't help the user.
char * name
Name of the command.
static enum CommandResult icmd_version(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse 'version' command - Implements ICommand::parse()
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
void print_version(FILE *fp)
Print system and compile info to a file.
String manipulation buffer.
static void dump_bind(struct Buffer *buf, struct Mapping *menu, struct Keymap *map)
Dump a bind map to a buffer.
static bool dump_menu(struct Buffer *buf, struct Mapping *menu, bool bind)
Dumps all the binds or macros maps of a menu into a buffer.
An Informational Command.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
All user-callable functions.
Container for Accounts, Notifications.
enum CommandResult mutt_parse_icommand(char *line, struct Buffer *err)
Parse an informational command.
Convenience wrapper for the config headers.
Some miscellaneous functions.
Pager pager (email viewer)
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
const char * mutt_get_func(const struct Binding *bindings, int op)
Get the name of a function.
struct ConfigSet * cs
Parent ConfigSet.
static enum CommandResult icmd_set(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse 'set' command to display config - Implements ICommand::parse()
Many unsorted constants and some structs.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
const struct Binding OpGeneric[]
Key bindings for the generic menu.
Convenience wrapper for the core headers.
short op
operation to perform
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
int mutt_buffer_add_printf(struct Buffer *buf, const char *fmt,...)
Format a string appending a Buffer.
static void dump_all_menus(struct Buffer *buf, bool bind)
Dumps all the binds or macros inside every menu.
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
const struct Mapping Menus[]
Menu name lookup table.
#define mutt_mktemp(buf, buflen)
enum CommandResult(* parse)(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Function to parse information commands.
int mutt_extract_token(struct Buffer *dest, struct Buffer *tok, TokenFlags flags)
Extract one token from a string.
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
#define CS_DUMP_NO_FLAGS
No flags are set.
char * macro
macro expansion (op == OP_MACRO)
char * dptr
Current read/write position.
char * data
Pointer to data.
bool dump_config(struct ConfigSet *cs, ConfigDumpFlags flags, FILE *fp)
Write all the config to a file.
#define STAILQ_FOREACH(var, head, field)
Display version and copyright about NeoMutt.
size_t mutt_buffer_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
char * desc
description of a macro for the help menu
Definitions of user functions.
int mutt_do_pager(const char *banner, const char *tempfile, PagerFlags do_color, struct Pager *info)
Display some page-able text to the user.
size_t escape_string(struct Buffer *buf, const char *src)
Write a string to a buffer, escaping special characters.
const struct Binding * km_get_table(enum MenuType menu)
Lookup a menu's keybindings.
static enum CommandResult icmd_bind(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse 'bind' and 'macro' commands - Implements ICommand::parse()
Mapping between user-readable string and a constant.
static void dump_macro(struct Buffer *buf, struct Mapping *menu, struct Keymap *map)
Dump a macro map to a buffer.
struct ConfigSubset * sub
Inherited config items.
Convenience wrapper for the library headers.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Mapping between a user key and a function.
#define MUTT_TOKEN_NO_FLAGS
No flags are set.
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.