Lines Matching refs:dp
107 * search for file using directories in dp
111 search(register struct ppfile* fp, register struct ppdirs* dp, int type, int flags)
147 dp ? (dp->index == INC_PREFIX ? "pre" : dp->index == INC_LOCAL ? "lcl" : dp->index == INC_VENDOR ? "vnd" : "std") : NiL,
148 dp ? dp->name : NiL,
161 for (index = -1; dp; dp = dp->next)
162 if (dp->type & need)
164 message((-3, "search: fp=%s need=%02x index=%d dp=%s type=%02x index=%d", fp->name, need, index, dp->name, dp->type, dp->index));
166 if (!(dp->type & (TYPE_ARCHIVE|TYPE_DIRECTORY)))
170 if (stat(dp->name, &st))
172 message((-3, "search: omit %s", dp->name));
173 dp->type = 0;
191 if (!(sp = sfopen(NiL, dp->name, "r")))
193 error(ERROR_SYSTEM|1, "%s: ignored -- cannot open", dp->name);
194 dp->type = 0;
201 error(1, "%s: ignored -- not a directory or archive", dp->name);
202 dp->type = 0;
210 dp->type |= TYPE_ARCHIVE;
229 dp->type |= TYPE_CHECKPOINT;
239 if (e = strrchr(dp->name, '/'))
242 dp->name = ".";
248 dp->name = strdup(t);
259 error(1, "%s: ignored -- cannot load archive", dp->name);
260 dp->type = 0;
294 ap->archive = dp;
298 xp->flags |= INC_MEMBER(dp->index);
299 xp->bound[dp->index] = (struct ppfile*)ap;
300 if (pp.test & 0x0020) error(1, "VDB#%d %s %s index=%d data=<%lu,%lu>", __LINE__, dp->name, xp->name, index, ap->offset, ap->size);
308 (pp.pool.input || !(dp->type & TYPE_CHECKPOINT))
310 !(dp->type & TYPE_CHECKPOINT)
312 && (dp->info.buffer = sfreserve(sp, off, 0)))
313 dp->type |= TYPE_BUFFER;
316 dp->info.sp = sp;
324 dp->type |= TYPE_DIRECTORY;
329 if (prefix && *fp->name != '/' && dp->index != INC_PREFIX)
331 if (dp->type & TYPE_DIRECTORY)
334 for (up = dp->info.subdir; up; up = up->next)
341 up->type = dp->type;
342 up->next = dp->info.subdir;
343 dp->info.subdir = up;
344 if (!*dp->name)
347 sfsprintf(t = pp.path, PATH_MAX - 1, "%s/%s", dp->name, prefix);
359 if (!(flags & SEARCH_NEXT) && index != dp->index && (!(need & TYPE_HOSTED) || dp->index == INC_STANDARD) && (!(need & TYPE_VENDOR) || dp->index == INC_VENDOR))
363 index = dp->index;
369 if (*fp->name == '/' || !*dp->name)
372 sfsprintf(pp.path, PATH_MAX - 1, "%s/%s", dp->name, fp->name);
377 if (dp->type & TYPE_HOSTED)
395 while (dp->next && dp->next->index == index)
396 dp = dp->next;
397 message((-3, "search: omit %s/%s", dp->name, fp->name));
417 if (*fp->name == '/' || !*dp->name)
420 sfsprintf(pp.path, PATH_MAX - 1, "%s/%s", dp->name, fp->name);
468 if (pp.test & 0x0040) error(1, "SEARCH#%d dir=%s%s%s%s%s file=%s%s path=%s index=%d", __LINE__, dp->name, (dp->type & TYPE_ARCHIVE) ? " ARCHIVE" : "", (dp->type & TYPE_BUFFER) ? " BUFFER" : "", (dp->type & TYPE_CHECKPOINT) ? " CHECKPOINT" : "", (dp->type & TYPE_DIRECTORY) ? " DIRECTORY" : "", fp->name, (fp->flags & INC_MEMBER(index)) ? " MEMBER" : "", pp.path, index);
469 if ((fp->flags & INC_MEMBER(index)) && ((struct ppmember*)fp->bound[index])->archive == dp)
475 else if (!(dp->type & TYPE_DIRECTORY))
485 pp.found = dp;
488 if (dp->c)
495 else if (!(markhosted = (dp->type & TYPE_HOSTED)) && dp->index == INC_PREFIX && (pp.mode & (FILEDEPS|HEADERDEPS|INIT)) == FILEDEPS)
497 up = dp;
498 while ((up = up->next) && !streq(up->name, dp->name));
599 register struct ppdirs* dp;
703 dp = pp.stddirs->next;
706 dp = pp.lcldirs;
707 if (dp == pp.firstdir)
716 dp->name = ppsetfile(error_info.file)->name;
720 dp->name = "";
746 if ((fd = search(xp, dp, type, flags)) >= 0)
753 if ((fd = search(fp, dp, type, flags)) < 0)