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

Function lua_compare

Libs/sol/sol.hpp:3051–3072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3049 "return a<=b\n";
3050
3051COMPAT53_API int lua_compare(lua_State* L, int idx1, int idx2, int op) {
3052 int result = 0;
3053 switch (op) {
3054 case LUA_OPEQ:
3055 return lua_equal(L, idx1, idx2);
3056 case LUA_OPLT:
3057 return lua_lessthan(L, idx1, idx2);
3058 case LUA_OPLE:
3059 luaL_checkstack(L, 5, "not enough stack slots");
3060 idx1 = lua_absindex(L, idx1);
3061 idx2 = lua_absindex(L, idx2);
3062 lua_pushvalue(L, idx1);
3063 lua_pushvalue(L, idx2);
3064 compat53_call_lua(L, compat53_compare_code, sizeof(compat53_compare_code) - 1, 2, 1);
3065 result = lua_toboolean(L, -1);
3066 lua_pop(L, 1);
3067 return result;
3068 default:
3069 luaL_error(L, "invalid 'op' argument for lua_compare");
3070 }
3071 return 0;
3072}
3073
3074COMPAT53_API void lua_copy(lua_State* L, int from, int to) {
3075 int abs_to = lua_absindex(L, to);

Callers 3

operator==Function · 0.85
checkMethod · 0.85
get_call_syntaxFunction · 0.85

Calls 3

luaL_checkstackFunction · 0.85
lua_absindexFunction · 0.85
compat53_call_luaFunction · 0.85

Tested by

no test coverage detected