backgammon(6)/hack(6)/larn(6): replace sgtty with termios
[dragonfly.git] / games / hack / config.h
CommitLineData
984263bc
MD
1/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2/* config.h - version 1.0.3 */
c7106d58 3/* $DragonFly: src/games/hack/config.h,v 1.3 2006/08/21 19:45:32 pavalos Exp $ */
984263bc 4
c7106d58 5#include <stdbool.h>
984263bc
MD
6#include "pathnames.h"
7
8#ifndef CONFIG /* make sure the compiler doesnt see the typedefs twice */
9
10#define CONFIG
11#define UNIX /* delete if no fork(), exec() available */
12#define CHDIR /* delete if no chdir() available */
13
984263bc
MD
14/* #define STUPID */ /* avoid some complicated expressions if
15 your C compiler chokes on them */
16/* #define PYRAMID_BUG */ /* avoid a bug on the Pyramid */
17/* #define NOWAITINCLUDE */ /* neither <wait.h> nor <sys/wait.h> exists */
18
19#define WIZARD "bruno" /* the person allowed to use the -D option */
20#define RECORD "record"/* the file containing the list of topscorers */
21#define NEWS "news" /* the file containing the latest hack news */
22#define HELP "help" /* the file containing a description of the commands */
23#define SHELP "hh" /* abbreviated form of the same */
24#define RUMORFILE "rumors" /* a file with fortune cookies */
25#define DATAFILE "data" /* a file giving the meaning of symbols used */
26#define FMASK 0660 /* file creation mask */
27#define HLOCK "perm" /* an empty file used for locking purposes */
28#define LLOCK "safelock" /* link to previous */
29
30#ifdef UNIX
31/*
32 * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
33 * If defined, it can be overridden by the environment variable PAGER.
34 * Hack will use its internal pager if DEF_PAGER is not defined.
35 * (This might be preferable for security reasons.)
36 * #define DEF_PAGER ".../mydir/mypager"
37 */
38
39/*
40 * If you define MAIL, then the player will be notified of new mail
41 * when it arrives. If you also define DEF_MAILREADER then this will
42 * be the default mail reader, and can be overridden by the environment
43 * variable MAILREADER; otherwise an internal pager will be used.
44 * A stat system call is done on the mailbox every MAILCKFREQ moves.
45 */
46/* #define MAIL */
47#define DEF_MAILREADER _PATH_MAIL /* or e.g. /bin/mail */
48#define MAILCKFREQ 100
49
50
51#define SHELL /* do not delete the '!' command */
984263bc 52#define SUSPEND /* let ^Z suspend the game */
304d60d9 53#endif /* UNIX */
984263bc
MD
54
55#ifdef CHDIR
56/*
57 * If you define HACKDIR, then this will be the default playground;
58 * otherwise it will be the current directory.
59 */
60#ifdef QUEST
61#define HACKDIR _PATH_QUEST
304d60d9 62#else /* QUEST */
984263bc 63#define HACKDIR _PATH_HACK
304d60d9 64#endif /* QUEST */
984263bc
MD
65
66/*
67 * Some system administrators are stupid enough to make Hack suid root
68 * or suid daemon, where daemon has other powers besides that of reading or
69 * writing Hack files. In such cases one should be careful with chdir's
70 * since the user might create files in a directory of his choice.
71 * Of course SECURE is meaningful only if HACKDIR is defined.
72 */
73#define SECURE /* do setuid(getuid()) after chdir() */
74
75/*
76 * If it is desirable to limit the number of people that can play Hack
77 * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS.
78 * #define MAX_NR_OF_PLAYERS 100
79 */
304d60d9 80#endif /* CHDIR */
984263bc
MD
81
82/* size of terminal screen is (at least) (ROWNO+2) by COLNO */
83#define COLNO 80
84#define ROWNO 22
85
86/*
87 * small signed integers (8 bits suffice)
88 * typedef char schar;
89 * will do when you have signed characters; otherwise use
90 * typedef short int schar;
91 */
c7106d58 92typedef short schar;
984263bc
MD
93
94/*
95 * small unsigned integers (8 bits suffice - but 7 bits do not)
96 * - these are usually object types; be careful with inequalities! -
97 * typedef unsigned char uchar;
98 * will be satisfactory if you have an "unsigned char" type; otherwise use
99 * typedef unsigned short int uchar;
100 */
101typedef unsigned char uchar;
102
103/*
104 * small integers in the range 0 - 127, usually coordinates
105 * although they are nonnegative they must not be declared unsigned
106 * since otherwise comparisons with signed quantities are done incorrectly
107 */
108typedef schar xchar;
c7106d58 109typedef bool boolean; /* 0 or 1 */
984263bc
MD
110#define TRUE 1
111#define FALSE 0
112
113/*
114 * Declaration of bitfields in various structs; if your C compiler
115 * doesnt handle bitfields well, e.g., if it is unable to initialize
116 * structs containing bitfields, then you might use
117 * #define Bitfield(x,n) uchar x
118 * since the bitfields used never have more than 7 bits. (Most have 1 bit.)
119 */
120#define Bitfield(x,n) unsigned x:n
121
122#define SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
123
304d60d9 124#endif /* CONFIG */