From f6834f4393eaa1055c2bbde82ebb33cc58be8371 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 2 Oct 2000 17:10:55 -0300 Subject: new API function `lua_type' + new type lua_Type --- lobject.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lobject.c') diff --git a/lobject.c b/lobject.c index 2256e953..9c478692 100644 --- a/lobject.c +++ b/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 1.48 2000/09/12 13:47:39 roberto Exp roberto $ +** $Id: lobject.c,v 1.49 2000/09/29 12:42:13 roberto Exp roberto $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -17,16 +17,14 @@ #include "lstate.h" -/* -** you can use the fact that the 3rd letter of each name is always different -** (e-m-r-b-n-l) to compare and switch these strings -*/ -const char *const luaO_typenames[] = { /* ORDER LUA_T */ - "userdata", "number", "string", "table", "function", "function", "nil", - "function", "function" + +const lua_Type luaO_typearr[] = { /* ORDER LUA_T */ + LUA_TUSERDATA, LUA_TNUMBER, LUA_TSTRING, LUA_TTABLE, + LUA_TFUNCTION, LUA_TFUNCTION, LUA_TNIL }; + const TObject luaO_nilobject = {TAG_NIL, {NULL}}; -- cgit v1.2.3-55-g6feb