summaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-09 20:02:47 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-09 20:02:47 -0200
commitf083812c020186d0d919833100c1a0b6eda8c2c0 (patch)
tree29c2e1d25f05af62277aab03e8e070aaa1a0d664 /lua.h
parent3533382a1ed7ba21f0233057c886be2dd8a71d92 (diff)
downloadlua-f083812c020186d0d919833100c1a0b6eda8c2c0.tar.gz
lua-f083812c020186d0d919833100c1a0b6eda8c2c0.tar.bz2
lua-f083812c020186d0d919833100c1a0b6eda8c2c0.zip
first implementation of coroutines
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/lua.h b/lua.h
index ed779771..0a2f5b10 100644
--- a/lua.h
+++ b/lua.h
@@ -45,10 +45,6 @@
45#define LUA_ERRMEM 4 45#define LUA_ERRMEM 4
46#define LUA_ERRERR 5 46#define LUA_ERRERR 5
47 47
48/* weak-table modes */
49#define LUA_WEAK_KEY 1
50#define LUA_WEAK_VALUE 2
51
52 48
53typedef struct lua_State lua_State; 49typedef struct lua_State lua_State;
54 50
@@ -182,6 +178,14 @@ LUA_API int lua_loadbuffer (lua_State *L, const char *buff, size_t size,
182LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size, 178LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size,
183 const char *name); 179 const char *name);
184 180
181
182/*
183** coroutine functions
184*/
185LUA_API void lua_cobegin (lua_State *L, int nargs);
186LUA_API int lua_yield (lua_State *L, int nresults);
187LUA_API void lua_resume (lua_State *L, lua_State *co);
188
185/* 189/*
186** Garbage-collection functions 190** Garbage-collection functions
187*/ 191*/
@@ -203,9 +207,6 @@ LUA_API void lua_concat (lua_State *L, int n);
203LUA_API void *lua_newuserdata (lua_State *L, size_t size); 207LUA_API void *lua_newuserdata (lua_State *L, size_t size);
204LUA_API void lua_newuserdatabox (lua_State *L, void *u); 208LUA_API void lua_newuserdatabox (lua_State *L, void *u);
205 209
206LUA_API void lua_setweakmode (lua_State *L, int mode);
207LUA_API int lua_getweakmode (lua_State *L, int index);
208
209 210
210 211
211/* 212/*
@@ -242,7 +243,7 @@ LUA_API int lua_getweakmode (lua_State *L, int index);
242** compatibility macros and functions 243** compatibility macros and functions
243*/ 244*/
244 245
245LUA_API void lua_pushupvalues (lua_State *L); 246LUA_API int lua_pushupvalues (lua_State *L);
246 247
247#define lua_isnull lua_isnone 248#define lua_isnull lua_isnone
248 249