-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/buffer.h>
+#include <lib-ui/curses.h>
+#include <lib-ui/menu.h>
static struct mapping_t KeyNames[] = {
{"<PageUp>", KEY_PPAGE},
{"<PageDown>", KEY_NPAGE},
static struct mapping_t KeyNames[] = {
{"<PageUp>", KEY_PPAGE},
{"<PageDown>", KEY_NPAGE},
- if (isdigit ((unsigned char) s[1]) &&
- isdigit ((unsigned char) s[2]) &&
- isdigit ((unsigned char) s[3]) && s[4] == '>') {
- return (s[3] - '0') + (s[2] - '0') * 8 + (s[1] - '0') * 64;
- }
- return -1;
+ int n;
+
+ if (*s != '<')
+ return -1;
+ n = strtol(s + 1, (char **)&s, 8);
+ return *s == '>' ? n : -1;
km_bind (s, menu, op, NULL, NULL);
}
km_bind (s, menu, op, NULL, NULL);
}
if (!map)
return (retry_generic (menu, NULL, 0, 0));
if (!map)
return (retry_generic (menu, NULL, 0, 0));
/* ncurses doesn't return on resized screen when timeout is set to zero */
if (menu != MENU_EDITOR)
timeout ((Timeout > 0 ? Timeout : 60) * 1000);
/* ncurses doesn't return on resized screen when timeout is set to zero */
if (menu != MENU_EDITOR)
timeout ((Timeout > 0 ? Timeout : 60) * 1000);
/* careful not to feed the <..> as one token. otherwise
* push_string() will push the bogus op right back! */
mutt_ungetch ('>', 0);
/* careful not to feed the <..> as one token. otherwise
* push_string() will push the bogus op right back! */
mutt_ungetch ('>', 0);
}
else if (c >= KEY_F0 && c < KEY_F (256)) /* this maximum is just a guess */
sprintf (buf, "<F%d>", c - KEY_F0);
}
else if (c >= KEY_F0 && c < KEY_F (256)) /* this maximum is just a guess */
sprintf (buf, "<F%d>", c - KEY_F0);
snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
else
snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c);
snprintf (buf, sizeof (buf), "%c", (unsigned char) c);
else
snprintf (buf, sizeof (buf), "\\x%hx", (unsigned short) c);
create_bindings (OpPost, MENU_POST);
create_bindings (OpQuery, MENU_QUERY);
create_bindings (OpAlias, MENU_ALIAS);
create_bindings (OpPost, MENU_POST);
create_bindings (OpQuery, MENU_QUERY);
create_bindings (OpAlias, MENU_ALIAS);
-
-
- if ((WithCrypto & APPLICATION_PGP))
- create_bindings (OpPgp, MENU_PGP);
-
- if ((WithCrypto & APPLICATION_SMIME))
- create_bindings (OpSmime, MENU_SMIME);
-
-#ifdef CRYPT_BACKEND_GPGME
+ create_bindings (OpPgp, MENU_PGP);
+ create_bindings (OpSmime, MENU_SMIME);
create_bindings (OpPgp, MENU_KEY_SELECT_PGP);
create_bindings (OpSmime, MENU_KEY_SELECT_SMIME);
create_bindings (OpPgp, MENU_KEY_SELECT_PGP);
create_bindings (OpSmime, MENU_KEY_SELECT_SMIME);
create_bindings (OpMix, MENU_MIX);
km_bindkey ("<space>", MENU_MIX, OP_GENERIC_SELECT_ENTRY);
km_bindkey ("h", MENU_MIX, OP_MIX_CHAIN_PREV);
km_bindkey ("l", MENU_MIX, OP_MIX_CHAIN_NEXT);
create_bindings (OpMix, MENU_MIX);
km_bindkey ("<space>", MENU_MIX, OP_GENERIC_SELECT_ENTRY);
km_bindkey ("h", MENU_MIX, OP_MIX_CHAIN_PREV);
km_bindkey ("l", MENU_MIX, OP_MIX_CHAIN_NEXT);
/* bindings for the line editor */
create_bindings (OpEditor, MENU_EDITOR);
/* bindings for the line editor */
create_bindings (OpEditor, MENU_EDITOR);
-int mutt_parse_push (BUFFER * buf, BUFFER * s, unsigned long data,
+int mutt_parse_push (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)),
snprintf (err->data, err->dsize, _("%s: no such menu"), p);
goto error;
}
snprintf (err->data, err->dsize, _("%s: no such menu"), p);
goto error;
}
-int mutt_parse_bind (BUFFER * buf, BUFFER * s, unsigned long data,
+int mutt_parse_bind (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)),
- if ((key = parse_keymap (menu, s, sizeof (menu) / sizeof (menu[0]),
- &nummenus, err)) == NULL)
- return (-1);
+ if (!(key = parse_keymap(menu, s, countof(menu), &nummenus, err)))
+ return -1;
/* function to execute */
mutt_extract_token (buf, s, 0);
if (MoreArgs (s)) {
/* function to execute */
mutt_extract_token (buf, s, 0);
if (MoreArgs (s)) {
-int mutt_parse_macro (BUFFER * buf, BUFFER * s, unsigned long data,
+int mutt_parse_macro (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)),
mutt_extract_token (buf, s, M_TOKEN_CONDENSE);
/* make sure the macro sequence is not an empty string */
if (!*buf->data) {
mutt_extract_token (buf, s, M_TOKEN_CONDENSE);
/* make sure the macro sequence is not an empty string */
if (!*buf->data) {
-int mutt_parse_exec (BUFFER * buf, BUFFER * s, unsigned long data,
+int mutt_parse_exec (BUFFER * buf, BUFFER * s, unsigned long data __attribute__ ((unused)),