scandir filter by substring
<p>I am trying to filter a <code>scandir</code> by substrings. I have my function working but just with a predetermined string.</p>

<pre><code>int nameFilter(const struct dirent *entry) {
    if (strstr(entry-&gt;d_name, "example") != NULL)
        return 1;
    return 0;
}
</code></pre>

<p>But I can't find a way where I can filter an <code>argv[i]</code> because there is no way I can declare it.</p>

<pre><code>int (*filter)(const struct dirent *)
</code></pre>

<p>Do you guys know any solution?</p>