Create content_playlist_get_index_by_path -make pointers

non-const
This commit is contained in:
twinaphex 2015-02-03 04:12:32 +01:00
parent 4c48fae242
commit 7ab6e9a469
2 changed files with 30 additions and 0 deletions

View File

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

View File

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