|
a/src/index/indexer.cpp |
|
b/src/index/indexer.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.8 2005-03-17 15:35:49 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: indexer.cpp,v 1.9 2005-03-25 09:40:27 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
#include <stdio.h>
|
4 |
#include <stdio.h>
|
5 |
#include <sys/stat.h>
|
5 |
#include <sys/stat.h>
|
6 |
|
6 |
|
7 |
#include <strings.h>
|
7 |
#include <strings.h>
|
|
... |
|
... |
144 |
if (!db.needUpdate(fn, stp)) {
|
144 |
if (!db.needUpdate(fn, stp)) {
|
145 |
LOGDEB(("indexfile: up to date: %s\n", fn.c_str()));
|
145 |
LOGDEB(("indexfile: up to date: %s\n", fn.c_str()));
|
146 |
return FsTreeWalker::FtwOk;
|
146 |
return FsTreeWalker::FtwOk;
|
147 |
}
|
147 |
}
|
148 |
|
148 |
|
|
|
149 |
FileInterner interner(fn, config, tmpdir);
|
|
|
150 |
FileInterner::Status fis = FileInterner::FIAgain;
|
|
|
151 |
while (fis == FileInterner::FIAgain) {
|
149 |
Rcl::Doc doc;
|
152 |
Rcl::Doc doc;
|
150 |
if (!internfile(fn, config, doc, tmpdir))
|
153 |
string ipath;
|
151 |
return FsTreeWalker::FtwOk;
|
154 |
fis = interner.internfile(doc, ipath);
|
|
|
155 |
if (fis == FileInterner::FIError)
|
|
|
156 |
break;
|
152 |
|
157 |
|
153 |
// Set up common fields:
|
158 |
// Set up common fields:
|
154 |
char ascdate[20];
|
159 |
char ascdate[20];
|
155 |
sprintf(ascdate, "%ld", long(stp->st_ctime));
|
160 |
sprintf(ascdate, "%ld", long(stp->st_ctime));
|
156 |
doc.mtime = ascdate;
|
161 |
doc.mtime = ascdate;
|
|
|
162 |
doc.ipath = ipath;
|
157 |
|
163 |
|
158 |
// Do database-specific work to update document data
|
164 |
// Do database-specific work to update document data
|
159 |
if (!db.add(fn, doc))
|
165 |
if (!db.add(fn, doc))
|
160 |
return FsTreeWalker::FtwError;
|
166 |
return FsTreeWalker::FtwError;
|
|
|
167 |
}
|
161 |
|
168 |
|
162 |
return FsTreeWalker::FtwOk;
|
169 |
return FsTreeWalker::FtwOk;
|
163 |
}
|
170 |
}
|
164 |
|
171 |
|
165 |
ConfIndexer::~ConfIndexer()
|
172 |
ConfIndexer::~ConfIndexer()
|