summaryrefslogtreecommitdiff
path: root/lua.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-04 08:47:49 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-04 08:47:49 -0200
commit3db06a95a388c2e0922fd138434321240a4eb075 (patch)
tree26b5d44d5ecd621bc728cd910ab2e2be6a74d309 /lua.h
parent31d58e2f0193998d28f1c0587573fdc35da383fd (diff)
downloadlua-github-3db06a95a388c2e0922fd138434321240a4eb075.tar.gz
Elimination of functions lua_isnil, etc.
Diffstat (limited to 'lua.h')
-rw-r--r--lua.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/lua.h b/lua.h
index f9a0a500..098b225a 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 1.5 1994/11/01 17:54:31 roberto Exp $
+** $Id: lua.h,v 3.1 1994/11/02 20:30:53 roberto Exp roberto $
*/
@@ -62,18 +62,22 @@ int lua_storefield (lua_Object object, char *field);
int lua_storeindexed (lua_Object object, float index);
int lua_storesubscript (void);
-int lua_isnil (lua_Object object);
-int lua_isnumber (lua_Object object);
-int lua_isstring (lua_Object object);
-int lua_istable (lua_Object object);
-int lua_isfunction (lua_Object object);
-int lua_iscfunction (lua_Object object);
-int lua_isuserdata (lua_Object object);
+int lua_type (lua_Object object);
/* for lua 1.1 */
#define lua_call(f) lua_callfunction(lua_getglobal(f))
+#define lua_getindexed(o,n) (lua_pushnumber(n), lua_getIndex(o))
+#define lua_getfield(o,f) (lua_pushstring(f), lua_getIndex(o))
+
+#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)
#endif