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.c | |
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.c')
-rw-r--r-- | lobject.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 1.48 2000/09/12 13:47:39 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 1.49 2000/09/29 12:42:13 roberto Exp roberto $ |
3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -17,16 +17,14 @@ | |||
17 | #include "lstate.h" | 17 | #include "lstate.h" |
18 | 18 | ||
19 | 19 | ||
20 | /* | 20 | |
21 | ** you can use the fact that the 3rd letter of each name is always different | 21 | const lua_Type luaO_typearr[] = { /* ORDER LUA_T */ |
22 | ** (e-m-r-b-n-l) to compare and switch these strings | 22 | LUA_TUSERDATA, LUA_TNUMBER, LUA_TSTRING, LUA_TTABLE, |
23 | */ | 23 | LUA_TFUNCTION, LUA_TFUNCTION, LUA_TNIL |
24 | const char *const luaO_typenames[] = { /* ORDER LUA_T */ | ||
25 | "userdata", "number", "string", "table", "function", "function", "nil", | ||
26 | "function", "function" | ||
27 | }; | 24 | }; |
28 | 25 | ||
29 | 26 | ||
27 | |||
30 | const TObject luaO_nilobject = {TAG_NIL, {NULL}}; | 28 | const TObject luaO_nilobject = {TAG_NIL, {NULL}}; |
31 | 29 | ||
32 | 30 | ||