mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 23:07:46 -04:00
1.31 release
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@80 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
53c908bb97
commit
0d0558bde9
2 changed files with 22 additions and 3 deletions
23
gp2x/menu.c
23
gp2x/menu.c
|
@ -286,6 +286,25 @@ static int scandir_cmp(const void *p1, const void *p2)
|
||||||
return alphasort(d1, d2);
|
return alphasort(d1, d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *filter_exts[] = { ".mp3", ".MP3", ".srm", ".brm", "s.gz", ".mds", "bcfg", ".txt", ".htm", "html", ".gpe" };
|
||||||
|
|
||||||
|
static int scandir_filter(const struct dirent *ent)
|
||||||
|
{
|
||||||
|
const char *p;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (ent == NULL || ent->d_name == NULL) return 0;
|
||||||
|
if (strlen(ent->d_name) < 5) return 1;
|
||||||
|
|
||||||
|
p = ent->d_name + strlen(ent->d_name) - 4;
|
||||||
|
|
||||||
|
for (i = 0; i < sizeof(filter_exts)/sizeof(filter_exts[0]); i++)
|
||||||
|
{
|
||||||
|
if (strcmp(p, filter_exts[i]) == 0) return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static char *romsel_loop(char *curr_path)
|
static char *romsel_loop(char *curr_path)
|
||||||
{
|
{
|
||||||
|
@ -305,10 +324,10 @@ static char *romsel_loop(char *curr_path)
|
||||||
fname = p+1;
|
fname = p+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
n = scandir(curr_path, &namelist, 0, scandir_cmp);
|
n = scandir(curr_path, &namelist, scandir_filter, scandir_cmp);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
// try root
|
// try root
|
||||||
n = scandir(curr_path, &namelist, 0, scandir_cmp);
|
n = scandir("/", &namelist, scandir_filter, scandir_cmp);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
// oops, we failed
|
// oops, we failed
|
||||||
printf("dir: "); printf(curr_path); printf("\n");
|
printf("dir: "); printf(curr_path); printf("\n");
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define VERSION "1.30"
|
#define VERSION "1.31"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue