aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-11 15:02:40 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-11-11 15:02:40 -0200
commit573372665ab47bb6c0451ee7ca3ff5fce9b370e0 (patch)
tree248cfe8ec057fb301145fea58387b752435d3be3 /lapi.c
parenta6755e2f1a6b9993cfd9e94c4165c76adafbdc31 (diff)
downloadlua-573372665ab47bb6c0451ee7ca3ff5fce9b370e0.tar.gz
lua-573372665ab47bb6c0451ee7ca3ff5fce9b370e0.tar.bz2
lua-573372665ab47bb6c0451ee7ca3ff5fce9b370e0.zip
new API function `lua_equalobj'
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lapi.c b/lapi.c
index 020a4642..33e384d3 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.54 1999/10/14 19:13:31 roberto Exp roberto $ 2** $Id: lapi.c,v 1.55 1999/11/04 17:22:26 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -209,15 +209,15 @@ const char *lua_type (lua_Object o) {
209} 209}
210 210
211int lua_isnil (lua_Object o) { 211int lua_isnil (lua_Object o) {
212 return (o!= LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_NIL); 212 return (o != LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_NIL);
213} 213}
214 214
215int lua_istable (lua_Object o) { 215int lua_istable (lua_Object o) {
216 return (o!= LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_ARRAY); 216 return (o != LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_ARRAY);
217} 217}
218 218
219int lua_isuserdata (lua_Object o) { 219int lua_isuserdata (lua_Object o) {
220 return (o!= LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_USERDATA); 220 return (o != LUA_NOOBJECT) && (ttype(Address(o)) == LUA_T_USERDATA);
221} 221}
222 222
223int lua_iscfunction (lua_Object o) { 223int lua_iscfunction (lua_Object o) {
@@ -225,7 +225,7 @@ int lua_iscfunction (lua_Object o) {
225} 225}
226 226
227int lua_isnumber (lua_Object o) { 227int lua_isnumber (lua_Object o) {
228 return (o!= LUA_NOOBJECT) && (tonumber(Address(o)) == 0); 228 return (o != LUA_NOOBJECT) && (tonumber(Address(o)) == 0);
229} 229}
230 230
231int lua_isstring (lua_Object o) { 231int lua_isstring (lua_Object o) {
@@ -238,6 +238,11 @@ int lua_isfunction (lua_Object o) {
238 return (t == LUA_T_PROTO) || (t == LUA_T_CPROTO); 238 return (t == LUA_T_PROTO) || (t == LUA_T_CPROTO);
239} 239}
240 240
241int lua_equalobj (lua_Object o1, lua_Object o2) {
242 if (o1 == LUA_NOOBJECT || o2 == LUA_NOOBJECT) return 0;
243 else return luaO_equalObj(Address(o1), Address(o2));
244}
245
241 246
242double lua_getnumber (lua_Object object) { 247double lua_getnumber (lua_Object object) {
243 if (object == LUA_NOOBJECT) return 0.0; 248 if (object == LUA_NOOBJECT) return 0.0;