Fandom

Wikihack

Source:NetHack 3.1.0/decl.h

2,034pages on
this wiki
Add New Page
Talk0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Below is the full text to decl.h from the source code of NetHack 3.1.0. To link to a particular line, write [[NetHack 3.1.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.
1.    /*	SCCS Id: @(#)decl.h	3.1	92/12/11	*/
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 int NEARDATA bases[];
28.   
29.   E int NEARDATA multi;
30.   E int NEARDATA warnlevel;
31.   E int NEARDATA nroom;
32.   E int NEARDATA nsubroom;
33.   E int NEARDATA occtime;
34.   
35.   E int x_maze_max, y_maze_max;
36.   E int otg_temp;
37.   
38.   #ifdef REDO
39.   E int NEARDATA 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.   #ifdef MULDGN
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.   #endif
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.   #ifdef MULDGN
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.  #endif
104.  
105.  E stairway NEARDATA dnstair, NEARDATA upstair; /* stairs up and down. */
106.  #define xdnstair	(dnstair.sx)
107.  #define ydnstair	(dnstair.sy)
108.  #define xupstair	(upstair.sx)
109.  #define yupstair	(upstair.sy)
110.  
111.  E stairway NEARDATA dnladder, NEARDATA upladder; /* ladders up and down. */
112.  #define xdnladder	(dnladder.sx)
113.  #define ydnladder	(dnladder.sy)
114.  #define xupladder	(upladder.sx)
115.  #define yupladder	(upladder.sy)
116.  
117.  E stairway NEARDATA sstairs;
118.  
119.  E dest_area NEARDATA updest, NEARDATA dndest; /* level-change dest. areas */
120.  
121.  E coord NEARDATA inv_pos;
122.  E dungeon NEARDATA dungeons[];
123.  E s_level NEARDATA *sp_levchn;
124.  #define dunlev_reached(x)	(dungeons[(x)->dnum].dunlev_ureached)
125.  
126.  #ifdef MULDGN
127.  #include "quest.h"
128.  E struct q_score 	quest_status;
129.  #endif
130.  
131.  E int NEARDATA done_stopprint;
132.  E int NEARDATA done_hup;
133.  
134.  E char NEARDATA pl_character[PL_CSIZ];
135.  #ifdef TUTTI_FRUTTI
136.  E char NEARDATA pl_fruit[PL_FSIZ];
137.  E int NEARDATA current_fruit;
138.  E struct fruit NEARDATA *ffruit;
139.  #endif
140.  
141.  E char NEARDATA tune[6];
142.  
143.  E const char NEARDATA quitchars[];
144.  E const char NEARDATA vowels[];
145.  E const char NEARDATA ynchars[];
146.  E const char NEARDATA ynqchars[];
147.  E const char NEARDATA ynaqchars[];
148.  E const char NEARDATA ynNaqchars[];
149.  E long NEARDATA yn_number;
150.  E int NEARDATA smeq[];
151.  E int NEARDATA doorindex;
152.  E char NEARDATA *save_cm;
153.  #define KILLED_BY_AN	 0
154.  #define KILLED_BY	 1
155.  #define NO_KILLER_PREFIX 2
156.  E int NEARDATA killer_format;
157.  E const char NEARDATA *killer;
158.  E const char *configfile;
159.  E char NEARDATA plname[PL_NSIZ];
160.  E char NEARDATA dogname[];
161.  E char NEARDATA catname[];
162.  E char preferred_pet;
163.  E const char NEARDATA *occtxt;		/* defined when occupation != NULL */
164.  E const char NEARDATA *nomovemsg;
165.  E const char NEARDATA nul[];
166.  E const char *traps[];
167.  E char lock[];
168.  
169.  E const char NEARDATA sdir[], NEARDATA ndir[];
170.  E const schar NEARDATA xdir[], NEARDATA ydir[], zdir[];
171.  
172.  E schar NEARDATA tbx, NEARDATA tby;		/* set in mthrowu.c */
173.  E int NEARDATA dig_effort;	/* apply.c, hack.c */
174.  E d_level NEARDATA dig_level;
175.  E coord NEARDATA dig_pos;
176.  E boolean NEARDATA dig_down;
177.  
178.  E long NEARDATA moves, NEARDATA monstermoves;
179.  E long NEARDATA wailmsg;
180.  
181.  E boolean NEARDATA in_mklev;
182.  E boolean NEARDATA stoned;
183.  E boolean NEARDATA unweapon;
184.  E boolean NEARDATA mrg_to_wielded;
185.  
186.  #ifdef KOPS
187.  E boolean NEARDATA allow_kops;
188.  #endif
189.  
190.  E const int shield_static[];
191.  
192.  #ifndef SPELLS_H
193.  #include "spell.h"
194.  #endif
195.  E struct spell NEARDATA spl_book[];	/* sized in decl.c */
196.  
197.  #ifdef TEXTCOLOR
198.  # ifndef COLOR_H
199.  #include "color.h"
200.  # endif
201.  E const int zapcolors[];
202.  #endif
203.  
204.  E const char def_oc_syms[MAXOCLASSES];	/* default class symbols */
205.  E uchar oc_syms[MAXOCLASSES];		/* current class symbols */
206.  E const char def_monsyms[MAXMCLASSES];	/* default class symbols */
207.  E uchar monsyms[MAXMCLASSES];		/* current class symbols */
208.  
209.  #ifndef OBJ_H
210.  #include "obj.h"
211.  #endif
212.  
213.  E struct obj NEARDATA *invent, NEARDATA *uarm, NEARDATA *uarmc,
214.  	NEARDATA *uarmh, NEARDATA *uarms, NEARDATA *uarmg, NEARDATA *uarmf,
215.  #ifdef TOURIST
216.  	NEARDATA *uarmu, /* under-wear, so to speak */
217.  #endif
218.  #ifdef POLYSELF
219.  	NEARDATA *uskin,
220.  #endif
221.  	NEARDATA *uamul, NEARDATA *uleft, NEARDATA *uright, NEARDATA *ublindf,
222.  	NEARDATA *uwep;
223.  
224.  E struct obj NEARDATA *uchain;	/* defined only when punished */
225.  E struct obj NEARDATA *uball;
226.  E struct obj NEARDATA *migrating_objs;
227.  E struct obj NEARDATA *billobjs;
228.  E struct obj NEARDATA zeroobj;		/* init'd and defined in decl.c */
229.  
230.  #ifndef YOU_H
231.  #include "you.h"
232.  #endif
233.  
234.  E struct you NEARDATA u;
235.  
236.  #ifndef ONAMES_H
237.  #include "onames.h"
238.  #endif
239.  #ifndef PM_H
240.  #include "pm.h"
241.  #endif
242.  
243.  E struct permonst NEARDATA playermon, NEARDATA *uasmon;
244.  					/* also decl'd extern in permonst.h */
245.  					/* init'd in monst.c */
246.  
247.  E struct monst NEARDATA youmonst;	/* init'd and defined in decl.c */
248.  E struct monst NEARDATA *mydogs, NEARDATA *migrating_mons;
249.  
250.  E struct c_color_names {
251.      char const	*const c_black, *const c_amber, *const c_golden,
252.  		*const c_light_blue,*const c_red, *const c_green,
253.  		*const c_silver, *const c_blue, *const c_purple,
254.  		*const c_white;
255.  } NEARDATA c_color_names;
256.  #define Black		c_color_names.c_black
257.  #define amber		c_color_names.c_amber
258.  #define golden		c_color_names.c_golden
259.  #define light_blue	c_color_names.c_light_blue
260.  #define red		c_color_names.c_red
261.  #define green		c_color_names.c_green
262.  #define silver		c_color_names.c_silver
263.  #define blue		c_color_names.c_blue
264.  #define purple		c_color_names.c_purple
265.  #define White		c_color_names.c_white
266.  
267.  E struct c_common_strings {
268.      char const	*const c_nothing_happens, *const c_thats_enough_tries,
269.  		*const c_silly_thing_to, *const c_shudder_for_moment;
270.  } c_common_strings;
271.  #define nothing_happens    c_common_strings.c_nothing_happens
272.  #define thats_enough_tries c_common_strings.c_thats_enough_tries
273.  #define silly_thing_to	   c_common_strings.c_silly_thing_to
274.  #define shudder_for_moment c_common_strings.c_shudder_for_moment
275.  
276.  /* Vision */
277.  E boolean NEARDATA vision_full_recalc;	/* TRUE if need vision recalc */
278.  E char NEARDATA **viz_array;	/* could see/in sight row pointers */
279.  
280.  /* Window system stuff */
281.  E winid NEARDATA WIN_MESSAGE, NEARDATA WIN_STATUS;
282.  E winid NEARDATA WIN_MAP, NEARDATA WIN_INVEN;
283.  E char toplines[];
284.  #ifndef TERMCAP_H
285.  E struct tc_gbl_data {	/* also declared in termcap.h */
286.      char *tc_AS, *tc_AE;	/* graphics start and end (tty font swapping) */
287.      int   tc_LI,  tc_CO;	/* lines and columns */
288.  } tc_gbl_data;
289.  #define AS tc_gbl_data.tc_AS
290.  #define AE tc_gbl_data.tc_AE
291.  #define LI tc_gbl_data.tc_LI
292.  #define CO tc_gbl_data.tc_CO
293.  #endif
294.  
295.  /* xxxexplain[] is in drawing.c */
296.  E const char *monexplain[], *objexplain[], *oclass_names[];
297.  
298.  E const char NEARDATA *pl_classes;
299.  
300.  #undef E
301.  
302.  #endif /* DECL_H */

Also on Fandom

Random Wiki