Lines Matching +defs:pathname +defs:name

18  * 3. Neither the name of the University nor the names of its contributors
55 * 4. Neither the name of the University nor the names of its contributors
89 * Returns true if the name given it needs to
139 * name of the directory and the names of all the files in the directory.
192 * determine if the file could be found using just the name given. When this
205 * directory. The name is not normalized in any way, that is, "."
211 char *name;
230 /* A list of cached directories, with fast lookup by directory name. */
274 CachedDir_New(const char *name)
278 dir->name = bmake_strdup(name);
284 DEBUG2(DIR, "CachedDir %p new for \"%s\"\n", dir, dir->name);
297 dir, dir->refCount, dir->name);
310 dir, dir->refCount, dir->name);
317 DEBUG2(DIR, "CachedDir %p free for \"%s\"\n", dir, dir->name);
320 OpenDirs_Remove(&openDirs, dir->name);
322 free(dir->name);
359 dir->refCount, dir->name);
369 OpenDirs_Find(OpenDirs *odirs, const char *name)
371 CachedDirListNode *ln = HashTable_FindValue(&odirs->table, name);
378 if (HashTable_FindEntry(&odirs->table, cdir->name) != NULL)
381 HashTable_Set(&odirs->table, cdir->name, odirs->list.last);
385 OpenDirs_Remove(OpenDirs *odirs, const char *name)
387 HashEntry *he = HashTable_FindEntry(&odirs->table, name);
401 cached_stats(const char *pathname, struct cached_stat *out_cst,
409 if (pathname == NULL || pathname[0] == '\0')
412 cst = HashTable_FindValue(tbl, pathname);
416 Targ_FmtTime(cst->cst_mtime), pathname);
420 rc = (useLstat ? lstat : stat)(pathname, &sys_st);
429 HashTable_Set(tbl, pathname, cst);
437 Targ_FmtTime(sys_st.st_mtime), pathname);
443 cached_stat(const char *pathname, struct cached_stat *cst)
445 return cached_stats(pathname, cst, false, false);
449 cached_lstat(const char *pathname, struct cached_stat *cst)
451 return cached_stats(pathname, cst, true, false);
546 Global_Append(".PATH", dotLast->name);
552 Global_Append(".PATH", dot->name);
554 Global_Append(".PATH", cur->name);
563 Global_Append(".PATH", dir->name);
568 Global_Append(".PATH", dot->name);
570 Global_Append(".PATH", cur->name);
586 Global_Append(".SYSPATH", dir->name);
592 * See if the given name has any wildcard characters in it and all braces and
600 Dir_HasWildcards(const char *name)
606 for (p = name; *p != '\0'; p++) {
646 const char *dirName = dir->name;
958 DEBUG1(DIR, " %s ...\n", dir->name);
963 file = str_concat3(dir->name, "/", base);
972 * Find if 'name' exists in 'dir'.
976 DirLookupSubdir(CachedDir *dir, const char *name)
980 ? bmake_strdup(name)
981 : str_concat3(dir->name, "/", name);
994 * Find if 'name' (which has basename 'base') exists in 'dir'.
999 DirLookupAbs(CachedDir *dir, const char *name, const char *base)
1001 const char *dnp; /* pointer into dir->name */
1002 const char *np; /* pointer into name */
1004 DEBUG1(DIR, " %s ...\n", dir->name);
1008 * exactly matches the entire name of the current search
1012 for (dnp = dir->name, np = name;
1025 DEBUG1(DIR, " returning %s\n", name);
1026 return bmake_strdup(name);
1034 DirFindDot(const char *name, const char *base)
1041 return bmake_strdup(name);
1045 DEBUG1(DIR, " in ${.CURDIR} = %s\n", cur->name);
1048 return str_concat3(cur->name, "/", base);
1056 const char *name, char **out_file)
1067 if ((file = DirLookupSubdir(dot, name)) != NULL)
1071 (file = DirLookupSubdir(cur, name)) != NULL)
1084 if ((file = DirLookupSubdir(dir, name)) != NULL)
1091 if ((file = DirLookupSubdir(dot, name)) != NULL)
1095 (file = DirLookupSubdir(cur, name)) != NULL)
1101 * Already checked by the given name, since . was in
1118 const char *name, const char *base, char **out_file)
1126 ((file = DirLookupAbs(cur, name, base)) != NULL))
1133 if ((file = DirLookupAbs(dir, name, base)) != NULL)
1138 ((file = DirLookupAbs(cur, name, base)) != NULL))
1153 * Find the file with the given name along the given search path.
1156 * name the file to find
1164 FindFile(const char *name, SearchPath *path, bool isinclude)
1170 const char *base = str_basename(name);
1172 DEBUG1(DIR, "Searching for %s ...", name);
1194 if (base == name || (base - name == 2 && *name == '.')) {
1199 * which contains the final component of the given name. If
1200 * such a file is found, return its pathname.
1209 if (!seenDotLast && (file = DirFindDot(name, base)) != NULL)
1220 if (seenDotLast && (file = DirFindDot(name, base)) != NULL)
1224 if (base == name) {
1233 if (name[0] != '/') {
1234 if (FindFileRelative(path, seenDotLast, name, &file))
1237 if (FindFileAbsolute(path, seenDotLast, name, base, &file))
1251 DEBUG1(DIR, " Looking for \"%s\" ...\n", name);
1254 if (cached_stat(name, &cst) == 0)
1255 return bmake_strdup(name);
1262 * Find the file with the given name along the given search path.
1265 * name the file to find
1272 Dir_FindFile(const char *name, SearchPath *path)
1274 return FindFile(name, path, false);
1278 * Find the include file with the given name along the given search path.
1281 * name the file to find
1288 Dir_FindInclude(const char *name, SearchPath *path)
1290 return FindFile(name, path, true);
1350 const char *base = str_basename(gn->name);
1351 if (base == gn->name)
1370 makeDependfile, gn->name, fullName);
1383 fullName = Dir_FindFile(gn->name, Suff_FindPath(gn));
1390 gn->name, fullName != NULL ? fullName : "(not found)");
1394 fullName = bmake_strdup(gn->name);
1448 CacheNewDir(const char *name, SearchPath *path)
1454 if ((d = opendir(name)) == NULL) {
1455 DEBUG1(DIR, "Caching %s ... not found\n", name);
1459 DEBUG1(DIR, "Caching %s ...\n", name);
1461 dir = CachedDir_New(name);
1483 DEBUG1(DIR, "Caching %s done\n", name);
1488 * Read the list of filenames in the directory 'name' and store the result
1496 * name The name of the directory to add.
1497 * The name is not normalized in any way.
1506 SearchPath_Add(SearchPath *path, const char *name)
1509 if (path != NULL && strcmp(name, ".DOTLAST") == 0) {
1515 if (strcmp(pathDir->name, name) == 0)
1524 CachedDir *dir = OpenDirs_Find(&openDirs, name);
1532 return CacheNewDir(name, path);
1570 Buf_AddStr(&buf, dir->name);
1642 dir->refCount, dir->hits, dir->name);
1653 debug_printf("%s ", dir->name);