mirror of
https://github.com/lua/lua.git
synced 2024-11-24 02:33:48 +08:00
new macro `lua_isudataval' (for completude)
This commit is contained in:
parent
44752fc9ce
commit
d88860131a
5
ltests.c
5
ltests.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ltests.c,v 1.127 2002/06/20 20:40:38 roberto Exp roberto $
|
||||
** $Id: ltests.c,v 1.128 2002/06/25 19:16:44 roberto Exp roberto $
|
||||
** Internal Module for Debugging of the Lua Implementation
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -578,6 +578,9 @@ static int testC (lua_State *L) {
|
||||
else if EQ("isuserdata") {
|
||||
lua_pushnumber(L, lua_isuserdata(L, getnum));
|
||||
}
|
||||
else if EQ("isudataval") {
|
||||
lua_pushnumber(L, lua_isudataval(L, getnum));
|
||||
}
|
||||
else if EQ("isnil") {
|
||||
lua_pushnumber(L, lua_isnil(L, getnum));
|
||||
}
|
||||
|
3
lua.h
3
lua.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lua.h,v 1.144 2002/06/26 19:28:44 roberto Exp roberto $
|
||||
** $Id: lua.h,v 1.145 2002/07/01 19:31:10 roberto Exp roberto $
|
||||
** Lua - An Extensible Extension Language
|
||||
** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
|
||||
** http://www.lua.org mailto:info@lua.org
|
||||
@ -242,6 +242,7 @@ LUA_API void *lua_newuserdata (lua_State *L, size_t size);
|
||||
#define lua_isfunction(L,n) (lua_type(L,n) == LUA_TFUNCTION)
|
||||
#define lua_istable(L,n) (lua_type(L,n) == LUA_TTABLE)
|
||||
#define lua_isuserdata(L,n) (lua_type(L,n) == LUA_TUSERDATA)
|
||||
#define lua_isudataval(L,n) (lua_type(L,n) == LUA_TUDATAVAL)
|
||||
#define lua_isnil(L,n) (lua_type(L,n) == LUA_TNIL)
|
||||
#define lua_isboolean(L,n) (lua_type(L,n) == LUA_TBOOLEAN)
|
||||
#define lua_isnone(L,n) (lua_type(L,n) == LUA_TNONE)
|
||||
|
Loading…
Reference in New Issue
Block a user