diff options
| -rw-r--r-- | lapi.c | 6 | ||||
| -rw-r--r-- | ldblib.c | 14 | ||||
| -rw-r--r-- | liolib.c | 8 | ||||
| -rw-r--r-- | lua.h | 6 |
4 files changed, 17 insertions, 17 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.131 2010/06/04 13:05:29 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.132 2010/07/02 17:35:06 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -644,7 +644,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { | |||
| 644 | } | 644 | } |
| 645 | 645 | ||
| 646 | 646 | ||
| 647 | LUA_API void lua_getenv (lua_State *L, int idx) { | 647 | LUA_API void lua_getuservalue (lua_State *L, int idx) { |
| 648 | StkId o; | 648 | StkId o; |
| 649 | lua_lock(L); | 649 | lua_lock(L); |
| 650 | o = index2addr(L, idx); | 650 | o = index2addr(L, idx); |
| @@ -754,7 +754,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { | |||
| 754 | } | 754 | } |
| 755 | 755 | ||
| 756 | 756 | ||
| 757 | LUA_API void lua_setenv (lua_State *L, int idx) { | 757 | LUA_API void lua_setuservalue (lua_State *L, int idx) { |
| 758 | StkId o; | 758 | StkId o; |
| 759 | lua_lock(L); | 759 | lua_lock(L); |
| 760 | api_checknelems(L, 1); | 760 | api_checknelems(L, 1); |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldblib.c,v 1.122 2010/06/21 16:30:12 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.123 2010/07/02 11:38:13 roberto Exp roberto $ |
| 3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -44,19 +44,19 @@ static int db_setmetatable (lua_State *L) { | |||
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | 46 | ||
| 47 | static int db_getenv (lua_State *L) { | 47 | static int db_getuservalue (lua_State *L) { |
| 48 | luaL_checktype(L, 1, LUA_TUSERDATA); | 48 | luaL_checktype(L, 1, LUA_TUSERDATA); |
| 49 | lua_getenv(L, 1); | 49 | lua_getuservalue(L, 1); |
| 50 | return 1; | 50 | return 1; |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | 53 | ||
| 54 | static int db_setenv (lua_State *L) { | 54 | static int db_setuservalue (lua_State *L) { |
| 55 | luaL_checktype(L, 1, LUA_TUSERDATA); | 55 | luaL_checktype(L, 1, LUA_TUSERDATA); |
| 56 | if (!lua_isnoneornil(L, 2)) | 56 | if (!lua_isnoneornil(L, 2)) |
| 57 | luaL_checktype(L, 2, LUA_TTABLE); | 57 | luaL_checktype(L, 2, LUA_TTABLE); |
| 58 | lua_settop(L, 2); | 58 | lua_settop(L, 2); |
| 59 | lua_setenv(L, 1); | 59 | lua_setuservalue(L, 1); |
| 60 | return 1; | 60 | return 1; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| @@ -375,7 +375,7 @@ static int db_traceback (lua_State *L) { | |||
| 375 | 375 | ||
| 376 | static const luaL_Reg dblib[] = { | 376 | static const luaL_Reg dblib[] = { |
| 377 | {"debug", db_debug}, | 377 | {"debug", db_debug}, |
| 378 | {"getenv", db_getenv}, | 378 | {"getuservalue", db_getuservalue}, |
| 379 | {"gethook", db_gethook}, | 379 | {"gethook", db_gethook}, |
| 380 | {"getinfo", db_getinfo}, | 380 | {"getinfo", db_getinfo}, |
| 381 | {"getlocal", db_getlocal}, | 381 | {"getlocal", db_getlocal}, |
| @@ -384,7 +384,7 @@ static const luaL_Reg dblib[] = { | |||
| 384 | {"getupvalue", db_getupvalue}, | 384 | {"getupvalue", db_getupvalue}, |
| 385 | {"upvaluejoin", db_upvaluejoin}, | 385 | {"upvaluejoin", db_upvaluejoin}, |
| 386 | {"upvalueid", db_upvalueid}, | 386 | {"upvalueid", db_upvalueid}, |
| 387 | {"setenv", db_setenv}, | 387 | {"setuservalue", db_setuservalue}, |
| 388 | {"sethook", db_sethook}, | 388 | {"sethook", db_sethook}, |
| 389 | {"setlocal", db_setlocal}, | 389 | {"setlocal", db_setlocal}, |
| 390 | {"setmetatable", db_setmetatable}, | 390 | {"setmetatable", db_setmetatable}, |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: liolib.c,v 2.88 2010/03/26 20:58:11 roberto Exp roberto $ | 2 | ** $Id: liolib.c,v 2.89 2010/07/02 11:38:13 roberto Exp roberto $ |
| 3 | ** Standard I/O (and system) library | 3 | ** Standard I/O (and system) library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -120,7 +120,7 @@ static FILE **newprefile (lua_State *L) { | |||
| 120 | static FILE **newfile (lua_State *L) { | 120 | static FILE **newfile (lua_State *L) { |
| 121 | FILE **pf = newprefile(L); | 121 | FILE **pf = newprefile(L); |
| 122 | lua_pushvalue(L, lua_upvalueindex(1)); /* set upvalue... */ | 122 | lua_pushvalue(L, lua_upvalueindex(1)); /* set upvalue... */ |
| 123 | lua_setenv(L, -2); /* ... as environment for new file */ | 123 | lua_setuservalue(L, -2); /* ... as environment for new file */ |
| 124 | return pf; | 124 | return pf; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| @@ -163,7 +163,7 @@ static int io_fclose (lua_State *L) { | |||
| 163 | 163 | ||
| 164 | 164 | ||
| 165 | static int aux_close (lua_State *L) { | 165 | static int aux_close (lua_State *L) { |
| 166 | lua_getenv(L, 1); | 166 | lua_getuservalue(L, 1); |
| 167 | lua_getfield(L, -1, "__close"); | 167 | lua_getfield(L, -1, "__close"); |
| 168 | return (lua_tocfunction(L, -1))(L); | 168 | return (lua_tocfunction(L, -1))(L); |
| 169 | } | 169 | } |
| @@ -595,7 +595,7 @@ static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { | |||
| 595 | lua_rawseti(L, 1, k); /* add it to common upvalue */ | 595 | lua_rawseti(L, 1, k); /* add it to common upvalue */ |
| 596 | } | 596 | } |
| 597 | lua_pushvalue(L, 3); /* get environment for default files */ | 597 | lua_pushvalue(L, 3); /* get environment for default files */ |
| 598 | lua_setenv(L, -2); /* set it as environment for file */ | 598 | lua_setuservalue(L, -2); /* set it as environment for file */ |
| 599 | lua_setfield(L, 2, fname); /* add file to module */ | 599 | lua_setfield(L, 2, fname); /* add file to module */ |
| 600 | } | 600 | } |
| 601 | 601 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.271 2010/07/02 12:01:53 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.272 2010/07/25 15:02:41 roberto Exp roberto $ |
| 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 |
| @@ -217,7 +217,7 @@ LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); | |||
| 217 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); | 217 | LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); |
| 218 | LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); | 218 | LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); |
| 219 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); | 219 | LUA_API int (lua_getmetatable) (lua_State *L, int objindex); |
| 220 | LUA_API void (lua_getenv) (lua_State *L, int idx); | 220 | LUA_API void (lua_getuservalue) (lua_State *L, int idx); |
| 221 | 221 | ||
| 222 | 222 | ||
| 223 | /* | 223 | /* |
| @@ -228,7 +228,7 @@ LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); | |||
| 228 | LUA_API void (lua_rawset) (lua_State *L, int idx); | 228 | LUA_API void (lua_rawset) (lua_State *L, int idx); |
| 229 | LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); | 229 | LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); |
| 230 | LUA_API int (lua_setmetatable) (lua_State *L, int objindex); | 230 | LUA_API int (lua_setmetatable) (lua_State *L, int objindex); |
| 231 | LUA_API void (lua_setenv) (lua_State *L, int idx); | 231 | LUA_API void (lua_setuservalue) (lua_State *L, int idx); |
| 232 | 232 | ||
| 233 | 233 | ||
| 234 | /* | 234 | /* |
