Debian Codegraph @

gramofile.c

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 /* GramoFile - Main
2
3 * Copyright (C) 1998 J.A. Bezemer
4 *
5 * Licensed under the terms of the GNU General Public License.
6 * ABSOLUTELY NO WARRANTY.
7 * See the file `COPYING' in this directory.
8 */
9
10 #include "mainmenu.h"
11 #include "splashscr.h"
12 #include <signal.h>
13 #include <unistd.h>
14 #include <string.h>
15 #ifndef OLD_CURSES
16 #include <ncurses.h>
17 #else
18 #include <curses.h>
19 #endif
20
21
22 void
23 init_curses (void)
24 {
25 initscr ();
26 keypad (stdscr, TRUE);
27 nonl ();
28 cbreak ();
29 noecho ();
30
31 /* Xterms erase everything after the first refresh,
32 so refresh one time before anything is added. */
33 refresh ();
34
35 return;
36 }
37
38 static void
39 finishmenu (int sig)
40 {
41 endwin ();
42 exit (0);
43 }
44
45 void
46 main (void)
47 {
48 char startdir[250];
49 char *helpcharptr;
50
51 signal (SIGINT, finishmenu);
52
53 init_curses ();
54
55 splashscreen ();
56
57 helpcharptr = getcwd (startdir, 250);
58 if (helpcharptr == NULL)
59 strcpy (startdir, "/");
60 else
61 strcat (startdir, "/");
62
63 mainmenu (startdir);
64
65 finishmenu (0);
66 }