aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-07-25 12:18:19 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-07-25 12:18:19 -0300
commit8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3 (patch)
tree6e91b533df43594cd6341c7dc149407b54ba7759
parent73b0a3451d0bd59f1540271aa3b8d8de36b36580 (diff)
downloadlua-8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3.tar.gz
lua-8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3.tar.bz2
lua-8b7cf8c62d0a3d20bfc8741a66d8c2447c847bd3.zip
'lua_[gs]etenv' -> 'lua_[gs]etuservalue'
-rw-r--r--lapi.c6
-rw-r--r--ldblib.c14
-rw-r--r--liolib.c8
-rw-r--r--lua.h6
4 files changed, 17 insertions, 17 deletions
diff --git a/lapi.c b/lapi.c
index 3b0d13a9..63d5e183 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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
647LUA_API void lua_getenv (lua_State *L, int idx) { 647LUA_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
757LUA_API void lua_setenv (lua_State *L, int idx) { 757LUA_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);
diff --git a/ldblib.c b/ldblib.c
index 6afc1fc1..3a773080 100644
--- a/ldblib.c
+++ b/ldblib.c
@@ -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
47static int db_getenv (lua_State *L) { 47static 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
54static int db_setenv (lua_State *L) { 54static 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
376static const luaL_Reg dblib[] = { 376static 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},
diff --git a/liolib.c b/liolib.c
index a26aff5a..48687bf8 100644
--- a/liolib.c
+++ b/liolib.c
@@ -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) {
120static FILE **newfile (lua_State *L) { 120static 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
165static int aux_close (lua_State *L) { 165static 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
diff --git a/lua.h b/lua.h
index 9b3c10ef..d17d8dc3 100644
--- a/lua.h
+++ b/lua.h
@@ -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);
217LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); 217LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec);
218LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); 218LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz);
219LUA_API int (lua_getmetatable) (lua_State *L, int objindex); 219LUA_API int (lua_getmetatable) (lua_State *L, int objindex);
220LUA_API void (lua_getenv) (lua_State *L, int idx); 220LUA_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);
228LUA_API void (lua_rawset) (lua_State *L, int idx); 228LUA_API void (lua_rawset) (lua_State *L, int idx);
229LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); 229LUA_API void (lua_rawseti) (lua_State *L, int idx, int n);
230LUA_API int (lua_setmetatable) (lua_State *L, int objindex); 230LUA_API int (lua_setmetatable) (lua_State *L, int objindex);
231LUA_API void (lua_setenv) (lua_State *L, int idx); 231LUA_API void (lua_setuservalue) (lua_State *L, int idx);
232 232
233 233
234/* 234/*