+ few imp. in the indexer code

This commit is contained in:
kelson42 2009-12-20 14:10:58 +00:00
parent 8e6f0047d6
commit f3bd14cf83
2 changed files with 16 additions and 3 deletions

View File

@ -11,14 +11,21 @@ int main(int argc, char **argv) {
/* Init the variables */
char *zimFilePath = argv[1];
char *xapianDirectoryPath = argv[2];
kiwix::Indexer *indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath);
kiwix::Indexer *indexer = NULL;
/* Try to prepare the indexing */
try {
indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath);
} catch (...) {
cout << "Unable to index '" << zimFilePath << "'." << endl;
exit(1);
}
/* Start the indexing */
if (indexer != NULL) {
indexer->startIndexing();
while (indexer->indexNextPercent()) {};
} else {
cout << "Unable to start the indexation process" << endl;
cout << "Unable instanciate the Kiwix indexer." << endl;
exit(1);
}

View File

@ -15,6 +15,9 @@
/* Define to 1 if you have the `bz2' library (-lbz2). */
#undef HAVE_LIBBZ2
/* Define to 1 if you have the `microhttpd' library (-lmicrohttpd). */
#undef HAVE_LIBMICROHTTPD
/* Define to 1 if you have the `unac' library (-lunac). */
#undef HAVE_LIBUNAC
@ -67,6 +70,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION