Mercurial > luasocket
comparison src/timeout.h @ 0:4b915342e2a8
LuaSocket 2.0.2 + CMake build description.
author | Eric Wing <ewing . public |-at-| gmail . com> |
---|---|
date | Tue, 26 Aug 2008 18:40:01 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4b915342e2a8 |
---|---|
1 #ifndef TIMEOUT_H | |
2 #define TIMEOUT_H | |
3 /*=========================================================================*\ | |
4 * Timeout management functions | |
5 * LuaSocket toolkit | |
6 * | |
7 * RCS ID: $Id: timeout.h,v 1.14 2005/10/07 04:40:59 diego Exp $ | |
8 \*=========================================================================*/ | |
9 #include "lua.h" | |
10 | |
11 /* timeout control structure */ | |
12 typedef struct t_timeout_ { | |
13 double block; /* maximum time for blocking calls */ | |
14 double total; /* total number of miliseconds for operation */ | |
15 double start; /* time of start of operation */ | |
16 } t_timeout; | |
17 typedef t_timeout *p_timeout; | |
18 | |
19 int timeout_open(lua_State *L); | |
20 void timeout_init(p_timeout tm, double block, double total); | |
21 double timeout_get(p_timeout tm); | |
22 double timeout_getretry(p_timeout tm); | |
23 p_timeout timeout_markstart(p_timeout tm); | |
24 double timeout_getstart(p_timeout tm); | |
25 double timeout_gettime(void); | |
26 int timeout_meth_settimeout(lua_State *L, p_timeout tm); | |
27 | |
28 #define timeout_iszero(tm) ((tm)->block == 0.0) | |
29 | |
30 #endif /* TIMEOUT_H */ |