Source:NetHack 3.4.3/include/decl.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/decl.h from NetHack 3.4.3. To link to a particular line, write [[decl.h#line123]], for example.

  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. */

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

  1. #ifndef DECL_H
  2. #define DECL_H
  3.  
  4. #define E extern
  5.  
  6. E int NDECL((*occupation));
  7. E int NDECL((*afternmv));
  8.  
  9. E const char *hname;
  10. E int hackpid;
  11. #if defined(UNIX) || defined(VMS)
  12. E int locknum;
  13. #endif
  14. #ifdef DEF_PAGER
  15. E char *catmore;
  16. #endif	/* DEF_PAGER */
  17.  
  18. E char SAVEF[];
  19. #ifdef MICRO
  20. E char SAVEP[];
  21. #endif
  22.  
  23. E NEARDATA int bases[MAXOCLASSES];
  24.  
  25. E NEARDATA int multi;
  26. #if 0
  27. E NEARDATA int warnlevel;
  28. #endif
  29. E NEARDATA int nroom;
  30. E NEARDATA int nsubroom;
  31. E NEARDATA int occtime;
  32.  
  33. #define WARNCOUNT 6			/* number of different warning levels */
  34. E uchar warnsyms[WARNCOUNT];
  35.  
  36. E int x_maze_max, y_maze_max;
  37. E int otg_temp;
  38.  
  39. #ifdef REDO
  40. E NEARDATA int in_doagain;
  41. #endif
  42.  
  43. E struct dgn_topology {		/* special dungeon levels for speed */
  44. d_level	d_oracle_level;
  45. d_level	d_bigroom_level;	/* unused */
  46. #ifdef REINCARNATION
  47. d_level	d_rogue_level;
  48. #endif
  49. d_level	d_medusa_level;
  50. d_level	d_stronghold_level;
  51. d_level	d_valley_level;
  52. d_level	d_wiz1_level;
  53. d_level	d_wiz2_level;
  54. d_level	d_wiz3_level;
  55. d_level	d_juiblex_level;
  56. d_level	d_orcus_level;
  57. d_level	d_baalzebub_level;	/* unused */
  58. d_level	d_asmodeus_level;	/* unused */
  59. d_level	d_portal_level;		/* only in goto_level() [do.c] */
  60. d_level	d_sanctum_level;
  61. d_level	d_earth_level;
  62. d_level	d_water_level;
  63. d_level	d_fire_level;
  64. d_level	d_air_level;
  65. d_level	d_astral_level;
  66. xchar	d_tower_dnum;
  67. xchar	d_sokoban_dnum;
  68. xchar	d_mines_dnum, d_quest_dnum;
  69. d_level	d_qstart_level, d_qlocate_level, d_nemesis_level;
  70. d_level	d_knox_level;
  71. } dungeon_topology;
  72. /* macros for accesing the dungeon levels by their old names */
  73. #define oracle_level		(dungeon_topology.d_oracle_level)
  74. #define bigroom_level		(dungeon_topology.d_bigroom_level)
  75. #ifdef REINCARNATION
  76. #define rogue_level		(dungeon_topology.d_rogue_level)
  77. #endif
  78. #define medusa_level		(dungeon_topology.d_medusa_level)
  79. #define stronghold_level	(dungeon_topology.d_stronghold_level)
  80. #define valley_level		(dungeon_topology.d_valley_level)
  81. #define wiz1_level		(dungeon_topology.d_wiz1_level)
  82. #define wiz2_level		(dungeon_topology.d_wiz2_level)
  83. #define wiz3_level		(dungeon_topology.d_wiz3_level)
  84. #define juiblex_level		(dungeon_topology.d_juiblex_level)
  85. #define orcus_level		(dungeon_topology.d_orcus_level)
  86. #define baalzebub_level		(dungeon_topology.d_baalzebub_level)
  87. #define asmodeus_level		(dungeon_topology.d_asmodeus_level)
  88. #define portal_level		(dungeon_topology.d_portal_level)
  89. #define sanctum_level		(dungeon_topology.d_sanctum_level)
  90. #define earth_level		(dungeon_topology.d_earth_level)
  91. #define water_level		(dungeon_topology.d_water_level)
  92. #define fire_level		(dungeon_topology.d_fire_level)
  93. #define air_level		(dungeon_topology.d_air_level)
  94. #define astral_level		(dungeon_topology.d_astral_level)
  95. #define tower_dnum		(dungeon_topology.d_tower_dnum)
  96. #define sokoban_dnum		(dungeon_topology.d_sokoban_dnum)
  97. #define mines_dnum		(dungeon_topology.d_mines_dnum)
  98. #define quest_dnum		(dungeon_topology.d_quest_dnum)
  99. #define qstart_level		(dungeon_topology.d_qstart_level)
  100. #define qlocate_level		(dungeon_topology.d_qlocate_level)
  101. #define nemesis_level		(dungeon_topology.d_nemesis_level)
  102. #define knox_level		(dungeon_topology.d_knox_level)
  103.  
  104. E NEARDATA stairway dnstair, upstair;		/* stairs up and down */
  105. #define xdnstair	(dnstair.sx)
  106. #define ydnstair	(dnstair.sy)
  107. #define xupstair	(upstair.sx)
  108. #define yupstair	(upstair.sy)
  109.  
  110. E NEARDATA stairway dnladder, upladder;		/* ladders up and down */
  111. #define xdnladder	(dnladder.sx)
  112. #define ydnladder	(dnladder.sy)
  113. #define xupladder	(upladder.sx)
  114. #define yupladder	(upladder.sy)
  115.  
  116. E NEARDATA stairway sstairs;
  117.  
  118. E NEARDATA dest_area updest, dndest;	/* level-change destination areas */
  119.  
  120. E NEARDATA coord inv_pos;
  121. E NEARDATA dungeon dungeons[];
  122. E NEARDATA s_level *sp_levchn;
  123. #define dunlev_reached(x)	(dungeons[(x)->dnum].dunlev_ureached)
  124.  
  125. #include "quest.h"
  126. E struct q_score quest_status;
  127.  
  128. E NEARDATA char pl_character[PL_CSIZ];
  129. E NEARDATA char pl_race;		/* character's race */
  130.  
  131. E NEARDATA char pl_fruit[PL_FSIZ];
  132. E NEARDATA int current_fruit;
  133. E NEARDATA struct fruit *ffruit;
  134.  
  135. E NEARDATA char tune[6];
  136.  
  137. #define MAXLINFO (MAXDUNGEON * MAXLEVEL)
  138. E struct linfo level_info[MAXLINFO];
  139.  
  140. E NEARDATA struct sinfo {
  141. 	int gameover;		/* self explanatory? */
  142. 	int stopprint;		/* inhibit further end of game disclosure */
  143. #if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32)
  144. 	int done_hup;		/* SIGHUP or moral equivalent received
  145. 				 * -- no more screen output */
  146. #endif
  147. 	int something_worth_saving;	/* in case of panic */
  148. 	int panicking;		/* `panic' is in progress */
  149. #if defined(VMS) || defined(WIN32)
  150. 	int exiting;		/* an exit handler is executing */
  151. #endif
  152. 	int in_impossible;
  153. #ifdef PANICLOG
  154. 	int in_paniclog;
  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. #include "color.h"
  226. #ifdef TEXTCOLOR
  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 NH_BLACK		c_color_names.c_black
  274. #define NH_AMBER		c_color_names.c_amber
  275. #define NH_GOLDEN		c_color_names.c_golden
  276. #define NH_LIGHT_BLUE		c_color_names.c_light_blue
  277. #define NH_RED			c_color_names.c_red
  278. #define NH_GREEN		c_color_names.c_green
  279. #define NH_SILVER		c_color_names.c_silver
  280. #define NH_BLUE			c_color_names.c_blue
  281. #define NH_PURPLE		c_color_names.c_purple
  282. #define NH_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. 		*const c_the_your[2];
  294. } c_common_strings;
  295. #define nothing_happens    c_common_strings.c_nothing_happens
  296. #define thats_enough_tries c_common_strings.c_thats_enough_tries
  297. #define silly_thing_to	   c_common_strings.c_silly_thing_to
  298. #define shudder_for_moment c_common_strings.c_shudder_for_moment
  299. #define something	   c_common_strings.c_something
  300. #define Something	   c_common_strings.c_Something
  301. #define You_can_move_again c_common_strings.c_You_can_move_again
  302. #define Never_mind	   c_common_strings.c_Never_mind
  303. #define vision_clears	   c_common_strings.c_vision_clears
  304. #define the_your	   c_common_strings.c_the_your
  305.  
  306. /* material strings */
  307. E const char *materialnm[];
  308.  
  309. /* Monster name articles */
  310. #define ARTICLE_NONE	0
  311. #define ARTICLE_THE	1
  312. #define ARTICLE_A	2
  313. #define ARTICLE_YOUR	3
  314.  
  315. /* Monster name suppress masks */
  316. #define SUPPRESS_IT		0x01
  317. #define SUPPRESS_INVISIBLE	0x02
  318. #define SUPPRESS_HALLUCINATION  0x04
  319. #define SUPPRESS_SADDLE		0x08
  320. #define EXACT_NAME		0x0F
  321.  
  322. /* Vision */
  323. E NEARDATA boolean vision_full_recalc;	/* TRUE if need vision recalc */
  324. E NEARDATA char **viz_array;		/* could see/in sight row pointers */
  325.  
  326. /* Window system stuff */
  327. E NEARDATA winid WIN_MESSAGE, WIN_STATUS;
  328. E NEARDATA winid WIN_MAP, WIN_INVEN;
  329. E char toplines[];
  330. #ifndef TCAP_H
  331. E struct tc_gbl_data {	/* also declared in tcap.h */
  332. char *tc_AS, *tc_AE;	/* graphics start and end (tty font swapping) */
  333. int   tc_LI,  tc_CO;	/* lines and columns */
  334. } tc_gbl_data;
  335. #define AS tc_gbl_data.tc_AS
  336. #define AE tc_gbl_data.tc_AE
  337. #define LI tc_gbl_data.tc_LI
  338. #define CO tc_gbl_data.tc_CO
  339. #endif
  340.  
  341. /* xxxexplain[] is in drawing.c */
  342. E const char * const monexplain[], invisexplain[], * const objexplain[], * const oclass_names[];
  343.  
  344. /* Some systems want to use full pathnames for some subsets of file names,
  345. * rather than assuming that they're all in the current directory.  This
  346. * provides all the subclasses that seem reasonable, and sets up for all
  347. * prefixes being null.  Port code can set those that it wants.
  348. */
  349. #define HACKPREFIX	0
  350. #define LEVELPREFIX	1
  351. #define SAVEPREFIX	2
  352. #define BONESPREFIX	3
  353. #define DATAPREFIX	4	/* this one must match hardcoded value in dlb.c */
  354. #define SCOREPREFIX	5
  355. #define LOCKPREFIX	6
  356. #define CONFIGPREFIX	7
  357. #define TROUBLEPREFIX	8
  358. #define PREFIX_COUNT	9
  359. /* used in files.c; xxconf.h can override if needed */
  360. # ifndef FQN_MAX_FILENAME
  361. #define FQN_MAX_FILENAME 512
  362. # endif
  363.  
  364. #if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND)
  365. /* the bare-bones stuff is unconditional above to simplify coding; for
  366. * ports that actually use prefixes, add some more localized things
  367. */
  368. #define PREFIXES_IN_USE
  369. #endif
  370.  
  371. E char *fqn_prefix[PREFIX_COUNT];
  372. #ifdef PREFIXES_IN_USE
  373. E char *fqn_prefix_names[PREFIX_COUNT];
  374. #endif
  375.  
  376. #ifdef AUTOPICKUP_EXCEPTIONS
  377. struct autopickup_exception {
  378. 	char *pattern;
  379. 	boolean grab;
  380. 	struct autopickup_exception *next;
  381. };
  382. #endif /* AUTOPICKUP_EXCEPTIONS */
  383.  
  384. #undef E
  385.  
  386. #endif /* DECL_H */