2007-05-27 05:29:41 +02:00
|
|
|
|
2005-10-13 00:53:59 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
filter(const struct dirent *p)
|
|
|
|
{
|
|
|
|
int len;
|
|
|
|
len = strlen(p->d_name);
|
|
|
|
if (len > 2 && strcmp(p->d_name + len - 2, ".h") == 0)
|
|
|
|
return 1;
|
|
|
|
else if (len > 4 && strcmp(p->d_name + len - 4, ".cpp") == 0)
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
int i, n, x;
|
|
|
|
struct dirent **p;
|
|
|
|
n = scandir(".", &p, filter, alphasort);
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
printf("<a href=\"%s\">%s</a><br>\n", p[i]->d_name, p[i]->d_name);
|
|
|
|
}
|