return 0;
}
-
-/*
- * prompts the user to enter a keystroke, and displays the octal value back
- * to the user.
- */
-void mutt_what_key (void)
-{
- int ch;
-
- mvwprintw (stdscr, LINES - 1, 0, _("Enter keys (^G to abort): "));
- do {
- ch = wgetch (stdscr);
- if (ch != ERR && ch != ctrl ('G')) {
- mutt_message (_("Char = %s, Octal = %o, Decimal = %d"),
- km_keyname (ch), ch, ch);
- }
- }
- while (ch != ERR && ch != ctrl ('G'));
-
- mutt_flushinp ();
-}
struct keymap_t *km_find_func (int, int);
void km_init (void);
void km_error_key (int);
-void mutt_what_key (void);
enum {
MENU_ALIAS,
SETCOLOR (MT_COLOR_NORMAL);
}
+void curses_initialize(void)
+{
+ ci_start_color();
+ keypad(stdscr, TRUE);
+ cbreak();
+ noecho();
+ typeahead (-1); /* simulate smooth scrolling */
+ meta(stdscr, TRUE);
+}
+
+void curses_install(void)
+{
+ SETCOLOR(MT_COLOR_NORMAL);
+ wclear(stdscr);
+ mutt_error = mutt_curses_error;
+ mutt_message = mutt_curses_message;
+}
+
void mutt_endwin (const char *msg)
{
if (!option (OPTNOCURSES)) {
mutt_error ("%s: %s (errno = %d) from %s:%i", s, p ? p : _("unknown error"), errno, filename, line);
}
+/*
+ * prompts the user to enter a keystroke, and displays the octal value back
+ * to the user.
+ */
+void mutt_what_key (void)
+{
+ int ch;
+
+ mvwprintw (stdscr, LINES - 1, 0, _("Enter keys (^G to abort): "));
+ do {
+ ch = wgetch (stdscr);
+ if (ch != ERR && ch != ctrl ('G')) {
+ mutt_message (_("Char = %s, Octal = %o, Decimal = %d"),
+ km_keyname (ch), ch, ch);
+ }
+ }
+ while (ch != ERR && ch != ctrl ('G'));
+
+ mutt_flushinp ();
+}
+
int mutt_any_key_to_continue (const char *s)
{
struct termios t;
event_t mutt_getch (void);
+void curses_initialize(void);
+void curses_install(void);
+
void mutt_endwin (const char *);
void mutt_flushinp (void);
void mutt_refresh (void);
int mutt_addwch (wchar_t);
int mutt_alloc_color (int fg, int bg);
int mutt_any_key_to_continue (const char *);
+void mutt_what_key (void);
int mutt_complete (char *, ssize_t);
#define mutt_enter_fname(A,B,C,D,E) _mutt_enter_fname(A,B,C,D,E,0,NULL,NULL)
int _mutt_enter_fname (const char *, char *, ssize_t, int *, int, int,
extern COLOR_LINE *ColorBodyList;
extern COLOR_LINE *ColorIndexList;
-void ci_init_color (void);
void ci_start_color (void);
#define mutt_make_string(A,B,C,D,E) _mutt_make_string(A,B,C,D,E,0)
exit (1);
}
mutt_signal_initialize ();
- ci_start_color ();
- keypad (stdscr, TRUE);
- cbreak ();
- noecho ();
- typeahead (-1); /* simulate smooth scrolling */
- meta (stdscr, TRUE);
+ curses_initialize();
}
#define M_IGNORE (1<<0) /* -z */
/* This must come before mutt_init() because curses needs to be started
before calling the init_pair() function to set the color scheme. */
if (!option (OPTNOCURSES))
- start_curses ();
+ start_curses();
/* set defaults and read init files */
mutt_init (flags & M_NOSYSRC, commands);
if (newMagic)
mx_set_magic (newMagic);
- if (!option (OPTNOCURSES)) {
- SETCOLOR (MT_COLOR_NORMAL);
- wclear (stdscr);
- mutt_error = mutt_curses_error;
- mutt_message = mutt_curses_message;
+ if (!option(OPTNOCURSES)) {
+ curses_install();
}
/* Create the Maildir directory if it doesn't exist. */
- if (!option (OPTNOCURSES) && Maildir) {
+ if (!option(OPTNOCURSES) && Maildir) {
struct stat sb;
char fpath[_POSIX_PATH_MAX];
char mesg[STRING];