diff options
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 19 |
1 files changed, 16 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.196 2002/06/06 12:40:22 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.197 2002/06/12 14:51:31 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 | */ |
| @@ -211,11 +211,24 @@ LUA_API int lua_isstring (lua_State *L, int index) { | |||
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | 213 | ||
| 214 | LUA_API int lua_equal (lua_State *L, int index1, int index2) { | 214 | LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { |
| 215 | StkId o1 = luaA_indexAcceptable(L, index1); | 215 | StkId o1 = luaA_indexAcceptable(L, index1); |
| 216 | StkId o2 = luaA_indexAcceptable(L, index2); | 216 | StkId o2 = luaA_indexAcceptable(L, index2); |
| 217 | return (o1 == NULL || o2 == NULL) ? 0 /* index out of range */ | 217 | return (o1 == NULL || o2 == NULL) ? 0 /* index out of range */ |
| 218 | : luaO_equalObj(o1, o2); | 218 | : luaO_rawequalObj(o1, o2); |
| 219 | } | ||
| 220 | |||
| 221 | |||
| 222 | LUA_API int lua_equal (lua_State *L, int index1, int index2) { | ||
| 223 | StkId o1, o2; | ||
| 224 | int i; | ||
| 225 | lua_lock(L); /* may call tag method */ | ||
| 226 | o1 = luaA_indexAcceptable(L, index1); | ||
| 227 | o2 = luaA_indexAcceptable(L, index2); | ||
| 228 | i = (o1 == NULL || o2 == NULL) ? 0 /* index out of range */ | ||
| 229 | : equalobj(L, o1, o2); | ||
| 230 | lua_unlock(L); | ||
| 231 | return i; | ||
| 219 | } | 232 | } |
| 220 | 233 | ||
| 221 | 234 | ||
