aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/test/testscanw.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-08-24 01:06:48 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-08-24 01:06:48 +0000
commit0e3d540892016a47f6a68ec9ba2879d35ce5f7c2 (patch)
treead214c5b2c8142ad6dc6d2ce3a9c83e6317d7f77 /contrib/ncurses/test/testscanw.c
downloadsrc-0e3d540892016a47f6a68ec9ba2879d35ce5f7c2.tar.gz
src-0e3d540892016a47f6a68ec9ba2879d35ce5f7c2.zip
Import unmodified (but trimmed) ncurses 5.0 prerelease 990821.vendor/ncurses/5.0-19990821
This contains the full eti (panel, form, menu) extensions. bmake glue to follow. Obtained from: ftp://ftp.clark.net/pub/dickey/ncurses
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=50276 svn path=/vendor/ncurses/5.0-19990821/; revision=50278; tag=vendor/ncurses/5.0-19990821
Diffstat (limited to 'contrib/ncurses/test/testscanw.c')
-rw-r--r--contrib/ncurses/test/testscanw.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/ncurses/test/testscanw.c b/contrib/ncurses/test/testscanw.c
new file mode 100644
index 000000000000..8420ea0fc55a
--- /dev/null
+++ b/contrib/ncurses/test/testscanw.c
@@ -0,0 +1,38 @@
+/* gleaned from a web-search, shows a bug combining scanw and implicit scroll.
+ * Date: 1997/03/17
+ * From: bayern@morpheus.cis.yale.edu
+ *
+ * $Id: testscanw.c,v 1.5 1997/09/20 14:16:20 tom Exp $
+ */
+#include <test.priv.h>
+#include <ctype.h>
+
+int main(int argc, char *argv[])
+{
+ long badanswer = 1;
+ long *response = &badanswer;
+
+ initscr();
+ scrollok(stdscr, TRUE);
+ idlok(stdscr, TRUE);
+ echo();
+
+#if 0
+ trace(TRACE_UPDATE|TRACE_CALLS);
+#endif
+ while (argc > 1) {
+ if (isdigit(*argv[1]))
+ move(atoi(argv[1]), 0);
+ else if (!strcmp(argv[1], "-k"))
+ keypad(stdscr, TRUE);
+ argc--, argv++;
+ }
+
+ while (badanswer) {
+ printw("Enter a number (0 to quit):\n");
+ printw("--> ");
+ scanw("%20ld", response); /* yes, it's a pointer */
+ }
+ endwin();
+ return EXIT_SUCCESS;
+}