MCPcopy Create free account
hub / github.com/DFHack/dfhack / lua_compare

Function lua_compare

depends/lua/src/lapi.c:318–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316
317
318LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
319 StkId o1, o2;
320 int i = 0;
321 lua_lock(L); /* may call tag method */
322 o1 = index2addr(L, index1);
323 o2 = index2addr(L, index2);
324 if (isvalid(o1) && isvalid(o2)) {
325 switch (op) {
326 case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break;
327 case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break;
328 case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break;
329 default: api_check(L, 0, "invalid option");
330 }
331 }
332 lua_unlock(L);
333 return i;
334}
335
336
337LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) {

Callers 4

math_minFunction · 0.85
math_maxFunction · 0.85
tmoveFunction · 0.85
sort_compFunction · 0.85

Calls 4

index2addrFunction · 0.85
luaV_equalobjFunction · 0.85
luaV_lessthanFunction · 0.85
luaV_lessequalFunction · 0.85

Tested by

no test coverage detected