From f493f3c2f526358b6d3c2f12bb3a32b1e48dfdde Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Wed, 13 May 2009 19:01:05 +0000 Subject: [PATCH] *Added Quicksort to the MP3 List. --- source/mp3s.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/mp3s.c b/source/mp3s.c index 44ada7d8..c70f4dd4 100644 --- a/source/mp3s.c +++ b/source/mp3s.c @@ -103,6 +103,12 @@ return 0; } */ +s32 filenamescmp(const void *a, const void *b) +{ + /* Compare strings */ + return stricmp((char *)a, (char *)b); +} + int GetFiles(char * mp3path) { int countmp3 = 0; @@ -127,5 +133,8 @@ if (dir == NULL) //If empty } } } + + qsort(mp3files, countmp3, sizeof(char[30]), filenamescmp); + return countmp3; }