Remove kerberosIV from the build.
[dragonfly.git] / gnu / lib / libdialog / TESTS / tree.c
1 /*
2  * tree.c
3  *
4  * small test-driver for new dialog functionality
5  *
6  * Copyright (c) 1998, Anatoly A. Orehovsky
7  *
8  * $FreeBSD: src/gnu/lib/libdialog/TESTS/tree.c,v 1.2 2000/01/10 11:52:10 phantom Exp $
9  * $DragonFly: src/gnu/lib/libdialog/TESTS/tree.c,v 1.3 2003/08/05 07:45:39 asmodai Exp $
10  */
11
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <dialog.h>
15
16 unsigned char *names[] = {
17         "/",
18         "/dev",
19         "/dev/fd",
20         "/tmp",
21         "/usr",
22         "/var",
23         "/home",
24         "/stand",
25         "/stand/etc",
26         "/stand/en_US.ISO8859-1",
27         "/stand/info",
28         "/stand/info/bin",
29         "/stand/info/des",
30         "/stand/info/games",
31         "/stand/info/manpages",
32         "/stand/info/proflibs",
33         "/stand/info/dict",
34         "/stand/info/info",
35         "/stand/info/src",
36         "/etc",
37         "/etc/gnats",
38         "/etc/mtree",
39         "/etc/namedb",
40         "/etc/ppp",
41         "/etc/uucp",
42         "/etc/sliphome",
43         "/proc",
44         "/lkm",
45         "/mnt",
46         "/root",
47         "/sbin",
48         "/bin",
49         0
50 };
51
52 unsigned char *names1[] = {
53         "a",
54         "a:b",
55         "a:b:c",
56         "a:d"
57 };
58
59 int
60 main(int argc, char **argv)
61 {
62         int retval;
63         unsigned char *tresult;
64         char comstr[BUFSIZ];
65
66         init_dialog();
67         do {
68                 use_helpline("Press OK for listing directory");
69                 retval = dialog_tree(names, 
70                         sizeof(names)/sizeof(unsigned char *) - 1,
71                          '/',
72                         "tree dialog box example",
73                         "Typical find -x / -type d output", 
74                         -1, -1, 15,
75                                     &tresult);
76                 
77                 if (retval)
78                         break;
79                 
80                 use_helpline(NULL);
81                 (void)snprintf(comstr, sizeof(comstr), 
82                         "ls -CF %s", tresult);
83
84                 retval = dialog_prgbox(
85                         comstr, 
86                         comstr, 20, 60, TRUE, TRUE);
87
88                 dialog_clear();
89                 
90                 retval = dialog_tree(names1, 
91                         sizeof(names1)/sizeof(unsigned char *),
92                          ':',
93                         "tree dialog box example",
94                         "Other tree", 
95                         -1, -1, 5,
96                                     &tresult);
97                 if (!retval)
98                 {
99                         dialog_clear();
100                 }
101         } while (!retval);
102
103         dialog_update();
104         
105         dialog_clear();
106         
107         end_dialog();
108         
109         exit(retval);
110 }