From f083812c020186d0d919833100c1a0b6eda8c2c0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 9 Jan 2002 20:02:47 -0200 Subject: first implementation of coroutines --- lua.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index ed779771..0a2f5b10 100644 --- a/lua.h +++ b/lua.h @@ -45,10 +45,6 @@ #define LUA_ERRMEM 4 #define LUA_ERRERR 5 -/* weak-table modes */ -#define LUA_WEAK_KEY 1 -#define LUA_WEAK_VALUE 2 - typedef struct lua_State lua_State; @@ -182,6 +178,14 @@ LUA_API int lua_loadbuffer (lua_State *L, const char *buff, size_t size, LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size, const char *name); + +/* +** coroutine functions +*/ +LUA_API void lua_cobegin (lua_State *L, int nargs); +LUA_API int lua_yield (lua_State *L, int nresults); +LUA_API void lua_resume (lua_State *L, lua_State *co); + /* ** Garbage-collection functions */ @@ -203,9 +207,6 @@ LUA_API void lua_concat (lua_State *L, int n); LUA_API void *lua_newuserdata (lua_State *L, size_t size); LUA_API void lua_newuserdatabox (lua_State *L, void *u); -LUA_API void lua_setweakmode (lua_State *L, int mode); -LUA_API int lua_getweakmode (lua_State *L, int index); - /* @@ -242,7 +243,7 @@ LUA_API int lua_getweakmode (lua_State *L, int index); ** compatibility macros and functions */ -LUA_API void lua_pushupvalues (lua_State *L); +LUA_API int lua_pushupvalues (lua_State *L); #define lua_isnull lua_isnone -- cgit v1.2.3-55-g6feb