abstract
| - Below is the full text to decl.h from the source code of NetHack 3.4.0. To link to a particular line, write [[NetHack 3.4.0/decl.h#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)decl.h 3.4 2001/12/10 */ 2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef DECL_H 6. #define DECL_H 7. 8. #define E extern 9. 10. E int NDECL((*occupation)); 11. E int NDECL((*afternmv)); 12. 13. E const char *hname; 14. E int hackpid; 15. #if defined(UNIX) || defined(VMS) 16. E int locknum; 17. #endif 18. #ifdef DEF_PAGER 19. E char *catmore; 20. #endif /* DEF_PAGER */ 21. 22. E char SAVEF[]; 23. #ifdef MICRO 24. E char SAVEP[]; 25. #endif 26. 27. E NEARDATA int bases[MAXOCLASSES]; 28. 29. E NEARDATA int multi; 30. #if 0 31. E NEARDATA int warnlevel; 32. #endif 33. E NEARDATA int nroom; 34. E NEARDATA int nsubroom; 35. E NEARDATA int occtime; 36. 37. #define WARNCOUNT 6 /* number of different warning levels */ 38. E uchar warnsyms[WARNCOUNT]; 39. 40. E int x_maze_max, y_maze_max; 41. E int otg_temp; 42. 43. #ifdef REDO 44. E NEARDATA int in_doagain; 45. #endif 46. 47. E struct dgn_topology { /* special dungeon levels for speed */ 48. d_level d_oracle_level; 49. d_level d_bigroom_level; /* unused */ 50. #ifdef REINCARNATION 51. d_level d_rogue_level; 52. #endif 53. d_level d_medusa_level; 54. d_level d_stronghold_level; 55. d_level d_valley_level; 56. d_level d_wiz1_level; 57. d_level d_wiz2_level; 58. d_level d_wiz3_level; 59. d_level d_juiblex_level; 60. d_level d_orcus_level; 61. d_level d_baalzebub_level; /* unused */ 62. d_level d_asmodeus_level; /* unused */ 63. d_level d_portal_level; /* only in goto_level() [do.c] */ 64. d_level d_sanctum_level; 65. d_level d_earth_level; 66. d_level d_water_level; 67. d_level d_fire_level; 68. d_level d_air_level; 69. d_level d_astral_level; 70. xchar d_tower_dnum; 71. xchar d_sokoban_dnum; 72. xchar d_mines_dnum, d_quest_dnum; 73. d_level d_qstart_level, d_qlocate_level, d_nemesis_level; 74. d_level d_knox_level; 75. } dungeon_topology; 76. /* macros for accesing the dungeon levels by their old names */ 77. #define oracle_level (dungeon_topology.d_oracle_level) 78. #define bigroom_level (dungeon_topology.d_bigroom_level) 79. #ifdef REINCARNATION 80. #define rogue_level (dungeon_topology.d_rogue_level) 81. #endif 82. #define medusa_level (dungeon_topology.d_medusa_level) 83. #define stronghold_level (dungeon_topology.d_stronghold_level) 84. #define valley_level (dungeon_topology.d_valley_level) 85. #define wiz1_level (dungeon_topology.d_wiz1_level) 86. #define wiz2_level (dungeon_topology.d_wiz2_level) 87. #define wiz3_level (dungeon_topology.d_wiz3_level) 88. #define juiblex_level (dungeon_topology.d_juiblex_level) 89. #define orcus_level (dungeon_topology.d_orcus_level) 90. #define baalzebub_level (dungeon_topology.d_baalzebub_level) 91. #define asmodeus_level (dungeon_topology.d_asmodeus_level) 92. #define portal_level (dungeon_topology.d_portal_level) 93. #define sanctum_level (dungeon_topology.d_sanctum_level) 94. #define earth_level (dungeon_topology.d_earth_level) 95. #define water_level (dungeon_topology.d_water_level) 96. #define fire_level (dungeon_topology.d_fire_level) 97. #define air_level (dungeon_topology.d_air_level) 98. #define astral_level (dungeon_topology.d_astral_level) 99. #define tower_dnum (dungeon_topology.d_tower_dnum) 100. #define sokoban_dnum (dungeon_topology.d_sokoban_dnum) 101. #define mines_dnum (dungeon_topology.d_mines_dnum) 102. #define quest_dnum (dungeon_topology.d_quest_dnum) 103. #define qstart_level (dungeon_topology.d_qstart_level) 104. #define qlocate_level (dungeon_topology.d_qlocate_level) 105. #define nemesis_level (dungeon_topology.d_nemesis_level) 106. #define knox_level (dungeon_topology.d_knox_level) 107. 108. E NEARDATA stairway dnstair, upstair; /* stairs up and down */ 109. #define xdnstair (dnstair.sx) 110. #define ydnstair (dnstair.sy) 111. #define xupstair (upstair.sx) 112. #define yupstair (upstair.sy) 113. 114. E NEARDATA stairway dnladder, upladder; /* ladders up and down */ 115. #define xdnladder (dnladder.sx) 116. #define ydnladder (dnladder.sy) 117. #define xupladder (upladder.sx) 118. #define yupladder (upladder.sy) 119. 120. E NEARDATA stairway sstairs; 121. 122. E NEARDATA dest_area updest, dndest; /* level-change destination areas */ 123. 124. E NEARDATA coord inv_pos; 125. E NEARDATA dungeon dungeons[]; 126. E NEARDATA s_level *sp_levchn; 127. #define dunlev_reached(x) (dungeons[(x)->dnum].dunlev_ureached) 128. 129. #include "quest.h" 130. E struct q_score quest_status; 131. 132. E NEARDATA char pl_character[PL_CSIZ]; 133. E NEARDATA char pl_race; /* character's race */ 134. 135. E NEARDATA char pl_fruit[PL_FSIZ]; 136. E NEARDATA int current_fruit; 137. E NEARDATA struct fruit *ffruit; 138. 139. E NEARDATA char tune[6]; 140. 141. #define MAXLINFO (MAXDUNGEON * MAXLEVEL) 142. E struct linfo level_info[MAXLINFO]; 143. 144. E NEARDATA struct sinfo { 145. int gameover; /* self explanatory? */ 146. int stopprint; /* inhibit further end of game disclosure */ 147. #if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32) 148. int done_hup; /* SIGHUP or moral equivalent received 149. * -- no more screen output */ 150. #endif 151. int something_worth_saving; /* in case of panic */ 152. int panicking; /* `panic' is in progress */ 153. #if defined(VMS) || defined(WIN32) 154. int exiting; /* an exit handler is executing */ 155. #endif 156. } program_state; 157. 158. E boolean restoring; 159. 160. E const char quitchars[]; 161. E const char vowels[]; 162. E const char ynchars[]; 163. E const char ynqchars[]; 164. E const char ynaqchars[]; 165. E const char ynNaqchars[]; 166. E NEARDATA long yn_number; 167. 168. E const char disclosure_options[]; 169. 170. E NEARDATA int smeq[]; 171. E NEARDATA int doorindex; 172. E NEARDATA char *save_cm; 173. #define KILLED_BY_AN 0 174. #define KILLED_BY 1 175. #define NO_KILLER_PREFIX 2 176. E NEARDATA int killer_format; 177. E const char *killer; 178. E const char *delayed_killer; 179. #ifdef GOLDOBJ 180. E long done_money; 181. #endif 182. E char killer_buf[BUFSZ]; 183. E const char *configfile; 184. E NEARDATA char plname[PL_NSIZ]; 185. E NEARDATA char dogname[]; 186. E NEARDATA char catname[]; 187. E NEARDATA char horsename[]; 188. E char preferred_pet; 189. E const char *occtxt; /* defined when occupation != NULL */ 190. E const char *nomovemsg; 191. E const char nul[]; 192. E char lock[]; 193. 194. E const char sdir[], ndir[]; 195. E const schar xdir[], ydir[], zdir[]; 196. 197. E NEARDATA schar tbx, tby; /* set in mthrowu.c */ 198. 199. E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot; 200. 201. E NEARDATA struct dig_info { /* apply.c, hack.c */ 202. int effort; 203. d_level level; 204. coord pos; 205. long lastdigtime; 206. boolean down, chew, warned, quiet; 207. } digging; 208. 209. E NEARDATA long moves, monstermoves; 210. E NEARDATA long wailmsg; 211. 212. E NEARDATA boolean in_mklev; 213. E NEARDATA boolean stoned; 214. E NEARDATA boolean unweapon; 215. E NEARDATA boolean mrg_to_wielded; 216. E NEARDATA struct obj *current_wand; 217. 218. E NEARDATA boolean in_steed_dismounting; 219. 220. E const int shield_static[]; 221. 222. #include "spell.h" 223. E NEARDATA struct spell spl_book[]; /* sized in decl.c */ 224. 225. #ifdef TEXTCOLOR 226. #include "color.h" 227. E const int zapcolors[]; 228. #endif 229. 230. E const char def_oc_syms[MAXOCLASSES]; /* default class symbols */ 231. E uchar oc_syms[MAXOCLASSES]; /* current class symbols */ 232. E const char def_monsyms[MAXMCLASSES]; /* default class symbols */ 233. E uchar monsyms[MAXMCLASSES]; /* current class symbols */ 234. 235. #include "obj.h" 236. E NEARDATA struct obj *invent, 237. *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf, 238. #ifdef TOURIST 239. *uarmu, /* under-wear, so to speak */ 240. #endif 241. *uskin, *uamul, *uleft, *uright, *ublindf, 242. *uwep, *uswapwep, *uquiver; 243. 244. E NEARDATA struct obj *uchain; /* defined only when punished */ 245. E NEARDATA struct obj *uball; 246. E NEARDATA struct obj *migrating_objs; 247. E NEARDATA struct obj *billobjs; 248. E NEARDATA struct obj zeroobj; /* init'd and defined in decl.c */ 249. 250. #include "you.h" 251. E NEARDATA struct you u; 252. 253. #include "onames.h" 254. #ifndef PM_H /* (pm.h has already been included via youprop.h) */ 255. #include "pm.h" 256. #endif 257. 258. E NEARDATA struct monst youmonst; /* init'd and defined in decl.c */ 259. E NEARDATA struct monst *mydogs, *migrating_mons; 260. 261. E NEARDATA struct mvitals { 262. uchar born; 263. uchar died; 264. uchar mvflags; 265. } mvitals[NUMMONS]; 266. 267. E NEARDATA struct c_color_names { 268. const char *const c_black, *const c_amber, *const c_golden, 269. *const c_light_blue,*const c_red, *const c_green, 270. *const c_silver, *const c_blue, *const c_purple, 271. *const c_white; 272. } c_color_names; 273. #define Black c_color_names.c_black 274. #define amber c_color_names.c_amber 275. #define golden c_color_names.c_golden 276. #define light_blue c_color_names.c_light_blue 277. #define red c_color_names.c_red 278. #define green c_color_names.c_green 279. #define silver c_color_names.c_silver 280. #define blue c_color_names.c_blue 281. #define purple c_color_names.c_purple 282. #define White c_color_names.c_white 283. 284. /* The names of the colors used for gems, etc. */ 285. E const char *c_obj_colors[]; 286. 287. E struct c_common_strings { 288. const char *const c_nothing_happens, *const c_thats_enough_tries, 289. *const c_silly_thing_to, *const c_shudder_for_moment, 290. *const c_something, *const c_Something, 291. *const c_You_can_move_again, 292. *const c_Never_mind, *c_vision_clears; 293. } c_common_strings; 294. #define nothing_happens c_common_strings.c_nothing_happens 295. #define thats_enough_tries c_common_strings.c_thats_enough_tries 296. #define silly_thing_to c_common_strings.c_silly_thing_to 297. #define shudder_for_moment c_common_strings.c_shudder_for_moment 298. #define something c_common_strings.c_something 299. #define Something c_common_strings.c_Something 300. #define You_can_move_again c_common_strings.c_You_can_move_again 301. #define Never_mind c_common_strings.c_Never_mind 302. #define vision_clears c_common_strings.c_vision_clears 303. 304. /* material strings */ 305. E const char *materialnm[]; 306. 307. /* Monster name articles */ 308. #define ARTICLE_NONE 0 309. #define ARTICLE_THE 1 310. #define ARTICLE_A 2 311. #define ARTICLE_YOUR 3 312. 313. /* Monster name suppress masks */ 314. #define SUPPRESS_IT 0x01 315. #define SUPPRESS_INVISIBLE 0x02 316. #define SUPPRESS_HALLUCINATION 0x04 317. #define SUPPRESS_SADDLE 0x08 318. #define EXACT_NAME 0x0F 319. 320. /* Vision */ 321. E NEARDATA boolean vision_full_recalc; /* TRUE if need vision recalc */ 322. E NEARDATA char **viz_array; /* could see/in sight row pointers */ 323. 324. /* Window system stuff */ 325. E NEARDATA winid WIN_MESSAGE, WIN_STATUS; 326. E NEARDATA winid WIN_MAP, WIN_INVEN; 327. E char toplines[]; 328. #ifndef TCAP_H 329. E struct tc_gbl_data { /* also declared in tcap.h */ 330. char *tc_AS, *tc_AE; /* graphics start and end (tty font swapping) */ 331. int tc_LI, tc_CO; /* lines and columns */ 332. } tc_gbl_data; 333. #define AS tc_gbl_data.tc_AS 334. #define AE tc_gbl_data.tc_AE 335. #define LI tc_gbl_data.tc_LI 336. #define CO tc_gbl_data.tc_CO 337. #endif 338. 339. /* xxxexplain[] is in drawing.c */ 340. E const char *monexplain[], *invisexplain, *objexplain[], *oclass_names[]; 341. 342. /* Some systems want to use full pathnames for some subsets of file names, 343. * rather than assuming that they're all in the current directory. This 344. * provides all the subclasses that seem reasonable, and sets up for all 345. * prefixes being null. Port code can set those that it wants. 346. */ 347. #define HACKPREFIX 0 348. #define LEVELPREFIX 1 349. #define SAVEPREFIX 2 350. #define BONESPREFIX 3 351. #define DATAPREFIX 4 352. #define SCOREPREFIX 5 353. #define LOCKPREFIX 6 354. #define CONFIGPREFIX 7 355. #define PREFIX_COUNT 8 356. /* used in files.c; xxconf.h can override if needed */ 357. # ifndef FQN_MAX_FILENAME 358. #define FQN_MAX_FILENAME 512 359. # endif 360. 361. #if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND) 362. /* the bare-bones stuff is unconditional above to simplify coding; for 363. * ports that actually use prefixes, add some more localized things 364. */ 365. #define PREFIXES_IN_USE 366. #endif 367. 368. E char *fqn_prefix[PREFIX_COUNT]; 369. #ifdef PREFIXES_IN_USE 370. E char *fqn_prefix_names[PREFIX_COUNT]; 371. #endif 372. 373. #undef E 374. 375. #endif /* DECL_H */
|