summaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-30 15:26:44 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-01-30 15:26:44 -0200
commitd6fd33e76fdeb919fd91860aa9d0f9524e6d415a (patch)
treef2347c99a8d57564b22e622d405f5c3d03061982 /lbaselib.c
parent50e29525936be4891f9db090f293432913b5f7c0 (diff)
downloadlua-d6fd33e76fdeb919fd91860aa9d0f9524e6d415a.tar.gz
lua-d6fd33e76fdeb919fd91860aa9d0f9524e6d415a.tar.bz2
lua-d6fd33e76fdeb919fd91860aa9d0f9524e6d415a.zip
`eventtable' renamed to `metatable'
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 87e417aa..1b1d4d96 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -135,15 +135,15 @@ static int luaB_getglobal (lua_State *L) {
135} 135}
136 136
137 137
138static int luaB_eventtable (lua_State *L) { 138static int luaB_metatable (lua_State *L) {
139 luaL_check_type(L, 1, LUA_TTABLE); 139 luaL_check_type(L, 1, LUA_TTABLE);
140 if (lua_isnone(L, 2)) 140 if (lua_isnone(L, 2))
141 lua_geteventtable(L, 1); 141 lua_getmetatable(L, 1);
142 else { 142 else {
143 int t = lua_type(L, 2); 143 int t = lua_type(L, 2);
144 luaL_arg_check(L, t == LUA_TNIL || t == LUA_TTABLE, 2, "nil/table expected"); 144 luaL_arg_check(L, t == LUA_TNIL || t == LUA_TTABLE, 2, "nil/table expected");
145 lua_settop(L, 2); 145 lua_settop(L, 2);
146 lua_seteventtable(L, 1); 146 lua_setmetatable(L, 1);
147 } 147 }
148 return 1; 148 return 1;
149} 149}
@@ -447,7 +447,7 @@ static int luaB_coroutine (lua_State *L) {
447 lua_cobegin(NL, n-1); 447 lua_cobegin(NL, n-1);
448 lua_newuserdatabox(L, NL); 448 lua_newuserdatabox(L, NL);
449 lua_getstr(L, LUA_REGISTRYINDEX, "Coroutine"); 449 lua_getstr(L, LUA_REGISTRYINDEX, "Coroutine");
450 lua_seteventtable(L, -2); 450 lua_setmetatable(L, -2);
451 lua_pushcclosure(L, luaB_resume, 1); 451 lua_pushcclosure(L, luaB_resume, 1);
452 return 1; 452 return 1;
453} 453}
@@ -517,6 +517,7 @@ static int luaB_tinsert (lua_State *L) {
517 v = 3; /* function may be called with more than 3 args */ 517 v = 3; /* function may be called with more than 3 args */
518 pos = luaL_check_int(L, 2); /* 2nd argument is the position */ 518 pos = luaL_check_int(L, 2); /* 2nd argument is the position */
519 } 519 }
520 if (pos > n+1) n = pos-1;
520 aux_setn(L, 1, n+1); /* t.n = n+1 */ 521 aux_setn(L, 1, n+1); /* t.n = n+1 */
521 for (; n>=pos; n--) { 522 for (; n>=pos; n--) {
522 lua_rawgeti(L, 1, n); 523 lua_rawgeti(L, 1, n);
@@ -665,7 +666,7 @@ static const luaL_reg base_funcs[] = {
665 {"dofile", luaB_dofile}, 666 {"dofile", luaB_dofile},
666 {"dostring", luaB_dostring}, 667 {"dostring", luaB_dostring},
667 {"error", luaB_error}, 668 {"error", luaB_error},
668 {"eventtable", luaB_eventtable}, 669 {"metatable", luaB_metatable},
669 {"foreach", luaB_foreach}, 670 {"foreach", luaB_foreach},
670 {"foreachi", luaB_foreachi}, 671 {"foreachi", luaB_foreachi},
671 {"gcinfo", luaB_gcinfo}, 672 {"gcinfo", luaB_gcinfo},