Showing the changes to src/lua.h (1 of 51 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 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 $ |
| 3 | ** Lua - A Scripting Language | 3 | ** Lua - A Scripting Language |
| 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) | 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) |
| 5 | ** See Copyright Notice at the end of this file | 5 | ** See Copyright Notice at the end of this file |
| @@ -19,7 +19,7 @@ · 13 unmodified lines | |||
| 19 | #define LUA_VERSION_MAJOR "5" | 19 | #define LUA_VERSION_MAJOR "5" |
| 20 | #define LUA_VERSION_MINOR "2" | 20 | #define LUA_VERSION_MINOR "2" |
| 21 | #define LUA_VERSION_NUM 502 | 21 | #define LUA_VERSION_NUM 502 |
| 22 | #define LUA_VERSION_RELEASE "0" " (beta)" | 22 | #define LUA_VERSION_RELEASE "0" |
| 23 | 23 | ||
| 24 | #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR | 24 | #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR |
| 25 | #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE | 25 | #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE |
| @@ -215,10 +215,12 @@ LUA_API int (lua_pushthread) (lua_State *L); · 189 unmodified lines | |||
| 215 | /* | 215 | /* |
| 216 | ** get functions (Lua -> stack) | 216 | ** get functions (Lua -> stack) |
| 217 | */ | 217 | */ |
| 218 | LUA_API void (lua_getglobal) (lua_State *L, const char *var); | ||
| 218 | LUA_API void (lua_gettable) (lua_State *L, int idx); | 219 | LUA_API void (lua_gettable) (lua_State *L, int idx); |
| 219 | LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); | 220 | LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); |
| 220 | LUA_API void (lua_rawget) (lua_State *L, int idx); | 221 | LUA_API void (lua_rawget) (lua_State *L, int idx); |
| 221 | LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); | 222 | 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); | ||
| 222 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); | 224 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); |
| 223 | LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); | 225 | LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); |
| 224 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); | 226 | 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 | |||
| 228 | /* | 230 | /* |
| 229 | ** set functions (stack -> Lua) | 231 | ** set functions (stack -> Lua) |
| 230 | */ | 232 | */ |
| 233 | LUA_API void (lua_setglobal) (lua_State *L, const char *var); | ||
| 231 | LUA_API void (lua_settable) (lua_State *L, int idx); | 234 | LUA_API void (lua_settable) (lua_State *L, int idx); |
| 232 | LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); | 235 | LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); |
| 233 | LUA_API void (lua_rawset) (lua_State *L, int idx); | 236 | LUA_API void (lua_rawset) (lua_State *L, int idx); |
| 234 | LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); | 237 | 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); | ||
| 235 | LUA_API int (lua_setmetatable) (lua_State *L, int objindex); | 239 | LUA_API int (lua_setmetatable) (lua_State *L, int objindex); |
| 236 | LUA_API void (lua_setuservalue) (lua_State *L, int idx); | 240 | LUA_API void (lua_setuservalue) (lua_State *L, int idx); |
| 237 | 241 | ||
| @@ -261,7 +265,7 @@ LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); · 23 unmodified lines | |||
| 261 | LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx, | 265 | LUA_API int (lua_yieldk) (lua_State *L, int nresults, int ctx, |
| 262 | lua_CFunction k); | 266 | lua_CFunction k); |
| 263 | #define lua_yield(L,n) lua_yieldk(L, (n), 0, NULL) | 267 | #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); |
| 265 | LUA_API int (lua_status) (lua_State *L); | 269 | LUA_API int (lua_status) (lua_State *L); |
| 266 | 270 | ||
| 267 | /* | 271 | /* |
| @@ -314,13 +318,6 @@ LUA_API void (lua_setallocf) (lua_State *L, lua_Alloc f, void *ud); · 46 unmodified lines | |||
| 314 | 318 | ||
| 315 | #define lua_newtable(L) lua_createtable(L, 0, 0) | 319 | #define lua_newtable(L) lua_createtable(L, 0, 0) |
| 316 | 320 | ||
| 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 | |||
| 324 | #define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) | 321 | #define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) |
| 325 | 322 | ||
| 326 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) | 323 | #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) |