Source:NetHack 3.4.3/include/timeout.h

From NetHackWiki
Jump to: navigation, search

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

  1. /*	SCCS Id: @(#)timeout.h	3.4	1999/02/13	*/
  2. /* Copyright 1994, Dean Luick					  */
  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 TIMEOUT_H
  2. #define TIMEOUT_H
  3.  
  4. /* generic timeout function */
  5. typedef void FDECL((*timeout_proc), (genericptr_t, long));
  6.  
  7. /* kind of timer */
  8. #define TIMER_LEVEL	0	/* event specific to level */
  9. #define TIMER_GLOBAL	1	/* event follows current play */
  10. #define TIMER_OBJECT	2	/* event follows a object */
  11. #define TIMER_MONSTER	3	/* event follows a monster */
  12.  
  13. /* save/restore timer ranges */
  14. #define RANGE_LEVEL  0		/* save/restore timers staying on level */
  15. #define RANGE_GLOBAL 1		/* save/restore timers following global play */
  16.  
  17. /*
  18. * Timeout functions.  Add a define here, then put it in the table
  19. * in timeout.c.  "One more level of indirection will fix everything."
  20. */
  21. #define ROT_ORGANIC	0	/* for buried organics */
  22. #define ROT_CORPSE	1
  23. #define REVIVE_MON	2
  24. #define BURN_OBJECT	3
  25. #define HATCH_EGG	4
  26. #define FIG_TRANSFORM	5
  27. #define NUM_TIME_FUNCS	6
  28.  
  29. /* used in timeout.c */
  30. typedef struct fe {
  31. struct fe *next;		/* next item in chain */
  32. long timeout;		/* when we time out */
  33. unsigned long tid;		/* timer ID */
  34. short kind;			/* kind of use */
  35. short func_index;		/* what to call when we time out */
  36. genericptr_t arg;		/* pointer to timeout argument */
  37. Bitfield (needs_fixup,1);	/* does arg need to be patched? */
  38. } timer_element;
  39.  
  40. #endif /* TIMEOUT_H */