mirror of
https://github.com/libretro/RetroArch
synced 2025-03-21 13:20:52 +00:00
Update libretro-common
This commit is contained in:
parent
4750e87c76
commit
ac18671ead
@ -64,6 +64,7 @@ struct RDIR
|
||||
#if defined(_WIN32)
|
||||
WIN32_FIND_DATA entry;
|
||||
HANDLE directory;
|
||||
bool next;
|
||||
#elif defined(VITA) || defined(PSP)
|
||||
SceUID directory;
|
||||
SceIoDirent entry;
|
||||
@ -118,7 +119,12 @@ bool retro_dirent_error(struct RDIR *rdir)
|
||||
int retro_readdir(struct RDIR *rdir)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return (FindNextFile(rdir->directory, &rdir->entry) != 0);
|
||||
if(rdir->next)
|
||||
return (FindNextFile(rdir->directory, &rdir->entry) != 0);
|
||||
else {
|
||||
rdir->next = true;
|
||||
return (rdir->directory != INVALID_HANDLE_VALUE);
|
||||
}
|
||||
#elif defined(VITA) || defined(PSP)
|
||||
return (sceIoDread(rdir->directory, &rdir->entry) > 0);
|
||||
#elif defined(__CELLOS_LV2__)
|
||||
@ -152,7 +158,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir)
|
||||
* Returns: true if directory listing entry is
|
||||
* a directory, false if not.
|
||||
*/
|
||||
bool retro_dirent_is_dir(struct RDIR *rdir, const char *path)
|
||||
bool retro_dirent_is_dir(struct RDIR *rdir)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
const WIN32_FIND_DATA *entry = (const WIN32_FIND_DATA*)&rdir->entry;
|
||||
@ -172,11 +178,13 @@ bool retro_dirent_is_dir(struct RDIR *rdir, const char *path)
|
||||
if (entry->d_type == DT_DIR)
|
||||
return true;
|
||||
/* This can happen on certain file systems. */
|
||||
const char *path = retro_dirent_get_name(rdir);
|
||||
if (entry->d_type == DT_UNKNOWN || entry->d_type == DT_LNK)
|
||||
return path_is_directory(path);
|
||||
return false;
|
||||
#else
|
||||
/* dirent struct doesn't have d_type, do it the slow way ... */
|
||||
const char *path = retro_dirent_get_name(rdir);
|
||||
return path_is_directory(path);
|
||||
#endif
|
||||
}
|
||||
|
@ -43,14 +43,13 @@ const char *retro_dirent_get_name(struct RDIR *rdir);
|
||||
*
|
||||
* retro_dirent_is_dir:
|
||||
* @rdir : pointer to the directory entry.
|
||||
* @path : path to the directory entry.
|
||||
*
|
||||
* Is the directory listing entry a directory?
|
||||
*
|
||||
* Returns: true if directory listing entry is
|
||||
* a directory, false if not.
|
||||
*/
|
||||
bool retro_dirent_is_dir(struct RDIR *rdir, const char *path);
|
||||
bool retro_dirent_is_dir(struct RDIR *rdir);
|
||||
|
||||
void retro_closedir(struct RDIR *rdir);
|
||||
|
||||
|
@ -28,6 +28,10 @@
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* path_is_directory:
|
||||
* @path : path
|
||||
@ -54,4 +58,8 @@ int32_t path_get_size(const char *path);
|
||||
**/
|
||||
bool mkdir_norecurse(const char *dir);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -26,8 +26,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
enum intfstream_type
|
||||
|
@ -188,7 +188,7 @@ struct string_list *dir_list_new(const char *dir,
|
||||
const char *file_ext = path_get_extension(name);
|
||||
|
||||
fill_pathname_join(file_path, dir, name, sizeof(file_path));
|
||||
is_dir = retro_dirent_is_dir(entry, file_path);
|
||||
is_dir = retro_dirent_is_dir(entry);
|
||||
|
||||
ret = parse_dir_entry(name, file_path, is_dir,
|
||||
include_dirs, include_compressed, list, ext_list, file_ext);
|
||||
|
@ -73,7 +73,7 @@ bool file_list_prepend(file_list_t *list,
|
||||
|
||||
for (i = list->size -1; i > 0; i--)
|
||||
{
|
||||
struct item_file *copy = (struct item_file*)calloc(1, sizeof(struct item_file));
|
||||
struct item_file *copy = calloc(1, sizeof(struct item_file));
|
||||
|
||||
memcpy(copy, &list->list[i-1], sizeof(struct item_file));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user