13 #include "ltm.h" |
13 #include "ltm.h" |
14 |
14 |
15 |
15 |
16 #define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) |
16 #define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) |
17 |
17 |
18 #define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ |
18 #define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ |
19 (((o) = luaV_tonumber(o,n)) != NULL)) |
19 (((o) = luaV_tonumber(o,n)) != NULL)) |
20 |
20 |
21 #define equalobj(L,o1,o2) \ |
21 #define equalobj(L,o1,o2) \ |
22 (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) |
22 (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) |
23 |
23 |
24 |
24 |
25 LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); |
25 LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); |
26 LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); |
26 LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); |
27 LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); |
27 LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); |