Source:NetHack 3.2.0/unixconf.h

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

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

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