unsafe fn compat53_findfield(L: *mut lua_State, objidx: c_int, level: c_int) -> c_int {
    if level == 0 || lua_istable(L, -1) == 0 {
        return 0; // not found
    }

    lua_pushnil(L); // start 'next' loop
    while lua_next(L, -2) != 0 {
        // for each pair in table
        if lua_type(L, -2) == LUA_TSTRING {
            // ignore non-string keys
            if lua_rawequal(L, objidx, -1) != 0 {
                // found object?
                lua_pop(L, 1); // remove value (but keep name)
                return 1;
            } else if compat53_findfield(L, objidx, level - 1) != 0 {
                // try recursively
                lua_remove(L, -2); // remove table (but keep name)
                lua_pushliteral(L, ".");
                lua_insert(L, -2); // place '.' between the two names
                lua_concat(L, 3);
                return 1;
            }
        }
        lua_pop(L, 1); // remove value
    }
    0 // not found
}
// size of the second part of the stack
size of the second part of the stack
size of the second part of the stack
unsafe fn compat53_findfield(L: *mut lua_State, objidx: c_int, level: c_int) -> c_int {
    if level == 0 || lua_istable(L, -1) == 0 {
        return 0; // not found
    }
    lua_pushnil(L); // start 'next' loop
    while lua_next(L, -2) != 0 {
        // for each pair in table
        if lua_type(L, -2) == LUA_TSTRING {
            // ignore non-string keys
            if lua_rawequal(L, objidx, -1) != 0 {
                // found object?
                lua_pop(L, 1); // remove value (but keep name)
                return 1;
            } else if compat53_findfield(L, objidx, level - 1) != 0 {
                // try recursively
                lua_remove(L, -2); // remove table (but keep name)
                lua_pushliteral(L, ".");
                lua_insert(L, -2); // place '.' between the two names
                lua_concat(L, 3);
                return 1;
            }
        }
        lua_pop(L, 1); // remove value
    }
    0 // not found
}
unsafe fn compat53_findfield ( L : * mut lua_State , objidx : c_int , level : c_int ) -> c_int { if level == 0 || lua_istable ( L , - 1 ) == 0 { return 0 ; // not found } lua_pushnil ( L ) ; // start 'next' loop while lua_next ( L , - 2 ) != 0 { // for each pair in table if lua_type ( L , - 2 ) == LUA_TSTRING { // ignore non-string keys if lua_rawequal ( L , objidx , - 1 ) != 0 { // found object? lua_pop ( L , 1 ) ; // remove value (but keep name) return 1 ; } else if compat53_findfield ( L , objidx , level - 1 ) != 0 { // try recursively lua_remove ( L , - 2 ) ; // remove table (but keep name) lua_pushliteral ( L , " " ) ; lua_insert ( L , - 2 ) ; // place '.' between the two names lua_concat ( L , 3 ) ; return 1 ; } } lua_pop ( L , 1 ) ; // remove value } 0 // not found }
size of the second part of the stack
size of the second part of the stack
L
*mut lua_State
objidx
c_int
level
c_int
L
*mut lua_State
objidx
c_int
level
c_int