From a275d9a25b161af426696d7b73d46f91150309c9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 19 Mar 1996 19:28:37 -0300 Subject: functions "lua_is..." consider coercions. --- lua.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lua.h') diff --git a/lua.h b/lua.h index a268a176..1bfcfaf1 100644 --- a/lua.h +++ b/lua.h @@ -2,7 +2,7 @@ ** LUA - Linguagem para Usuarios de Aplicacao ** Grupo de Tecnologia em Computacao Grafica ** TeCGraf - PUC-Rio -** $Id: lua.h,v 3.22 1996/02/12 18:32:09 roberto Exp roberto $ +** $Id: lua.h,v 3.23 1996/02/14 13:40:26 roberto Exp $ */ @@ -52,6 +52,14 @@ void lua_endblock (void); lua_Object lua_getparam (int number); #define lua_getresult(_) lua_getparam(_) +#define lua_isnil(_) (lua_type(_)==LUA_T_NIL) +#define lua_istable(_) (lua_type(_)==LUA_T_ARRAY) +#define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) +#define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) +int lua_isnumber (lua_Object object); +int lua_isstring (lua_Object object); +int lua_isfunction (lua_Object object); + float lua_getnumber (lua_Object object); char *lua_getstring (lua_Object object); lua_CFunction lua_getcfunction (lua_Object object); @@ -88,14 +96,6 @@ lua_Object lua_createtable (void); #define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA) -#define lua_isnil(_) (lua_type(_)==LUA_T_NIL) -#define lua_isnumber(_) (lua_type(_)==LUA_T_NUMBER) -#define lua_isstring(_) (lua_type(_)==LUA_T_STRING) -#define lua_istable(_) (lua_type(_)==LUA_T_ARRAY) -#define lua_isfunction(_) (lua_type(_)==LUA_T_FUNCTION) -#define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) -#define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) - /* for compatibility with old versions. Avoid using these macros */ -- cgit v1.2.3-55-g6feb