Lines Matching refs:dp
52 struct dir_list *dp; in add_to_dirlist() local
54 dp = malloc(sizeof(struct dir_list)); in add_to_dirlist()
55 if (!dp) in add_to_dirlist()
57 dp->name = malloc(strlen(name)+1); in add_to_dirlist()
58 if (!dp->name) { in add_to_dirlist()
59 free(dp); in add_to_dirlist()
62 strcpy(dp->name, name); in add_to_dirlist()
63 dp->next = *list; in add_to_dirlist()
64 *list = dp; in add_to_dirlist()
72 struct dir_list *dp, *next; in free_dirlist() local
74 for (dp = *list; dp; dp = next) { in free_dirlist()
75 next = dp->next; in free_dirlist()
76 free(dp->name); in free_dirlist()
77 free(dp); in free_dirlist()
86 struct dirent *dp; in scan_dir() local
94 dp = readdir(dir); in scan_dir()
95 while (dp) { in scan_dir()
96 if (dirlen + strlen(dp->d_name) + 2 >= sizeof(path)) in scan_dir()
98 if (dp->d_name[0] == '.' && in scan_dir()
99 ((dp->d_name[1] == 0) || in scan_dir()
100 ((dp->d_name[1] == '.') && (dp->d_name[2] == 0)))) in scan_dir()
102 sprintf(path, "%s/%s", dirname, dp->d_name); in scan_dir()
119 dp = readdir(dir); in scan_dir()