File: timeout.h

package info (click to toggle)
slashem 0.0.7E7F3-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,928 kB
  • sloc: ansic: 263,208; cpp: 7,180; yacc: 2,154; sh: 739; lex: 440; awk: 97; makefile: 56; sed: 11
file content (61 lines) | stat: -rw-r--r-- 1,782 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*	SCCS Id: @(#)timeout.h	3.4	1999/02/13	*/
/* Copyright 1994, Dean Luick					  */
/* NetHack may be freely redistributed.  See license for details. */

#ifndef TIMEOUT_H
#define TIMEOUT_H

/* generic timeout function */
typedef void FDECL((*timeout_proc), (genericptr_t, long));

/* kind of timer */
#define TIMER_LEVEL	0	/* event specific to level */
#define TIMER_GLOBAL	1	/* event follows current play */
#define TIMER_OBJECT	2	/* event follows a object */
#define TIMER_MONSTER	3	/* event follows a monster */

/* save/restore timer ranges */
#define RANGE_LEVEL  0		/* save/restore timers staying on level */
#define RANGE_GLOBAL 1		/* save/restore timers following global play */

/*
 * Timeout functions.  Add a define here, then put it in the table
 * in timeout.c.  "One more level of indirection will fix everything."
 */
#define ROT_ORGANIC	0	/* for buried organics */
#define ROT_CORPSE	1
#define MOLDY_CORPSE	2
#define REVIVE_MON	3
#define BURN_OBJECT	4
#define HATCH_EGG	5
#define FIG_TRANSFORM	6
#define UNPOLY_MON      7
# ifdef FIREARMS
#define BOMB_BLOW	8
#  ifdef UNPOLYPILE
#define UNPOLY_OBJ      9
#define NUM_TIME_FUNCS  10
#  else
#define NUM_TIME_FUNCS  9
#  endif
# else /* FIREARMS */
#  ifdef UNPOLYPILE
#define UNPOLY_OBJ      8
#define NUM_TIME_FUNCS  9
#  else
#define NUM_TIME_FUNCS  8
#  endif
# endif /* FIREARMS */

/* used in timeout.c */
typedef struct fe {
    struct fe *next;		/* next item in chain */
    long timeout;		/* when we time out */
    unsigned long tid;		/* timer ID */
    short kind;			/* kind of use */
    short func_index;		/* what to call when we time out */
    genericptr_t arg;		/* pointer to timeout argument */
    Bitfield (needs_fixup,1);	/* does arg need to be patched? */
} timer_element;

#endif /* TIMEOUT_H */