Yes, the filter argument is a function pointer that lets you pass in a function to filter the results. You might want to write a function like the one below and pass it by name as the value for filter.
int file_select(const struct dirent *entry)
{
return strcmp(entry->d_name, "exe");
}