Lines Matching refs:dirent
35 #include "dirent.h"
325 static struct dirent **scandir_get_file_list(const char *dir, int *num, int(*filter)(const struct dirent *))
330 struct dirent **list = NULL;
331 struct dirent **newList = NULL;
332 struct dirent *ent = NULL;
333 struct dirent *p = NULL;
341 list = (struct dirent **)malloc(listSize * sizeof(struct dirent *));
354 newList = (struct dirent **)malloc(listSize * sizeof(struct dirent *));
359 err = memcpy_s(newList, listSize * sizeof(struct dirent *), list, n * sizeof(struct dirent *));
368 p = (struct dirent *)malloc(sizeof(struct dirent));
373 (void)memcpy_s((void *)p, sizeof(struct dirent), (void *)ent, sizeof(struct dirent));
391 int scandir(const char *dir, struct dirent ***namelist,
392 int(*filter)(const struct dirent *),
393 int(*compar)(const struct dirent **, const struct dirent **))
396 struct dirent **list = NULL;
408 *namelist = (struct dirent **)malloc(n * sizeof(struct dirent *));
412 (void)memcpy_s(*namelist, n * sizeof(struct dirent *), list, n * sizeof(struct dirent *));
421 qsort((void *)*namelist, (size_t)n, sizeof(struct dirent *), (int (*)(const void *, const void *))*compar);
427 int alphasort(const struct dirent **a, const struct dirent **b)
442 static char *ls_get_fullpath(const char *path, struct dirent *pdirent)
582 struct dirent *pdirent = NULL;