mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-27 10:10:57 +00:00
Create content_playlist_get_index_by_path -make pointers
non-const
This commit is contained in:
parent
4c48fae242
commit
7ab6e9a469
25
playlist.c
25
playlist.c
@ -49,6 +49,31 @@ void content_playlist_get_index(content_playlist_t *playlist,
|
||||
*core_name = playlist->entries[idx].core_name;
|
||||
}
|
||||
|
||||
void content_playlist_get_index_by_path(content_playlist_t *playlist,
|
||||
const char *search_path,
|
||||
char **path, char **core_path,
|
||||
char **core_name)
|
||||
{
|
||||
size_t i;
|
||||
if (!playlist)
|
||||
return;
|
||||
|
||||
for (i = 0; i < playlist->size; i++)
|
||||
{
|
||||
if (strcmp(playlist->entries[i].path, search_path) != 0)
|
||||
continue;
|
||||
|
||||
if (path)
|
||||
*path = playlist->entries[i].path;
|
||||
if (core_path)
|
||||
*core_path = playlist->entries[i].core_path;
|
||||
if (core_name)
|
||||
*core_name = playlist->entries[i].core_name;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* content_playlist_free_entry:
|
||||
* @entry : Playlist entry handle.
|
||||
|
@ -104,6 +104,11 @@ void content_playlist_push(content_playlist_t *playlist,
|
||||
const char *path, const char *core_path,
|
||||
const char *core_name);
|
||||
|
||||
void content_playlist_get_index_by_path(content_playlist_t *playlist,
|
||||
const char *search_path,
|
||||
char **path, char **core_path,
|
||||
char **core_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user