HAMMER Utilities: Sync with 60F
[dragonfly.git] / contrib / ncurses-5.4 / test / testscanw.c
blob8fc3908fcfbc6e5f031c66b3d91c9b25d636ea09
1 /* gleaned from a web-search, shows a bug combining scanw and implicit scroll.
2 * Date: 1997/03/17
3 * From: bayern@morpheus.cis.yale.edu
5 * $Id: testscanw.c,v 1.10 2002/10/19 22:11:24 tom Exp $
6 */
7 #include <test.priv.h>
9 int
10 main(int argc, char *argv[])
12 long badanswer = 1;
13 long *response = &badanswer;
15 setlocale(LC_ALL, "");
17 initscr();
18 scrollok(stdscr, TRUE);
19 idlok(stdscr, TRUE);
20 echo();
22 #if 0
23 trace(TRACE_UPDATE | TRACE_CALLS);
24 #endif
25 while (argc > 1) {
26 if (isdigit(UChar(*argv[1])))
27 move(atoi(argv[1]), 0);
28 else if (!strcmp(argv[1], "-k"))
29 keypad(stdscr, TRUE);
30 argc--, argv++;
33 while (badanswer) {
34 printw("Enter a number (0 to quit):\n");
35 printw("--> ");
36 scanw("%20ld", response); /* yes, it's a pointer */
38 endwin();
39 ExitProgram(EXIT_SUCCESS);