diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-04-30 17:28:34 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2001-04-30 17:28:34 (GMT) |
commit | 3e8e2e531ac41a9d4729375151b6af6493a61fd7 (patch) | |
tree | e2fe643e6fc6aabac8311560e2258318c1dead5a /src/doxysearch.cpp | |
parent | 9a1a3728724df58e6fc9196651f8e8c8f23f1e2d (diff) | |
download | Doxygen-3e8e2e531ac41a9d4729375151b6af6493a61fd7.zip Doxygen-3e8e2e531ac41a9d4729375151b6af6493a61fd7.tar.gz Doxygen-3e8e2e531ac41a9d4729375151b6af6493a61fd7.tar.bz2 |
Release-1.2.7
Diffstat (limited to 'src/doxysearch.cpp')
-rw-r--r-- | src/doxysearch.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/doxysearch.cpp b/src/doxysearch.cpp index c4e69b3..3b5b227 100644 --- a/src/doxysearch.cpp +++ b/src/doxysearch.cpp @@ -55,11 +55,12 @@ struct FileInfo { - FileInfo() { f=0; url=0; } + FileInfo() { name[0]='\0'; f=0; url=0; } ~FileInfo() { if (f) fclose(f); delete[] url; } FILE *f; + char name[MAXSTRLEN]; int index; int refOffset; char *url; @@ -396,8 +397,11 @@ void searchIndex(const char *word,SearchResults *results) FileInfo *fi=fileList.first; while (fi) { + fi->f = fopen(fi->name, "rb"); fseek(fi->f,8,SEEK_SET); searchRecursive(results,fi,word); + fclose(fi->f); + fi->f=0; fi=fi->next; } @@ -516,6 +520,10 @@ void generateResults(SearchResults *sr) if (skipEntries == 0) { SearchDoc *d=docPtrArray[i]; + if (d->fileInfo->f == 0) + { + d->fileInfo->f = fopen(d->fileInfo->name, "rb"); + } FILE *f=d->fileInfo->f; fseek(f,d->fileInfo->refOffset+d->index*4,SEEK_SET); int offset=readInt(f); @@ -531,6 +539,11 @@ void generateResults(SearchResults *sr) rank*2+55, 255-rank*2, rank, d->fileInfo->url, htmlName, linkName); pageEntries--; + if (d->fileInfo->f != 0) + { + fclose(d->fileInfo->f); + d->fileInfo->f = 0; + } } else { @@ -946,6 +959,7 @@ int main(int argc,char **argv) FileInfo *fi=fileList.add(); FILE *g; + strcpy(fi->name,indexFile); if ((fi->f=fopen(indexFile,"rb"))==NULL) { message("Error: could not open index file %s\n",indexFile); @@ -982,6 +996,8 @@ int main(int argc,char **argv) } // read and store the offset to the link index fi->refOffset=readInt(fi->f); + fclose(fi->f); + fi->f = 0; } char *word; |