diff options
Diffstat (limited to 'src/timeout.h')
-rw-r--r-- | src/timeout.h | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/timeout.h b/src/timeout.h index 1dc0a5a..43476cb 100644 --- a/src/timeout.h +++ b/src/timeout.h | |||
@@ -3,23 +3,29 @@ | |||
3 | * | 3 | * |
4 | * RCS ID: $Id$ | 4 | * RCS ID: $Id$ |
5 | \*=========================================================================*/ | 5 | \*=========================================================================*/ |
6 | #ifndef _TM_H | 6 | #ifndef TM_H |
7 | #define _TM_H | 7 | #define TM_H |
8 | 8 | ||
9 | typedef struct t_tm_tag { | 9 | #include <lua.h> |
10 | int tm_return; | 10 | |
11 | int tm_block; | 11 | /* timeout control structure */ |
12 | int tm_start; | 12 | typedef struct t_tm_ { |
13 | int tm_end; | 13 | int total; /* total number of miliseconds for operation */ |
14 | int block; /* maximum time for blocking calls */ | ||
15 | int start; /* time of start of operation */ | ||
14 | } t_tm; | 16 | } t_tm; |
15 | typedef t_tm *p_tm; | 17 | typedef t_tm *p_tm; |
16 | 18 | ||
17 | void tm_set(p_tm tm, int tm_block, int tm_return); | ||
18 | int tm_getremaining(p_tm tm); | ||
19 | int tm_getelapsed(p_tm tm); | ||
20 | int tm_gettime(void); | ||
21 | void tm_get(p_tm tm, int *tm_block, int *tm_return); | ||
22 | void tm_markstart(p_tm tm); | ||
23 | void tm_open(lua_State *L); | 19 | void tm_open(lua_State *L); |
20 | void tm_init(p_tm tm, int block, int total); | ||
21 | void tm_setblock(p_tm tm, int block); | ||
22 | void tm_settotal(p_tm tm, int total); | ||
23 | int tm_getblock(p_tm tm); | ||
24 | int tm_gettotal(p_tm tm); | ||
25 | void tm_markstart(p_tm tm); | ||
26 | int tm_getstart(p_tm tm); | ||
27 | int tm_get(p_tm tm); | ||
28 | int tm_gettime(void); | ||
29 | int tm_meth_timeout(lua_State *L, p_tm tm); | ||
24 | 30 | ||
25 | #endif | 31 | #endif |