Source:NetHack 5.0.0/include/global.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to global.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/global.h#line12]], for example.

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. /* NetHack 5.0	global.h	$NHDT-Date: 1704225560 2024/01/02 19:59:20 $  $NHDT-Branch: keni-luabits2 $:$NHDT-Revision: 1.159 $ */
2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3. /*-Copyright (c) Michael Allison, 2006. */
4. /* NetHack may be freely redistributed.  See license for details. */
5. 
6. #ifndef GLOBAL_H
7. #define GLOBAL_H
8. 
9. /*
10.  * Files expected to exist in the playground directory (possibly inside
11.  * a dlb container file).
12.  */
13. 
14. #define RECORD "record"         /* file containing list of topscorers */
15. #define HELP "help"             /* file containing command descriptions */
16. #define SHELP "hh"              /* abbreviated form of the same */
17. #define KEYHELP "keyhelp"       /* explanatory text for 'whatdoes' command */
18. #define DEBUGHELP "wizhelp"     /* file containing debug mode cmds */
19. #define RUMORFILE "rumors"      /* file with fortune cookies */
20. #define ORACLEFILE "oracles"    /* file with oracular information */
21. #define DATAFILE "data"         /* file giving the meaning of symbols used */
22. #define CMDHELPFILE "cmdhelp"   /* file telling what commands do */
23. #define HISTORY "history"       /* file giving nethack's history */
24. #define LICENSE "license"       /* file with license information */
25. #define OPTIONFILE "opthelp"    /* file explaining runtime options */
26. #define OPTMENUHELP "optmenu"   /* file explaining #options command */
27. #define USAGEHELP "usagehlp"    /* file explaining command line use */
28. #define OPTIONS_USED "options"  /* compile-time options, for #version */
29. #define SYMBOLS "symbols"       /* replacement symbol sets */
30. #define EPITAPHFILE "epitaph"   /* random epitaphs on graves */
31. #define ENGRAVEFILE "engrave"   /* random engravings on the floor */
32. #define BOGUSMONFILE "bogusmon" /* hallucinatory monsters */
33. #define TRIBUTEFILE "tribute"   /* 3.6 tribute to Terry Pratchett */
34. #define LEV_EXT ".lua"          /* extension for special level files */
35. 
36. /* padding amounts for files that have lines chosen by fseek to random spot,
37.    advancing to the next line, and using that line; makedefs forces shorter
38.    lines to be padded to these lengths; value of 0 will inhibit any padding,
39.    avoiding an increase in files' sizes, but resulting in biased selection;
40.    used by makedefs while building and by core's callers of get_rnd_text() */
41. #define MD_PAD_RUMORS 60u /* for RUMORFILE, EPITAPHFILE, and ENGRAVEFILE */
42. #define MD_PAD_BOGONS 20u /* for BOGUSMONFILE */
43. 
44. /* Assorted definitions that may depend on selections in config.h. */
45. 
46. /*
47.  * for DUMB preprocessor and compiler, e.g., cpp and pcc supplied
48.  * with Microport SysV/AT, which have small symbol tables;
49.  * DUMB if needed is defined in CFLAGS
50.  */
51. #ifdef DUMB
52. #ifdef BITFIELDS
53. #undef BITFIELDS
54. #endif
55. #ifndef STUPID
56. #define STUPID
57. #endif
58. #endif /* DUMB */
59. 
60. /*
61.  * type xint8: small integers (typedef'd as signed,
62.  * in the range -127 - 127).
63.  */
64. typedef int8_t xint8;
65. /*
66.  * type coordxy: integers (typedef'd as signed,
67.  * in the range -32768 to 32767), mostly coordinates.
68.  * Note that in 2022, screen coordinates easily
69.  * surpass an upper limit of 127.
70.  */
71. typedef int16_t coordxy;
72. /*
73.  * type xint16: integers (typedef'd as signed,
74.  * in the range -32768 to 32767), non-coordinates.
75.  */
76. typedef int16_t xint16;
77. 
78. #ifdef __MINGW32__
79. /* Resolve conflict with Qt 5 and MinGW-w32 */
80. typedef unsigned char boolean; /* 0 or 1 */
81. #else
82. #ifndef SKIP_BOOLEAN
83. typedef schar boolean; /* 0 or 1 */
84. #endif
85. #endif
86. 
87. /* vision seen vectors: viz_array[][] and levl[][].seenv, which use different
88.    values from each other but are close enough in size to share a type;
89.    viz_array contains 8-bit bitmasks, lev->seenv is a 5-bit bitfield */
90. typedef unsigned char seenV; /* no need for uint8_t */
91. 
92. /* Type for third parameter of read(2) */
93. #if defined(BSD) || defined(ULTRIX)
94. typedef int readLenType;
95. #else /* e.g. SYSV, __TURBOC__ */
96. typedef unsigned readLenType;
97. #endif
98. 
99. #ifndef TRUE /* defined in some systems' native include files */
100. #define TRUE ((boolean) 1)
101. #define FALSE ((boolean) 0)
102. #endif
103. #define BOOL_RANDOM (-1)
104. 
105. /*
106.  * type nhsym: loadable symbols go into this type
107.  */
108. typedef uchar nhsym;
109. 
110. #ifndef STRNCMPI
111. /* SAS/C already shifts to stricmp */
112. #if !defined(__SASC_60) && !defined(CROSS_TO_AMIGA)
113. #define strcmpi(a, b) strncmpi((a), (b), -1)
114. #endif
115. #endif
116. #ifdef CROSS_TO_AMIGA
117. #define strcmpi(a, b) stricmp(a, b)
118. #endif
119. 
120. /* #define SPECIALIZATION */ /* do "specialized" version of new topology */
121. 
122. #ifdef BITFIELDS
123. #define Bitfield(x, n) unsigned x : n
124. #else
125. #define Bitfield(x, n) uchar x
126. #endif
127. 
128. #define SIZE(x) (int)(sizeof(x) / sizeof(x[0]))
129. 
130. /* A limit for some NetHack int variables.  It need not, and for comparable
131.  * scoring should not, depend on the actual limit on integers for a
132.  * particular machine, although it is set to the minimum required maximum
133.  * signed integer for C (2^15 -1).
134.  */
135. #define LARGEST_INT 32767
136. 
137. #include "coord.h"
138. 
139. /* define USING_ADDRESS_SANITIZER if ASAN is in use */
140. #if defined(__clang__)
141. #if defined(__has_feature)
142. #if __has_feature(address_sanitizer)
143. #define USING_ADDRESS_SANITIZER
144. #endif  /* __has_feature */
145. #endif  /* __has_feature(address_sanitizer) */
146. #else   /* ?__clang__ */
147. #if defined(__GNUC__) || defined(_MSC_VER)
148. #ifdef __SANITIZE_ADDRESS__
149. #define USING_ADDRESS_SANITIZER
150. #endif  /* __SANITIZE_ADDRESS__ */
151. #endif  /* __GNUC__ || _MSC_VER */
152. #endif  /* !__clang__ */
153. 
154. /*
155.  * Automatic inclusions for the subsidiary files.
156.  * Please don't change the order.  It does matter.
157.  */
158. 
159. #ifdef VMS
160. #include "vmsconf.h"
161. #endif
162. 
163. #ifdef UNIX
164. #include "unixconf.h"
165. #endif
166. 
167. #ifdef MSDOS
168. #include "pcconf.h"
169. #endif
170. 
171. #ifdef WIN32
172. #include "windconf.h"
173. #endif
174. 
175. #include "warnings.h"
176. 
177. /* amiconf.h needs to be the last nested #include of config.h because
178.    'make depend' will turn it into a comment, hiding anything after it */
179. #ifdef AMIGA
180. #include "amiconf.h"
181. #endif
182. 
183. /* Displayable name of this port; don't redefine if defined in *conf.h */
184. #ifndef PORT_ID
185. #ifdef AMIGA
186. #define PORT_ID "Amiga"
187. #endif
188. #ifdef MACOS9
189. #define PORT_ID "Mac"
190. #endif
191. #ifdef __APPLE__
192. #define PORT_ID "MacOS"
193. #endif
194. #ifdef MSDOS
195. #ifdef PC9800
196. #define PORT_ID "PC-9800"
197. #else
198. #define PORT_ID "PC"
199. #endif
200. #ifdef DJGPP
201. #define PORT_SUB_ID "djgpp"
202. #else
203. #ifdef OVERLAY
204. #define PORT_SUB_ID "overlaid"
205. #else
206. #define PORT_SUB_ID "non-overlaid"
207. #endif
208. #endif
209. #endif
210. #ifdef OS2
211. #define PORT_ID "OS/2"
212. #endif
213. #ifdef TOS
214. #define PORT_ID "ST"
215. #endif
216. /* Check again in case something more specific has been defined above. */
217. #ifndef PORT_ID
218. #ifdef UNIX
219. #define PORT_ID "Unix"
220. #endif
221. #endif
222. #ifdef VMS
223. #define PORT_ID "VMS"
224. #endif
225. #ifdef WIN32
226. #define PORT_ID "Windows"
227. #endif
228. #endif
229. 
230. #if !defined(CROSSCOMPILE)
231. #if defined(MICRO)
232. #if !defined(AMIGA) && !defined(TOS) && !defined(OS2_HPFS)
233. #define SHORT_FILENAMES /* filenames are 8.3 */
234. #endif
235. #endif
236. #endif
237. 
238. #include "fnamesiz.h" /* file sizes shared between nethack and recover */
239. 
240. #ifdef VMS
241. /* vms_exit() (sys/vms/vmsmisc.c) expects the non-VMS EXIT_xxx values below.
242.  * these definitions allow all systems to be treated uniformly, provided
243.  * main() routines do not terminate with return(), whose value is not
244.  * so massaged.
245.  */
246. #ifdef EXIT_SUCCESS
247. #undef EXIT_SUCCESS
248. #endif
249. #ifdef EXIT_FAILURE
250. #undef EXIT_FAILURE
251. #endif
252. #endif
253. 
254. #ifndef EXIT_SUCCESS
255. #define EXIT_SUCCESS 0
256. #endif
257. #ifndef EXIT_FAILURE
258. #define EXIT_FAILURE 1
259. #endif
260. 
261. #if defined(X11_GRAPHICS) || defined(QT_GRAPHICS) || defined(GNOME_GRAPHICS) \
262.     || defined(MSWIN_GRAPHICS)
263. #ifndef NO_TILE_C
264. #ifndef TILES_IN_GLYPHMAP
265. #define TILES_IN_GLYPHMAP
266. #endif
267. #endif
268. #endif
269. #if defined(AMII_GRAPHICS) || defined(GEM_GRAPHICS)
270. #ifndef NO_TILE_C
271. #ifndef TILES_IN_GLYPHMAP
272. #define TILES_IN_GLYPHMAP
273. #endif
274. #endif
275. #endif
276. 
277. #if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
278. #define HANGUPHANDLING
279. #endif
280. #if defined(SAFERHANGUP) \
281.     && (defined(NOSAVEONHANGUP) || !defined(HANGUPHANDLING))
282. #undef SAFERHANGUP
283. #endif
284. 
285. #define Sprintf (void) sprintf
286. #define Strcat (void) strcat
287. #define Strcpy (void) strcpy
288. #define Strlen(s) Strlen_(s,__func__,__LINE__)
289. #ifdef NEED_VARARGS
290. #define Vprintf (void) vprintf
291. #define Vfprintf (void) vfprintf
292. #define Vsprintf (void) vsprintf
293. #endif
294. 
295. /*
296.  *  Memory allocation.  Functions are declared here rather than in
297.  *  extern.h so that source files which use config.h instead of hack.h
298.  *  will see the declarations.
299.  *
300.  *  NetHack does not use malloc() [except to implement alloc() in alloc.c]
301.  *  or realloc() or calloc().  They return Null if memory runs out and
302.  *  nethack's code relies on alloc() to intercept that so that a zillion
303.  *  callers don't need to test for Null result.  alloc() never returns
304.  *  Null; if memory runs out, it calls panic() and does not return at all.
305.  */
306. 
307. /* dupstr() is unconditional in alloc.c but not used when MONITOR_HEAP
308.    is enabled; some utility programs link with alloc.{o,obj} and need it
309.    if nethack is built with MONITOR_HEAP enabled and they aren't; this
310.    declaration has been moved out of the '#else' below to avoid getting
311.    a complaint from -Wmissing-prototypes when building with MONITOR_HEAP */
312. extern char *dupstr(const char *) NONNULL NONNULLARG1;
313. /* same, but return strlen(string) in extra argument */
314. extern char *dupstr_n(const char *string,
315.                       unsigned *lenout) NONNULL NONNULLPTRS;
316. 
317. /*
318.  * MONITOR_HEAP is conditionally used for primitive memory leak debugging.
319.  * When enabled, NH_HEAPLOG (if defined in the environment) is used as the
320.  * name of a log file to create for capturing allocations and releases.
321.  * [The 'heaputil' program to analyze that file isn't included in releases.]
322.  *
323.  * See alloc.c.
324.  */
325. #ifdef MONITOR_HEAP
326. /* plain alloc() is not declared except in alloc.c */
327. extern long *nhalloc(unsigned int, const char *, int) NONNULL NONNULLARG2;
328. extern long *nhrealloc(long *, unsigned int, const char *,
329.                        int) NONNULL NONNULLARG3;
330. extern void nhfree(genericptr_t, const char *, int) NONNULLARG2;
331. extern char *nhdupstr(const char *, const char *, int) NONNULL NONNULLPTRS;
332. /* this predates C99's __func__; that is trickier to use conditionally
333.    because it is not implemented as a preprocessor macro; MONITOR_HEAP
334.    wouldn't gain much benefit from it anyway so continue to live without it;
335.    if func's caller were accessible, that would be a very different issue */
336. #define alloc(a) nhalloc(a, __FILE__, (int) __LINE__)
337. #define re_alloc(a,n) nhrealloc(a, n, __FILE__, (int) __LINE__)
338. #define free(a) nhfree(a, __FILE__, (int) __LINE__)
339. #define dupstr(s) nhdupstr(s, __FILE__, (int) __LINE__)
340. #else /* !MONITOR_HEAP */
341. /* declare alloc.c's alloc(); allocations made with it use ordinary free() */
342. extern long *alloc(unsigned int) NONNULL;  /* alloc.c */
343. extern long *re_alloc(long *, unsigned int) NONNULL;
344. #endif /* ?MONITOR_HEAP */
345. 
346. /* Used for consistency checks of various data files; declare it here so
347.    that utility programs which include config.h but not hack.h can see it. */
348. struct version_info {
349.     unsigned long incarnation;   /* actual version number */
350.     unsigned long feature_set;   /* bitmask of config settings */
351.     unsigned long entity_count;  /* # of monsters and objects */
352. };
353. 
354. /* This is used to store some build-info data that used
355.    to be present in makedefs-generated header file date.h */
356. 
357. struct nomakedefs_s {
358.     const char *build_date;
359.     const char *copyright_banner_c;
360.     const char *git_sha;
361.     const char *git_branch;
362.     const char *git_prefix;
363.     const char *version_string;
364.     const char *version_id;
365.     unsigned long version_number;
366.     unsigned long version_features;
367.     unsigned long ignored_features;
368.     unsigned long version_sanity1;
369.     unsigned long build_time;
370. };
371. extern struct nomakedefs_s nomakedefs;
372. 
373. /*
374.  * Configurable internal parameters.
375.  *
376.  * Please be very careful if you are going to change one of these.  Any
377.  * changes in these parameters, unless properly done, can render the
378.  * executable inoperative.
379.  */
380. 
381. /* size of terminal screen is (at least) (ROWNO+3) by COLNO */
382. #define COLNO 80
383. #define ROWNO 21
384. 
385. #define MAXNROFROOMS 40 /* max number of rooms per level */
386. #define MAX_SUBROOMS 24 /* max # of subrooms in a given room */
387. #define DOORINC      20 /* number of doors per level, increment */
388. 
389. #define BUFSZ 256  /* for getlin buffers */
390. #define QBUFSZ 128 /* for building question text */
391. #define TBUFSZ 300 /* gt.toplines[] buffer max msg: 3 81-char names
392.                     * plus longest prefix plus a few extra words */
393. 
394. /* COLBUFSZ is the larger of BUFSZ and COLNO */
395. #if BUFSZ > COLNO
396. #define COLBUFSZ BUFSZ
397. #else
398. #define COLBUFSZ COLNO
399. #endif
400. 
401. #define PL_NSIZ 32 /* name of player, ghost, shopkeeper */
402. #define PL_CSIZ 32 /* sizeof pl_character */
403. #define PL_FSIZ 32 /* fruit name */
404. #define PL_PSIZ 63 /* player-given names for pets, other monsters, objects */
405. /* room for "name-role-race-gend-algn" plus 1 character playmode code */
406. #define PL_NSIZ_PLUS (PL_NSIZ + 4 * (1 + 3) + 1) /* 49 */
407. 
408. #define MAXDUNGEON 16 /* current maximum number of dungeons */
409. #define MAXLEVEL 32   /* max number of levels in one dungeon */
410. #define MAXSTAIRS 1   /* max # of special stairways in a dungeon */
411. #define ALIGNWEIGHT 4 /* generation weight of alignment */
412. 
413. #define MAXULEV 30 /* max character experience level */
414. 
415. #define MAXMONNO 120 /* extinct monst after this number created */
416. #define MHPMAX 500   /* maximum monster hp */
417. 
418. #ifndef MAX_MSG_HISTORY
419. #define MAX_MSG_HISTORY 128 /* max # of lines in msg_history */
420. #endif
421. 
422. #include "color.h"
423. 
424. /*
425.  * Version 5.0.x has aspirations of portable file formats. We
426.  * make a distinction between MAIL functionality and MAIL_STRUCTURES
427.  * so that the underlying structures are consistent, whether MAIL is
428.  * defined or not.
429.  */
430. #define MAIL_STRUCTURES
431. 
432. /* PANICTRACE: Always defined for NH_DEVEL_STATUS != NH_STATUS_RELEASED
433.    but only for supported platforms. */
434. #ifndef NOPANICTRACE
435. #ifdef UNIX
436. #if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
437. /* see end.c */
438. #if !defined(CROSS_TO_WASM) && !defined(CROSS_TO_MSDOS)
439. #ifndef PANICTRACE
440. #define PANICTRACE
441. #endif  /* PANICTRACE */
442. #endif  /* CROSS_TO_WASM |  CROSS_TO_MSDOS */
443. #endif  /* NH_DEVEL_STATUS != NH_STATUS_RELEASED */
444. #endif  /* UNIX */
445. #endif  /* !NOPANICTRACE */
446. 
447. /* The following are meaningless if PANICTRACE is not defined: */
448. #if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ >= 2)
449. #define PANICTRACE_LIBC
450. #endif
451. #if defined(MACOS)
452. #define PANICTRACE_LIBC
453. #endif
454. #ifdef UNIX
455. #if !defined(CROSS_TO_WASM) /* no popen in WASM */
456. #define PANICTRACE_GDB
457. #endif
458. #ifdef CROSS_TO_WASM
459. #undef COMPRESS
460. #endif
461. #endif
462. 
463. /* Supply nethack_enter macro if not supplied by port */
464. #ifndef nethack_enter
465. #define nethack_enter(argc, argv) ((void) 0)
466. #endif
467. 
468. /* Supply nhassert macro if not supplied by port */
469. #ifndef nhassert
470. #define nhassert(expression) (void)((!!(expression)) || \
471.         (nhassert_failed(#expression, __FILE__, __LINE__), 0))
472. #endif
473. 
474. /* Macros for meta and ctrl modifiers:
475.  *   M and C return the meta/ctrl code for the given character;
476.  *     e.g., (C('c') is ctrl-c
477.  */
478. #ifndef M
479. #ifndef NHSTDC
480. #define M(c) (0x80 | (c))
481. #else
482. #define M(c) ((c) - 128)
483. #endif /* NHSTDC */
484. #endif
485. 
486. #ifndef C
487. #define C(c) (0x1f & (c))
488. #endif
489. 
490. #define unmeta(c) (0x7f & (c))
491. 
492. /* Game log message type flags */
493. #define LL_NONE       0x0000L /* No message is livelogged */
494. #define LL_WISH       0x0001L /* Report stuff people type at the wish prompt */
495. #define LL_ACHIEVE    0x0002L /* Achievements bitfield + invocation, planes */
496. #define LL_UMONST     0x0004L /* defeated unique monster */
497. #define LL_DIVINEGIFT 0x0008L /* Sacrifice gifts, crowning */
498. #define LL_LIFESAVE   0x0010L /* Use up amulet of lifesaving */
499. #define LL_CONDUCT    0x0020L /* Break conduct - not reported early-game */
500. #define LL_ARTIFACT   0x0040L /* bestowed, found, or manufactured */
501. #define LL_GENOCIDE   0x0080L /* Logging of genocides */
502. #define LL_KILLEDPET  0x0100L /* Killed a tame monster */
503. #define LL_ALIGNMENT  0x0200L /* changed alignment, temporary or permanent */
504. #define LL_DUMP_ASC   0x0400L /* Log URL for dumplog if ascended */
505. #define LL_DUMP_ALL   0x0800L /* Log dumplog url for all games */
506. #define LL_MINORAC    0x1000L /* Log 'minor' achievements - can be spammy */
507. #define LL_SPOILER    0x2000L /* reveals information so don't show in-game
508.                                * via #chronicle unless in wizard mode */
509. #define LL_DUMP       0x4000L /* none of the above but should be in dumplog */
510. #define LL_DEBUG      0x8000L /* For debugging messages and other spam */
511. 
512. /*
513.  * Lua sandbox
514.  */
515. /* Control block for setting up a Lua state with nhl_init(). */
516. typedef struct nhl_sandbox_info {
517.     uint32_t  flags;       /* see below */
518.     uint32_t  memlimit;    /* approximate memory limit */
519.     uint32_t  steps;       /* instruction limit for state OR ... */
520.     uint32_t  perpcall;    /* ... instruction limit per nhl_pcall */
521. } nhl_sandbox_info;
522. 
523. /* For efficiency, we only check every NHL_SB_STEPSIZE instructions. */
524. #ifndef NHL_SB_STEPSIZE
525. #define NHL_SB_STEPSIZE 1000
526. #endif
527. 
528. /* High level groups.  Use these flags. */
529.     /* Safe functions. */
530. #define NHL_SB_SAFE        0x80000000
531.     /* Access to Lua version information. */
532. #define NHL_SB_VERSION     0x40000000
533.     /* Debugging library - mostly unsafe. */
534. #define NHL_SB_DEBUGGING   0x08000000
535. 
536. /* Low level groups.  If you need these, you probably need to define
537.  * a new high level group instead. */
538. #define NHL_SB_STRING      0x00000001
539. #define NHL_SB_TABLE       0x00000002
540. #define NHL_SB_COROUTINE   0x00000004
541. #define NHL_SB_MATH        0x00000008
542. #define NHL_SB_UTF8        0x00000010
543. #ifdef notyet
544. #define NHL_SB_IO          0x00000020
545. #endif
546. #define NHL_SB_OS          0x00000040
547. 
548. #define NHL_SB_BASEMASK    0x00000f80
549. #define NHL_SB_BASE_BASE   0x00000080
550. #define NHL_SB_BASE_ERROR  0x00000100
551. #define NHL_SB_BASE_META   0x00000200
552. #define NHL_SB_BASE_GC     0x00000400
553. #define NHL_SB_BASE_UNSAFE 0x00000800
554. 
555. #define NHL_SB_DBMASK      0x00003000
556. #define NHL_SB_DB_DB       0x00001000
557. #define NHL_SB_DB_SAFE     0x00002000
558. 
559. #define NHL_SB_OSMASK      0x0000c000
560. #define NHL_SB_OS_TIME     0x00004000
561. #define NHL_SB_OS_FILES    0x00008000
562. 
563. #define NHL_SB_ALL         0x0000ffff
564. 
565. /* return codes */
566. #define NHL_SBRV_DENY 1
567. #define NHL_SBRV_ACCEPT 2
568. #define NHL_SBRV_FAIL 3
569. 
570. /* NHL_pcall_handle action values */
571. typedef enum NHL_pcall_action {
572.     NHLpa_panic,
573.     NHLpa_impossible
574. } NHL_pcall_action;
575. 
576. enum optchoice { opt_in, opt_out};
577. /*
578.  * option setting restrictions
579.  */
580. enum optset_restrictions {
581.     set_in_sysconf = 0, /* system config file option only */
582.     set_in_config = 1,  /* config file option only */
583.     set_viaprog = 2,    /* may be set via extern program, not seen in game */
584.     set_gameview = 3,   /* may be set via extern program, displayed in game */
585.     set_in_game = 4,    /* may be set via extern program or set in the game */
586.     set_wizonly = 5,    /* may be set in the game if wizmode */
587.     set_wiznofuz = 6,   /* wizard-mode only, but not by fuzzer */
588.     set_hidden = 7      /* placeholder for prefixed entries, never show it  */
589. };
590. 
591. /* these aren't the same as set_xxx */
592. enum option_phases {
593.     phase_not_set = 0,
594.     builtin_opt = 1, /* compiled-in default value of an option */
595.     syscf_opt,       /* sysconf setting of an option, overrides builtin */
596.     rc_file_opt, /* player's run-time config file setting, overrides syscf */
597.     environ_opt, /* player's environment NETHACKOPTIONS, overrides rc_file */
598.     cmdline_opt, /* program invocation command-line, overrides environ */
599.     play_opt,    /* 'O' command, interactively set so overrides all */
600.     num_opt_phases
601. };
602. 
603. #define SET__IS_VALUE_VALID(s) ((s < set_in_sysconf) || (s > set_wiznofuz))
604. #include "optlist.h"
605. enum opt {
606.     opt_prefix_only = -1,
607. #define NHOPT_ENUM
608. #include "optlist.h"
609. #undef NHOPT_ENUM
610.     OPTCOUNT
611. };
612. 
613. 
614. 
615. #define SFCTOOL_BIT (1UL << 30)
616. 
617. #endif /* GLOBAL_H */