Combine list_special files

This commit is contained in:
twinaphex 2016-03-20 17:28:24 +01:00
parent 972d3faabb
commit ac6362cae4
25 changed files with 107 additions and 149 deletions

View File

@ -137,8 +137,7 @@ OBJ += frontend/frontend.o \
libretro-common/lists/string_list.o \
libretro-common/string/stdstring.o \
libretro-common/memmap/memalign.o \
dir_list_special.o \
string_list_special.o \
list_special.o \
libretro-common/file/nbio/nbio_stdio.o \
libretro-common/file/file_path.o \
file_path_special.o \

View File

@ -75,7 +75,7 @@ else
OBJS += input/drivers_joypad/hid_joypad.o
OBJS += input/drivers_hid/null_hid.o
OBJS += gfx/video_state_tracker.o
OBJS += libretro-common/queues/fifo_buffer.o
OBJS += libretro-common/queues/fifo_queue.o
OBJS += audio/audio_resampler_driver.o
OBJS += audio/drivers_resampler/sinc.o
OBJS += audio/drivers_resampler/nearest.o
@ -122,17 +122,16 @@ else
OBJS += content.o
OBJS += libretro-common/file/file_path.o
OBJS += file_path_special.o
OBJS += libretro-common/file/dir_list.o
OBJS += libretro-common/lists/dir_list.o
OBJS += libretro-common/file/retro_dirent.o
OBJS += libretro-common/file/retro_file.o
OBJS += libretro-common/streams/file_stream.o
OBJS += libretro-common/file/retro_stat.o
OBJS += dir_list_special.o
OBJS += string_list_special.o
OBJS += libretro-common/string/string_list.o
OBJS += list_special.o
OBJS += libretro-common/lists/string_list.o
OBJS += libretro-common/string/stdstring.o
OBJS += file_ops.o
OBJS += libretro-common/file/nbio/nbio_stdio.o
OBJS += libretro-common/file/file_list.o
OBJS += libretro-common/lists/file_list.o
OBJS += libretro-common/queues/message_queue.o
OBJS += patch.o
OBJS += configuration.o

View File

@ -29,7 +29,7 @@
#include "../general.h"
#include "../performance.h"
#include "../verbosity.h"
#include "../string_list_special.h"
#include "../list_special.h"
#ifndef AUDIO_BUFFER_FREE_SAMPLES_COUNT
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)

View File

@ -24,7 +24,7 @@
#include "../performance.h"
#endif
#ifndef DONT_HAVE_STRING_LIST
#include "../string_list_special.h"
#include "../list_special.h"
#endif
static const rarch_resampler_t *resampler_drivers[] = {

View File

@ -19,7 +19,7 @@
#include "camera_driver.h"
#include "../general.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../verbosity.h"
static const camera_driver_t *camera_drivers[] = {

View File

@ -38,7 +38,7 @@
#include "rewind.h"
#include "system.h"
#include "ui/ui_companion_driver.h"
#include "dir_list_special.h"
#include "list_special.h"
#ifdef HAVE_CHEEVOS
#include "cheevos.h"

View File

@ -24,7 +24,7 @@
#include "core_info.h"
#include "configuration.h"
#include "dir_list_special.h"
#include "list_special.h"
#include "config.def.h"
#ifdef HAVE_CONFIG_H

View File

@ -19,7 +19,7 @@
#include <retro_endianness.h>
#include "dir_list_special.h"
#include "list_special.h"
#include "database_info.h"
#include "msg_hash.h"
#include "verbosity.h"

View File

@ -1,78 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - 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 <lists/dir_list.h>
#include "dir_list_special.h"
#include "frontend/frontend_driver.h"
#include "configuration.h"
#include "core_info.h"
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter)
{
char ext_name[PATH_MAX_LENGTH];
const char *dir = NULL;
const char *exts = NULL;
bool include_dirs = false;
settings_t *settings = config_get_ptr();
(void)input_dir;
(void)settings;
switch (type)
{
case DIR_LIST_CORES:
dir = settings->libretro_directory;
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
return NULL;
exts = ext_name;
break;
case DIR_LIST_CORE_INFO:
{
core_info_list_t *list = NULL;
core_info_ctl(CORE_INFO_CTL_LIST_GET, &list);
dir = input_dir;
exts = list->all_ext;
}
break;
case DIR_LIST_SHADERS:
dir = settings->video.shader_dir;
exts = "cg|cgp|glsl|glslp|slang|slangp";
break;
case DIR_LIST_COLLECTIONS:
dir = settings->playlist_directory;
exts = "lpl";
break;
case DIR_LIST_DATABASES:
dir = settings->content_database;
exts = "rdb";
break;
case DIR_LIST_PLAIN:
dir = input_dir;
exts = filter;
break;
case DIR_LIST_NONE:
default:
return NULL;
}
return dir_list_new(dir, exts, include_dirs, type == DIR_LIST_CORE_INFO);
}

View File

@ -1,38 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - 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 _DIR_LIST_SPECIAL_H
#define _DIR_LIST_SPECIAL_H
#include <stdint.h>
#include <lists/string_list.h>
enum dir_list_type
{
DIR_LIST_NONE = 0,
DIR_LIST_CORES,
DIR_LIST_CORE_INFO,
DIR_LIST_DATABASES,
DIR_LIST_COLLECTIONS,
DIR_LIST_PLAIN,
DIR_LIST_SHADERS
};
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter);
#endif

View File

@ -29,7 +29,7 @@
#include "../config.def.h"
#include "../general.h"
#include "../performance.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../libretro_version_1.h"
#include "../system.h"
#include "../command_event.h"

View File

@ -644,8 +644,7 @@ FILE
#include "../libretro-common/file/retro_dirent.c"
#include "../libretro-common/streams/file_stream.c"
#include "../libretro-common/file/retro_stat.c"
#include "../dir_list_special.c"
#include "../string_list_special.c"
#include "../list_special.c"
#include "../libretro-common/string/stdstring.c"
#include "../libretro-common/file/nbio/nbio_stdio.c"

View File

@ -20,7 +20,7 @@
#include "../general.h"
#include "../movie.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../verbosity.h"
#ifdef HAVE_COMMAND

View File

@ -19,7 +19,7 @@
#include <string.h>
#include "input_hid_driver.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../verbosity.h"
static hid_driver_t *hid_drivers[] = {

View File

@ -22,7 +22,7 @@
#include "input_keymaps.h"
#include "../general.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../verbosity.h"
static input_device_driver_t *joypad_drivers[] = {

View File

@ -1,4 +1,5 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@ -15,7 +16,12 @@
#include <string.h>
#include "string_list_special.h"
#include <lists/dir_list.h>
#include "list_special.h"
#include "frontend/frontend_driver.h"
#include "configuration.h"
#include "core_info.h"
#ifdef HAVE_MENU
#include "menu/menu_driver.h"
@ -38,6 +44,62 @@
#include "audio/audio_resampler_driver.h"
#include "record/record_driver.h"
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter)
{
char ext_name[PATH_MAX_LENGTH];
const char *dir = NULL;
const char *exts = NULL;
bool include_dirs = false;
settings_t *settings = config_get_ptr();
(void)input_dir;
(void)settings;
switch (type)
{
case DIR_LIST_CORES:
dir = settings->libretro_directory;
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
return NULL;
exts = ext_name;
break;
case DIR_LIST_CORE_INFO:
{
core_info_list_t *list = NULL;
core_info_ctl(CORE_INFO_CTL_LIST_GET, &list);
dir = input_dir;
exts = list->all_ext;
}
break;
case DIR_LIST_SHADERS:
dir = settings->video.shader_dir;
exts = "cg|cgp|glsl|glslp|slang|slangp";
break;
case DIR_LIST_COLLECTIONS:
dir = settings->playlist_directory;
exts = "lpl";
break;
case DIR_LIST_DATABASES:
dir = settings->content_database;
exts = "rdb";
break;
case DIR_LIST_PLAIN:
dir = input_dir;
exts = filter;
break;
case DIR_LIST_NONE:
default:
return NULL;
}
return dir_list_new(dir, exts, include_dirs, type == DIR_LIST_CORE_INFO);
}
struct string_list *string_list_new_special(enum string_list_type type,
void *data, unsigned *len, size_t *list_size)
{

View File

@ -1,4 +1,5 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@ -13,13 +14,25 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _STRING_LIST_SPECIAL_H
#define _STRING_LIST_SPECIAL_H
#ifndef _LIST_SPECIAL_H
#define _LIST_SPECIAL_H
#include <stdint.h>
#include <stddef.h>
#include <lists/string_list.h>
enum dir_list_type
{
DIR_LIST_NONE = 0,
DIR_LIST_CORES,
DIR_LIST_CORE_INFO,
DIR_LIST_DATABASES,
DIR_LIST_COLLECTIONS,
DIR_LIST_PLAIN,
DIR_LIST_SHADERS
};
enum string_list_type
{
STRING_LIST_NONE = 0,
@ -37,6 +50,9 @@ enum string_list_type
STRING_LIST_SUPPORTED_CORES_NAMES
};
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter);
struct string_list *string_list_new_special(enum string_list_type type,
void *data, unsigned *len, size_t *list_size);

View File

@ -20,7 +20,7 @@
#include "../general.h"
#include "../system.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../verbosity.h"
static const location_driver_t *location_drivers[] = {

View File

@ -35,7 +35,7 @@
#include "../../config.def.h"
#include "../../dir_list_special.h"
#include "../../list_special.h"
#include "../menu_driver.h"
#include "../menu_animation.h"

View File

@ -39,8 +39,7 @@
#include "../config.features.h"
#include "../git_version.h"
#include "../input/input_config.h"
#include "../dir_list_special.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../performance.h"
#include "../core_info.h"

View File

@ -33,7 +33,7 @@
#include "../system.h"
#include "../defaults.h"
#include "../frontend/frontend.h"
#include "../string_list_special.h"
#include "../list_special.h"
#include "../tasks/tasks_internal.h"
#include "../ui/ui_companion_driver.h"
#include "../verbosity.h"

View File

@ -26,7 +26,7 @@
#include "../retroarch.h"
#include "../verbosity.h"
#include "../msg_hash.h"
#include "../string_list_special.h"
#include "../list_special.h"
#ifdef HAVE_CONFIG_H
#include "../config.h"

View File

@ -45,7 +45,7 @@
#include "runloop.h"
#include "rewind.h"
#include "system.h"
#include "dir_list_special.h"
#include "list_special.h"
#include "audio/audio_driver.h"
#include "camera/camera_driver.h"
#include "record/record_driver.h"

View File

@ -28,7 +28,7 @@
#include "../database_info.h"
#endif
#include "../dir_list_special.h"
#include "../list_special.h"
#include "../msg_hash.h"
#include "../playlist.h"
#include "../verbosity.h"

View File

@ -30,7 +30,7 @@
#include "../database_info.h"
#endif
#include "../dir_list_special.h"
#include "../list_special.h"
#include "../msg_hash.h"
#include "../general.h"
#include "../verbosity.h"