void remove_current_item(menu_state_t *ms) { menu_data_t *const m = ms->d; menu_current_line_erase(ms); remove_from_string_array(m->items, m->len, m->pos); if(m->data != NULL) { remove_from_string_array(m->data, m->len, m->pos); } if(m->void_data != NULL) { memmove(m->void_data + m->pos, m->void_data + m->pos + 1, sizeof(*m->void_data)*((m->len - 1) - m->pos)); } if(ms->matches != NULL) { if(ms->matches[m->pos][0] >= 0) { --ms->matching_entries; } memmove(ms->matches + m->pos, ms->matches + m->pos + 1, sizeof(*ms->matches)*((m->len - 1) - m->pos)); } --m->len; draw_menu(ms); move_to_menu_pos(m->pos, ms); }
void remove_current_item(menu_info *m) { clean_menu_position(m); remove_from_string_array(m->items, m->len, m->pos); if(m->matches != NULL) { if(m->matches[m->pos]) m->matching_entries--; memmove(m->matches + m->pos, m->matches + m->pos + 1, sizeof(int)*((m->len - 1) - m->pos)); } m->len--; draw_menu(m); move_to_menu_pos(m->pos, m); }