8 #define _DTIFY(DT) [DT] #DT
9 const char * const types
[] = {
21 int main(int argc
, char *argv
[])
25 const char *mydir
= (argc
== 1 ? "/" : argv
[1]);
27 if ((dirh
= opendir(mydir
)) == NULL
) {
32 printf("readdir() says:\n");
33 while ((de
= readdir(dirh
)) != NULL
)
34 printf("\tdir entry %s: %s\n", types
[de
->d_type
], de
->d_name
);