From 78c136b218e666deed4e12af8e1c00baa9307133 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 15 Oct 2014 07:40:19 +0200 Subject: [PATCH] Start setting the stage for deferred push callback --- file_list.c | 5 +++++ file_list.h | 2 ++ frontend/menu/menu_entries.c | 10 ++++++++-- frontend/menu/menu_entries.h | 4 ++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/file_list.c b/file_list.c index fbb24e8fb2..367ff07727 100644 --- a/file_list.c +++ b/file_list.c @@ -205,6 +205,11 @@ void *file_list_get_actiondata_at_offset(const file_list_t *list, size_t index) return list->list[index].actiondata; } +void *file_list_get_last_actiondata(const file_list_t *list) +{ + return list->list[list->size - 1].actiondata; +} + void file_list_get_at_offset(const file_list_t *list, size_t index, const char **path, const char **label, unsigned *file_type) { diff --git a/file_list.h b/file_list.h index 6843db9bbb..875a429eb4 100644 --- a/file_list.h +++ b/file_list.h @@ -60,6 +60,8 @@ void file_list_get_last(const file_list_t *list, const char **path, const char **label, unsigned *type); +void *file_list_get_last_actiondata(const file_list_t *list); + size_t file_list_get_size(const file_list_t *list); size_t file_list_get_directory_ptr(const file_list_t *list); diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index cd90b89545..5663051191 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -543,7 +543,7 @@ static int push_list(menu_handle_t *menu, return 0; } -static int menu_parse_list(file_list_t *list, file_list_t *menu_list, +int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, const char *dir, const char *label, unsigned type, unsigned default_type_plain, const char *exts) { @@ -792,6 +792,7 @@ int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list) const char *path = NULL; const char *label = NULL; const char *exts = NULL; + menu_file_list_cbs_t *cbs = NULL; char ext_buf[PATH_MAX]; file_list_get_last(menu_list, &path, &label, &type); @@ -803,6 +804,11 @@ int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list) if (((menu_parse_check(label, type)) == -1)) return push_list(driver.menu, list, path, label, type); + cbs = (menu_file_list_cbs_t*) + file_list_get_last_actiondata(menu_list); + + (void)cbs; + //RARCH_LOG("LABEL: %s\n", label); if (!strcmp(label, "core_list")) exts = EXT_EXECUTABLES; @@ -860,7 +866,7 @@ int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list) else exts = g_extern.system.valid_extensions; - menu_parse_list(list, menu_list, path, label, + menu_entries_parse_list(list, menu_list, path, label, type, default_type_plain, exts); return 0; diff --git a/frontend/menu/menu_entries.h b/frontend/menu/menu_entries.h index cfb2f6f366..0b060b7bdb 100644 --- a/frontend/menu/menu_entries.h +++ b/frontend/menu/menu_entries.h @@ -30,6 +30,10 @@ void menu_entries_push(file_list_t *list, const char *path, const char *label, unsigned type, size_t directory_ptr); +int menu_entries_parse_list(file_list_t *list, file_list_t *menu_list, + const char *dir, const char *label, unsigned type, + unsigned default_type_plain, const char *exts); + void menu_entries_pop_list(file_list_t *list); int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list);