Source:SLASH'EM 0.0.7E7F2/decl.h

From NetHackWiki
Revision as of 17:39, 7 March 2008 by Kernigh bot (talk | contribs) (SLASH'EM 0.0.7E7F2/decl.h moved to Source:SLASH'EM 0.0.7E7F2/decl.h: Robot: moved page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Below is the full text to decl.h from the source code of SLASH'EM 0.0.7E7F2. To link to a particular line, write [[SLASH'EM 0.0.7E7F2/decl.h#line123]], for example.

The latest source code for vanilla NetHack is at Source code.


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.    /*	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 lastuse;
34.   E NEARDATA int nextuse;
35.   E NEARDATA int nroom;
36.   E NEARDATA int nsubroom;
37.   E NEARDATA int occtime;
38.   
39.   #define WARNCOUNT 6			/* number of different warning levels */
40.   E uchar warnsyms[WARNCOUNT];
41.   
42.   E int x_maze_max, y_maze_max;
43.   E int otg_temp;
44.   
45.   #ifdef REDO
46.   E NEARDATA int in_doagain;
47.   #endif
48.   
49.   E struct dgn_topology {		/* special dungeon levels for speed */
50.       d_level	d_oracle_level;
51.       d_level	d_bigroom_level;	/* unused */
52.   #ifdef REINCARNATION
53.       d_level	d_rogue_level;
54.   #endif
55.       d_level	d_medusa_level;
56.       d_level     d_mineend_level;
57.       d_level	d_stronghold_level;
58.       d_level	d_valley_level;
59.       d_level	d_wiz1_level;
60.       d_level	d_wiz2_level;
61.       d_level	d_wiz3_level;
62.       d_level	d_juiblex_level;
63.       d_level	d_orcus_level;
64.       d_level	d_baalzebub_level;	/* unused */
65.       d_level     d_demogorgon_level;      /* unused */
66.       d_level     d_dispater_level;      /* unused */
67.       d_level     d_geryon_level;      /* unused */
68.       d_level     d_yeenoghu_level;      /* unused */
69.       d_level	d_asmodeus_level;	/* unused */
70.       d_level	d_portal_level;		/* only in goto_level() [do.c] */
71.       d_level	d_sanctum_level;
72.       d_level	d_earth_level;
73.       d_level	d_water_level;
74.       d_level	d_fire_level;
75.       d_level	d_air_level;
76.       d_level	d_astral_level;
77.       xchar	d_tower_dnum;
78.       xchar	d_sokoban_dnum;
79.       xchar	d_mines_dnum, d_quest_dnum;
80.       xchar       d_spiders_dnum;
81.       d_level	d_lawful_quest_level;
82.       d_level	d_neutral_quest_level;
83.       d_level	d_chaotic_quest_level;
84.       d_level	d_qstart_level, d_qlocate_level, d_nemesis_level;
85.       d_level	d_knox_level;
86.   #ifdef BLACKMARKET
87.       d_level     d_blackmarket_level;
88.   #endif /* BLACKMARKET */
89.   } dungeon_topology;
90.   /* macros for accesing the dungeon levels by their old names */
91.   #define oracle_level		(dungeon_topology.d_oracle_level)
92.   #define bigroom_level		(dungeon_topology.d_bigroom_level)
93.   #ifdef REINCARNATION
94.   #define rogue_level		(dungeon_topology.d_rogue_level)
95.   #endif
96.   #define medusa_level		(dungeon_topology.d_medusa_level)
97.   #define stronghold_level	(dungeon_topology.d_stronghold_level)
98.   #define valley_level		(dungeon_topology.d_valley_level)
99.   #define mineend_level           (dungeon_topology.d_mineend_level)
100.  #define wiz1_level		(dungeon_topology.d_wiz1_level)
101.  #define wiz2_level		(dungeon_topology.d_wiz2_level)
102.  #define wiz3_level		(dungeon_topology.d_wiz3_level)
103.  #define juiblex_level		(dungeon_topology.d_juiblex_level)
104.  #define orcus_level		(dungeon_topology.d_orcus_level)
105.  #define baalzebub_level		(dungeon_topology.d_baalzebub_level)
106.  #define yeenoghu_level          (dungeon_topology.d_yeenoghu_level)
107.  #define geryon_level            (dungeon_topology.d_geryon_level)
108.  #define dispater_level          (dungeon_topology.d_dispater_level)
109.  #define demogorgon_level        (dungeon_topology.d_demogorgon_level)
110.  #define asmodeus_level		(dungeon_topology.d_asmodeus_level)
111.  #define portal_level		(dungeon_topology.d_portal_level)
112.  #define sanctum_level		(dungeon_topology.d_sanctum_level)
113.  #define earth_level		(dungeon_topology.d_earth_level)
114.  #define water_level		(dungeon_topology.d_water_level)
115.  #define fire_level		(dungeon_topology.d_fire_level)
116.  #define air_level		(dungeon_topology.d_air_level)
117.  #define astral_level		(dungeon_topology.d_astral_level)
118.  #define tower_dnum		(dungeon_topology.d_tower_dnum)
119.  #define sokoban_dnum		(dungeon_topology.d_sokoban_dnum)
120.  #define mines_dnum		(dungeon_topology.d_mines_dnum)
121.  #define quest_dnum		(dungeon_topology.d_quest_dnum)
122.  #define qstart_level		(dungeon_topology.d_qstart_level)
123.  #define qlocate_level		(dungeon_topology.d_qlocate_level)
124.  #define nemesis_level		(dungeon_topology.d_nemesis_level)
125.  #define knox_level		(dungeon_topology.d_knox_level)
126.  #define spiders_dnum		(dungeon_topology.d_spiders_dnum)
127.  #define lawful_quest_level	(dungeon_topology.d_lawful_quest_level)
128.  #define neutral_quest_level	(dungeon_topology.d_neutral_quest_level)
129.  #define chaotic_quest_level	(dungeon_topology.d_chaotic_quest_level)
130.  #ifdef BLACKMARKET
131.  #define blackmarket_level	(dungeon_topology.d_blackmarket_level)
132.  #endif /* BLACKMARKET */
133.  
134.  E NEARDATA stairway dnstair, upstair;		/* stairs up and down */
135.  #define xdnstair	(dnstair.sx)
136.  #define ydnstair	(dnstair.sy)
137.  #define xupstair	(upstair.sx)
138.  #define yupstair	(upstair.sy)
139.  
140.  E NEARDATA stairway dnladder, upladder;		/* ladders up and down */
141.  #define xdnladder	(dnladder.sx)
142.  #define ydnladder	(dnladder.sy)
143.  #define xupladder	(upladder.sx)
144.  #define yupladder	(upladder.sy)
145.  
146.  E NEARDATA stairway sstairs;
147.  
148.  E NEARDATA dest_area updest, dndest;	/* level-change destination areas */
149.  
150.  E NEARDATA coord inv_pos;
151.  E NEARDATA dungeon dungeons[];
152.  E NEARDATA s_level *sp_levchn;
153.  #define dunlev_reached(x)	(dungeons[(x)->dnum].dunlev_ureached)
154.  
155.  #include "quest.h"
156.  E struct q_score quest_status;
157.  
158.  E NEARDATA char pl_fruit[PL_FSIZ];
159.  E NEARDATA int current_fruit;
160.  E NEARDATA struct fruit *ffruit;
161.  
162.  E NEARDATA char tune[6];
163.  
164.  #define MAXLINFO (MAXDUNGEON * MAXLEVEL)
165.  E struct linfo level_info[MAXLINFO];
166.  
167.  E NEARDATA struct sinfo {
168.  	int gameover;		/* self explanatory? */
169.  	int stopprint;		/* inhibit further end of game disclosure */
170.  #if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32)
171.  	int done_hup;		/* SIGHUP or moral equivalent received
172.  				 * -- no more screen output */
173.  #endif
174.  	int something_worth_saving;	/* in case of panic */
175.  	int panicking;		/* `panic' is in progress */
176.  #if defined(VMS) || defined(WIN32)
177.  	int exiting;		/* an exit handler is executing */
178.  #endif
179.  	int in_impossible;
180.  #ifdef PANICLOG
181.  	int in_paniclog;
182.  #endif
183.  } program_state;
184.  
185.  E boolean restoring;
186.  
187.  E const char quitchars[];
188.  E const char vowels[];
189.  E const char ynchars[];
190.  E const char ynqchars[];
191.  E const char ynaqchars[];
192.  E const char ynNaqchars[];
193.  E NEARDATA long yn_number;
194.  
195.  E const char disclosure_options[];
196.  
197.  E NEARDATA int smeq[];
198.  E NEARDATA int doorindex;
199.  E NEARDATA char *save_cm;
200.  #define KILLED_BY_AN	 0
201.  #define KILLED_BY	 1
202.  #define NO_KILLER_PREFIX 2
203.  E NEARDATA int killer_format;
204.  E const char *killer;
205.  E const char *delayed_killer;
206.  #ifdef GOLDOBJ
207.  E long done_money;
208.  #endif
209.  E char killer_buf[BUFSZ];
210.  E const char *configfile;
211.  E NEARDATA char plname[PL_NSIZ];
212.  E NEARDATA char dogname[];
213.  E NEARDATA char catname[];
214.  E NEARDATA char ghoulname[];
215.  E NEARDATA char horsename[];
216.  E NEARDATA char wolfname[];
217.  #if 0
218.  E NEARDATA char batname[];
219.  E NEARDATA char snakename[];
220.  E NEARDATA char ratname[];
221.  E NEARDATA char badgername[];
222.  E NEARDATA char reddragonname[];
223.  E NEARDATA char whitedragonname[];
224.  #endif
225.  E char preferred_pet;
226.  E const char *occtxt;			/* defined when occupation != NULL */
227.  E const char *nomovemsg;
228.  E const char nul[];
229.  E char lock[];
230.  
231.  E const char sdir[], ndir[];
232.  E const schar xdir[], ydir[], zdir[];
233.  
234.  E NEARDATA schar tbx, tby;		/* set in mthrowu.c */
235.  
236.  E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot;
237.  
238.  E NEARDATA struct dig_info {		/* apply.c, hack.c */
239.  	int	effort;
240.  	d_level level;
241.  	coord	pos;
242.  	long lastdigtime;
243.  	boolean down, chew, warned, quiet;
244.  } digging;
245.  
246.  E NEARDATA long moves, monstermoves;
247.  E NEARDATA long wailmsg;
248.  
249.  E NEARDATA boolean in_mklev;
250.  E NEARDATA boolean stoned;
251.  E NEARDATA boolean unweapon;
252.  E NEARDATA boolean mrg_to_wielded;
253.  E NEARDATA struct obj *current_wand;
254.  E NEARDATA boolean defer_see_monsters;
255.  
256.  E NEARDATA boolean in_steed_dismounting;
257.  
258.  E const int shield_static[];
259.  
260.  
261.  /*** Objects ***/
262.  #include "obj.h"
263.  
264.  E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
265.  #ifdef TOURIST
266.  	*uarmu,				/* under-wear, so to speak */
267.  #endif
268.  #ifdef STEED
269.  	*usaddle,
270.  #endif
271.  	*uskin, *uamul, *uleft, *uright, *ublindf,
272.  	*uwep, *uswapwep, *uquiver;
273.  
274.  E NEARDATA struct obj *uchain;		/* defined only when punished */
275.  E NEARDATA struct obj *uball;
276.  E NEARDATA struct obj *migrating_objs;
277.  E NEARDATA struct obj *billobjs;
278.  E NEARDATA struct obj zeroobj;		/* init'd and defined in decl.c */
279.  E NEARDATA struct obj thisplace;	/* init'd and defined in decl.c */
280.  
281.  #include "spell.h"
282.  E NEARDATA struct spell spl_book[];	/* sized in decl.c */
283.  
284.  #ifndef TECH_H
285.  #include "tech.h"
286.  #endif
287.  E NEARDATA struct tech tech_list[];     /* sized in decl.c */
288.  
289.  
290.  /*** The player ***/
291.  E NEARDATA char pl_character[PL_CSIZ];
292.  E NEARDATA char pl_race;		/* character's race */
293.  /* KMH, role patch -- more maintainable when declared as an array */
294.  E const char pl_classes[];
295.  
296.  #include "you.h"
297.  #include "onames.h"
298.  
299.  E NEARDATA struct you u;
300.  E NEARDATA struct Role urole;
301.  
302.  
303.  /*** Monsters ***/
304.  #ifndef PM_H
305.  #include "pm.h"
306.  #endif
307.  
308.  E NEARDATA struct permonst playermon, *uasmon;
309.  					/* also decl'd extern in permonst.h */
310.  					/* init'd in monst.c */
311.  
312.  E NEARDATA struct monst youmonst;	/* init'd and defined in decl.c */
313.  E NEARDATA struct monst *mydogs, *migrating_mons;
314.  
315.  E NEARDATA struct permonst upermonst;	/* init'd in decl.c, 
316.  					 * defined in polyself.c 
317.  					 */
318.  
319.  E NEARDATA struct mvitals {
320.  	uchar	born;
321.  	uchar	died;
322.  	uchar	mvflags;
323.  #ifdef EATEN_MEMORY
324.  	uchar	eaten;		/* WAC -- eaten memory */
325.  #endif
326.  } mvitals[NUMMONS];
327.  
328.  
329.  /* The names of the colors used for gems, etc. */
330.  E const char *c_obj_colors[];
331.  
332.  E struct c_common_strings {
333.      const char	*const c_nothing_happens, *const c_thats_enough_tries,
334.  		*const c_silly_thing_to, *const c_shudder_for_moment,
335.  		*const c_something, *const c_Something,
336.  		*const c_You_can_move_again,
337.  		*const c_Never_mind, *c_vision_clears,
338.  		*const c_the_your[2];
339.  } c_common_strings;
340.  #define nothing_happens    c_common_strings.c_nothing_happens
341.  #define thats_enough_tries c_common_strings.c_thats_enough_tries
342.  #define silly_thing_to	   c_common_strings.c_silly_thing_to
343.  #define shudder_for_moment c_common_strings.c_shudder_for_moment
344.  #define something	   c_common_strings.c_something
345.  #define Something	   c_common_strings.c_Something
346.  #define You_can_move_again c_common_strings.c_You_can_move_again
347.  #define Never_mind	   c_common_strings.c_Never_mind
348.  #define vision_clears	   c_common_strings.c_vision_clears
349.  #define the_your	   c_common_strings.c_the_your
350.  
351.  E const char no_elbow_room[];
352.  
353.  /* material strings */
354.  E const char *materialnm[];
355.  
356.  /* Monster name articles */
357.  #define ARTICLE_NONE	0
358.  #define ARTICLE_THE	1
359.  #define ARTICLE_A	2
360.  #define ARTICLE_YOUR	3
361.  
362.  /* Monster name suppress masks */
363.  #define SUPPRESS_IT		0x01
364.  #define SUPPRESS_INVISIBLE	0x02
365.  #define SUPPRESS_HALLUCINATION  0x04
366.  #define SUPPRESS_SADDLE		0x08
367.  #define EXACT_NAME		0x0F
368.  
369.  
370.  /*** Vision ***/
371.  E NEARDATA boolean vision_full_recalc;	/* TRUE if need vision recalc */
372.  E NEARDATA char **viz_array;		/* could see/in sight row pointers */
373.  
374.  
375.  /*** Window system stuff ***/
376.  #include "color.h"
377.  #ifdef TEXTCOLOR
378.  E const int zapcolors[];
379.  #endif
380.  
381.  E const char def_oc_syms[MAXOCLASSES];	/* default class symbols */
382.  E uchar oc_syms[MAXOCLASSES];		/* current class symbols */
383.  E const char def_monsyms[MAXMCLASSES];	/* default class symbols */
384.  E uchar monsyms[MAXMCLASSES];		/* current class symbols */
385.  
386.  E NEARDATA struct c_color_names {
387.      const char	*const c_black, *const c_amber, *const c_golden,
388.  		*const c_light_blue,*const c_red, *const c_green,
389.  		*const c_silver, *const c_blue, *const c_purple,
390.  		*const c_white;
391.  } c_color_names;
392.  #define NH_BLACK		c_color_names.c_black
393.  #define NH_AMBER		c_color_names.c_amber
394.  #define NH_GOLDEN		c_color_names.c_golden
395.  #define NH_LIGHT_BLUE		c_color_names.c_light_blue
396.  #define NH_RED			c_color_names.c_red
397.  #define NH_GREEN		c_color_names.c_green
398.  #define NH_SILVER		c_color_names.c_silver
399.  #define NH_BLUE			c_color_names.c_blue
400.  #define NH_PURPLE		c_color_names.c_purple
401.  #define NH_WHITE		c_color_names.c_white
402.  
403.  E NEARDATA winid WIN_MESSAGE, WIN_STATUS;
404.  E NEARDATA winid WIN_MAP, WIN_INVEN;
405.  E char toplines[];
406.  #ifndef TCAP_H
407.  E struct tc_gbl_data {	/* also declared in tcap.h */
408.      char *tc_AS, *tc_AE;	/* graphics start and end (tty font swapping) */
409.      int   tc_LI,  tc_CO;	/* lines and columns */
410.  } tc_gbl_data;
411.  #define AS tc_gbl_data.tc_AS
412.  #define AE tc_gbl_data.tc_AE
413.  #define LI tc_gbl_data.tc_LI
414.  #define CO tc_gbl_data.tc_CO
415.  #endif
416.  
417.  E struct authentication {
418.      char prog[BUFSZ];
419.      char args[BUFSZ];
420.  } authentication;
421.  
422.  #define MAXNOTILESETS		20
423.  #ifndef TILESET_MAX_FILENAME
424.  #define TILESET_MAX_FILENAME	256
425.  #endif
426.  
427.  #define TILESET_TRANSPARENT	1
428.  #define TILESET_PSEUDO3D	2
429.  
430.  E struct tileset {
431.      char name[PL_PSIZ];
432.      char file[TILESET_MAX_FILENAME];
433.      unsigned long flags;
434.      void *data;				/* For windowing port's use */
435.  } tilesets[MAXNOTILESETS];
436.  E int no_tilesets;
437.  E struct tileset def_tilesets[];
438.  E char tileset[PL_PSIZ];
439.  
440.  /* xxxexplain[] is in drawing.c */
441.  E const char * const monexplain[], invisexplain[], * const objexplain[], * const oclass_names[];
442.  
443.  /* Some systems want to use full pathnames for some subsets of file names,
444.   * rather than assuming that they're all in the current directory.  This
445.   * provides all the subclasses that seem reasonable, and sets up for all
446.   * prefixes being null.  Port code can set those that it wants.
447.   */
448.  #define HACKPREFIX	0
449.  #define LEVELPREFIX	1
450.  #define SAVEPREFIX	2
451.  #define BONESPREFIX	3
452.  #define DATAPREFIX	4	/* this one must match hardcoded value in dlb.c */
453.  #define SCOREPREFIX	5
454.  #define LOCKPREFIX	6
455.  #define CONFIGPREFIX	7
456.  #define TROUBLEPREFIX	8
457.  #define PREFIX_COUNT	9
458.  /* used in files.c; xxconf.h can override if needed */
459.  # ifndef FQN_MAX_FILENAME
460.  #define FQN_MAX_FILENAME 512
461.  # endif
462.  
463.  #if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND)
464.  /* the bare-bones stuff is unconditional above to simplify coding; for
465.   * ports that actually use prefixes, add some more localized things
466.   */
467.  #define PREFIXES_IN_USE
468.  #endif
469.  
470.  E char *fqn_prefix[PREFIX_COUNT];
471.  #ifdef PREFIXES_IN_USE
472.  E char *fqn_prefix_names[PREFIX_COUNT];
473.  #endif
474.  
475.  
476.  #ifdef AUTOPICKUP_EXCEPTIONS
477.  struct autopickup_exception {
478.  	char *pattern;
479.  	boolean grab;
480.  	struct autopickup_exception *next;
481.  };
482.  #endif /* AUTOPICKUP_EXCEPTIONS */
483.  
484.  #undef E
485.  
486.  #endif /* DECL_H */