abstract
| - Below is the full text to config.h from the source code of NetHack 1.4f. To link to a particular line, write [[NetHack 1.4f/config.h#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)config.h 1.4 87/08/08 2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /* config.h - version 1.0.3 */ 4. 5. #ifndef CONFIG /* make sure the compiler does not see the typedefs twice */ 6. #define CONFIG 7. 8. #define CHDIR /* delete if no chdir() available */ 9. 10. /* 11. * Some include files are in a different place under SYSV 12. * BSD SYSV 13. * 14. * 15. * 16. * Some routines are called differently 17. * index strchr 18. * rindex strrchr 19. * Also, the code for suspend and various ioctls is only given for BSD4.2 20. * (I do not have access to a SYSV system.) 21. */ 22. /* #define MSDOS /* define for MS-DOS (actually defined by compiler) */ 23. #define UNIX /* delete if no fork(), exec() available */ 24. /* #define GENIX /* Yet Another Unix Clone */ 25. #define BSD /* defind for 4.n BSD */ 26. /* #define SYSV /* define for System V */ 27. 28. /* #define BETA /* if a beta-test copy [MRS] */ 29. #define VERSION "1.4f" /* version number. */ 30. 31. #define PYRAMID_BUG /* avoid a bug on the Pyramid */ 32. /* #define APOLLO /* same for the Apollo */ 33. /* #define STUPID /* avoid some complicated expressions if 34. your C compiler chokes on them */ 35. /* #define TERMINFO /* uses "curses" rather than termcap */ 36. 37. #ifdef __TURBOC__ 38. #define alloc malloc 39. #define signal ssignal 40. #endif 41. 42. #define WIZARD "mike" /* the person allowed to use the -D option */ 43. #define RECORD "record"/* the file containing the list of topscorers */ 44. #define NEWS "news" /* the file containing the latest hack news */ 45. #define HELP "help" /* the file containing a description of the commands */ 46. #define SHELP "hh" /* abbreviated form of the same */ 47. #define RUMORFILE "rumors" /* a file with fortune cookies */ 48. #define DATAFILE "data" /* a file giving the meaning of symbols used */ 49. #define FMASK 0660 /* file creation mask */ 50. 51. #ifdef UNIX 52. #define HLOCK "perm" /* an empty file used for locking purposes */ 53. #define LLOCK "safelock" /* link to previous */ 54. 55. /* 56. * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" 57. * If defined, it can be overridden by the environment variable PAGER. 58. * Hack will use its internal pager if DEF_PAGER is not defined. 59. * (This might be preferable for security reasons.) 60. * #define DEF_PAGER ".../mydir/mypager" 61. */ 62. 63. /* 64. * If you define MAIL, then the player will be notified of new mail 65. * when it arrives. If you also define DEF_MAILREADER then this will 66. * be the default mail reader, and can be overridden by the environment 67. * variable MAILREADER; otherwise an internal pager will be used. 68. * A stat system call is done on the mailbox every MAILCKFREQ moves. 69. */ 70. #define MAIL 71. #define DEF_MAILREADER "/usr/bin/mail" /* or e.g. /bin/mail */ 72. #define MAILCKFREQ 1 73. 74. 75. #define SHELL /* do not delete the '!' command */ 76. 77. #ifdef BSD 78. #define SUSPEND /* let ^Z suspend the game */ 79. #endif 80. #endif /* UNIX /**/ 81. 82. #ifdef CHDIR 83. /* 84. * If you define HACKDIR, then this will be the default playground; 85. * otherwise it will be the current directory. 86. */ 87. #define HACKDIR "/usr/games/lib/nethackdir" 88. 89. /* 90. * Some system administrators are stupid enough to make Hack suid root 91. * or suid daemon, where daemon has other powers besides that of reading or 92. * writing Hack files. In such cases one should be careful with chdir's 93. * since the user might create files in a directory of his choice. 94. * Of course SECURE is meaningful only if HACKDIR is defined. 95. */ 96. #define SECURE /* do setuid(getuid()) after chdir() */ 97. 98. /* 99. * If it is desirable to limit the number of people that can play Hack 100. * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. 101. * #define MAX_NR_OF_PLAYERS 6 102. */ 103. #endif /* CHDIR /**/ 104. 105. /* size of terminal screen is (at least) (ROWNO+2) by COLNO */ 106. #define COLNO 80 107. #define ROWNO 22 108. 109. #ifdef BSD 110. #include /* declarations for strcat etc. */ 111. #define memcpy(d, s, n) bcopy(s, d, n) 112. #define memcmp(s1, s2, n) bcmp(s2, s1, n) 113. #else 114. #include /* idem on System V */ 115. #define index strchr 116. #define rindex strrchr 117. #endif 118. 119. /* 120. * small signed integers (8 bits suffice) 121. * typedef char schar; 122. * will do when you have signed characters; otherwise use 123. * typedef short int schar; 124. */ 125. typedef char schar; 126. 127. /* 128. * small unsigned integers (8 bits suffice - but 7 bits do not) 129. * - these are usually object types; be careful with inequalities! - 130. * typedef unsigned char uchar; 131. * will be satisfactory if you have an "unsigned char" type; otherwise use 132. * typedef unsigned short int uchar; 133. */ 134. typedef unsigned char uchar; 135. 136. /* 137. * small integers in the range 0 - 127, usually coordinates 138. * although they are nonnegative they must not be declared unsigned 139. * since otherwise comparisons with signed quantities are done incorrectly 140. */ 141. typedef schar xchar; 142. typedef xchar boolean; /* 0 or 1 */ 143. #define TRUE 1 144. #define FALSE 0 145. 146. /* 147. * Declaration of bitfields in various structs; if your C compiler 148. * doesnt handle bitfields well, e.g., if it is unable to initialize 149. * structs containing bitfields, then you might use 150. * #define Bitfield(x,n) uchar x 151. * since the bitfields used never have more than 7 bits. (Most have 1 bit.) 152. * otherwise: 153. * #define Bitfield(x,n) unsigned x:n 154. */ 155. #define Bitfield(x,n) uchar x 156. 157. #define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) 158. 159. #ifdef MSDOS 160. #include 161. #define exit msexit /* do chdir first */ 162. #ifdef getchar 163. # undef getchar 164. #endif /* getchar /**/ 165. #define getchar tgetch 166. #define DGK /* MS DOS specific enhancements by dgk */ 167. 168. #ifdef DGK 169. # include "msdos.h" /* contains necessary externs for msdos.c */ 170. # define SHELL /* via exec of COMMAND.COM */ 171. # define PATHLEN 64 /* maximum pathlength */ 172. # define FILENAME 80 /* maximum filename length (conservative) */ 173. # define FROMPERM 1 /* for ramdisk use */ 174. # define TOPERM 2 /* for ramdisk use */ 175. # define glo(x) name_file(lock, x) /* name_file used for bones */ 176. extern char *configfile; 177. #endif /* DGK /**/ 178. #endif /* MSDOS /**/ 179. 180. /* 181. * Conditional compilation of special options are controlled here. 182. * If you define the following flags, you will add not only to the 183. * complexity of the game but also to the size of the load module. 184. */ 185. 186. #define DOGNAME /* Name of your first dog as an option */ 187. #define SPELLS /* Spell casting by M. Stephenson */ 188. #define PRAYERS /* Prayer code by M. Stephenson */ 189. #define KAA /* Various changes made by Ken Arromdee */ 190. #define MARKER /* Magic marker modification from Gil Neiger */ 191. #define NEWCLASS /* Samurai/Ninja etc. by M. Stephenson */ 192. #define SAFE_ATTACK /* Safe attack code by Don Kneller */ 193. #define PROBING /* Wand of probing code by Gil Neiger */ 194. #define DIAGS /* Diagnostics after death/quit by Gil Neiger */ 195. #define SORTING /* Sorted inventory by Don Kneller */ 196. #define DGKMOD /* Additional features by Don Kneller */ 197. #define REDO /* support for redoing last command - DGK */ 198. #define HARD /* Enhanced wizard code by M. Stephenson */ 199. #define WALKIES /* Leash code by M. Stephenson */ 200. #define NEWTRAPS /* Magic and Squeeky board traps by Scott R. Turner*/ 201. #define FREEHAND /* Cannot use Pick-axe without wielding it. */ 202. #define SPIDERS /* Spiders and webs by Scott R. Turner */ 203. #define FOUNTAINS /* Fountain code by SRT (+ GAN + EB) */ 204. #define KOPS /* Keystone Kops by Scott R. Turner */ 205. #define ROCKMOLE /* Rockmoles by Scott R. Turner */ 206. #define COM_COMPL /* Command line completion by John S. Bien */ 207. #define GRAPHICS /* Funky screen character support (Eric S. Raymond) */ 208. #define HACKOPTIONS /* Support DGK-style HACKOPTIONS processing (ESR) */ 209. 210. /* 211. * Status Line options. 212. */ 213. 214. #define GOLD_ON_BOTL 215. #define EXP_ON_BOTL 216. 217. #ifdef REDO 218. #define DOAGAIN '\001' /* Used in tty.c and cmd.c */ 219. #endif 220. 221. #ifdef DGKMOD 222. #define LARGEST_INT ((1 << 15) - 1) 223. #endif 224. 225. #endif /* CONFIG /**/
|