#include <lib-ui/lib-ui.h>
-#include "enter.h"
#include "menu.h"
+#include "browser.h"
#include "mutt.h"
#include "alias.h"
#include "history.h"
#include "buffy.h"
+typedef struct {
+ wchar_t *wbuf;
+ size_t wbuflen;
+ size_t lastchar;
+ size_t curpos;
+ size_t begin;
+ int tabs;
+} ENTER_STATE;
+
/* redraw flags for mutt_enter_string() */
enum {
M_REDRAW_INIT = 1, /* go to end of line and redraw */
p_delete(&savebuf);
}
-int mutt_enter_string (char *buf, size_t buflen, int y, int x,
- int flags, int multiple, char ***files, int *numfiles,
- ENTER_STATE * state)
+static int
+mutt_enter_string(char *buf, size_t buflen, int y, int x, int flags,
+ int multiple, char ***files, int *numfiles,
+ ENTER_STATE *state)
{
int width = COLS - x - 1;
int redraw;
return rv;
}
-void mutt_free_enter_state (ENTER_STATE ** esp)
+int _mutt_get_field(const char *field, char *buf, ssize_t buflen, int flags,
+ int multiple, char ***files, int *numfiles)
{
- if (!esp)
- return;
+ int ret;
+ int x, y;
+ ENTER_STATE es;
+
+ p_clear(&es, 1);
- p_delete(&(*esp)->wbuf);
- p_delete(esp);
+ do {
+ CLEARLINE(stdscr, LINES - 1);
+ waddstr (stdscr, field);
+ mutt_refresh ();
+ getyx (stdscr, y, x);
+ ret = mutt_enter_string(buf, buflen, y, x, flags, multiple, files,
+ numfiles, &es);
+ } while (ret == 1);
+ CLEARLINE(stdscr, LINES - 1);
+
+ p_delete(&es.wbuf);
+ return ret;
}
/*