Lines Matching refs:dirent
40 * struct dirent (through namelist). Returns -1 if there were any errors.
44 #include <dirent.h>
53 * entry. This requires the amount of space in struct dirent without the
59 ((sizeof(struct dirent) - sizeof(dp)->d_name) + \
63 scandir(const char *dirname, struct dirent ***namelist,
64 int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **,
65 const struct dirent **))
67 struct dirent *d, *p, **names = NULL;
76 names = (struct dirent **)malloc(arraysz * sizeof(struct dirent *));
86 p = (struct dirent *)malloc(DIRSIZ(d));
99 struct dirent **names2;
101 names2 = (struct dirent **)realloc((char *)names,
102 (arraysz * 2) * sizeof(struct dirent *));
114 qsort_r(names, nitems, sizeof(struct dirent *),
132 alphasort(const struct dirent **d1, const struct dirent **d2)
141 int (*dc)(const struct dirent **, const struct dirent **);
143 dc = *(int (**)(const struct dirent **, const struct dirent **))thunk;
144 return (dc((const struct dirent **)p1, (const struct dirent **)p2));