Skip to content

Commit ac6362c

Browse files
committed
Combine list_special files
1 parent 972d3fa commit ac6362c

25 files changed

+107
-149
lines changed

Makefile.common

+1-2
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ OBJ += frontend/frontend.o \
137137
libretro-common/lists/string_list.o \
138138
libretro-common/string/stdstring.o \
139139
libretro-common/memmap/memalign.o \
140-
dir_list_special.o \
141-
string_list_special.o \
140+
list_special.o \
142141
libretro-common/file/nbio/nbio_stdio.o \
143142
libretro-common/file/file_path.o \
144143
file_path_special.o \

Makefile.ctr

+6-7
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ else
7575
OBJS += input/drivers_joypad/hid_joypad.o
7676
OBJS += input/drivers_hid/null_hid.o
7777
OBJS += gfx/video_state_tracker.o
78-
OBJS += libretro-common/queues/fifo_buffer.o
78+
OBJS += libretro-common/queues/fifo_queue.o
7979
OBJS += audio/audio_resampler_driver.o
8080
OBJS += audio/drivers_resampler/sinc.o
8181
OBJS += audio/drivers_resampler/nearest.o
@@ -122,17 +122,16 @@ else
122122
OBJS += content.o
123123
OBJS += libretro-common/file/file_path.o
124124
OBJS += file_path_special.o
125-
OBJS += libretro-common/file/dir_list.o
125+
OBJS += libretro-common/lists/dir_list.o
126126
OBJS += libretro-common/file/retro_dirent.o
127-
OBJS += libretro-common/file/retro_file.o
127+
OBJS += libretro-common/streams/file_stream.o
128128
OBJS += libretro-common/file/retro_stat.o
129-
OBJS += dir_list_special.o
130-
OBJS += string_list_special.o
131-
OBJS += libretro-common/string/string_list.o
129+
OBJS += list_special.o
130+
OBJS += libretro-common/lists/string_list.o
132131
OBJS += libretro-common/string/stdstring.o
133132
OBJS += file_ops.o
134133
OBJS += libretro-common/file/nbio/nbio_stdio.o
135-
OBJS += libretro-common/file/file_list.o
134+
OBJS += libretro-common/lists/file_list.o
136135
OBJS += libretro-common/queues/message_queue.o
137136
OBJS += patch.o
138137
OBJS += configuration.o

audio/audio_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "../general.h"
3030
#include "../performance.h"
3131
#include "../verbosity.h"
32-
#include "../string_list_special.h"
32+
#include "../list_special.h"
3333

3434
#ifndef AUDIO_BUFFER_FREE_SAMPLES_COUNT
3535
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)

audio/audio_resampler_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "../performance.h"
2525
#endif
2626
#ifndef DONT_HAVE_STRING_LIST
27-
#include "../string_list_special.h"
27+
#include "../list_special.h"
2828
#endif
2929

3030
static const rarch_resampler_t *resampler_drivers[] = {

camera/camera_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "camera_driver.h"
2020

2121
#include "../general.h"
22-
#include "../string_list_special.h"
22+
#include "../list_special.h"
2323
#include "../verbosity.h"
2424

2525
static const camera_driver_t *camera_drivers[] = {

command_event.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "rewind.h"
3939
#include "system.h"
4040
#include "ui/ui_companion_driver.h"
41-
#include "dir_list_special.h"
41+
#include "list_special.h"
4242

4343
#ifdef HAVE_CHEEVOS
4444
#include "cheevos.h"

core_info.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#include "core_info.h"
2626
#include "configuration.h"
27-
#include "dir_list_special.h"
27+
#include "list_special.h"
2828
#include "config.def.h"
2929

3030
#ifdef HAVE_CONFIG_H

database_info.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include <retro_endianness.h>
2121

22-
#include "dir_list_special.h"
22+
#include "list_special.h"
2323
#include "database_info.h"
2424
#include "msg_hash.h"
2525
#include "verbosity.h"

dir_list_special.c

-78
This file was deleted.

dir_list_special.h

-38
This file was deleted.

gfx/video_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "../config.def.h"
3030
#include "../general.h"
3131
#include "../performance.h"
32-
#include "../string_list_special.h"
32+
#include "../list_special.h"
3333
#include "../libretro_version_1.h"
3434
#include "../system.h"
3535
#include "../command_event.h"

griffin/griffin.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,7 @@ FILE
644644
#include "../libretro-common/file/retro_dirent.c"
645645
#include "../libretro-common/streams/file_stream.c"
646646
#include "../libretro-common/file/retro_stat.c"
647-
#include "../dir_list_special.c"
648-
#include "../string_list_special.c"
647+
#include "../list_special.c"
649648
#include "../libretro-common/string/stdstring.c"
650649
#include "../libretro-common/file/nbio/nbio_stdio.c"
651650

input/input_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "../general.h"
2222
#include "../movie.h"
23-
#include "../string_list_special.h"
23+
#include "../list_special.h"
2424
#include "../verbosity.h"
2525

2626
#ifdef HAVE_COMMAND

input/input_hid_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <string.h>
2020

2121
#include "input_hid_driver.h"
22-
#include "../string_list_special.h"
22+
#include "../list_special.h"
2323
#include "../verbosity.h"
2424

2525
static hid_driver_t *hid_drivers[] = {

input/input_joypad_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "input_keymaps.h"
2424
#include "../general.h"
25-
#include "../string_list_special.h"
25+
#include "../list_special.h"
2626
#include "../verbosity.h"
2727

2828
static input_device_driver_t *joypad_drivers[] = {

string_list_special.c list_special.c

+63-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* RetroArch - A frontend for libretro.
2+
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
23
* Copyright (C) 2011-2016 - Daniel De Matteis
34
*
45
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@@ -15,7 +16,12 @@
1516

1617
#include <string.h>
1718

18-
#include "string_list_special.h"
19+
#include <lists/dir_list.h>
20+
21+
#include "list_special.h"
22+
#include "frontend/frontend_driver.h"
23+
#include "configuration.h"
24+
#include "core_info.h"
1925

2026
#ifdef HAVE_MENU
2127
#include "menu/menu_driver.h"
@@ -38,6 +44,62 @@
3844
#include "audio/audio_resampler_driver.h"
3945
#include "record/record_driver.h"
4046

47+
struct string_list *dir_list_new_special(const char *input_dir,
48+
enum dir_list_type type, const char *filter)
49+
{
50+
char ext_name[PATH_MAX_LENGTH];
51+
const char *dir = NULL;
52+
const char *exts = NULL;
53+
bool include_dirs = false;
54+
55+
settings_t *settings = config_get_ptr();
56+
57+
(void)input_dir;
58+
(void)settings;
59+
60+
switch (type)
61+
{
62+
case DIR_LIST_CORES:
63+
dir = settings->libretro_directory;
64+
65+
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
66+
return NULL;
67+
68+
exts = ext_name;
69+
break;
70+
case DIR_LIST_CORE_INFO:
71+
{
72+
core_info_list_t *list = NULL;
73+
core_info_ctl(CORE_INFO_CTL_LIST_GET, &list);
74+
75+
dir = input_dir;
76+
exts = list->all_ext;
77+
}
78+
break;
79+
case DIR_LIST_SHADERS:
80+
dir = settings->video.shader_dir;
81+
exts = "cg|cgp|glsl|glslp|slang|slangp";
82+
break;
83+
case DIR_LIST_COLLECTIONS:
84+
dir = settings->playlist_directory;
85+
exts = "lpl";
86+
break;
87+
case DIR_LIST_DATABASES:
88+
dir = settings->content_database;
89+
exts = "rdb";
90+
break;
91+
case DIR_LIST_PLAIN:
92+
dir = input_dir;
93+
exts = filter;
94+
break;
95+
case DIR_LIST_NONE:
96+
default:
97+
return NULL;
98+
}
99+
100+
return dir_list_new(dir, exts, include_dirs, type == DIR_LIST_CORE_INFO);
101+
}
102+
41103
struct string_list *string_list_new_special(enum string_list_type type,
42104
void *data, unsigned *len, size_t *list_size)
43105
{

string_list_special.h list_special.h

+18-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* RetroArch - A frontend for libretro.
2+
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
23
* Copyright (C) 2011-2016 - Daniel De Matteis
34
*
45
* RetroArch is free software: you can redistribute it and/or modify it under the terms
@@ -13,13 +14,25 @@
1314
* If not, see <http://www.gnu.org/licenses/>.
1415
*/
1516

16-
#ifndef _STRING_LIST_SPECIAL_H
17-
#define _STRING_LIST_SPECIAL_H
17+
#ifndef _LIST_SPECIAL_H
18+
#define _LIST_SPECIAL_H
1819

20+
#include <stdint.h>
1921
#include <stddef.h>
2022

2123
#include <lists/string_list.h>
2224

25+
enum dir_list_type
26+
{
27+
DIR_LIST_NONE = 0,
28+
DIR_LIST_CORES,
29+
DIR_LIST_CORE_INFO,
30+
DIR_LIST_DATABASES,
31+
DIR_LIST_COLLECTIONS,
32+
DIR_LIST_PLAIN,
33+
DIR_LIST_SHADERS
34+
};
35+
2336
enum string_list_type
2437
{
2538
STRING_LIST_NONE = 0,
@@ -37,6 +50,9 @@ enum string_list_type
3750
STRING_LIST_SUPPORTED_CORES_NAMES
3851
};
3952

53+
struct string_list *dir_list_new_special(const char *input_dir,
54+
enum dir_list_type type, const char *filter);
55+
4056
struct string_list *string_list_new_special(enum string_list_type type,
4157
void *data, unsigned *len, size_t *list_size);
4258

location/location_driver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "../general.h"
2222
#include "../system.h"
23-
#include "../string_list_special.h"
23+
#include "../list_special.h"
2424
#include "../verbosity.h"
2525

2626
static const location_driver_t *location_drivers[] = {

0 commit comments

Comments
 (0)