From efce5b6bd5c9d4f8214a71e0f7a7c35751710a4c Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 8 Nov 2021 01:17:11 +0800 Subject: + tolua + lpeg --- ThirdParty/tolua_runtime/luasocket/timeout.h | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 ThirdParty/tolua_runtime/luasocket/timeout.h (limited to 'ThirdParty/tolua_runtime/luasocket/timeout.h') diff --git a/ThirdParty/tolua_runtime/luasocket/timeout.h b/ThirdParty/tolua_runtime/luasocket/timeout.h new file mode 100644 index 0000000..af90231 --- /dev/null +++ b/ThirdParty/tolua_runtime/luasocket/timeout.h @@ -0,0 +1,29 @@ +#ifndef TIMEOUT_H +#define TIMEOUT_H +/*=========================================================================*\ +* Timeout management functions +* LuaSocket toolkit +\*=========================================================================*/ +#include "lua.h" + +/* timeout control structure */ +typedef struct t_timeout_ { + double block; /* maximum time for blocking calls */ + double total; /* total number of miliseconds for operation */ + double start; /* time of start of operation */ +} t_timeout; +typedef t_timeout *p_timeout; + +int timeout_open(lua_State *L); +void timeout_init(p_timeout tm, double block, double total); +double timeout_get(p_timeout tm); +double timeout_getretry(p_timeout tm); +p_timeout timeout_markstart(p_timeout tm); +double timeout_getstart(p_timeout tm); +double timeout_gettime(void); +int timeout_meth_settimeout(lua_State *L, p_timeout tm); +int timeout_meth_gettimeout(lua_State *L, p_timeout tm); + +#define timeout_iszero(tm) ((tm)->block == 0.0) + +#endif /* TIMEOUT_H */ -- cgit v1.1-26-g67d0