From 4daae2165d617e57ad1460471f8d902d38abac6e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 11 Dec 1997 15:21:11 -0200 Subject: new API function and built-in "lua_copytagmethods" --- ltm.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index ac2160ac..ff01f27a 100644 --- a/ltm.c +++ b/ltm.c @@ -1,5 +1,5 @@ /* -** $Id: ltm.c,v 1.9 1997/11/19 18:16:33 roberto Exp roberto $ +** $Id: ltm.c,v 1.10 1997/12/11 14:48:46 roberto Exp roberto $ ** Tag methods ** See Copyright Notice in lua.h */ @@ -46,7 +46,7 @@ static char validevents[NUM_TAGS][IM_N] = { /* ORDER LUA_T, ORDER IM */ }; -static int validevent (lua_Type t, int e) +static int validevent (int t, int e) { /* ORDER LUA_T */ return (t < LUA_T_NIL) ? 1 : validevents[-t][e]; } @@ -95,6 +95,18 @@ void luaT_realtag (int tag) } +int lua_copytagmethods (int tagto, int tagfrom) +{ + int e; + checktag(tagto); + checktag(tagfrom); + for (e=0; e