Source:NetHack 3.3.0/decl.h

From NetHackWiki
Revision as of 10:19, 4 March 2008 by Kernigh bot (talk | contribs) (NetHack 3.3.0/decl.h moved to Source:NetHack 3.3.0/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 NetHack 3.3.0. To link to a particular line, write [[NetHack 3.3.0/decl.h#line123]], for example.

Warning! This is the source code from an old release. For the latest release, see 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.3	99/07/02	*/
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.   E NEARDATA int warnlevel;
31.   E NEARDATA int nroom;
32.   E NEARDATA int nsubroom;
33.   E NEARDATA int occtime;
34.   
35.   E int x_maze_max, y_maze_max;
36.   E int otg_temp;
37.   
38.   #ifdef REDO
39.   E NEARDATA int in_doagain;
40.   #endif
41.   
42.   E struct dgn_topology {		/* special dungeon levels for speed */
43.       d_level	d_oracle_level;
44.       d_level	d_bigroom_level;	/* unused */
45.   #ifdef REINCARNATION
46.       d_level	d_rogue_level;
47.   #endif
48.       d_level	d_medusa_level;
49.       d_level	d_stronghold_level;
50.       d_level	d_valley_level;
51.       d_level	d_wiz1_level;
52.       d_level	d_wiz2_level;
53.       d_level	d_wiz3_level;
54.       d_level	d_juiblex_level;
55.       d_level	d_orcus_level;
56.       d_level	d_baalzebub_level;	/* unused */
57.       d_level	d_asmodeus_level;	/* unused */
58.       d_level	d_portal_level;		/* only in goto_level() [do.c] */
59.       d_level	d_sanctum_level;
60.       d_level	d_earth_level;
61.       d_level	d_water_level;
62.       d_level	d_fire_level;
63.       d_level	d_air_level;
64.       d_level	d_astral_level;
65.       xchar	d_tower_dnum;
66.       xchar	d_sokoban_dnum;
67.       xchar	d_mines_dnum, d_quest_dnum;
68.       d_level	d_qstart_level, d_qlocate_level, d_nemesis_level;
69.       d_level	d_knox_level;
70.   } dungeon_topology;
71.   /* macros for accesing the dungeon levels by their old names */
72.   #define oracle_level		(dungeon_topology.d_oracle_level)
73.   #define bigroom_level		(dungeon_topology.d_bigroom_level)
74.   #ifdef REINCARNATION
75.   #define rogue_level		(dungeon_topology.d_rogue_level)
76.   #endif
77.   #define medusa_level		(dungeon_topology.d_medusa_level)
78.   #define stronghold_level	(dungeon_topology.d_stronghold_level)
79.   #define valley_level		(dungeon_topology.d_valley_level)
80.   #define wiz1_level		(dungeon_topology.d_wiz1_level)
81.   #define wiz2_level		(dungeon_topology.d_wiz2_level)
82.   #define wiz3_level		(dungeon_topology.d_wiz3_level)
83.   #define juiblex_level		(dungeon_topology.d_juiblex_level)
84.   #define orcus_level		(dungeon_topology.d_orcus_level)
85.   #define baalzebub_level		(dungeon_topology.d_baalzebub_level)
86.   #define asmodeus_level		(dungeon_topology.d_asmodeus_level)
87.   #define portal_level		(dungeon_topology.d_portal_level)
88.   #define sanctum_level		(dungeon_topology.d_sanctum_level)
89.   #define earth_level		(dungeon_topology.d_earth_level)
90.   #define water_level		(dungeon_topology.d_water_level)
91.   #define fire_level		(dungeon_topology.d_fire_level)
92.   #define air_level		(dungeon_topology.d_air_level)
93.   #define astral_level		(dungeon_topology.d_astral_level)
94.   #define tower_dnum		(dungeon_topology.d_tower_dnum)
95.   #define sokoban_dnum		(dungeon_topology.d_sokoban_dnum)
96.   #define mines_dnum		(dungeon_topology.d_mines_dnum)
97.   #define quest_dnum		(dungeon_topology.d_quest_dnum)
98.   #define qstart_level		(dungeon_topology.d_qstart_level)
99.   #define qlocate_level		(dungeon_topology.d_qlocate_level)
100.  #define nemesis_level		(dungeon_topology.d_nemesis_level)
101.  #define knox_level		(dungeon_topology.d_knox_level)
102.  
103.  E NEARDATA stairway dnstair, upstair;		/* stairs up and down */
104.  #define xdnstair	(dnstair.sx)
105.  #define ydnstair	(dnstair.sy)
106.  #define xupstair	(upstair.sx)
107.  #define yupstair	(upstair.sy)
108.  
109.  E NEARDATA stairway dnladder, upladder;		/* ladders up and down */
110.  #define xdnladder	(dnladder.sx)
111.  #define ydnladder	(dnladder.sy)
112.  #define xupladder	(upladder.sx)
113.  #define yupladder	(upladder.sy)
114.  
115.  E NEARDATA stairway sstairs;
116.  
117.  E NEARDATA dest_area updest, dndest;	/* level-change destination areas */
118.  
119.  E NEARDATA coord inv_pos;
120.  E NEARDATA dungeon dungeons[];
121.  E NEARDATA s_level *sp_levchn;
122.  #define dunlev_reached(x)	(dungeons[(x)->dnum].dunlev_ureached)
123.  
124.  #include "quest.h"
125.  E struct q_score quest_status;
126.  
127.  E NEARDATA char pl_character[PL_CSIZ];
128.  E NEARDATA char pl_race;		/* character's race */
129.  
130.  E NEARDATA char pl_fruit[PL_FSIZ];
131.  E NEARDATA int current_fruit;
132.  E NEARDATA struct fruit *ffruit;
133.  
134.  E NEARDATA char tune[6];
135.  
136.  #define MAXLINFO (MAXDUNGEON * MAXLEVEL)
137.  E struct linfo level_info[MAXLINFO];
138.  
139.  E NEARDATA struct sinfo {
140.  	int stopprint;		/* game over, inhibit further disclosure */
141.  #if defined(UNIX) || defined(VMS) || defined (__EMX__)
142.  	int done_hup;		/* SIGHUP or moral equivalent received
143.  				 * -- no more screen output */
144.  #endif
145.  	int something_worth_saving;	/* in case of panic */
146.  	int panicking;		/* `panic' is in progress */
147.  #if defined(VMS) || defined(WIN32)
148.  	int exiting;		/* an exit handler is executing */
149.  #endif
150.  } program_state;
151.  
152.  E boolean restoring;
153.  
154.  E const char quitchars[];
155.  E const char vowels[];
156.  E const char ynchars[];
157.  E const char ynqchars[];
158.  E const char ynaqchars[];
159.  E const char ynNaqchars[];
160.  E NEARDATA long yn_number;
161.  E NEARDATA int smeq[];
162.  E NEARDATA int doorindex;
163.  E NEARDATA char *save_cm;
164.  #define KILLED_BY_AN	 0
165.  #define KILLED_BY	 1
166.  #define NO_KILLER_PREFIX 2
167.  E NEARDATA int killer_format;
168.  E const char *killer;
169.  E const char *configfile;
170.  E NEARDATA char plname[PL_NSIZ];
171.  E NEARDATA char dogname[];
172.  E NEARDATA char catname[];
173.  E NEARDATA char horsename[];
174.  E char preferred_pet;
175.  E const char *occtxt;			/* defined when occupation != NULL */
176.  E const char *nomovemsg;
177.  E const char nul[];
178.  E char lock[];
179.  
180.  E const char sdir[], ndir[];
181.  E const schar xdir[], ydir[], zdir[];
182.  
183.  E NEARDATA schar tbx, tby;		/* set in mthrowu.c */
184.  
185.  E NEARDATA struct dig_info {		/* apply.c, hack.c */
186.  	int	effort;
187.  	d_level level;
188.  	coord	pos;
189.  	boolean down, chew;
190.  } digging;
191.  
192.  E NEARDATA long moves, monstermoves;
193.  E NEARDATA long wailmsg;
194.  
195.  E NEARDATA boolean in_mklev;
196.  E NEARDATA boolean stoned;
197.  E NEARDATA boolean unweapon;
198.  E NEARDATA boolean mrg_to_wielded;
199.  E NEARDATA struct obj *current_wand;
200.  
201.  E NEARDATA boolean in_steed_dismounting;
202.  
203.  E const int shield_static[];
204.  
205.  #include "spell.h"
206.  E NEARDATA struct spell spl_book[];	/* sized in decl.c */
207.  
208.  #ifdef TEXTCOLOR
209.  #include "color.h"
210.  E const int zapcolors[];
211.  #endif
212.  
213.  E const char def_oc_syms[MAXOCLASSES];	/* default class symbols */
214.  E uchar oc_syms[MAXOCLASSES];		/* current class symbols */
215.  E const char def_monsyms[MAXMCLASSES];	/* default class symbols */
216.  E uchar monsyms[MAXMCLASSES];		/* current class symbols */
217.  
218.  #include "obj.h"
219.  E NEARDATA struct obj *invent,
220.  	*uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
221.  #ifdef TOURIST
222.  	*uarmu,				/* under-wear, so to speak */
223.  #endif
224.  	*uskin, *uamul, *uleft, *uright, *ublindf,
225.  	*uwep, *uswapwep, *uquiver;
226.  
227.  E NEARDATA struct obj *uchain;		/* defined only when punished */
228.  E NEARDATA struct obj *uball;
229.  E NEARDATA struct obj *migrating_objs;
230.  E NEARDATA struct obj *billobjs;
231.  E NEARDATA struct obj zeroobj;		/* init'd and defined in decl.c */
232.  
233.  E const char *he[3];
234.  E const char *him[3];
235.  E const char *his[3];
236.  
237.  #include "you.h"
238.  E NEARDATA struct you u;
239.  
240.  #include "onames.h"
241.  #ifndef PM_H		/* (pm.h has already been included via youprop.h) */
242.  #include "pm.h"
243.  #endif
244.  
245.  E NEARDATA struct monst youmonst;	/* init'd and defined in decl.c */
246.  E NEARDATA struct monst *mydogs, *migrating_mons;
247.  
248.  E NEARDATA struct mvitals {
249.  	uchar	born;
250.  	uchar	died;
251.  	uchar	mvflags;
252.  } mvitals[NUMMONS];
253.  
254.  E NEARDATA struct c_color_names {
255.      const char	*const c_black, *const c_amber, *const c_golden,
256.  		*const c_light_blue,*const c_red, *const c_green,
257.  		*const c_silver, *const c_blue, *const c_purple,
258.  		*const c_white;
259.  } c_color_names;
260.  #define Black		c_color_names.c_black
261.  #define amber		c_color_names.c_amber
262.  #define golden		c_color_names.c_golden
263.  #define light_blue	c_color_names.c_light_blue
264.  #define red		c_color_names.c_red
265.  #define green		c_color_names.c_green
266.  #define silver		c_color_names.c_silver
267.  #define blue		c_color_names.c_blue
268.  #define purple		c_color_names.c_purple
269.  #define White		c_color_names.c_white
270.  
271.  E struct c_common_strings {
272.      const char	*const c_nothing_happens, *const c_thats_enough_tries,
273.  		*const c_silly_thing_to, *const c_shudder_for_moment,
274.  		*const c_something, *const c_Something,
275.  		*const c_You_can_move_again;
276.  } c_common_strings;
277.  #define nothing_happens    c_common_strings.c_nothing_happens
278.  #define thats_enough_tries c_common_strings.c_thats_enough_tries
279.  #define silly_thing_to	   c_common_strings.c_silly_thing_to
280.  #define shudder_for_moment c_common_strings.c_shudder_for_moment
281.  #define something	   c_common_strings.c_something
282.  #define Something	   c_common_strings.c_Something
283.  #define You_can_move_again c_common_strings.c_You_can_move_again
284.  
285.  /* Vision */
286.  E NEARDATA boolean vision_full_recalc;	/* TRUE if need vision recalc */
287.  E NEARDATA char **viz_array;		/* could see/in sight row pointers */
288.  
289.  /* Window system stuff */
290.  E NEARDATA winid WIN_MESSAGE, WIN_STATUS;
291.  E NEARDATA winid WIN_MAP, WIN_INVEN;
292.  E char toplines[];
293.  #ifndef TCAP_H
294.  E struct tc_gbl_data {	/* also declared in tcap.h */
295.      char *tc_AS, *tc_AE;	/* graphics start and end (tty font swapping) */
296.      int   tc_LI,  tc_CO;	/* lines and columns */
297.  } tc_gbl_data;
298.  #define AS tc_gbl_data.tc_AS
299.  #define AE tc_gbl_data.tc_AE
300.  #define LI tc_gbl_data.tc_LI
301.  #define CO tc_gbl_data.tc_CO
302.  #endif
303.  
304.  /* xxxexplain[] is in drawing.c */
305.  E const char *monexplain[], *invisexplain, *objexplain[], *oclass_names[];
306.  
307.  #undef E
308.  
309.  #endif /* DECL_H */