-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextern.h
More file actions
119 lines (101 loc) · 3.18 KB
/
extern.h
File metadata and controls
119 lines (101 loc) · 3.18 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
* Widely sued defines and extern statements
*
* @(#)extern.h 4.35 (Berkeley) 02/05/99
*
* Rogue: Exploring the Dungeons of Doom
* Copyright (C) 1980-1983, 1985, 1999 Michael Toy, Ken Arnold and Glenn Wichman
* All rights reserved.
*
* See the file LICENSE for full copyright and licensing information.
*/
#if !defined(INCLUDE_EXTERN_H)
#define INCLUDE_EXTERN_H
/*
* Don't change the constants, since they are used for sizes in many
* places in the program.
*/
#include <stdlib.h>
#include <sys/types.h>
#define MAXSTR 1024 /* maximum length of strings */
#define SHORTSTR 32 /* typical short string */
#define MAXLINES 32 /* maximum number of screen lines used */
#define MAXCOLS 80 /* maximum number of screen columns used */
#if defined(NON_BSD_RN_GENERATOR)
/*
* NOTE: The RN is a poor way to generate pseudo-random numbers.
* Worse, the RN value limits the seed value to a 16-bit pseudo-random number.
*/
# define RN (((seed = seed*11109+13849) >> 16) & 0xffff)
#else
/*
* use the BSD random(3) generator, seed by he dungeon number to generate a 31-bit pseudo-random number.
*/
# define RN ((unsigned int)random())
#endif
#ifdef CTRL
#undef CTRL
#endif
#define CTRL(c) (c & 037)
/* maximum length the score line apart from the username */
#define MAX_OTHER_SCORE 80
/* must be an just integer = MAX_USERNAME+MAX_OTHER_SCORE */
#define MAXSCORELINE (MAX_USERNAME+MAX_OTHER_SCORE)
/*
* Now all the global variables
*/
#define PFBUF_LEN (2*MAXSTR)
extern int got_ltc, in_shell;
extern int wizard;
extern char fruit[MAXSTR+1]; /* +1 for paranoia */
extern char prbuf[PFBUF_LEN+1]; /* +1 for paranoia */
extern int orig_dsusp;
extern FILE *scoreboard;
extern int numscores;
extern char *Numname;
extern int allscore;
extern char home[MAXSTR + 1]; /* home path plus trailing /, +1 for paranoia */
extern char lock_path[MAXSTR + 1]; /* rogue lock file path, +1 for paranoia */
extern char file_name[MAXSTR + 1]; /* rogue save file path, +1 for paranoia */
extern char score_path[MAXSTR + 1]; /* rogue score file path, +1 for paranoia */
/*
* Function types
*/
int md_chmod(const char *filename, int mode);
char *md_crypt(const char *key, const char *salt);
int md_dsuspchar(void);
int md_erasechar(void);
char *md_gethomedir(void);
char *md_getusername(void);
uid_t md_getuid(void);
char *md_getpass(char *prompt);
pid_t md_getpid(void);
char *md_getrealname(uid_t uid);
void md_init(void);
int md_killchar(void);
void md_normaluser(void);
void md_raw_standout(void);
void md_raw_standend(void);
int md_readchar(WINDOW *win);
int md_setdsuspchar(int c);
int md_shellescape(void);
void md_sleep(int s);
int md_suspchar(void);
int md_hasclreol(void);
int md_unlink(char *file);
int md_unlink_open_file(const char *file, FILE *inf);
void md_tstpsignal(void);
void md_tstphold(void);
void md_tstpresume(void);
void md_ignoreallsignals(void);
void md_onsignal_autosave(void);
void md_onsignal_exit(void);
void md_onsignal_default(void);
int md_issymlink(char *sp);
extern char *xcrypt(const char *key, const char *setting);
extern void form_home(void);
extern void form_lock_path(void);
extern void form_save_path(void);
extern void form_score_path(void);
extern void endwin_and_ncurses_cleanup(void);
#endif