diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-19 19:28:37 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-03-19 19:28:37 -0300 |
commit | a275d9a25b161af426696d7b73d46f91150309c9 (patch) | |
tree | 763a5694213fe30b231bc81777cec71828935696 /lua.h | |
parent | 7e0be1fbde80d72886e11bcbf114a8dbf6d5e1d9 (diff) | |
download | lua-a275d9a25b161af426696d7b73d46f91150309c9.tar.gz lua-a275d9a25b161af426696d7b73d46f91150309c9.tar.bz2 lua-a275d9a25b161af426696d7b73d46f91150309c9.zip |
functions "lua_is..." consider coercions.
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -2,7 +2,7 @@ | |||
2 | ** LUA - Linguagem para Usuarios de Aplicacao | 2 | ** LUA - Linguagem para Usuarios de Aplicacao |
3 | ** Grupo de Tecnologia em Computacao Grafica | 3 | ** Grupo de Tecnologia em Computacao Grafica |
4 | ** TeCGraf - PUC-Rio | 4 | ** TeCGraf - PUC-Rio |
5 | ** $Id: lua.h,v 3.22 1996/02/12 18:32:09 roberto Exp roberto $ | 5 | ** $Id: lua.h,v 3.23 1996/02/14 13:40:26 roberto Exp $ |
6 | */ | 6 | */ |
7 | 7 | ||
8 | 8 | ||
@@ -52,6 +52,14 @@ void lua_endblock (void); | |||
52 | lua_Object lua_getparam (int number); | 52 | lua_Object lua_getparam (int number); |
53 | #define lua_getresult(_) lua_getparam(_) | 53 | #define lua_getresult(_) lua_getparam(_) |
54 | 54 | ||
55 | #define lua_isnil(_) (lua_type(_)==LUA_T_NIL) | ||
56 | #define lua_istable(_) (lua_type(_)==LUA_T_ARRAY) | ||
57 | #define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) | ||
58 | #define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) | ||
59 | int lua_isnumber (lua_Object object); | ||
60 | int lua_isstring (lua_Object object); | ||
61 | int lua_isfunction (lua_Object object); | ||
62 | |||
55 | float lua_getnumber (lua_Object object); | 63 | float lua_getnumber (lua_Object object); |
56 | char *lua_getstring (lua_Object object); | 64 | char *lua_getstring (lua_Object object); |
57 | lua_CFunction lua_getcfunction (lua_Object object); | 65 | lua_CFunction lua_getcfunction (lua_Object object); |
@@ -88,14 +96,6 @@ lua_Object lua_createtable (void); | |||
88 | 96 | ||
89 | #define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA) | 97 | #define lua_pushuserdata(u) lua_pushusertag(u, LUA_T_USERDATA) |
90 | 98 | ||
91 | #define lua_isnil(_) (lua_type(_)==LUA_T_NIL) | ||
92 | #define lua_isnumber(_) (lua_type(_)==LUA_T_NUMBER) | ||
93 | #define lua_isstring(_) (lua_type(_)==LUA_T_STRING) | ||
94 | #define lua_istable(_) (lua_type(_)==LUA_T_ARRAY) | ||
95 | #define lua_isfunction(_) (lua_type(_)==LUA_T_FUNCTION) | ||
96 | #define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) | ||
97 | #define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) | ||
98 | |||
99 | 99 | ||
100 | /* for compatibility with old versions. Avoid using these macros */ | 100 | /* for compatibility with old versions. Avoid using these macros */ |
101 | 101 | ||