Browse Source

new macro `lua_isudataval' (for completude)

Roberto Ierusalimschy 23 years ago
parent
commit
d88860131a
2 changed files with 6 additions and 2 deletions
  1. 4 1
      ltests.c
  2. 2 1
      lua.h

+ 4 - 1
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));
     }

+ 2 - 1
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:[email protected]
@@ -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)