diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 17:10:55 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 17:10:55 -0300 |
commit | f6834f4393eaa1055c2bbde82ebb33cc58be8371 (patch) | |
tree | 3583008ef181106d0fc7e130300f12adc70a5854 /lobject.h | |
parent | 78bc8e553d4190fc3b90be5b621fc0f3507586ef (diff) | |
download | lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.tar.gz lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.tar.bz2 lua-f6834f4393eaa1055c2bbde82ebb33cc58be8371.zip |
new API function `lua_type' + new type lua_Type
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 1.76 2000/09/11 20:29:27 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.77 2000/09/29 12:42:13 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -48,7 +48,7 @@ typedef enum { | |||
48 | TAG_LMARK, /* mark for Lua closures */ | 48 | TAG_LMARK, /* mark for Lua closures */ |
49 | TAG_CMARK /* mark for C closures */ | 49 | TAG_CMARK /* mark for C closures */ |
50 | 50 | ||
51 | } lua_Type; | 51 | } lua_Tag; |
52 | 52 | ||
53 | /* tags for values visible from Lua == first user-created tag */ | 53 | /* tags for values visible from Lua == first user-created tag */ |
54 | #define NUM_TAGS 7 | 54 | #define NUM_TAGS 7 |
@@ -80,7 +80,7 @@ typedef union { | |||
80 | 80 | ||
81 | 81 | ||
82 | typedef struct lua_TObject { | 82 | typedef struct lua_TObject { |
83 | lua_Type ttype; | 83 | lua_Tag ttype; |
84 | Value value; | 84 | Value value; |
85 | } TObject; | 85 | } TObject; |
86 | 86 | ||
@@ -189,10 +189,12 @@ typedef struct CallInfo { | |||
189 | } CallInfo; | 189 | } CallInfo; |
190 | 190 | ||
191 | 191 | ||
192 | extern const char *const luaO_typenames[]; | 192 | extern const lua_Type luaO_typearr[]; |
193 | extern const TObject luaO_nilobject; | 193 | extern const TObject luaO_nilobject; |
194 | 194 | ||
195 | #define luaO_typename(o) luaO_typenames[ttype(o)] | 195 | #define luaO_tag2type(t) (luaO_typearr[(int)(t)]) |
196 | #define luaO_type(o) (luaO_tag2type(ttype(o))) | ||
197 | #define luaO_typename(L, o) (lua_typename(L, luaO_type(o))) | ||
196 | 198 | ||
197 | lint32 luaO_power2 (lint32 n); | 199 | lint32 luaO_power2 (lint32 n); |
198 | char *luaO_openspace (lua_State *L, size_t n); | 200 | char *luaO_openspace (lua_State *L, size_t n); |