Wikia

Wikihack

Source:NetHack 3.3.0/unixconf.h

2,032pages on
this wiki
Talk0

Below is the full text to unixconf.h from the source code of NetHack 3.3.0. To link to a particular line, write [[NetHack 3.3.0/unixconf.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

The NetHack General Public License applies to screenshots, source code and other content from NetHack.
1.    /*	SCCS Id: @(#)unixconf.h 3.3	99/07/02	*/
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifdef UNIX
6.    #ifndef UNIXCONF_H
7.    #define UNIXCONF_H
8.    
9.    /*
10.    * Some include files are in a different place under SYSV
11.    *	BSD		   SYSV
12.    * <sys/time.h>		<time.h>
13.    * <sgtty.h>		<termio.h>
14.    *
15.    * Some routines are called differently
16.    * index		strchr
17.    * rindex		strrchr
18.    *
19.    */
20.   
21.   /* define exactly one of the following four choices */
22.   /* #define BSD 1 */	/* define for 4.n BSD  */
23.   			/* also for relatives like SunOS 4.x, DG/UX, and */
24.   			/* older versions of Linux */
25.   /* #define ULTRIX */	/* define for Ultrix v3.0 or higher (but not lower) */
26.   			/* Use BSD for < v3.0 */
27.   			/* "ULTRIX" not to be confused with "ultrix" */
28.   #define SYSV		/* define for System V, Solaris 2.x, newer versions */
29.   			/* of Linux */
30.   /* #define HPUX */	/* Hewlett-Packard's Unix, version 6.5 or higher */
31.   			/* use SYSV for < v6.5 */
32.   
33.   
34.   /* define any of the following that are appropriate */
35.   #define SVR4		/* use in addition to SYSV for System V Release 4 */
36.   			/* including Solaris 2+ */
37.   #define NETWORK		/* if running on a networked system */
38.   			/* e.g. Suns sharing a playground through NFS */
39.   /* #define SUNOS4 */	/* SunOS 4.x */
40.   /* #define LINUX */	/* Another Unix clone */
41.   /* #define GENIX */	/* Yet Another Unix Clone */
42.   /* #define HISX */	/* Bull Unix for XPS Machines */
43.   /* #define BOS */	/* Bull Open Software - Unix for DPX/2 Machines */
44.   /* #define UNIXPC */	/* use in addition to SYSV for AT&T 7300/3B1 */
45.   /* #define AIX_31 */	/* In AIX 3.1 (IBM RS/6000) use BSD ioctl's to gain
46.   			 * job control (note that AIX is SYSV otherwise)
47.   			 * Also define this for AIX 3.2 */
48.   #define TERMINFO	/* uses terminfo rather than termcap */
49.   			/* Should be defined for most SYSV, SVR4 (including
50.   			 * Solaris 2+), HPUX, and Linux systems.  In
51.   			 * particular, it should NOT be defined for the UNIXPC
52.   			 * unless you remove the use of the shared library in
53.   			 * the Makefile */
54.   #define TEXTCOLOR	/* Use System V r3.2 terminfo color support */
55.   			/* and/or ANSI color support on termcap systems */
56.   			/* and/or X11 color */
57.   #define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control */
58.   			/* (e.g., VSUSP) */
59.   #define POSIX_TYPES	/* use POSIX types for system calls and termios */
60.   			/* Define for many recent OS releases, including
61.   			 * those with specific defines (since types are
62.   			 * changing toward the standard from earlier chaos).
63.   			 * For example, platforms using the GNU libraries,
64.   			 * Linux, Solaris 2.x
65.   			 */
66.   
67.   /* #define OPENWINBUG */	/* avoid a problem using OpenWindows 3.0 for
68.   				   X11 on SunOS 4.1.x, x>= 2.  Do not define
69.   				   for other X11 implementations. */
70.   /* #define PYRAMID_BUG */	/* avoid a bug on the Pyramid */
71.   /* #define BSD_43_BUG */	/* for real 4.3BSD cc's without schain botch fix */
72.   /* #define MICROPORT_BUG */	/* problems with large arrays in structs */
73.   /* #define MICROPORT_286_BUG */ /* changes needed in termcap.c to get it to
74.   				   run with Microport Sys V/AT version 2.4.
75.   				   By Jay Maynard */
76.   /* #define AIXPS_2BUG */	/* avoid a problem with little_to_big() optimization */
77.   
78.   /* #define RANDOM */		/* if neither random/srandom nor lrand48/srand48
79.   				   is available from your system */
80.   
81.   /* see sys/unix/snd86.shr for more information on these */
82.   /* #define UNIX386MUSIC */	/* play real music through speaker on systems
83.   				   with music driver installed */
84.   /* #define VPIX_MUSIC */	/* play real music through speaker on systems
85.   				   with built-in VPIX support */
86.   
87.   
88.   /*
89.    * The next two defines are intended mainly for the Andrew File System,
90.    * which does not allow hard links.  If NO_FILE_LINKS is defined, lock files
91.    * will be created in LOCKDIR using open() instead of in the playground using
92.    * link().
93.    *		Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88)
94.    */
95.   
96.   /* #define NO_FILE_LINKS */	/* if no hard links */
97.   /* #define LOCKDIR "/usr/games/lib/nethackdir" */	/* where to put locks */
98.   
99.   
100.  /*
101.   * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
102.   * If defined, it can be overridden by the environment variable PAGER.
103.   * Hack will use its internal pager if DEF_PAGER is not defined.
104.   * (This might be preferable for security reasons.)
105.   * #define DEF_PAGER	".../mydir/mypager"
106.   */
107.  
108.  
109.  
110.  /*
111.   * Define PORT_HELP to be the name of the port-specfic help file.
112.   * This file is found in HACKDIR.
113.   * Normally, you shouldn't need to change this.
114.   * There is currently no port-specific help for Unix systems.
115.   */
116.  /* #define PORT_HELP "Unixhelp" */
117.  
118.  #ifdef TTY_GRAPHICS
119.  /*
120.   * To enable the `timed_delay' option for using a timer rather than extra
121.   * screen output when pausing for display effect.  Requires that `msleep'
122.   * function be available (with time argument specified in milliseconds).
123.   * Various output devices can produce wildly varying delays when the
124.   * "extra output" method is used, but not all systems provide access to
125.   * a fine-grained timer.
126.   */
127.  /* #define TIMED_DELAY */	/* usleep() */
128.  #endif
129.  
130.  /*
131.   * If you define MAIL, then the player will be notified of new mail
132.   * when it arrives.  If you also define DEF_MAILREADER then this will
133.   * be the default mail reader, and can be overridden by the environment
134.   * variable MAILREADER; otherwise an internal pager will be used.
135.   * A stat system call is done on the mailbox every MAILCKFREQ moves.
136.   */
137.  
138.  #define MAIL			/* Deliver mail during the game */
139.  
140.  /* The Andrew Message System does mail a little differently from normal
141.   * UNIX.  Mail is deposited in the user's own directory in ~/Mailbox
142.   * (another directory).  MAILBOX is the element that will be added on to
143.   * the user's home directory path to generate the Mailbox path - just in
144.   * case other Andrew sites do it differently from CMU.
145.   *
146.   *		dan lovinger
147.   *		dl2n+@andrew.cmu.edu (dec 19 1989)
148.   */
149.  
150.  /* #define AMS */		/* use Andrew message system for mail */
151.  
152.  /* NO_MAILREADER is for kerberos authenticating filesystems where it is
153.   * essentially impossible to securely exec child processes, like mail
154.   * readers, when the game is running under a special token.
155.   *
156.   *	       dan
157.   */
158.  
159.  /* #define NO_MAILREADER */	/* have mail daemon just tell player of mail */
160.  
161.  #ifdef	MAIL
162.  # if defined(BSD) || defined(ULTRIX)
163.  #  ifdef AMS
164.  #define AMS_MAILBOX	"/Mailbox"
165.  #  else
166.  #define DEF_MAILREADER	"/usr/ucb/Mail"
167.  #  endif
168.  #else
169.  # if defined(SYSV) || defined(DGUX) || defined(HPUX)
170.  #  ifdef M_XENIX
171.  #define DEF_MAILREADER	"/usr/bin/mail"
172.  #  else
173.  #   ifdef __sgi
174.  #define DEF_MAILREADER	"/usr/sbin/Mail"
175.  #   else
176.  #define DEF_MAILREADER	"/usr/bin/mailx"
177.  #   endif
178.  #  endif
179.  # else
180.  #define DEF_MAILREADER	"/bin/mail"
181.  # endif
182.  #endif
183.  
184.  #define MAILCKFREQ	50
185.  #endif	/* MAIL */
186.  
187.  
188.  
189.  #ifdef COMPRESS
190.  /* Some implementations of compress need a 'quiet' option.
191.   * If you've got one of these versions, put -q here.
192.   * You can also include any other strange options your compress needs.
193.   * If you have a normal compress, just leave it commented out.
194.   */
195.  /* #define COMPRESS_OPTIONS "-q" */
196.  #endif
197.  
198.  #define FCMASK	0660	/* file creation mask */
199.  
200.  
201.  /*
202.   * The remainder of the file should not need to be changed.
203.   */
204.  
205.  #ifdef _AUX_SOURCE
206.  # ifdef AUX /* gcc ? */
207.  #  define _SYSV_SOURCE
208.  #  define _BSD_SOURCE
209.  #else
210.  #  define AUX
211.  # endif
212.  #endif /* _AUX_SOURCE */
213.  
214.  #if defined(LINUX) || defined(bsdi)
215.  # ifndef POSIX_TYPES
216.  #  define POSIX_TYPES
217.  # endif
218.  # ifndef POSIX_JOB_CONTROL
219.  #  define POSIX_JOB_CONTROL
220.  # endif
221.  #endif
222.  
223.  /*
224.   * BSD/ULTRIX systems are normally the only ones that can suspend processes.
225.   * Suspending NetHack processes cleanly should be easy to add to other systems
226.   * that have SIGTSTP in the Berkeley sense.  Currently the only such systems
227.   * known to work are HPUX and AIX 3.1; other systems will probably require
228.   * tweaks to unixtty.c and ioctl.c.
229.   *
230.   * POSIX defines a slightly different type of job control, which should be
231.   * equivalent for NetHack's purposes.  POSIX_JOB_CONTROL should work on
232.   * various recent SYSV versions (with possibly tweaks to unixtty.c again).
233.   */
234.  #ifndef POSIX_JOB_CONTROL
235.  # if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
236.  #  define BSD_JOB_CONTROL
237.  # else
238.  #  if defined(SVR4)
239.  #   define POSIX_JOB_CONTROL
240.  #  endif
241.  # endif
242.  #endif
243.  #if defined(BSD_JOB_CONTROL) || defined(POSIX_JOB_CONTROL) || defined(AUX)
244.  #define SUSPEND		/* let ^Z suspend the game */
245.  #endif
246.  
247.  
248.  #if defined(BSD) || defined(ULTRIX)
249.  #include <sys/time.h>
250.  #else
251.  #include <time.h>
252.  #endif
253.  
254.  #define HLOCK	"perm"	/* an empty file used for locking purposes */
255.  
256.  #ifndef REDO
257.  #define Getchar nhgetch
258.  #endif
259.  #define tgetch getchar
260.  
261.  #define SHELL		/* do not delete the '!' command */
262.  
263.  #include "system.h"
264.  
265.  #if defined(POSIX_TYPES) || defined(__GNUC__)
266.  #include <stdlib.h>
267.  #include <unistd.h>
268.  #endif
269.  
270.  #if defined(POSIX_TYPES) || defined(__GNUC__) || defined(BSD) || defined(ULTRIX)
271.  #include <sys/wait.h>
272.  #endif
273.  
274.  #if defined(BSD) || defined(ULTRIX)
275.  # if !defined(DGUX) && !defined(SUNOS4)
276.  #define memcpy(d, s, n)		bcopy(s, d, n)
277.  #define memcmp(s1, s2, n)	bcmp(s2, s1, n)
278.  # endif
279.  # ifdef SUNOS4
280.  #include <memory.h>
281.  # endif
282.  #else	/* therefore SYSV */
283.  # ifndef index	/* some systems seem to do this for you */
284.  #define index	strchr
285.  # endif
286.  # ifndef rindex
287.  #define rindex	strrchr
288.  # endif
289.  #endif
290.  
291.  /* Use the high quality random number routines. */
292.  #if defined(BSD) || defined(ULTRIX) || defined(RANDOM)
293.  #define Rand()	random()
294.  #else
295.  #define Rand()	lrand48()
296.  #endif
297.  
298.  #ifdef TIMED_DELAY
299.  # if defined(SUNOS4) || defined(LINUX)
300.  # define msleep(k) usleep((k)*1000)
301.  # endif
302.  # ifdef ULTRIX
303.  # define msleep(k) napms(k)
304.  # endif
305.  #endif
306.  
307.  #ifdef hc	/* older versions of the MetaWare High-C compiler define this */
308.  # ifdef __HC__
309.  #  undef __HC__
310.  # endif
311.  # define __HC__ hc
312.  # undef hc
313.  #endif
314.  
315.  #endif /* UNIXCONF_H */
316.  #endif /* UNIX */

Around Wikia's network

Random Wiki