From 0a87d9d3346bcf74d84e4d6bae775bceecef096f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 5 Feb 2002 20:35:58 -0200 Subject: new function `lua_replace' --- lua.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index 776f0e36..0845a386 100644 --- a/lua.h +++ b/lua.h @@ -108,6 +108,7 @@ LUA_API void lua_settop (lua_State *L, int index); LUA_API void lua_pushvalue (lua_State *L, int index); LUA_API void lua_remove (lua_State *L, int index); LUA_API void lua_insert (lua_State *L, int index); +LUA_API void lua_replace (lua_State *L, int index); LUA_API int lua_stackspace (lua_State *L); @@ -163,7 +164,6 @@ LUA_API void lua_setstr (lua_State *L, int index, const char *name); LUA_API void lua_settable (lua_State *L, int index); LUA_API void lua_rawset (lua_State *L, int index); LUA_API void lua_rawseti (lua_State *L, int index, int n); -LUA_API void lua_setglobals (lua_State *L); LUA_API void lua_setmetatable (lua_State *L, int objindex); @@ -186,7 +186,7 @@ LUA_API int lua_dobuffer (lua_State *L, const char *buff, size_t size, */ 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); +LUA_API int lua_resume (lua_State *L, lua_State *co); /* ** Garbage-collection functions @@ -234,6 +234,7 @@ LUA_API void lua_newuserdatabox (lua_State *L, void *u); #define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) #define lua_getglobals(L) lua_pushvalue(L, LUA_GLOBALSINDEX) +#define lua_setglobals(L) lua_replace(L, LUA_GLOBALSINDEX) #define lua_getglobal(L,s) lua_getstr(L, LUA_GLOBALSINDEX, s) #define lua_setglobal(L,s) lua_setstr(L, LUA_GLOBALSINDEX, s) -- cgit v1.2.3-55-g6feb