Revert "Remove menu_common_list.c - make menu_common_list_delete a static"

This reverts commit df2b80a14c836be4adf0b191889bc6ae55472a6e.
This commit is contained in:
twinaphex 2015-05-19 23:00:02 +02:00
parent df2b80a14c
commit 194b32d7eb
5 changed files with 79 additions and 24 deletions

View File

@ -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 \

View File

@ -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"

43
menu/menu_common_list.c Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#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;
}

33
menu/menu_common_list.h Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
*/
#ifndef MENU_COMMON_LIST_H__
#define MENU_COMMON_LIST_H__
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
void menu_common_list_delete(void *data, size_t idx,
size_t list_size);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -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;