Hide it.
Note: I'd like to get rid of that poo and replace with a proper
readline-like ncurses-aware widget that comes with all the vi/emacs bindings
ready :/
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
/* remote host account manipulation (POP/IMAP) */
#include <lib-lib/lib-lib.h>
-#include <lib-ui/enter.h>
#include <lib-ui/lib-ui.h>
#include "mutt.h"
#include <lib-sys/unix.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include "alias.h"
#include <grp.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-mx/mx.h>
#include <lib-lua/lib-lua.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-mx/mx.h>
#include <lib-mime/mime.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-mx/mx.h>
#include <lib-mime/mime.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-mx/mx.h>
#include <lib-lib/lib-lib.h>
-#include <lib-ui/enter.h>
-
#include "mutt.h"
#include "imap_private.h"
#include <lib-sys/mutt_signal.h>
#include "menu.h"
-#include "enter.h"
#include "mutt.h"
#include "pager.h"
return (ch == ctrl ('G') ? err : ret);
}
-int _mutt_get_field ( const char *field, char *buf, ssize_t buflen,
- int complete, int multiple, char ***files, int *numfiles)
-{
- int ret;
- int x, y;
-
- ENTER_STATE *es = mutt_new_enter_state ();
-
- do {
- CLEARLINE(stdscr, LINES - 1);
- waddstr (stdscr, field);
- mutt_refresh ();
- getyx (stdscr, y, x);
- ret = mutt_enter_string(buf, buflen, y, x, complete, multiple, files,
- numfiles, es);
- } while (ret == 1);
- CLEARLINE(stdscr, LINES - 1);
- mutt_free_enter_state (&es);
-
- return (ret);
-}
-
int mutt_get_field_unbuffered (char *msg, char *buf, ssize_t buflen, int flags)
{
int rc;
MT_COLOR_MAX
};
+/* flags for mutt_get_field() */
+#define M_ALIAS (1<<0) /* do alias "completion" by calling up the alias-menu */
+#define M_FILE (1<<1) /* do file completion */
+#define M_EFILE (1<<2) /* do file completion, plus incoming folders */
+#define M_CMD (1<<3) /* do completion on previous word */
+#define M_PASS (1<<4) /* password mode (no echo) */
+#define M_CLEAR (1<<5) /* clear input if printable character is pressed */
+#define M_COMMAND (1<<6) /* do command completion */
+#define M_PATTERN (1<<7) /* pattern mode - only used for history classes */
+#define M_LASTFOLDER (1<<8) /* last-folder mode - hack hack hack */
+
typedef struct color_line {
regex_t rx;
char *pattern;
#include <lib-ui/lib-ui.h>
-#include "enter.h"
#include "menu.h"
#include "mutt.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);
}
/*
+++ /dev/null
-/*
- * Copyright notice from original mutt:
- * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
- *
- * This file is part of mutt-ng, see http://www.muttng.org/.
- * It's licensed under the GNU General Public License,
- * please see the file GPL in the top level source directory.
- */
-#ifndef _MUTT_ENTER_H
-#define _MUTT_ENTER_H
-
-/* flags for mutt_enter_string() */
-#define M_ALIAS 1 /* do alias "completion" by calling up the alias-menu */
-#define M_FILE (1<<1) /* do file completion */
-#define M_EFILE (1<<2) /* do file completion, plus incoming folders */
-#define M_CMD (1<<3) /* do completion on previous word */
-#define M_PASS (1<<4) /* password mode (no echo) */
-#define M_CLEAR (1<<5) /* clear input if printable character is pressed */
-#define M_COMMAND (1<<6) /* do command completion */
-#define M_PATTERN (1<<7) /* pattern mode - only used for history classes */
-#define M_LASTFOLDER (1<<8) /* last-folder mode - hack hack hack */
-
-typedef struct {
- wchar_t *wbuf;
- size_t wbuflen;
- size_t lastchar;
- size_t curpos;
- size_t begin;
- int tabs;
-} ENTER_STATE;
-
-#define mutt_new_enter_state() p_new(ENTER_STATE, 1)
-
-void mutt_free_enter_state (ENTER_STATE **);
-int mutt_enter_string (char *, size_t, int, int, int, int, char ***, int *,
- ENTER_STATE *);
-
-#endif /* !_MUTT_ENTER_H */
#include <lib-ui/lib-ui.h>
-#include "enter.h"
#include "menu.h"
#include "mutt.h"
#include <pwd.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-sys/unix.h>
#include <imap/imap.h>
#include <lib-lib/lib-lib.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-ui/madtty.h>
#include <lib-mx/mx.h>
#include <lib-lib/lib-lib.h>
#include <lib-mime/mime.h>
-#include <lib-ui/enter.h>
#include <lib-ui/lib-ui.h>
#include <lib-mx/mx.h>
#include <imap/imap.h>
#include <lib-mime/mime.h>
-#include <lib-ui/enter.h>
-#include <lib-ui/menu.h>
#include <lib-ui/lib-ui.h>
+#include <lib-ui/menu.h>
#include <lib-mx/mx.h>
#include <lib-sys/unix.h>
#include <lib-sys/unix.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-mx/mx.h>
#include <lib-mime/mime.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-mx/mx.h>
#include <lib-mime/rfc3676.h>
#include <lib-sys/unix.h>
#include <lib-ui/lib-ui.h>
-#include <lib-ui/enter.h>
#include <lib-mx/mx.h>
#include "alias.h"
#include <lib-sys/exit.h>
#include <lib-sys/mutt_signal.h>
#include <lib-mime/mime.h>
-#include <lib-ui/enter.h>
#include <lib-ui/lib-ui.h>
#include <lib-mx/mx.h>