aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-07 17:04:30 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-07 17:04:30 -0200
commit63ccf42397c30d89497d5f1e1e953ce879bef724 (patch)
tree5d705102d981c84410af463b9fd8a2335b848b1f /lapi.c
parent1942b5860981bc6398fe7db2479885fe41297c92 (diff)
downloadlua-63ccf42397c30d89497d5f1e1e953ce879bef724.tar.gz
lua-63ccf42397c30d89497d5f1e1e953ce879bef724.tar.bz2
lua-63ccf42397c30d89497d5f1e1e953ce879bef724.zip
new API function 'lua_type'.
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 1f63dbc5..9048d5af 100644
--- a/lapi.c
+++ b/lapi.c
@@ -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
219const char *lua_type (lua_Object o) {
220 return (o == LUA_NOOBJECT) ? "NOOBJECT" : luaO_typename(Address(o));
221}
219 222
220int lua_isnil (lua_Object o) { 223int 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);