2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
11 int filter(const struct dirent
*de
)
13 return !strcmp(de
->d_name
, "T");
16 void testscandir(const char *dir
,
17 int (*select
)(const struct dirent
*),
18 int (*compar
)(const struct dirent
**, const struct dirent
**))
21 struct dirent
**namelist
;
23 printf("\nscandir dir %s filter %p sort %p\n", dir
, select
, compar
);
25 int res
= scandir(dir
, &namelist
, select
, compar
);
26 printf("result %d\n", res
);
33 for (i
=0 ; i
< res
; i
++)
35 printf("%d %s\n", i
, namelist
[i
]->d_name
);
44 testscandir("ram:", NULL
, NULL
);
45 testscandir("ram:", NULL
, alphasort
);
46 testscandir("ram:", filter
, NULL
);