History

Lua 5.2.0-rc1

Lua Team committed 14 years ago

Commit d74d0e51 parent 8203bab51 files · +1861 −1136Browse files

Showing the changes to src/lua.h (1 of 51 files). Show all

Unified · Split

src/lua.h+7−10
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lua.h,v 1.278 2011/07/02 16:00:15 roberto Exp $
2+** $Id: lua.h,v 1.281 2011/10/24 16:53:05 roberto Exp $
33 ** Lua - A Scripting Language
44 ** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
55 ** See Copyright Notice at the end of this file
@@ -19,7 +19,7 @@ · 13 unmodified lines
1919 #define LUA_VERSION_MAJOR "5"
2020 #define LUA_VERSION_MINOR "2"
2121 #define LUA_VERSION_NUM 502
22−#define LUA_VERSION_RELEASE "0" " (beta)"
22+#define LUA_VERSION_RELEASE "0"
2323
2424 #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR
2525 #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE
@@ -215,10 +215,12 @@ LUA_API int (lua_pushthread) (lua_State *L); · 189 unmodified lines
215215 /*
216216 ** get functions (Lua -> stack)
217217 */
218+LUA_API void (lua_getglobal) (lua_State *L, const char *var);
218219 LUA_API void (lua_gettable) (lua_State *L, int idx);
219220 LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k);
220221 LUA_API void (lua_rawget) (lua_State *L, int idx);
221222 LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n);
223+LUA_API void (lua_rawgetp) (lua_State *L, int idx, const void *p);
222224 LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
223225 LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
224226 LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
@@ -228,10 +230,12 @@ LUA_API void (lua_getuservalue) (lua_State *L, int idx); · 3 unmodified lines
228230 /*
229231 ** set functions (stack -> Lua)
230232 */
233+LUA_API void (lua_setglobal) (lua_State *L, const char *var);
231234 LUA_API void (lua_settable) (lua_State *L, int idx);
232235 LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k);
233236 LUA_API void (lua_rawset) (lua_State *L, int idx);
234237 LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
238+LUA_API void (lua_rawsetp) (lua_State *L, int idx, const void *p);
235239 LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
236240 LUA_API void (lua_setuservalue) (lua_State *L, int idx);
237241
@@ -261,7 +265,7 @@ LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); · 23 unmodified lines
261265 LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx,
262266 lua_CFunction k);
263267 #define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL)
264−LUA_API int (lua_resume) (lua_State *L, int narg);
268+LUA_API int (lua_resume) (lua_State *L, lua_State *from, int narg);
265269 LUA_API int (lua_status) (lua_State *L);
266270
267271 /*
@@ -314,13 +318,6 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); · 46 unmodified lines
314318
315319 #define lua_newtable(L) lua_createtable(L, 0, 0)
316320
317−#define lua_setglobal(L,s) \
318− (lua_pushglobaltable(L), lua_pushvalue(L, -2), \
319− lua_setfield(L, -2, (s)), lua_pop(L, 2))
320−
321−#define lua_getglobal(L,s) \
322− (lua_pushglobaltable(L), lua_getfield(L, -1, (s)), lua_remove(L, -2))
323−
324321 #define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n)))
325322
326323 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)