new API function 'lua_type'.

This commit is contained in:
Roberto Ierusalimschy
1999-10-07 17:04:30 -02:00
parent 1942b58609
commit 63ccf42397
3 changed files with 15 additions and 14 deletions

5
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 1.50 1999/09/21 16:10:13 roberto Exp roberto $
** $Id: lapi.c,v 1.51 1999/10/04 17:51:04 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -216,6 +216,9 @@ void lua_rawsetglobal (const char *name) {
}
const char *lua_type (lua_Object o) {
return (o == LUA_NOOBJECT) ? "NOOBJECT" : luaO_typename(Address(o));
}
int lua_isnil (lua_Object o) {
return (o!= LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_NIL);