From 0dfd04eb60a7b9d54a6348ef4d9a3fa3963682aa Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 31 May 2004 16:41:52 -0300 Subject: `lua_strlen' upgraded to `lua_objsize' (which also works with userdata) --- ltests.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 456c9d91..afdfb515 100644 --- a/ltests.c +++ b/ltests.c @@ -1,5 +1,5 @@ /* -** $Id: ltests.c,v 2.6 2004/05/10 17:50:51 roberto Exp roberto $ +** $Id: ltests.c,v 2.7 2004/05/31 18:50:48 roberto Exp roberto $ ** Internal Module for Debugging of the Lua Implementation ** See Copyright Notice in lua.h */ @@ -760,16 +760,6 @@ static int int2fb_aux (lua_State *L) { } -static int test_do (lua_State *L) { - const char *p = luaL_checkstring(L, 1); - if (*p == '@') - lua_dofile(L, p+1); - else - lua_dostring(L, p); - return lua_gettop(L); -} - - /* ** {====================================================== @@ -858,8 +848,8 @@ static int testC (lua_State *L) { const char *s = lua_tostring(L, getnum); lua_pushstring(L, s); } - else if EQ("strlen") { - lua_pushinteger(L, lua_strlen(L, getnum)); + else if EQ("objsize") { + lua_pushinteger(L, lua_objsize(L, getnum)); } else if EQ("tocfunction") { lua_pushcfunction(L, lua_tocfunction(L, getnum)); @@ -1033,7 +1023,6 @@ static const struct luaL_reg tests_funcs[] = { {"stacklevel", stacklevel}, {"querystr", string_query}, {"querytab", table_query}, - {"doit", test_do}, {"testC", testC}, {"checkmemory", lua_checkmemory}, {"gccolor", get_gccolor}, -- cgit v1.2.3-55-g6feb