luasocket/src/timeout.h

32 lines
904 B
C
Raw Normal View History

#ifndef TM_H
#define TM_H
2003-03-28 22:08:50 +01:00
/*=========================================================================*\
* Timeout management functions
* LuaSocket toolkit
2003-03-28 22:08:50 +01:00
*
* RCS ID: $Id$
\*=========================================================================*/
2003-05-25 03:54:13 +02:00
#include <lua.h>
/* timeout control structure */
typedef struct t_tm_ {
int total; /* total number of miliseconds for operation */
int block; /* maximum time for blocking calls */
int start; /* time of start of operation */
2002-07-03 21:06:54 +02:00
} t_tm;
typedef t_tm *p_tm;
void tm_open(lua_State *L);
2003-05-25 03:54:13 +02:00
void tm_init(p_tm tm, int block, int total);
void tm_setblock(p_tm tm, int block);
void tm_settotal(p_tm tm, int total);
int tm_getblock(p_tm tm);
int tm_gettotal(p_tm tm);
void tm_markstart(p_tm tm);
int tm_getstart(p_tm tm);
int tm_get(p_tm tm);
int tm_gettime(void);
int tm_meth_timeout(lua_State *L, p_tm tm);
2002-07-03 21:06:54 +02:00
#endif /* TM_H */