diff --git a/Makefile.common b/Makefile.common index b3c78737a1..44c0fa795f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -337,6 +337,7 @@ ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/menu_input.o \ menu/menu.o \ menu/menu_entry.o \ + menu/menu_common_list.o \ menu/menu_navigation.o \ menu/menu_setting.o \ menu/menu_database.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index f4b7021741..495f63c3a7 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -713,6 +713,7 @@ MENU #include "../menu/menu_input.c" #include "../menu/menu.c" #include "../menu/menu_entry.c" +#include "../menu/menu_common_list.c" #include "../menu/menu_setting.c" #include "../menu/menu_list.c" #include "../menu/menu_entries_cbs_ok.c" diff --git a/menu/menu_common_list.c b/menu/menu_common_list.c new file mode 100644 index 0000000000..79f14118bd --- /dev/null +++ b/menu/menu_common_list.c @@ -0,0 +1,43 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2015 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include "menu_common_list.h" +#include "menu.h" +#include "menu_entries_cbs.h" + +void menu_common_list_delete(void *data, size_t idx, + size_t list_size) +{ + menu_file_list_cbs_t *cbs = NULL; + file_list_t *list = (file_list_t*)data; + + if (!list) + return; + + cbs = (menu_file_list_cbs_t*)list->list[idx].actiondata; + + if (cbs) + { + cbs->action_start = NULL; + cbs->action_ok = NULL; + cbs->action_cancel = NULL; + cbs->action_left = NULL; + cbs->action_right = NULL; + cbs->action_deferred_push = NULL; + free(list->list[idx].actiondata); + } + list->list[idx].actiondata = NULL; +} diff --git a/menu/menu_common_list.h b/menu/menu_common_list.h new file mode 100644 index 0000000000..938b1eac9a --- /dev/null +++ b/menu/menu_common_list.h @@ -0,0 +1,33 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2015 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#ifndef MENU_COMMON_LIST_H__ +#define MENU_COMMON_LIST_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void menu_common_list_delete(void *data, size_t idx, + size_t list_size); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/menu/menu_list.c b/menu/menu_list.c index aa13f34b48..83c600e8f0 100644 --- a/menu/menu_list.c +++ b/menu/menu_list.c @@ -20,6 +20,7 @@ #include "../driver.h" #include "menu.h" +#include "menu_common_list.h" #include "menu_entries_cbs.h" #include "menu_list.h" #include "menu_navigation.h" @@ -143,30 +144,6 @@ void menu_list_refresh(file_list_t *list) menu_navigation_clear(nav, true); } -static void menu_common_list_delete(void *data, size_t idx, - size_t list_size) -{ - menu_file_list_cbs_t *cbs = NULL; - file_list_t *list = (file_list_t*)data; - - if (!list) - return; - - cbs = (menu_file_list_cbs_t*)list->list[idx].actiondata; - - if (cbs) - { - cbs->action_start = NULL; - cbs->action_ok = NULL; - cbs->action_cancel = NULL; - cbs->action_left = NULL; - cbs->action_right = NULL; - cbs->action_deferred_push = NULL; - free(list->list[idx].actiondata); - } - list->list[idx].actiondata = NULL; -} - static void menu_list_destroy(file_list_t *list) { unsigned i;