diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-10-07 17:04:30 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-10-07 17:04:30 -0200 |
commit | 63ccf42397c30d89497d5f1e1e953ce879bef724 (patch) | |
tree | 5d705102d981c84410af463b9fd8a2335b848b1f /lapi.c | |
parent | 1942b5860981bc6398fe7db2479885fe41297c92 (diff) | |
download | lua-63ccf42397c30d89497d5f1e1e953ce879bef724.tar.gz lua-63ccf42397c30d89497d5f1e1e953ce879bef724.tar.bz2 lua-63ccf42397c30d89497d5f1e1e953ce879bef724.zip |
new API function 'lua_type'.
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.50 1999/09/21 16:10:13 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.51 1999/10/04 17:51:04 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -216,6 +216,9 @@ void lua_rawsetglobal (const char *name) { | |||
216 | } | 216 | } |
217 | 217 | ||
218 | 218 | ||
219 | const char *lua_type (lua_Object o) { | ||
220 | return (o == LUA_NOOBJECT) ? "NOOBJECT" : luaO_typename(Address(o)); | ||
221 | } | ||
219 | 222 | ||
220 | int lua_isnil (lua_Object o) { | 223 | int lua_isnil (lua_Object o) { |
221 | return (o!= LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_NIL); | 224 | return (o!= LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_NIL); |