File: gramofile.c

package info (click to toggle)
gramofile 1.6-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 820 kB
  • ctags: 536
  • sloc: ansic: 10,238; makefile: 55
file content (66 lines) | stat: -rw-r--r-- 990 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* GramoFile - Main

 * Copyright (C) 1998 J.A. Bezemer
 *
 * Licensed under the terms of the GNU General Public License.
 * ABSOLUTELY NO WARRANTY.
 * See the file `COPYING' in this directory.
 */

#include "mainmenu.h"
#include "splashscr.h"
#include <signal.h>
#include <unistd.h>
#include <string.h>
#ifndef OLD_CURSES
#include <ncurses.h>
#else
#include <curses.h>
#endif


void
init_curses (void)
{
  initscr ();
  keypad (stdscr, TRUE);
  nonl ();
  cbreak ();
  noecho ();

  /* Xterms erase everything after the first refresh,
     so refresh one time before anything is added. */
  refresh ();

  return;
}

static void
finishmenu (int sig)
{
  endwin ();
  exit (0);
}

void
main (void)
{
  char startdir[250];
  char *helpcharptr;

  signal (SIGINT, finishmenu);

  init_curses ();

  splashscreen ();

  helpcharptr = getcwd (startdir, 250);
  if (helpcharptr == NULL)
    strcpy (startdir, "/");
  else
    strcat (startdir, "/");

  mainmenu (startdir);

  finishmenu (0);
}