summaryrefslogtreecommitdiff
path: root/utilities/gbfidx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utilities/gbfidx.cpp')
-rw-r--r--utilities/gbfidx.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/utilities/gbfidx.cpp b/utilities/gbfidx.cpp
index 4dc6e65..8b1d1dd 100644
--- a/utilities/gbfidx.cpp
+++ b/utilities/gbfidx.cpp
@@ -1,9 +1,11 @@
/*****************************************************************************
*
- * This code reeks but works (at least for WEB). Good luck!
+ * gbfidx.cpp - This code reeks but works (at least for WEB).
+ * Good luck!
*
+ * $Id: gbfidx.cpp 2833 2013-06-29 06:40:28Z chrislit $
*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -61,9 +63,9 @@ int main(int argc, char **argv)
openfiles(argv[1]);
- testmnt = key1.Testament();
- num1 = key1.Chapter();
- num2 = key1.Verse();
+ testmnt = key1.getTestament();
+ num1 = key1.getChapter();
+ num2 = key1.getVerse();
pos = 0;
write(bfp, &pos, 4); /* Book offset for testament intros */
pos = 4;
@@ -83,11 +85,11 @@ int main(int argc, char **argv)
startflag = 1;
}
else {
- if (num2 < key2.Verse()) { // new chapter
- if (num1 <= key2.Chapter()) { // new book
- key2.Verse(1);
- key2.Chapter(1);
- key2.Book(key2.Book()+1);
+ if (num2 < key2.getVerse()) { // new chapter
+ if (num1 <= key2.getChapter()) { // new book
+ key2.setVerse(1);
+ key2.setChapter(1);
+ key2.setBook(key2.getBook()+1);
}
printf("Found Chapter Break: %d ('%s')\n", num1, (const char *)key2);
chapoffset = offset;
@@ -95,12 +97,12 @@ int main(int argc, char **argv)
// continue;
}
}
- key2.Verse(1);
- key2.Chapter(num1);
- key2.Verse(num2);
+ key2.setVerse(1);
+ key2.setChapter(num1);
+ key2.setVerse(num2);
key3 = key2;
-// key3 += (rangemax - key3.Verse());
+// key3 += (rangemax - key3.getVerse());
writeidx(key1, key2, key3, offset, size);
}
@@ -123,9 +125,9 @@ void writeidx(VerseKey &key1, VerseKey &key2, VerseKey &key3, long offset, short
long pos;
short tmp;
- for (; ((key1 <= key3) && (key1.Error() != KEYERR_OUTOFBOUNDS) && (key1.Testament() == testmnt)); key1+=1) {
- if (key1.Verse() == 1) { // new chapter
- if (key1.Chapter() == 1) { // new book
+ for (; ((key1 <= key3) && (key1.popError() != KEYERR_OUTOFBOUNDS) && (key1.getTestament() == testmnt)); key1+=1) {
+ if (key1.getVerse() == 1) { // new chapter
+ if (key1.getChapter() == 1) { // new book
pos = lseek(cfp, 0, SEEK_CUR);
write(bfp, &pos, 4);
pos = lseek(vfp, 0, SEEK_CUR); /* Book intro (cps) */