2
* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
3
* CrossWire Bible Society
7
* This program is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License as published by the
9
* Free Software Foundation version 2.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
29
#ifndef NO_SWORD_NAMESPACE
30
using namespace sword;
33
int main(int argc, char **argv)
36
fprintf(stderr, "usage: %s <lex path>\n\n", *argv);
43
sprintf(buf, "%s.idx", argv[1]);
44
FileDesc *idxfd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::RDONLY, true);
45
long maxoff = idxfd->seek(0, SEEK_END) - 6;
46
FileMgr::getSystemFileMgr()->close(idxfd);
51
for (long index = 0; index < maxoff; index+=6) {
52
mod.getIDXBuf(index, &trybuf);
54
if (strcmp(trybuf, last.c_str()) < 0) {
55
printf("entry %ld(offset: %ld) (%s) is less than previous entry (%s)\n\n", index/6, index, trybuf, last.c_str());