Well i guess you could use the directory reading functions in the POSIX c library.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/stat.h>
void ListFiles(const char* path)
{
DIR *dir;
struct stat statx;
struct dirent *ent;
if ((dir = opendir(path)))
{
while ((ent = readdir(dir)))
{
char fullName[1024];
strncpy(fullName, path, sizeof(fullName));
strncat(fullName, ent->d_name, sizeof(fullName));
stat(fullName, &statx);
if (!(statx.st_mode & S_IFDIR)) //remove this if you also want to list sub directories
printf("%s\n", fullName);
}
}
closedir(dir);
}
I havnt tested it but that should list all the files in a directory. You can use ent->d_name and check it's extension.