comparison srogue/main.c @ 36:2128c7dc8a40

Import Super-Rogue 9.0 from the Roguelike Restoration Project (r1490)
author elwin
date Thu, 25 Nov 2010 12:21:41 +0000
parents
children 34d7a614855e
comparison
equal deleted inserted replaced
35:05018c63a721 36:2128c7dc8a40
1 /*
2 * Rogue
3 * Exploring the dungeons of doom
4 *
5 * @(#)main.c 9.0 (rdk) 7/17/84
6 *
7 * Super-Rogue
8 * Copyright (C) 1984 Robert D. Kindelberger
9 * All rights reserved.
10 *
11 * Based on "Rogue: Exploring the Dungeons of Doom"
12 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
13 * All rights reserved.
14 *
15 * See the file LICENSE.TXT for full copyright and licensing information.
16 */
17
18 #include <time.h>
19 #include <termios.h>
20 #include <fcntl.h>
21 #include <stdio.h>
22 #include <signal.h>
23 #include <pwd.h>
24 #include <limits.h>
25 #include <sys/stat.h>
26 #include "rogue.h"
27
28 #ifdef ATT
29 #include <time.h>
30 #endif
31
32 #ifdef BSD
33 #define srand48(seed) srandom(seed)
34 #define lrand48() random()
35 #include <sys/time.h>
36 #endif
37
38 #include "rogue.ext"
39
40 struct termios terminal;
41
42 main(argc, argv, envp)
43 char **argv;
44 char **envp;
45 {
46 register char *env;
47 register struct linked_list *item;
48 register struct object *obj;
49 struct passwd *pw;
50 struct passwd *getpwuid();
51 char alldone, wpt;
52 char *getpass(), *xcrypt(), *strrchr();
53 int lowtime;
54 time_t now;
55 char *roguehome();
56 char *homedir = roguehome();
57
58 #ifdef __DJGPP__
59 _fmode = O_BINARY;
60 #endif
61
62 if (homedir == NULL)
63 homedir = "";
64
65 playuid = getuid();
66
67 if (setuid(playuid) < 0) {
68 printf("Cannot change to effective uid: %d\n", playuid);
69 exit(1);
70 }
71 playgid = getgid();
72
73 /* check for print-score option */
74
75 strcpy(scorefile, homedir);
76
77 if (*scorefile)
78 strcat(scorefile,"/");
79