summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-10-11 18:41:21 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-10-11 18:41:21 -0300
commit0c3ea96541525c5e347f1072ac2659f010e2ec34 (patch)
tree7d67e22b34a3422465c3dd7ca066fd44cd1aa643
parentbabaa96eab3a5419889b393424db14377f581a69 (diff)
downloadlua-0c3ea96541525c5e347f1072ac2659f010e2ec34.tar.gz
lua-0c3ea96541525c5e347f1072ac2659f010e2ec34.tar.bz2
lua-0c3ea96541525c5e347f1072ac2659f010e2ec34.zip
no more copytagmethod function
-rw-r--r--lbaselib.c5
-rw-r--r--ltm.c14
-rw-r--r--lua.h4
3 files changed, 1 insertions, 22 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 8fe44d56..62695c04 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -198,10 +198,6 @@ static int luaB_newtype (lua_State *L) {
198 return 1; 198 return 1;
199} 199}
200 200
201static int luaB_copytagmethods (lua_State *L) {
202 lua_pushnumber(L, lua_copytagmethods(L, gettag(L, 1), gettag(L, 2)));
203 return 1;
204}
205 201
206static int luaB_globals (lua_State *L) { 202static int luaB_globals (lua_State *L) {
207 lua_getglobals(L); /* value to be returned */ 203 lua_getglobals(L); /* value to be returned */
@@ -697,7 +693,6 @@ static const luaL_reg base_funcs[] = {
697 {l_s(LUA_ERRORMESSAGE), luaB__ERRORMESSAGE}, 693 {l_s(LUA_ERRORMESSAGE), luaB__ERRORMESSAGE},
698 {l_s("call"), luaB_call}, 694 {l_s("call"), luaB_call},
699 {l_s("collectgarbage"), luaB_collectgarbage}, 695 {l_s("collectgarbage"), luaB_collectgarbage},
700 {l_s("copytagmethods"), luaB_copytagmethods},
701 {l_s("dofile"), luaB_dofile}, 696 {l_s("dofile"), luaB_dofile},
702 {l_s("dostring"), luaB_dostring}, 697 {l_s("dostring"), luaB_dostring},
703 {l_s("error"), luaB_error}, 698 {l_s("error"), luaB_error},
diff --git a/ltm.c b/ltm.c
index 57c0df28..a58934fa 100644
--- a/ltm.c
+++ b/ltm.c
@@ -108,20 +108,6 @@ static void checktag (lua_State *L, int tag) {
108} 108}
109 109
110 110
111LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom) {
112 int e;
113 lua_lock(L);
114 checktag(L, tagto);
115 checktag(L, tagfrom);
116 for (e=0; e<TM_N; e++) {
117 if (luaT_validevent(tagto, e))
118 luaT_gettm(G(L), tagto, e) = luaT_gettm(G(L), tagfrom, e);
119 }
120 lua_unlock(L);
121 return tagto;
122}
123
124
125int luaT_tag (const TObject *o) { 111int luaT_tag (const TObject *o) {
126 int t = ttype(o); 112 int t = ttype(o);
127 switch (t) { 113 switch (t) {
diff --git a/lua.h b/lua.h
index 3c3c507e..3ec57716 100644
--- a/lua.h
+++ b/lua.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lua.h,v 1.102 2001/07/19 13:24:18 roberto Exp roberto $ 2** $Id: lua.h,v 1.103 2001/08/31 19:46:07 roberto Exp $
3** Lua - An Extensible Extension Language 3** Lua - An Extensible Extension Language
4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil 4** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
5** e-mail: info@lua.org 5** e-mail: info@lua.org
@@ -202,7 +202,6 @@ LUA_API void lua_setgcthreshold (lua_State *L, int newthreshold);
202** miscellaneous functions 202** miscellaneous functions
203*/ 203*/
204LUA_API int lua_newtype (lua_State *L, const lua_char *name, int basictype); 204LUA_API int lua_newtype (lua_State *L, const lua_char *name, int basictype);
205LUA_API int lua_copytagmethods (lua_State *L, int tagto, int tagfrom);
206LUA_API void lua_settag (lua_State *L, int tag); 205LUA_API void lua_settag (lua_State *L, int tag);
207 206
208LUA_API int lua_name2tag (lua_State *L, const lua_char *name); 207LUA_API int lua_name2tag (lua_State *L, const lua_char *name);
@@ -237,7 +236,6 @@ LUA_API int lua_getweakmode (lua_State *L, int index);
237 236
238#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n)) 237#define lua_register(L,n,f) (lua_pushcfunction(L, f), lua_setglobal(L, n))
239#define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0) 238#define lua_pushcfunction(L,f) lua_pushcclosure(L, f, 0)
240#define lua_clonetag(L,t) lua_copytagmethods(L, lua_newtag(L), (t))
241 239
242#define lua_isfunction(L,n) (lua_rawtag(L,n) == LUA_TFUNCTION) 240#define lua_isfunction(L,n) (lua_rawtag(L,n) == LUA_TFUNCTION)
243#define lua_istable(L,n) (lua_rawtag(L,n) == LUA_TTABLE) 241#define lua_istable(L,n) (lua_rawtag(L,n) == LUA_TTABLE)