65 fprintf(fp,
"bind %s %*s %*s # %s\n", menu_name, -wb0, bi->
a[0], -wb1,
126 fprintf(fp,
"macro %s %*s \"%s\" \"%s\"\n", menu_name, -wm0, bi->
a[0],
131 fprintf(fp,
"macro %s %*s \"%s\"\n", menu_name, -wm0, bi->
a[0], bi->
a[1]);
175 intptr_t data,
struct Buffer *err)
178 struct Buffer *tempfile = NULL;
179 bool dump_all =
false;
180 bool bind = (
data == 0);
232 buf_printf(err, bind ?
_(
"%s: no binds for this menu") :
_(
"%s: no macros for this menu"),
243 pview.
banner = bind ?
"bind" :
"macro";
#define ARRAY_SORT(head, fn, sdata)
Sort an array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_SIZE(head)
The number of elements stored.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
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.
Convenience wrapper for the core headers.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
enum CommandResult dump_bind_macro(struct Buffer *buf, struct Buffer *s, intptr_t data, struct Buffer *err)
Parse 'bind' and 'macro' commands - Implements Command::parse() -.
int binding_sort(const void *a, const void *b, void *sdata)
Compare two BindingInfo by their keybinding - Implements sort_t -.
static void colon_macro(enum MenuType menu, FILE *fp)
Dump the macros.
static void colon_bind(enum MenuType menu, FILE *fp)
Dump the key bindings.
static int print_bind(enum MenuType menu, FILE *fp)
Display the bindings for one menu.
static int print_macro(enum MenuType menu, FILE *fp)
Display the macros for one menu.
int measure_column(struct BindingInfoArray *bia, int col)
Measure one column of a table.
void gather_menu(enum MenuType menu, struct BindingInfoArray *bia_bind, struct BindingInfoArray *bia_macro)
Gather info about one menu.
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
const char * mutt_map_get_name(int val, const struct Mapping *map)
Lookup a string for a constant.
Convenience wrapper for the library headers.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
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.
Info about one keybinding.
const char * a[3]
Array of info.
String manipulation buffer.
char * data
Pointer to data.
const struct Mapping MenuNames[]
Menu name lookup table.
MenuType
Types of GUI selections.