Lines Matching refs:dp
48 struct dir_list *dp; in add_to_dirlist() local
50 dp = malloc(sizeof(struct dir_list)); in add_to_dirlist()
51 if (!dp) in add_to_dirlist()
53 dp->name = malloc(strlen(name)+1); in add_to_dirlist()
54 if (!dp->name) { in add_to_dirlist()
55 free(dp); in add_to_dirlist()
58 strcpy(dp->name, name); in add_to_dirlist()
59 dp->next = *list; in add_to_dirlist()
60 *list = dp; in add_to_dirlist()
68 struct dir_list *dp, *next; in free_dirlist() local
70 for (dp = *list; dp; dp = next) { in free_dirlist()
71 next = dp->next; in free_dirlist()
72 free(dp->name); in free_dirlist()
73 free(dp); in free_dirlist()
82 struct dirent *dp; in scan_dir() local
90 dp = readdir(dir); in scan_dir()
91 while (dp) { in scan_dir()
92 if (dirlen + strlen(dp->d_name) + 2 >= sizeof(path)) in scan_dir()
94 if (dp->d_name[0] == '.' && in scan_dir()
95 ((dp->d_name[1] == 0) || in scan_dir()
96 ((dp->d_name[1] == '.') && (dp->d_name[2] == 0)))) in scan_dir()
98 sprintf(path, "%s/%s", dirname, dp->d_name); in scan_dir()
114 dp = readdir(dir); in scan_dir()