projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
curs_lib.c
diff --git
a/curs_lib.c
b/curs_lib.c
index
9f77340
..
13539e2
100644
(file)
--- a/
curs_lib.c
+++ b/
curs_lib.c
@@
-16,6
+16,7
@@
#endif
#include "mutt.h"
#endif
#include "mutt.h"
+#include "enter.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "pager.h"
#include "mutt_menu.h"
#include "mutt_curses.h"
#include "pager.h"
@@
-137,16
+138,14
@@
int _mutt_get_field ( /* const */ char *field, char *buf, size_t buflen,
return (ret);
}
return (ret);
}
-int mutt_get_
password (char *msg, char *buf, size_t buflen
)
+int mutt_get_
field_unbuffered (char *msg, char *buf, size_t buflen, int flags
)
{
int rc;
{
int rc;
- CLEARLINE (LINES - 1);
- addstr (msg);
set_option (OPTUNBUFFEREDINPUT);
set_option (OPTUNBUFFEREDINPUT);
- rc = mutt_
enter_string (buf, buflen, LINES - 1, mutt_strlen (msg), M_PASS
);
+ rc = mutt_
get_field (msg, buf, buflen, flags
);
unset_option (OPTUNBUFFEREDINPUT);
unset_option (OPTUNBUFFEREDINPUT);
- CLEARLINE (LINES - 1);
+
return (rc);
}
return (rc);
}
@@
-215,12
+214,12
@@
int mutt_yesorno (const char *msg, int def)
* ensure there is enough room for the answer and truncate the question
* to fit.
*/
* ensure there is enough room for the answer and truncate the question
* to fit.
*/
- answer_string =
safe
_malloc (COLS + 1);
+ answer_string =
mem
_malloc (COLS + 1);
snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def == M_YES ? yes : no,
def == M_YES ? no : yes);
snprintf (answer_string, COLS + 1, " ([%s]/%s): ", def == M_YES ? yes : no,
def == M_YES ? no : yes);
- answer_string_len =
mutt_str
len (answer_string);
+ answer_string_len =
str_
len (answer_string);
printw ("%.*s%s", COLS - answer_string_len, msg, answer_string);
printw ("%.*s%s", COLS - answer_string_len, msg, answer_string);
-
FREE
(&answer_string);
+
mem_free
(&answer_string);
FOREVER {
mutt_refresh ();
FOREVER {
mutt_refresh ();
@@
-277,7
+276,7
@@
void mutt_query_exit (void)
if (Timeout)
timeout (-1); /* restore blocking operation */
if (mutt_yesorno (_("Exit Mutt-ng?"), M_YES) == M_YES) {
if (Timeout)
timeout (-1); /* restore blocking operation */
if (mutt_yesorno (_("Exit Mutt-ng?"), M_YES) == M_YES) {
-
endwin (
);
+
mutt_endwin (NULL
);
exit (1);
}
mutt_clear_error ();
exit (1);
}
mutt_clear_error ();
@@
-403,7
+402,7
@@
int mutt_do_pager (const char *banner,
{
int rc;
{
int rc;
- if (!Pager ||
mutt_str
cmp (Pager, "builtin") == 0)
+ if (!Pager ||
str_
cmp (Pager, "builtin") == 0)
rc = mutt_pager (banner, tempfile, do_color, info);
else {
char cmd[STRING];
rc = mutt_pager (banner, tempfile, do_color, info);
else {
char cmd[STRING];
@@
-448,7
+447,7
@@
int _mutt_enter_fname (const char *prompt, char *buf, size_t blen,
*redraw = REDRAW_FULL;
}
else {
*redraw = REDRAW_FULL;
}
else {
- char *pc =
safe_malloc (mutt_str
len (prompt) + 3);
+ char *pc =
mem_malloc (str_
len (prompt) + 3);
sprintf (pc, "%s: ", prompt); /* __SPRINTF_CHECKED__ */
mutt_ungetch (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
sprintf (pc, "%s: ", prompt); /* __SPRINTF_CHECKED__ */
mutt_ungetch (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
@@
-458,7
+457,7
@@
int _mutt_enter_fname (const char *prompt, char *buf, size_t blen,
!= 0)
buf[0] = 0;
MAYBE_REDRAW (*redraw);
!= 0)
buf[0] = 0;
MAYBE_REDRAW (*redraw);
-
FREE
(&pc);
+
mem_free
(&pc);
}
return 0;
}
return 0;
@@
-472,7
+471,7
@@
void mutt_ungetch (int ch, int op)
tmp.op = op;
if (UngetCount >= UngetBufLen)
tmp.op = op;
if (UngetCount >= UngetBufLen)
-
safe
_realloc (&KeyEvent, (UngetBufLen += 128) * sizeof (event_t));
+
mem
_realloc (&KeyEvent, (UngetBufLen += 128) * sizeof (event_t));
KeyEvent[UngetCount++] = tmp;
}
KeyEvent[UngetCount++] = tmp;
}
@@
-528,7
+527,7
@@
int mutt_multi_choice (char *prompt, char *letters)
}
else if (ch.ch <= '9' && ch.ch > '0') {
choice = ch.ch - '0';
}
else if (ch.ch <= '9' && ch.ch > '0') {
choice = ch.ch - '0';
- if (choice <=
mutt_str
len (letters))
+ if (choice <=
str_
len (letters))
break;
}
}
break;
}
}
@@
-648,7
+647,7
@@
static void mutt_format_s_x (char *dest,
}
mutt_format_string (dest, destlen, min_width, max_width,
}
mutt_format_string (dest, destlen, min_width, max_width,
- right_justify, ' ', s,
mutt_str
len (s), arboreal);
+ right_justify, ' ', s,
str_
len (s), arboreal);
}
void mutt_format_s (char *dest,
}
void mutt_format_s (char *dest,
@@
-673,7
+672,7
@@
void mutt_paddstr (int n, const char *s)
wchar_t wc;
int w;
size_t k;
wchar_t wc;
int w;
size_t k;
- size_t len =
mutt_str
len (s);
+ size_t len =
str_
len (s);
mbstate_t mbstate;
memset (&mbstate, 0, sizeof (mbstate));
mbstate_t mbstate;
memset (&mbstate, 0, sizeof (mbstate));
@@
-697,7
+696,7
@@
void mutt_paddstr (int n, const char *s)
}
/*
}
/*
- * mutt_strwidth is like
mutt_str
len except that it returns the width
+ * mutt_strwidth is like
str_
len except that it returns the width
* refering to the number of characters cells.
*/
* refering to the number of characters cells.
*/
@@
-711,7
+710,7
@@
int mutt_strwidth (const char *s)
if (!s)
return 0;
if (!s)
return 0;
- n =
mutt_str
len (s);
+ n =
str_
len (s);
memset (&mbstate, 0, sizeof (mbstate));
for (w = 0; n && (k = mbrtowc (&wc, s, n, &mbstate)); s += k, n -= k) {
memset (&mbstate, 0, sizeof (mbstate));
for (w = 0; n && (k = mbrtowc (&wc, s, n, &mbstate)); s += k, n -= k) {