Lines Matching refs:dirent
40 * struct dirent (through namelist). Returns -1 if there were any errors.
44 #include <dirent.h>
60 typedef DECLARE_BLOCK(int, select_block, const struct dirent *);
61 typedef DECLARE_BLOCK(int, dcomp_block, const struct dirent **,
62 const struct dirent **);
69 scandir_b(const char *dirname, struct dirent ***namelist, select_block select,
72 scandir(const char *dirname, struct dirent ***namelist,
73 int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **,
74 const struct dirent **))
77 struct dirent *d, *p, **names = NULL;
86 names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *));
96 p = (struct dirent *)malloc(_GENERIC_DIRSIZ(d));
109 struct dirent **names2;
112 2 * sizeof(struct dirent *));
125 qsort_b(names, numitems, sizeof(struct dirent *), (void*)dcomp);
127 qsort_r(names, numitems, sizeof(struct dirent *),
147 alphasort(const struct dirent **d1, const struct dirent **d2)
156 int (*dc)(const struct dirent **, const struct dirent **);
158 dc = *(int (**)(const struct dirent **, const struct dirent **))thunk;
159 return (dc((const struct dirent **)p1, (const struct dirent **)p2));