version 1.16, 2000/02/02 13:47:47 |
version 1.17, 2000/03/26 16:21:32 |
|
|
{ |
{ |
#ifdef CLEANUP |
#ifdef CLEANUP |
dot->refCount -= 1; |
dot->refCount -= 1; |
Dir_Destroy((ClientData) dot); |
Dir_Destroy(dot); |
Dir_ClearPath(dirSearchPath); |
Dir_ClearPath(dirSearchPath); |
Lst_Destroy(dirSearchPath, NOFREE); |
Lst_Destroy(dirSearchPath, NOFREE); |
Dir_ClearPath(openDirectories); |
Dir_ClearPath(openDirectories); |
|
|
} |
} |
} |
} |
if (DEBUG(DIR)) { |
if (DEBUG(DIR)) { |
Lst_ForEach(expansions, DirPrintWord, (ClientData) 0); |
Lst_ForEach(expansions, DirPrintWord, NULL); |
fputc('\n', stdout); |
fputc('\n', stdout); |
} |
} |
} |
} |
|
|
} |
} |
entry = Hash_CreateEntry(&mtimes, (char *) file, |
entry = Hash_CreateEntry(&mtimes, (char *) file, |
(Boolean *)NULL); |
(Boolean *)NULL); |
Hash_SetValue(entry, (long)stb.st_mtime); |
/* XXX */ |
|
Hash_SetValue(entry, (ClientData)((long)stb.st_mtime)); |
nearmisses += 1; |
nearmisses += 1; |
return (file); |
return (file); |
} else { |
} else { |
|
|
printf("Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), |
printf("Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), |
name); |
name); |
} |
} |
Hash_SetValue(entry, (long)stb.st_mtime); |
/* XXX */ |
|
Hash_SetValue(entry, (ClientData)(long)stb.st_mtime); |
return (estrdup (name)); |
return (estrdup (name)); |
} else { |
} else { |
if (DEBUG(DIR)) { |
if (DEBUG(DIR)) { |
|
|
DIR *d; /* for reading directory */ |
DIR *d; /* for reading directory */ |
register struct dirent *dp; /* entry in directory */ |
register struct dirent *dp; /* entry in directory */ |
|
|
ln = Lst_Find(openDirectories, DirFindName, (ClientData)name); |
ln = Lst_Find(openDirectories, DirFindName, name); |
if (ln != NULL) { |
if (ln != NULL) { |
p = (Path *)Lst_Datum (ln); |
p = (Path *)Lst_Datum (ln); |
if (Lst_Member(path, (ClientData)p) == NULL) { |
if (Lst_Member(path, p) == NULL) { |
p->refCount += 1; |
p->refCount += 1; |
Lst_AtEnd(path, (ClientData)p); |
Lst_AtEnd(path, p); |
} |
} |
} else { |
} else { |
if (DEBUG(DIR)) { |
if (DEBUG(DIR)) { |
|
|
(void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL); |
(void)Hash_CreateEntry(&p->files, dp->d_name, (Boolean *)NULL); |
} |
} |
(void) closedir (d); |
(void) closedir (d); |
Lst_AtEnd(openDirectories, (ClientData)p); |
Lst_AtEnd(openDirectories, p); |
Lst_AtEnd(path, (ClientData)p); |
Lst_AtEnd(path, p); |
} |
} |
if (DEBUG(DIR)) { |
if (DEBUG(DIR)) { |
printf("done\n"); |
printf("done\n"); |
|
|
{ |
{ |
((Path *) p)->refCount += 1; |
((Path *) p)->refCount += 1; |
|
|
return ((ClientData)p); |
return p; |
} |
} |
|
|
/*- |
/*- |
|
|
if (p->refCount == 0) { |
if (p->refCount == 0) { |
LstNode ln; |
LstNode ln; |
|
|
ln = Lst_Member (openDirectories, (ClientData)p); |
ln = Lst_Member(openDirectories, p); |
Lst_Remove(openDirectories, ln); |
Lst_Remove(openDirectories, ln); |
|
|
Hash_DeleteTable (&p->files); |
Hash_DeleteTable (&p->files); |
|
|
{ |
{ |
Path *p; |
Path *p; |
while ((p = (Path *)Lst_DeQueue(path)) != NULL) |
while ((p = (Path *)Lst_DeQueue(path)) != NULL) |
Dir_Destroy((ClientData)p); |
Dir_Destroy(p); |
} |
} |
|
|
|
|
|
|
|
|
for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) { |
for (ln = Lst_First(path2); ln != NULL; ln = Lst_Succ(ln)) { |
p = (Path *)Lst_Datum(ln); |
p = (Path *)Lst_Datum(ln); |
if (Lst_Member(path1, (ClientData)p) == NULL) { |
if (Lst_Member(path1, p) == NULL) { |
p->refCount += 1; |
p->refCount += 1; |
Lst_AtEnd(path1, (ClientData)p); |
Lst_AtEnd(path1, p); |
} |
} |
} |
} |
} |
} |
|
|
Dir_PrintPath (path) |
Dir_PrintPath (path) |
Lst path; |
Lst path; |
{ |
{ |
Lst_ForEach (path, DirPrintDir, (ClientData)0); |
Lst_ForEach(path, DirPrintDir, NULL); |
} |
} |