void walker(const gchar *path) {
DIR *d;
struct dirent *dir;
gchar *filename=NULL, *extension=NULL;
d = opendir(path);
GList *pList=NULL;
char *pFile=NULL;
if (d) {
while ((dir = readdir(d)) != NULL) {
if (strcmp(dir->d_name, ".") == 0) continue;
if (strcmp(dir->d_name, "..") == 0) continue;
filename = dir->d_name;
extension = strchr(filename,'.');
if (strcmp(extension, ".png") == 0 || strcmp(extension, ".jpg") == 0 || strcmp(extension, ".xpm") == 0) {
printf("Adding %s to list\n", dir->d_name);
*pFile = g_new (char, 1);
*pFile = dir->d_name;
pList = g_list_append (pList, pFile);
}
}
closedir(d);
}
_printList(pList);
}