diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-04 08:47:49 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-04 08:47:49 -0200 |
| commit | 3db06a95a388c2e0922fd138434321240a4eb075 (patch) | |
| tree | 26b5d44d5ecd621bc728cd910ab2e2be6a74d309 | |
| parent | 31d58e2f0193998d28f1c0587573fdc35da383fd (diff) | |
| download | lua-3db06a95a388c2e0922fd138434321240a4eb075.tar.gz lua-3db06a95a388c2e0922fd138434321240a4eb075.tar.bz2 lua-3db06a95a388c2e0922fd138434321240a4eb075.zip | |
Elimination of functions lua_isnil, etc.
| -rw-r--r-- | lua.h | 20 |
1 files changed, 12 insertions, 8 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 1.5 1994/11/01 17:54:31 roberto Exp $ | 5 | ** $Id: lua.h,v 3.1 1994/11/02 20:30:53 roberto Exp roberto $ |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | 8 | ||
| @@ -62,18 +62,22 @@ int lua_storefield (lua_Object object, char *field); | |||
| 62 | int lua_storeindexed (lua_Object object, float index); | 62 | int lua_storeindexed (lua_Object object, float index); |
| 63 | int lua_storesubscript (void); | 63 | int lua_storesubscript (void); |
| 64 | 64 | ||
| 65 | int lua_isnil (lua_Object object); | 65 | int lua_type (lua_Object object); |
| 66 | int lua_isnumber (lua_Object object); | ||
| 67 | int lua_isstring (lua_Object object); | ||
| 68 | int lua_istable (lua_Object object); | ||
| 69 | int lua_isfunction (lua_Object object); | ||
| 70 | int lua_iscfunction (lua_Object object); | ||
| 71 | int lua_isuserdata (lua_Object object); | ||
| 72 | 66 | ||
| 73 | 67 | ||
| 74 | /* for lua 1.1 */ | 68 | /* for lua 1.1 */ |
| 75 | 69 | ||
| 76 | #define lua_call(f) lua_callfunction(lua_getglobal(f)) | 70 | #define lua_call(f) lua_callfunction(lua_getglobal(f)) |
| 77 | 71 | ||
| 72 | #define lua_getindexed(o,n) (lua_pushnumber(n), lua_getIndex(o)) | ||
| 73 | #define lua_getfield(o,f) (lua_pushstring(f), lua_getIndex(o)) | ||
| 74 | |||
| 75 | #define lua_isnil(_) (lua_type(_)==LUA_T_NIL) | ||
| 76 | #define lua_isnumber(_) (lua_type(_)==LUA_T_NUMBER) | ||
| 77 | #define lua_isstring(_) (lua_type(_)==LUA_T_STRING) | ||
| 78 | #define lua_istable(_) (lua_type(_)==LUA_T_ARRAY) | ||
| 79 | #define lua_isfunction(_) (lua_type(_)==LUA_T_FUNCTION) | ||
| 80 | #define lua_iscfunction(_) (lua_type(_)==LUA_T_CFUNCTION) | ||
| 81 | #define lua_isuserdata(_) (lua_type(_)>=LUA_T_USERDATA) | ||
| 78 | 82 | ||
| 79 | #endif | 83 | #endif |
