check curses-libs by configure
[openafs.git] / src / gtx / curses_test.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*
11  * Test of the curses package, to make sure I really understand how to use it.
12  */
13
14 #include <afsconfig.h>
15 #include <afs/param.h>
16
17 #if defined(HAVE_NCURSES_H)
18 # include <ncurses.h>
19 #elif defined(HAVE_CURSES_H)
20 # include <curses.h>
21 #endif
22
23 #include "AFS_component_version_number.c"
24
25 main(argc, argv)
26      int argc;
27      char **argv;
28
29 {                               /*main */
30
31     WINDOW *mainscr;
32     char str[128];
33     int i;
34
35     mainscr = initscr();
36     scrollok(stdscr, TRUE);
37     clear();
38     addstr("This is my first curses string ever!\n");
39     refresh();
40     box(stdscr, '|', '-');
41     standout();
42     addstr("This is a standout string\n");
43     refresh();
44     standend();
45
46 #if 0
47     box addstr("Enter a string and a number: ");
48     refresh();
49     scanw(stdscr, "%s %d", str, &i);
50     wprintw(stdscr, "String was '%s', number was %d\n", str, i);
51     refresh();
52 #endif /* 0 */
53
54     endwin();
55
56 }                               /*main */