mirror of
https://github.com/libretro/RetroArch
synced 2025-01-14 09:43:27 +00:00
(playlist) Add content_playlist_qsort()
This commit is contained in:
parent
e66c8cdaf0
commit
a0457d77f3
@ -402,3 +402,9 @@ error:
|
|||||||
content_playlist_free(playlist);
|
content_playlist_free(playlist);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void content_playlist_qsort(content_playlist_t *playlist, content_playlist_sort_fun_t *fn)
|
||||||
|
{
|
||||||
|
qsort(playlist->entries, playlist->size, sizeof(content_playlist_entry_t),
|
||||||
|
(int (*)(const void *, const void *))fn);
|
||||||
|
}
|
||||||
|
@ -43,6 +43,9 @@ typedef struct content_playlist
|
|||||||
char *conf_path;
|
char *conf_path;
|
||||||
} content_playlist_t;
|
} content_playlist_t;
|
||||||
|
|
||||||
|
typedef int (content_playlist_sort_fun_t)(const content_playlist_entry_t *a,
|
||||||
|
const content_playlist_entry_t *b);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* content_playlist_init:
|
* content_playlist_init:
|
||||||
* @path : Path to playlist contents file.
|
* @path : Path to playlist contents file.
|
||||||
@ -126,6 +129,8 @@ void content_playlist_get_index_by_path(content_playlist_t *playlist,
|
|||||||
|
|
||||||
void content_playlist_write_file(content_playlist_t *playlist);
|
void content_playlist_write_file(content_playlist_t *playlist);
|
||||||
|
|
||||||
|
void content_playlist_qsort(content_playlist_t *playlist, content_playlist_sort_fun_t *fn);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user