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.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index bd8a5a73..d6f667f4 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.76 2000/09/11 20:29:27 roberto Exp roberto $ +** $Id: lobject.h,v 1.77 2000/09/29 12:42:13 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -48,7 +48,7 @@ typedef enum { TAG_LMARK, /* mark for Lua closures */ TAG_CMARK /* mark for C closures */ -} lua_Type; +} lua_Tag; /* tags for values visible from Lua == first user-created tag */ #define NUM_TAGS 7 @@ -80,7 +80,7 @@ typedef union { typedef struct lua_TObject { - lua_Type ttype; + lua_Tag ttype; Value value; } TObject; @@ -189,10 +189,12 @@ typedef struct CallInfo { } CallInfo; -extern const char *const luaO_typenames[]; +extern const lua_Type luaO_typearr[]; extern const TObject luaO_nilobject; -#define luaO_typename(o) luaO_typenames[ttype(o)] +#define luaO_tag2type(t) (luaO_typearr[(int)(t)]) +#define luaO_type(o) (luaO_tag2type(ttype(o))) +#define luaO_typename(L, o) (lua_typename(L, luaO_type(o))) lint32 luaO_power2 (lint32 n); char *luaO_openspace (lua_State *L, size_t n); -- cgit v1.2.3-55-g6feb