MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / lua_compare

Function lua_compare

extlibs/sol3/include/sol/sol.hpp:2537–2559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2535"return a<=b\n";
2536
2537COMPAT53_API int lua_compare(lua_State *L, int idx1, int idx2, int op) {
2538 int result = 0;
2539 switch (op) {
2540 case LUA_OPEQ:
2541 return lua_equal(L, idx1, idx2);
2542 case LUA_OPLT:
2543 return lua_lessthan(L, idx1, idx2);
2544 case LUA_OPLE:
2545 luaL_checkstack(L, 5, "not enough stack slots");
2546 idx1 = lua_absindex(L, idx1);
2547 idx2 = lua_absindex(L, idx2);
2548 lua_pushvalue(L, idx1);
2549 lua_pushvalue(L, idx2);
2550 compat53_call_lua(L, compat53_compare_code,
2551 sizeof(compat53_compare_code) - 1, 2, 1);
2552 result = lua_toboolean(L, -1);
2553 lua_pop(L, 1);
2554 return result;
2555 default:
2556 luaL_error(L, "invalid 'op' argument for lua_compare");
2557 }
2558 return 0;
2559}
2560
2561COMPAT53_API void lua_copy(lua_State *L, int from, int to) {
2562 int abs_to = lua_absindex(L, to);

Callers 3

operator==Function · 0.70
checkMethod · 0.70
get_call_syntaxFunction · 0.70

Calls 6

lua_pushvalueFunction · 0.85
compat53_call_luaFunction · 0.85
lua_tobooleanFunction · 0.85
luaL_errorFunction · 0.85
luaL_checkstackFunction · 0.70
lua_absindexFunction · 0.70

Tested by

no test coverage detected