Add menu_entries_push_selection_buf

This commit is contained in:
twinaphex 2015-10-27 10:45:06 +01:00
parent bb6f66fc44
commit 30fb40ad87
2 changed files with 30 additions and 0 deletions

View File

@ -613,6 +613,33 @@ void menu_entries_push(file_list_t *list, const char *path, const char *label,
menu_cbs_init(list, cbs, path, label, type, idx);
}
void menu_entries_push_selection_buf(file_list_t *list, const char *path, const char *label,
unsigned type, size_t directory_ptr, size_t entry_idx)
{
file_list_t **selection_buf = NULL;
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu_list)
return;
selection_buf = (file_list_t**)realloc(selection_buf, (menu_list->selection_buf_size + 1) * sizeof(file_list_t));
if (!selection_buf)
goto error;
menu_list->selection_buf = selection_buf;
menu_list->selection_buf_size++;
menu_list->selection_buf[menu_list->selection_buf_size] = (file_list_t*)calloc(1, sizeof(*menu_list->selection_buf[menu_list->selection_buf_size]));
menu_entries_push(menu_list->selection_buf[menu_list->selection_buf_size], path, label, type, directory_ptr, entry_idx);
return;
error:
if (list)
free(selection_buf);
}
void menu_entries_push_menu_stack(file_list_t *list, const char *path, const char *label,
unsigned type, size_t directory_ptr, size_t entry_idx)
{

View File

@ -171,6 +171,9 @@ void menu_entries_set_alt_at_offset(file_list_t *list, size_t idx,
void menu_entries_push_menu_stack(file_list_t *list, const char *path, const char *label,
unsigned type, size_t directory_ptr, size_t entry_idx);
void menu_entries_push_selection_buf(file_list_t *list, const char *path, const char *label,
unsigned type, size_t directory_ptr, size_t entry_idx);
void menu_entries_refresh(file_list_t *list);
rarch_setting_t *menu_entries_get_setting(uint32_t i);