summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:54:01 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:54:01 -0400
commit71a39f4652cd51df814c930dd268f3c9ad2aee86 (patch)
tree5994350a603908c4e4d660bc9d72c4ec43dd648e /include
parent03134fa5f6f25d92724ce4c183f9bbe12a9e37dc (diff)
Imported Upstream version 1.6.0+dfsg
Diffstat (limited to 'include')
-rw-r--r--include/.cvsignore2
-rw-r--r--include/Makefile.am6
-rw-r--r--include/apocrypha.h219
-rw-r--r--include/canon.h575
-rw-r--r--include/canon_abbrevs.h548
-rw-r--r--include/canon_kjva.h262
-rw-r--r--include/canon_leningrad.h166
-rw-r--r--include/canon_mt.h166
-rw-r--r--include/canon_nrsv.h179
-rw-r--r--include/canon_nrsva.h271
-rw-r--r--include/canon_null.h44
-rw-r--r--include/config.h29
-rw-r--r--include/config.h.in21
-rw-r--r--include/curlftpt.h20
-rw-r--r--include/curlhttpt.h52
-rw-r--r--include/defs.h2
-rw-r--r--include/encfiltmgr.h1
-rw-r--r--include/filemgr.h4
-rw-r--r--include/flatapi.h4
-rw-r--r--include/ftplibftpt.h20
-rw-r--r--include/ftptrans.h42
-rw-r--r--include/installmgr.h183
-rw-r--r--include/listkey.h7
-rw-r--r--include/osisbook.h640
-rw-r--r--include/osishtmlhref.h4
-rw-r--r--include/osismorphsegmentation.h2
-rw-r--r--include/osisplain.h12
-rw-r--r--include/osisruby.h (renamed from include/scsuutf8.h)78
-rw-r--r--include/rawcom.h16
-rw-r--r--include/rawcom4.h13
-rw-r--r--include/rawgenbook.h5
-rw-r--r--include/rawld.h6
-rw-r--r--include/rawld4.h6
-rw-r--r--include/rawstr.h17
-rw-r--r--include/rawstr4.h17
-rw-r--r--include/rawtext.h19
-rw-r--r--include/rawtext4.h16
-rw-r--r--include/rawverse.h5
-rw-r--r--include/rawverse4.h5
-rw-r--r--include/regex.h545
-rw-r--r--include/roman.h2
-rw-r--r--include/swbuf.h22
-rw-r--r--include/swcom.h30
-rw-r--r--include/swconfig.h3
-rw-r--r--include/swgenbook.h10
-rw-r--r--include/swkey.h64
-rw-r--r--include/swld.h11
-rw-r--r--include/swlocale.h11
-rw-r--r--include/swmgr.h15
-rw-r--r--include/swmodule.h52
-rw-r--r--include/swtext.h16
-rw-r--r--include/teirtf.h1
-rw-r--r--include/treekey.h25
-rw-r--r--include/treekeyidx.h16
-rw-r--r--include/utf8arabicpoints.h40
-rw-r--r--include/utf8transliterator.h16
-rw-r--r--include/utilstr.h26
-rw-r--r--include/utilxml.h9
-rw-r--r--include/versekey.h269
-rw-r--r--include/versemgr.h163
-rw-r--r--include/versetreekey.h27
-rw-r--r--include/zcom.h16
-rw-r--r--include/zld.h8
-rw-r--r--include/zlib.h893
-rw-r--r--include/zstr.h11
-rw-r--r--include/ztext.h16
-rw-r--r--include/zverse.h8
67 files changed, 2786 insertions, 3223 deletions
diff --git a/include/.cvsignore b/include/.cvsignore
deleted file mode 100644
index 9a4764a..0000000
--- a/include/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-config.h.in
-stamp-h1
diff --git a/include/Makefile.am b/include/Makefile.am
index 62866cb..7145e63 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -3,14 +3,17 @@ swincludedir = $(top_srcdir)/include
pkginclude_HEADERS = $(swincludedir)/Greek2Greek.h
pkginclude_HEADERS += $(swincludedir)/GreekChars.h
pkginclude_HEADERS += $(swincludedir)/canon.h
+pkginclude_HEADERS += $(swincludedir)/canon_abbrevs.h
pkginclude_HEADERS += $(swincludedir)/cipherfil.h
pkginclude_HEADERS += $(swincludedir)/curlftpt.h
+pkginclude_HEADERS += $(swincludedir)/curlhttpt.h
pkginclude_HEADERS += $(swincludedir)/defs.h
pkginclude_HEADERS += $(swincludedir)/echomod.h
pkginclude_HEADERS += $(swincludedir)/encfiltmgr.h
pkginclude_HEADERS += $(swincludedir)/entriesblk.h
pkginclude_HEADERS += $(swincludedir)/femain.h
pkginclude_HEADERS += $(swincludedir)/filemgr.h
+pkginclude_HEADERS += $(swincludedir)/versemgr.h
pkginclude_HEADERS += $(swincludedir)/flatapi.h
pkginclude_HEADERS += $(swincludedir)/ftpparse.h
pkginclude_HEADERS += $(swincludedir)/ftptrans.h
@@ -77,7 +80,6 @@ pkginclude_HEADERS += $(swincludedir)/regex.h
pkginclude_HEADERS += $(swincludedir)/roman.h
pkginclude_HEADERS += $(swincludedir)/rtfhtml.h
pkginclude_HEADERS += $(swincludedir)/sapphire.h
-pkginclude_HEADERS += $(swincludedir)/scsuutf8.h
pkginclude_HEADERS += $(swincludedir)/strkey.h
pkginclude_HEADERS += $(swincludedir)/swbasicfilter.h
pkginclude_HEADERS += $(swincludedir)/swbuf.h
@@ -125,6 +127,7 @@ pkginclude_HEADERS += $(swincludedir)/thmlwordjs.h
pkginclude_HEADERS += $(swincludedir)/teiplain.h
pkginclude_HEADERS += $(swincludedir)/teirtf.h
+pkginclude_HEADERS += $(swincludedir)/teihtmlhref.h
pkginclude_HEADERS += $(swincludedir)/treekey.h
pkginclude_HEADERS += $(swincludedir)/treekeyidx.h
@@ -137,6 +140,7 @@ pkginclude_HEADERS += $(swincludedir)/utf8bidireorder.h
pkginclude_HEADERS += $(swincludedir)/utf8cantillation.h
pkginclude_HEADERS += $(swincludedir)/utf8greekaccents.h
pkginclude_HEADERS += $(swincludedir)/utf8hebrewpoints.h
+pkginclude_HEADERS += $(swincludedir)/utf8arabicpoints.h
pkginclude_HEADERS += $(swincludedir)/utf8html.h
pkginclude_HEADERS += $(swincludedir)/utf8latin1.h
pkginclude_HEADERS += $(swincludedir)/utf8nfc.h
diff --git a/include/apocrypha.h b/include/apocrypha.h
deleted file mode 100644
index 6f08bbe..0000000
--- a/include/apocrypha.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/******************************************************************************
- * apocrypha.h - Apocryphal text information to be included by VerseKey.cpp
- *
- * $Id: apocrypha.h 1688 2005-01-01 04:42:26Z scribe $
- *
- * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-
-/******************************************************************************
- * [a]tbooks - initialize static instance for all canonical text names
- * and chapmax
- */
-
-#include <defs.h>
-//SWORD_NAMESPACE_START
-
-//Data based on NRSVA unless otherwise noted; this book ordering is not necessarily optimal.
-
-struct sbook
-VerseKey::otbooks[] = {
- //Catholic Deuterocanon
- {"Tobit", "Tob", 14}, //67
- {"Judith", "Jdt", 16}, //68
- {"Wisdom", "Wis", 19}, //69
- {"Sirach", "Sir", 51}, //70 //51 or 52? count prologue as separate book or just chapter?
- {"Baruch", "Bar", 5}, //71 //5 or 6? (see next line)
- {"Letter of Jeremiah", "EpJer", 1}, //72 //1 or 6? EpJer is ch6 of Baruch
- {"1 Esdras", "1Esd", 9}, //73
- {"2 Esdras", "2Esd", 16}, //74
- {"1 Maccabees", "1Macc", 16}, //75
- {"2 Maccabees", "2Macc", 15}, //76
-
- //LXX
- {"3 Maccabees", "3Macc", 7}, //77
- {"4 Maccabees", "4Macc", 18}, //78
- {"Odes", "Odes", 14}, //79 //based on LXX
- {"Psalms of Solomon", "PssSol", 18}, //80 //based on LXX
-
- //Protestant Apocrypha
- {"Additions to Esther", "AddEsth", 6}, //81 //based on Charles/NRSVA //6 or F or 16? If you're Catholic, you have a 16 chapter canonical book called Esther (ie Greek Esther); if you're Protestant you have a 10 chapter canonical book called Esther (ie Hebrew Esther) plus a 6 "chapter" set of "Additions" in an apocryphal book called Additions to Esther, which are "numbered" A through F or continue from chapter 10 through 16.
- {"Prayer of Azariah", "PrAzar", 1}, //82
- {"Susanna", "Sus", 1}, //83
- {"Bel and the Dragon", "Bel", 1}, //84
- {"Prayer of Manasses", "PrMan", 1}, //85
- {"Psalm 151", "Ps151", 1}, //86
-
- //Vulgate
- {"Epistle to the Laodiceans", "EpLao", 1}, //87 //based on Vulgate
-
- //Other books may follow at a later date (e.g. Jub, 1En)
-};
-
-/******************************************************************************
- * Abbreviations - MUST be in alphabetical order & by PRIORITY
- * RULE: first match of entire key
- * (e.g. key: "1CH"; match: "1CHRONICLES")
- */
-
-const struct abbrev
- VerseKey::builtin_abbrevs[] = {
- {"1 ESDRAS", 73},
- {"1 MACCABEES", 75},
- {"1ESDRAS", 73},
- {"1MACCABEES", 75},
- {"2 ESDRAS", 74},
- {"2 MACCABEES", 76},
- {"2ESDRAS", 74},
- {"2MACCABEES", 76},
- {"3 MACCABEES", 77},
- {"3MACCABEES", 77},
- {"4 MACCABEES", 78},
- {"4MACCABEES", 78},
- {"ADDESTHER", 81},
- {"ADDITIONS TO ESTHER", 81},
- {"BARUCH", 71},
- {"BEL AND THE DRAGON", 84},
- {"BEN SIRACH", 70},
- {"ECCLESIASTICUS", 70},
- {"EPISTLE OF JEREMIAH", 72},
- {"EPISTLE TO THE LAODICEANS", 87},
- {"EPJER", 72},
- {"EPLAO", 87},
- {"I ESDRAS", 73},
- {"I MACCABEES", 75},
- {"IESDRAS", 73},
- {"II ESDRAS", 74},
- {"II MACCABEES", 76},
- {"IIESDRAS", 74},
- {"III MACCABEES", 77},
- {"IIII MACCABEES", 78},
- {"IIIIMACCABEES", 78},
- {"IIIMACCABEES", 77},
- {"IIMACCABEES", 76},
- {"IMACCABEES", 75},
- {"IV MACCABEES", 78},
- {"IVMACCABEES", 78},
- {"JDT", 68},
- {"JESUS BEN SIRACH", 70},
- {"JUDITH", 68},
- {"LAODICEANS", 87},
- {"LETTER OF JEREMIAH", 72},
- {"MANASSEH", 85},
- {"MANASSES", 85},
- {"ODES", 79},
- {"PRAYER OF AZARIAH", 82},
- {"PRAYER OF MANASSEH", 85},
- {"PRAYER OF MANASSES", 85},
- {"PRAZAR", 82},
- {"PRMAN", 85},
- {"PS151", 86},
- {"PSALM151", 86},
- {"PSALMS OF SOLOMON", 80},
- {"PSSOL", 80},
- {"PSSSOL", 80},
- {"SIRACH", 70},
- {"SUSANNA", 83},
- {"TOBIT", 67},
- {"WISDOM OF JESUS BEN SIRACH", 70},
- {"WISDOM", 69},
- {"", -1}
-};
-
-
-/******************************************************************************
- * Maximum verses per chapter
- */
-
-int
-VerseKey::vm[] = {
- //Catholic Deuterocanon
- //Tobit 14 //67
- 22, 14, 17, 21, 21, 17, 18, 21, 6, 12,
- 19, 22, 18, 15,
- //Judith 16 //68
- 16, 28, 10, 15, 24, 21, 32, 36, 14, 23,
- 23, 20, 20, 19, 13, 25,
- //Wisdom 19 //69
- 16, 24, 19, 20, 23, 25, 30, 21, 18, 21,
- 26, 27, 19, 31, 19, 29, 21, 25, 22,
- //Sirach 51 //70 //Prologue has 36 vv. in LXX, 1 v. in NRSVA
- 30, 18, 31, 31, 15, 37, 36, 19, 18, 31,
- 34, 18, 26, 27, 20, 30, 32, 33, 30, 32,
- 28, 27, 27, 34, 26, 29, 30, 26, 28, 25,
- 31, 24, 31, 26, 20, 26, 31, 34, 35, 30,
- 23, 25, 33, 23, 26, 20, 25, 25, 16, 29,
- 30,
- //Baruch 5 //71
- 21, 35, 37, 37, 9,
- //Letter of Jeremiah 1 //72
- 73,
- //1 Esdras 9 //73
- 58, 30, 24, 63, 73, 34, 15, 96, 55,
- //2 Esdras 16 //74
- 40, 48, 36, 52, 56, 59, 140, 63, 47, 59,
- 46, 51, 58, 48, 63, 78,
- //1 Maccabees 16 //75
- 64, 70, 60, 61, 68, 63, 50, 32, 73, 89,
- 74, 53, 53, 49, 41, 24,
- //2 Maccabees 15 //76
- 36, 32, 40, 50, 27, 31, 42, 36, 29, 38,
- 38, 45, 26, 46, 39,
-
- //LXX
- //3 Maccabees 7 //77
- 29, 33, 30, 21, 51, 41, 23,
- //4 Maccabees 18 //78
- 35, 24, 21, 26, 38, 35, 23, 29, 32, 21,
- 27, 19, 27, 20, 32, 25, 24, 24,
- //Odes 14 //79
- 19, 43, 10, 19, 20, 10, 45, 88, 79, 9,
- 20, 15, 32, 46,
- //Psalms of Solomon 18 //80
- 8, 37, 12, 25, 19, 6, 10, 34, 11, 8,
- 9, 6, 12, 10, 13, 15, 46, 12,
-
- //Protestant Apocrypha
- //Additions to Esther 6 //81
- 17, 7, 30, 16, 24, 11
- //Prayer of Azariah 1 //82
- 68,
- //Susanna 1 //83
- 64,
- //Bel and the Dragon 1 //84
- 42,
- //Prayer of Manasses 1 //85
- 15,
- //Psalm 151 1 //86
- 7,
-
- //Vulgate
- //Epistle to the Laodiceans 1 //87
- 20,
-};
-
-
-long
- VerseKey::atbks[] = {
-0, 1, 16, 33, 53, 105, 111, 113, 123, 140, 157, 173, 181, 200, 215, 234, 241, 243, 245, 247, 249, 251
-};
-
-long
- VerseKey::atcps[] = {
-0, 2, 3, 26, 41, 59, 81, 103, 121, 140, 162, 169, 183, 203, 226, 245, 262, 279, 308, 319, 335, 360, 382, 415, 452, 467, 492, 516, 537, 558, 578, 592, 619, 636, 661, 681, 702, 726, 752, 783, 805, 824, 847, 874, 902, 922, 954, 974, 1004, 1026, 1052, 1076, 1107, 1126, 1158, 1190, 1206, 1244, 1281, 1301, 1320, 1353, 1388, 1407, 1434, 1462, 1483, 1514, 1547, 1581, 1612, 1646, 1675, 1703, 1731, 1766, 1793, 1823, 1854, 1881, 1910, 1937, 1969, 1994, 2026, 2053, 2074, 2101, 2133, 2168, 2204, 2236, 2260, 2286, 2320, 2344, 2371, 2392, 2418, 2444, 2461, 2492, 2524, 2546, 2582, 2620, 2658, 2669, 2744, 2803, 2834, 2859, 2923, 2997, 3032, 3048, 3145, 3202, 3243, 3292, 3329, 3382, 3439, 3499, 3640, 3704, 3752, 3813, 3860, 3912, 3971, 4020, 4084, 4164, 4229, 4300, 4361, 4423, 4492, 4556, 4607, 4640, 4714, 4805, 4880, 4934, 4988, 5038, 5080, 5106, 5143, 5176, 5217, 5268, 5296, 5328, 5371, 5408, 5438, 5478, 5517, 5563, 5590, 5637, 5678, 5708, 5742, 5773, 5795, 5847, 5889, 5914, 5950, 5975, 5997, 6024, 6063, 6099, 6123, 6153, 6186, 6209, 6237, 6257, 6285, 6306, 6339, 6365, 6390, 6416, 6436, 6480, 6491, 6511, 6532, 6543, 6589, 6678, 6758, 6769, 6790, 6806, 6839, 6887, 6896, 6934, 6947, 6973, 6993, 7000, 7011, 7046, 7058, 7068, 7078, 7085, 7098, 7109, 7123, 7139, 7186, 7200, 7270, 7336, 7380, 7397, 7406
-};
-
-//SWORD_NAMESPACE_END
diff --git a/include/canon.h b/include/canon.h
index a17f86a..95222c4 100644
--- a/include/canon.h
+++ b/include/canon.h
@@ -1,9 +1,9 @@
/******************************************************************************
* canon.h - Canonical text information to be included by VerseKey.cpp
*
- * $Id: canon.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: canon.h 2365 2009-04-29 19:30:06Z chrislit $
*
- * Copyright 1998-2005 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -19,294 +19,96 @@
*
*/
-/******************************************************************************
- * [on]tbooks - initialize static instance for all canonical text names
- * and chapmax
- */
+#ifndef CANON_H
+#define CANON_H
-struct sbook
- VerseKey::otbooks[] = {
- {"Genesis", "Gen", 50},
- {"Exodus", "Exod", 40},
- {"Leviticus", "Lev", 27},
- {"Numbers", "Num", 36},
- {"Deuteronomy", "Deut", 34},
- {"Joshua", "Josh", 24},
- {"Judges", "Judg", 21},
- {"Ruth", "Ruth", 4},
- {"I Samuel", "1Sam", 31},
- {"II Samuel", "2Sam", 24},
- {"I Kings", "1Kgs", 22},
- {"II Kings", "2Kgs", 25},
- {"I Chronicles", "1Chr", 29},
- {"II Chronicles", "2Chr", 36},
- {"Ezra", "Ezra", 10},
- {"Nehemiah", "Neh", 13},
- {"Esther", "Esth", 10},
- {"Job", "Job", 42},
- {"Psalms", "Ps", 150},
- {"Proverbs", "Prov", 31},
- {"Ecclesiastes", "Eccl", 12},
- {"Song of Solomon", "Song", 8},
- {"Isaiah", "Isa", 66},
- {"Jeremiah", "Jer", 52},
- {"Lamentations", "Lam", 5},
- {"Ezekiel", "Ezek", 48},
- {"Daniel", "Dan", 12},
- {"Hosea", "Hos", 14},
- {"Joel", "Joel", 3},
- {"Amos", "Amos", 9},
- {"Obadiah", "Obad", 1},
- {"Jonah", "Jonah", 4},
- {"Micah", "Mic", 7},
- {"Nahum", "Nah", 3},
- {"Habakkuk", "Hab", 3},
- {"Zephaniah", "Zeph", 3},
- {"Haggai", "Hag", 2},
- {"Zechariah", "Zech", 14},
- {"Malachi", "Mal", 4}
-};
+#include <canon_abbrevs.h>
-struct sbook
- VerseKey::ntbooks[] = {
- {"Matthew", "Matt", 28},
- {"Mark", "Mark", 16},
- {"Luke", "Luke", 24},
- {"John", "John", 21},
- {"Acts", "Acts", 28},
- {"Romans", "Rom", 16},
- {"I Corinthians", "1Cor", 16},
- {"II Corinthians", "2Cor", 13},
- {"Galatians", "Gal", 6},
- {"Ephesians", "Eph", 6},
- {"Philippians", "Phil", 4},
- {"Colossians", "Col", 4},
- {"I Thessalonians", "1Thess", 5},
- {"II Thessalonians", "2Thess", 3},
- {"I Timothy", "1Tim", 6},
- {"II Timothy", "2Tim", 4},
- {"Titus", "Titus", 3},
- {"Philemon", "Phlm", 1},
- {"Hebrews", "Heb", 13},
- {"James", "Jas", 5},
- {"I Peter", "1Pet", 5},
- {"II Peter", "2Pet", 3},
- {"I John", "1John", 5},
- {"II John", "2John", 1},
- {"III John", "3John", 1},
- {"Jude", "Jude", 1},
- {"Revelation of John", "Rev", 22}
-};
+SWORD_NAMESPACE_START
/******************************************************************************
- * Abbreviations - MUST be in alphabetical order & by PRIORITY
- * RULE: first match of entire key
- * (e.g. key: "1CH"; match: "1CHRONICLES")
+ * [on]tbooks - initialize static instance for all canonical text names
+ * and chapmax
*/
-
-const struct abbrev
- VerseKey::builtin_abbrevs[] = {
- {"1 C", 46}, // 1 Corinthians
- {"1 CHRONICLES", 13}, // 1 Chronicles
- {"1 CORINTHIANS", 46}, // 1 Corinthians
- {"1 JN", 62}, // 1 John
- {"1 JOHN", 62}, // 1 John
- {"1 KGS", 11}, // 1 Kings
- {"1 KINGS", 11}, // 1 Kings
- {"1 PETER", 60}, // 1 Peter
- {"1 PTR", 60}, // 1 Peter
- {"1 SAMUEL", 9}, // 1 Samuel
- {"1 THESSALONIANS", 52}, // 1 Thessalonians
- {"1 TIMOTHY", 54}, // 1 Timothy
- {"1C", 46}, // 1 Corinthians
- {"1CHRONICLES", 13}, // 1 Chronicles
- {"1CORINTHIANS", 46}, // 1 Corinthians
- {"1JN", 62}, // 1 John
- {"1JOHN", 62}, // 1 John
- {"1KGS", 11}, // 1 Kings
- {"1KINGS", 11}, // 1 Kings
- {"1PETER", 60}, // 1 Peter
- {"1PTR", 60}, // 1 Peter
- {"1SAMUEL", 9}, // 1 Samuel
- {"1THESSALONIANS", 52}, // 1 Thessalonians
- {"1TIMOTHY", 54}, // 1 Timothy
- {"2 C", 47}, // 2 Corinthians
- {"2 CHRONICLES", 14}, // 2 Chronicles
- {"2 CORINTHIANS", 47}, // 2 Corinthians
- {"2 JN", 63}, // 2 John
- {"2 JOHN", 63}, // 2 John
- {"2 KGS", 12}, // 2 Kings
- {"2 KINGS", 12}, // 2 Kings
- {"2 PETER", 61}, // 2 Peter
- {"2 PTR", 61}, // 2 Peter
- {"2 SAMUEL", 10}, // 2 Samuel
- {"2 THESSALONIANS", 53}, // 2 Thessalonians
- {"2 TIMOTHY", 55}, // 2 Timothy
- {"2C", 47}, // 2 Corinthians
- {"2CHRONICLES", 14}, // 2 Chronicles
- {"2CORINTHIANS", 47}, // 2 Corinthians
- {"2JN", 63}, // 2 John
- {"2JOHN", 63}, // 2 John
- {"2KGS", 12}, // 2 Kings
- {"2KINGS", 12}, // 2 Kings
- {"2PETER", 61}, // 2 Peter
- {"2PTR", 61}, // 2 Peter
- {"2SAMUEL", 10}, // 2 Samuel
- {"2THESSALONIANS", 53}, // 2 Thessalonians
- {"2TIMOTHY", 55}, // 2 Timothy
- {"3 JN", 64}, // 3 John
- {"3 JOHN", 64}, // 3 John
- {"3JN", 64}, // 3 John
- {"3JOHN", 64}, // 3 John
- {"ACTS", 44}, // Acts
- {"AMOS", 30}, // Amos
- {"APOCALYPSE OF ST. JOHN", 66}, // Apocalypse of St. John (Rev.)
- {"C", 51}, // Colossians
- {"CANTICLE OF CANTICLES", 22}, // Canticle of Canticles (Song of S.)
- {"COLOSSIANS", 51}, // Colossians
- {"D", 5}, // Deuteronomy
- {"DANIEL", 27}, // Daniel
- {"DEUTERONOMY", 5}, // Deuteronomy
- {"E", 49}, // Ephesians
- {"ECCLESIASTES", 21}, // Ecclesiastes
- {"EPHESIANS", 49}, // Ephesians
- {"ESTER", 17}, // Esther
- {"ESTHER", 17}, // Esther
- {"EXODUS", 2}, // Exodus
- {"EZEKIEL", 26}, // Ezekiel
- {"EZK", 26}, // Ezekiel
- {"EZRA", 15}, // Ezra
- {"G", 1}, // Genesis
- {"GALATIANS", 48}, // Galatians
- {"GENESIS", 1}, // Genesis
- {"H", 58}, // Hebrews
- {"HABAKKUK", 35}, // Habakkuk
- {"HAGGAI", 37}, // Haggai
- {"HEBREWS", 58}, // Hebrews
- {"HOSEA", 28}, // Hosea
- {"I C", 46}, // 1 Corinthians
- {"I CHRONICLES", 13}, // 1 Chronicles
- {"I CORINTHIANS", 46}, // 1 Corinthians
- {"I JN", 62}, // 1 John
- {"I JOHN", 62}, // 1 John
- {"I KGS", 11}, // 1 Kings
- {"I KINGS", 11}, // 1 Kings
- {"I PETER", 60}, // 1 Peter
- {"I PTR", 60}, // 1 Peter
- {"I SAMUEL", 9}, // 1 Samuel
- {"I THESSALONIANS", 52}, // 1 Thessalonians
- {"I TIMOTHY", 54}, // 1 Timothy
- {"IC", 46}, // 1 Corinthians
- {"ICHRONICLES", 13}, // 1 Chronicles
- {"ICORINTHIANS", 46}, // 1 Corinthians
- {"II C", 47}, // 2 Corinthians
- {"II CHRONICLES", 14}, // 2 Chronicles
- {"II CORINTHIANS", 47}, // 2 Corinthians
- {"II JN", 63}, // 2 John
- {"II JOHN", 63}, // 2 John
- {"II KGS", 12}, // 2 Kings
- {"II KINGS", 12}, // 2 Kings
- {"II PETER", 61}, // 2 Peter
- {"II PTR", 61}, // 2 Peter
- {"II SAMUEL", 10}, // 2 Samuel
- {"II THESSALONIANS", 53}, // 2 Thessalonians
- {"II TIMOTHY", 55}, // 2 Timothy
- {"IIC", 47}, // 2 Corinthians
- {"IICHRONICLES", 14}, // 2 Chronicles
- {"IICORINTHIANS", 47}, // 2 Corinthians
- {"III JN", 64}, // 3 John
- {"III JOHN", 64}, // 3 John
- {"IIIJN", 64}, // 3 John
- {"IIIJOHN", 64}, // 3 John
- {"IIJN", 63}, // 2 John
- {"IIJOHN", 63}, // 2 John
- {"IIKGS", 12}, // 2 Kings
- {"IIKINGS", 12}, // 2 Kings
- {"IIPETER", 61}, // 2 Peter
- {"IIPTR", 61}, // 2 Peter
- {"IISAMUEL", 10}, // 2 Samuel
- {"IITHESSALONIANS", 53}, // 2 Thessalonians
- {"IITIMOTHY", 55}, // 2 Timothy
- {"IJN", 62}, // 1 John
- {"IJOHN", 62}, // 1 John
- {"IKGS", 11}, // 1 Kings
- {"IKINGS", 11}, // 1 Kings
- {"IPETER", 60}, // 1 Peter
- {"IPTR", 60}, // 1 Peter
- {"ISA", 23}, // Isaiah
- {"ISAIAH", 23}, // Isaiah
- {"ISAMUEL", 9}, // 1 Samuel
- {"ITHESSALONIANS", 52}, // 1 Thessalonians
- {"ITIMOTHY", 54}, // 1 Timothy
- {"J", 43}, // John
- {"JAMES", 59}, // James
- {"JAS", 59}, // James
- {"JDGS", 7}, // Judges
- {"JEREMIAH", 24}, // Jeremiah
- {"JHN", 43}, // John
- {"JN", 43}, // John
- {"JO", 43}, // John
- {"JOB", 18}, // Job
- {"JOEL", 29}, // Joel
- {"JOHN", 43}, // John
- {"JOL", 29}, // Joel
- {"JONAH", 32}, // Jonah
- {"JOSHUA", 6}, // Joshua
- {"JUDE", 65}, // Jude
- {"JUDGES", 7}, // Judges
- {"L", 42}, // Luke
- {"LAMENTATIONS", 25}, // Lamentations
- {"LEVITICUS", 3}, // Leviticus
- {"LK", 42}, // Luke
- {"LUKE", 42}, // Luke
- {"MA", 40}, // Matthew
- {"MALACHI", 39}, // Malachi
- {"MARK", 41}, // Mark
- {"MATTHEW", 40}, // Matthew
- {"MICAH", 33}, // Micah
- {"MK", 41}, // Mark
- {"MRK", 41}, // Mark
- {"MT", 40}, // Matthew
- {"N", 4}, // Numbers
- {"NAHUM", 34}, // Nahum
- {"NAM", 34}, // Nahum
- {"NEHEMIAH", 16}, // Nehemiah
- {"NUMBERS", 4}, // Numbers
- {"OBADIAH", 31}, // Obadiah
- {"P", 19}, // Psalms
- {"PHIL", 50}, // Philippians
- {"PHILEMON", 57}, // Philemon
- {"PHILIPPIANS", 50}, // Philippians
- {"PHLM", 57}, // Philemon
- {"PHM", 57}, // Philemon
- {"PHP", 50}, // Philippians
- {"PROVERBS", 20}, // Proverbs
- {"PSALMS", 19}, // Psalms
- {"PSM", 19}, // Psalms
- {"PSS", 19}, // Psalms
- {"QOHELETH", 21}, // Qohelet (Ecclesiastes)
- {"REVELATION OF JOHN", 66}, // Revelation
- {"ROMANS", 45}, // Romans
- {"RUTH", 8}, // Ruth
- {"SNG", 22}, // Song of Solomon
- {"SOLOMON", 22}, // Song of Solomon
- {"SONG OF SOLOMON", 22}, // Song of Solomon
- {"SONG OF SONGS", 22}, // Song of Solomon
- {"SOS", 22}, // Song of Solomon
- {"TITUS", 56}, // Titus
- {"ZECHARIAH", 38}, // Zechariah
- {"ZEPHANIAH", 36}, // Zephaniah
- {"", -1}
+struct sbook otbooks[] = {
+ {"Genesis", "Gen", "Gen", 50},
+ {"Exodus", "Exod", "Exod", 40},
+ {"Leviticus", "Lev", "Lev", 27},
+ {"Numbers", "Num", "Num", 36},
+ {"Deuteronomy", "Deut", "Deut", 34},
+ {"Joshua", "Josh", "Josh", 24},
+ {"Judges", "Judg", "Judg", 21},
+ {"Ruth", "Ruth", "Ruth", 4},
+ {"I Samuel", "1Sam", "1Sam", 31},
+ {"II Samuel", "2Sam", "2Sam", 24},
+ {"I Kings", "1Kgs", "1Kgs", 22},
+ {"II Kings", "2Kgs", "2Kgs", 25},
+ {"I Chronicles", "1Chr", "1Chr", 29},
+ {"II Chronicles", "2Chr", "2Chr", 36},
+ {"Ezra", "Ezra", "Ezra", 10},
+ {"Nehemiah", "Neh", "Neh", 13},
+ {"Esther", "Esth", "Esth", 10},
+ {"Job", "Job", "Job", 42},
+ {"Psalms", "Ps", "Ps", 150},
+ {"Proverbs", "Prov", "Prov", 31},
+ {"Ecclesiastes", "Eccl", "Eccl", 12},
+ {"Song of Solomon", "Song", "Song", 8},
+ {"Isaiah", "Isa", "Isa", 66},
+ {"Jeremiah", "Jer", "Jer", 52},
+ {"Lamentations", "Lam", "Lam", 5},
+ {"Ezekiel", "Ezek", "Ezek", 48},
+ {"Daniel", "Dan", "Dan", 12},
+ {"Hosea", "Hos", "Hos", 14},
+ {"Joel", "Joel", "Joel", 3},
+ {"Amos", "Amos", "Amos", 9},
+ {"Obadiah", "Obad", "Obad", 1},
+ {"Jonah", "Jonah", "Jonah", 4},
+ {"Micah", "Mic", "Mic", 7},
+ {"Nahum", "Nah", "Nah", 3},
+ {"Habakkuk", "Hab", "Hab", 3},
+ {"Zephaniah", "Zeph", "Zeph", 3},
+ {"Haggai", "Hag", "Hag", 2},
+ {"Zechariah", "Zech", "Zech", 14},
+ {"Malachi", "Mal", "Mal", 4},
+ {"", "", "", 0}
+};
+struct sbook ntbooks[] = {
+ {"Matthew", "Matt", "Matt", 28},
+ {"Mark", "Mark", "Mark", 16},
+ {"Luke", "Luke", "Luke", 24},
+ {"John", "John", "John", 21},
+ {"Acts", "Acts", "Acts", 28},
+ {"Romans", "Rom", "Rom", 16},
+ {"I Corinthians", "1Cor", "1Cor", 16},
+ {"II Corinthians", "2Cor", "2Cor", 13},
+ {"Galatians", "Gal", "Gal", 6},
+ {"Ephesians", "Eph", "Eph", 6},
+ {"Philippians", "Phil", "Phil", 4},
+ {"Colossians", "Col", "Col", 4},
+ {"I Thessalonians", "1Thess", "1Thess", 5},
+ {"II Thessalonians", "2Thess", "2Thess", 3},
+ {"I Timothy", "1Tim", "1Tim", 6},
+ {"II Timothy", "2Tim", "2Tim", 4},
+ {"Titus", "Titus", "Titus", 3},
+ {"Philemon", "Phlm", "Phlm", 1},
+ {"Hebrews", "Heb", "Heb", 13},
+ {"James", "Jas", "Jas", 5},
+ {"I Peter", "1Pet", "1Pet", 5},
+ {"II Peter", "2Pet", "2Pet", 3},
+ {"I John", "1John", "1John", 5},
+ {"II John", "2John", "2John", 1},
+ {"III John", "3John", "3John", 1},
+ {"Jude", "Jude", "Jude", 1},
+ {"Revelation of John", "Rev", "Rev", 22},
+ {"", "", "", 0}
};
-
/******************************************************************************
* Maximum verses per chapter
*/
-int
- VerseKey::vm[] = {
+int vm[] = {
// Genesis
31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38,
18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36,
@@ -332,7 +134,7 @@ int
48, 25,
// Ruth
22, 23, 18, 22,
- // I Samual
+ // I Samuel
28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24,
42, 15, 23, 29, 22, 44, 25, 12, 25, 11, 31, 13,
// II Samuel
@@ -480,218 +282,7 @@ int
};
-long
- VerseKey::otbks[] = {
- 0, 1, 52, 93, 121, 158,
- 193, 218, 240, 245, 277, 302, 325,
- 351, 381, 418, 429, 443, 454, 497,
- 648, 680, 693, 702, 769, 822, 828,
- 877, 890, 905, 909, 919, 921, 926,
- 934, 938, 942, 946, 949, 964
-};
-
-long
- VerseKey::otcps[] = {
- 0, 2, 3, 35, 61, 86,
- 113, 146, 169, 194, 217, 247, 280,
- 313, 334, 353, 378, 400, 417, 445,
- 479, 518, 537, 572, 597, 618, 686,
- 721, 757, 804, 827, 863, 907, 963,
- 996, 1017, 1049, 1079, 1123, 1160, 1191,
- 1215, 1239, 1297, 1336, 1371, 1406, 1435,
- 1470, 1502, 1525, 1559, 1586, 1587, 1610,
- 1636, 1659, 1691, 1715, 1746, 1772, 1805,
- 1841, 1871, 1882, 1934, 1957, 1989, 2017,
- 2054, 2071, 2099, 2125, 2152, 2189, 2221,
- 2255, 2274, 2315, 2353, 2375, 2419, 2466,
- 2505, 2524, 2560, 2584, 2620, 2656, 2695,
- 2725, 2757, 2801, 2840, 2841, 2859, 2876,
- 2894, 2930, 2950, 2981, 3020, 3057, 3082,
- 3103, 3151, 3160, 3220, 3278, 3312, 3347,
- 3364, 3395, 3433, 3461, 3486, 3520, 3565,
- 3589, 3645, 3692, 3727, 3728, 3783, 3818,
- 3870, 3920, 3952, 3980, 4070, 4097, 4121,
- 4158, 4194, 4211, 4245, 4291, 4333, 4384,
- 4398, 4431, 4454, 4484, 4520, 4562, 4593,
- 4619, 4638, 4704, 4728, 4760, 4801, 4818,
- 4873, 4916, 4973, 5003, 5038, 5052, 5053,
- 5100, 5138, 5168, 5218, 5252, 5278, 5305,
- 5326, 5356, 5379, 5412, 5445, 5464, 5494,
- 5518, 5541, 5562, 5585, 5607, 5628, 5652,
- 5683, 5709, 5732, 5752, 5772, 5799, 5868,
- 5898, 5919, 5950, 6003, 6033, 6046, 6047,
- 6066, 6091, 6109, 6134, 6150, 6178, 6205,
- 6241, 6269, 6313, 6337, 6362, 6396, 6412,
- 6476, 6487, 6506, 6535, 6587, 6597, 6643,
- 6678, 6695, 6729, 6730, 6767, 6791, 6823,
- 6848, 6880, 6921, 6947, 6983, 7041, 7060,
- 7101, 7117, 7143, 7164, 7185, 7217, 7231,
- 7263, 7294, 7343, 7369, 7370, 7393, 7417,
- 7436, 7459, 7460, 7489, 7526, 7548, 7571,
- 7584, 7606, 7624, 7647, 7675, 7703, 7719,
- 7745, 7769, 7822, 7858, 7882, 7941, 7972,
- 7997, 8040, 8056, 8080, 8110, 8133, 8178,
- 8204, 8217, 8243, 8255, 8287, 8301, 8302,
- 8330, 8363, 8403, 8416, 8442, 8466, 8496,
- 8515, 8529, 8549, 8577, 8609, 8649, 8683,
- 8721, 8745, 8775, 8809, 8853, 8880, 8903,
- 8955, 8995, 9021, 9022, 9076, 9123, 9152,
- 9187, 9206, 9245, 9297, 9364, 9393, 9423,
- 9467, 9501, 9536, 9568, 9603, 9638, 9663,
- 9710, 9732, 9776, 9806, 9860, 9861, 9880,
- 9906, 9934, 9979, 10007, 10041, 10062, 10092,
- 10130, 10167, 10189, 10211, 10237, 10267, 10306,
- 10327, 10369, 10407, 10445, 10467, 10494, 10515,
- 10553, 10574, 10605, 10606, 10661, 10717, 10742,
- 10786, 10813, 10895, 10936, 10977, 11022, 11037,
- 11085, 11126, 11141, 11159, 11189, 11233, 11261,
- 11279, 11299, 11308, 11339, 11359, 11392, 11424,
- 11456, 11489, 11524, 11546, 11577, 11578, 11596,
- 11615, 11633, 11656, 11671, 11714, 11737, 11756,
- 11788, 11808, 11832, 11849, 11872, 11888, 11908,
- 11923, 11943, 11978, 11990, 12028, 12049, 12062,
- 12084, 12112, 12141, 12165, 12175, 12203, 12240,
- 12268, 12290, 12324, 12350, 12384, 12412, 12436,
- 12437, 12449, 12520, 12534, 12559, 12577, 12600,
- 12629, 12666, 12682, 12727, 12728, 12740, 12761,
- 12794, 12818, 12838, 12858, 12932, 12951, 12990,
- 13030, 13067, 13115, 13147, 13148, 13171, 13195,
- 13211, 13229, 13244, 13259, 13270, 13288, 13321,
- 13325, 13326, 13349, 13363, 13390, 13412, 13440,
- 13471, 13493, 13516, 13552, 13575, 13596, 13622,
- 13651, 13674, 13710, 13733, 13750, 13772, 13802,
- 13832, 13867, 13898, 13916, 13942, 13949, 13964,
- 13988, 14017, 14043, 14075, 14116, 14139, 14173,
- 14211, 14228, 14262, 14287, 14329, 14360, 14385,
- 14420, 14438, 14439, 14446, 14459, 14468, 14477,
- 14490, 14501, 14519, 14529, 14550, 14569, 14577,
- 14586, 14593, 14601, 14607, 14619, 14635, 14686,
- 14701, 14711, 14725, 14757, 14764, 14775, 14798,
- 14811, 14826, 14836, 14848, 14861, 14886, 14898,
- 14921, 14944, 14973, 14986, 15027, 15050, 15064,
- 15082, 15096, 15108, 15114, 15141, 15159, 15171,
- 15181, 15196, 15217, 15241, 15261, 15271, 15278,
- 15286, 15310, 15324, 15336, 15348, 15366, 15379,
- 15388, 15401, 15413, 15424, 15438, 15459, 15467,
- 15503, 15540, 15546, 15571, 15592, 15621, 15645,
- 15656, 15669, 15690, 15763, 15777, 15797, 15814,
- 15823, 15842, 15855, 15869, 15887, 15895, 15914,
- 15967, 15985, 16002, 16018, 16024, 16048, 16060,
- 16074, 16087, 16097, 16107, 16113, 16122, 16151,
- 16174, 16210, 16256, 16305, 16349, 16363, 16395,
- 16403, 16414, 16425, 16435, 16444, 16463, 16483,
- 16486, 16516, 16693, 16701, 16710, 16720, 16725,
- 16734, 16740, 16747, 16753, 16760, 16769, 16778,
- 16782, 16801, 16805, 16809, 16831, 16858, 16868,
- 16877, 16902, 16916, 16927, 16935, 16948, 16964,
- 16986, 16997, 17018, 17033, 17043, 17050, 17051,
- 17085, 17108, 17144, 17172, 17196, 17232, 17260,
- 17297, 17316, 17349, 17381, 17410, 17436, 17472,
- 17506, 17540, 17569, 17594, 17624, 17655, 17687,
- 17717, 17753, 17788, 17817, 17846, 17874, 17903,
- 17931, 17965, 17997, 17998, 18017, 18044, 18067,
- 18084, 18105, 18118, 18148, 18166, 18185, 18206,
- 18217, 18232, 18233, 18251, 18269, 18281, 18298,
- 18315, 18329, 18343, 18358, 18359, 18391, 18414,
- 18441, 18448, 18479, 18493, 18519, 18542, 18564,
- 18599, 18616, 18623, 18646, 18679, 18689, 18704,
- 18719, 18727, 18753, 18760, 18778, 18804, 18823,
- 18847, 18860, 18882, 18896, 18926, 18951, 18985,
- 18995, 19016, 19041, 19059, 19070, 19093, 19132,
- 19155, 19164, 19196, 19226, 19252, 19281, 19310,
- 19336, 19350, 19366, 19389, 19416, 19428, 19452,
- 19468, 19481, 19499, 19513, 19526, 19548, 19563,
- 19585, 19608, 19620, 19633, 19653, 19666, 19692,
- 19717, 19718, 19738, 19776, 19802, 19834, 19866,
- 19897, 19932, 19955, 19982, 20008, 20032, 20050,
- 20078, 20101, 20123, 20145, 20173, 20197, 20213,
- 20232, 20247, 20278, 20319, 20330, 20369, 20394,
- 20417, 20435, 20468, 20493, 20534, 20579, 20606,
- 20629, 20649, 20682, 20704, 20733, 20752, 20769,
- 20788, 20811, 20825, 20856, 20862, 20891, 20899,
- 20947, 20987, 21034, 21099, 21134, 21135, 21158,
- 21181, 21248, 21271, 21294, 21295, 21324, 21335,
- 21363, 21381, 21399, 21414, 21442, 21461, 21473,
- 21496, 21522, 21551, 21575, 21599, 21608, 21672,
- 21697, 21730, 21745, 21795, 21828, 21860, 21910,
- 21938, 21956, 21978, 22015, 22042, 22064, 22091,
- 22110, 22143, 22177, 22209, 22225, 22264, 22293,
- 22317, 22347, 22397, 22424, 22445, 22473, 22505,
- 22531, 22556, 22580, 22616, 22617, 22639, 22689,
- 22720, 22758, 22790, 22819, 22848, 22876, 22904,
- 22926, 22972, 22986, 22987, 22999, 23023, 23029,
- 23049, 23065, 23077, 23094, 23109, 23127, 23143,
- 23156, 23171, 23188, 23198, 23199, 23220, 23253,
- 23275, 23276, 23292, 23309, 23325, 23339, 23367,
- 23382, 23400, 23415, 23431, 23432, 23454, 23455,
- 23473, 23484, 23495, 23507, 23508, 23525, 23539,
- 23552, 23566, 23582, 23599, 23620, 23621, 23637,
- 23651, 23671, 23672, 23690, 23711, 23731, 23732,
- 23751, 23767, 23788, 23789, 23805, 23829, 23830,
- 23852, 23866, 23877, 23892, 23904, 23920, 23935,
- 23959, 23977, 23990, 24008, 24023, 24033, 24055,
- 24056, 24071, 24089, 24108
-};
-
-long
- VerseKey::ntbks[] = {
- 0, 1, 30, 47, 72, 94,
- 123, 140, 157, 171, 178, 185, 190,
- 195, 201, 205, 212, 217, 221, 223,
- 237, 243, 249, 253, 259, 261, 263,
- 265
-};
-
-long
- VerseKey::ntcps[] = {
- 0, 2, 3, 29, 53, 71,
- 97, 146, 181, 211, 246, 285, 328,
- 359, 410, 469, 506, 546, 575, 603,
- 639, 670, 705, 752, 799, 839, 891,
- 938, 1014, 1081, 1102, 1103, 1149, 1178,
- 1214, 1256, 1300, 1357, 1395, 1434, 1485,
- 1538, 1572, 1617, 1655, 1728, 1776, 1797,
- 1798, 1879, 1932, 1971, 2016, 2056, 2106,
- 2157, 2214, 2277, 2320, 2375, 2435, 2471,
- 2507, 2540, 2572, 2610, 2654, 2703, 2751,
- 2790, 2862, 2919, 2973, 2974, 3026, 3052,
- 3089, 3144, 3192, 3264, 3318, 3378, 3420,
- 3463, 3521, 3572, 3611, 3643, 3671, 3705,
- 3732, 3773, 3816, 3848, 3874, 3875, 3902,
- 3950, 3977, 4015, 4058, 4074, 4135, 4176,
- 4220, 4269, 4300, 4326, 4379, 4408, 4450,
- 4491, 4526, 4555, 4597, 4636, 4677, 4708,
- 4744, 4772, 4800, 4833, 4878, 4910, 4911,
- 4944, 4974, 5006, 5032, 5054, 5078, 5104,
- 5144, 5178, 5200, 5237, 5259, 5274, 5298,
- 5332, 5360, 5361, 5393, 5410, 5434, 5456,
- 5470, 5491, 5532, 5546, 5574, 5608, 5643,
- 5675, 5689, 5730, 5789, 5814, 5815, 5840,
- 5858, 5877, 5896, 5918, 5937, 5954, 5979,
- 5995, 6014, 6048, 6070, 6085, 6086, 6111,
- 6133, 6163, 6195, 6222, 6241, 6242, 6266,
- 6289, 6311, 6344, 6378, 6403, 6404, 6435,
- 6466, 6488, 6512, 6513, 6543, 6567, 6593,
- 6612, 6613, 6624, 6645, 6659, 6678, 6707,
- 6708, 6721, 6739, 6758, 6759, 6780, 6796,
- 6813, 6830, 6856, 6878, 6879, 6898, 6925,
- 6943, 6966, 6967, 6984, 7000, 7016, 7017,
- 7043, 7044, 7059, 7078, 7098, 7115, 7130,
- 7151, 7180, 7194, 7223, 7263, 7304, 7334,
- 7360, 7361, 7389, 7416, 7435, 7453, 7474,
- 7475, 7501, 7527, 7550, 7570, 7585, 7586,
- 7608, 7631, 7650, 7651, 7662, 7692, 7717,
- 7739, 7761, 7762, 7776, 7777, 7792, 7793,
- 7819, 7820, 7841, 7871, 7894, 7906, 7921,
- 7939, 7957, 7971, 7993, 8005, 8025, 8043,
- 8062, 8083, 8092, 8114, 8133, 8158, 8180,
- 8196, 8224
-};
+SWORD_NAMESPACE_END
-int
- VerseKey::offsize[2][2] =
- { {sizeof (VerseKey::otbks) / sizeof(long), sizeof (VerseKey::otcps) / sizeof(long)}
-, {sizeof (VerseKey::ntbks) / sizeof(long), sizeof (VerseKey::ntcps) / sizeof(long)}
-};
-
+#endif
diff --git a/include/canon_abbrevs.h b/include/canon_abbrevs.h
new file mode 100644
index 0000000..f456a5f
--- /dev/null
+++ b/include/canon_abbrevs.h
@@ -0,0 +1,548 @@
+/******************************************************************************
+ * canon_abbrevs.h - Canonical text information to be included by VerseKey.cpp
+ *
+ * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef CANON_ABBREVS_H
+#define CANON_ABBREVS_H
+
+SWORD_NAMESPACE_START
+
+
+/******************************************************************************
+ * Abbreviations - MUST be in alphabetical order & by PRIORITY
+ * RULE: first match of entire key
+ * (e.g. key: "1CH"; match: "1CHRONICLES")
+ */
+
+const struct abbrev builtin_abbrevs[] = {
+ {"1 BARUCH", "Bar"}, // Baruch
+ {"1 C", "1Cor"}, // I Corinthians
+ {"1 CHRONICLES", "1Chr"}, // I Chronicles
+ {"1 CORINTHIANS", "1Cor"}, // I Corinthians
+ {"1 E", "1Esd"}, // I Esdras
+ {"1 ENOCH", "1En"}, // I Enoch
+ {"1 ESDRAS", "1Esd"}, // I Esdras
+ {"1 JN", "1John"}, // I John
+ {"1 JOHN", "1John"}, // I John
+ {"1 K", "1Kgs"}, // I Kings
+ {"1 KGDMS", "1Sam"}, // I Samuel
+ {"1 KGS", "1Kgs"}, // I Kings
+ {"1 KING", "1Kgs"}, // I Kings
+ {"1 KINGDOMS", "1Sam"}, // I Samuel
+ {"1 KINGS", "1Kgs"}, // I Kings
+ {"1 MACCABEES", "1Macc"}, // I Maccabees
+ {"1 MAKABIAN", "1Meq"}, // I Meqabyan
+ {"1 MEQABYAN", "1Meq"}, // I Meqabyan
+ {"1 P", "1Pet"}, // I Peter
+ {"1 PARALIPOMENON", "1Chr"}, // I Chronicles
+ {"1 PETER", "1Pet"}, // I Peter
+ {"1 PTR", "1Pet"}, // I Peter
+ {"1 SAMUEL", "1Sam"}, // I Samuel
+ {"1 THESSALONIANS", "1Thess"}, // I Thessalonians
+ {"1 TIMOTHY", "1Tim"}, // I Timothy
+ {"1BARUCH", "Bar"}, // Baruch
+ {"1C", "1Cor"}, // I Corinthians
+ {"1CHR", "1Chr"}, // I Chronicles
+ {"1CHRONICLES", "1Chr"}, // I Chronicles
+ {"1COR", "1Cor"}, // I Corinthians
+ {"1CORINTHIANS", "1Cor"}, // I Corinthians
+ {"1E", "1Esd"}, // I Esdras
+ {"1EN", "1En"}, // I Enoch
+ {"1ENOCH", "1En"}, // I Enoch
+ {"1ESD", "1Esd"}, // I Esdras
+ {"1ESDRAS", "1Esd"}, // I Esdras
+ {"1JN", "1John"}, // I John
+ {"1JOHN", "1John"}, // I John
+ {"1K", "1Kgs"}, // I Kings
+ {"1KGDMS", "1Sam"}, // I Samuel
+ {"1KGS", "1Kgs"}, // I Kings
+ {"1KING", "1Kgs"}, // I Kings
+ {"1KINGDOMS", "1Sam"}, // I Samuel
+ {"1KINGS", "1Kgs"}, // I Kings
+ {"1MACC", "1Macc"}, // I Maccabees
+ {"1MACCABEES", "1Macc"}, // I Maccabees
+ {"1MAKABIAN", "1Meq"}, // I Meqabyan
+ {"1MEQ", "1Meq"}, // I Meqabyan
+ {"1MEQABYAN", "1Meq"}, // I Meqabyan
+ {"1P", "1Pet"}, // I Peter
+ {"1PARALIPOMENON", "1Chr"}, // I Chronicles
+ {"1PET", "1Pet"}, // I Peter
+ {"1PETER", "1Pet"}, // I Peter
+ {"1PTR", "1Pet"}, // I Peter
+ {"1SAM", "1Sam"}, // I Samuel
+ {"1SAMUEL", "1Sam"}, // I Samuel
+ {"1THESS", "1Thess"}, // I Thessalonians
+ {"1THESSALONIANS", "1Thess"}, // I Thessalonians
+ {"1TIM", "1Tim"}, // I Timothy
+ {"1TIMOTHY", "1Tim"}, // I Timothy
+ {"2 BARUCH", "2Bar"}, // 2Baruch
+ {"2 C", "2Cor"}, // II Corinthians
+ {"2 CHRONICLES", "2Chr"}, // II Chronicles
+ {"2 CORINTHIANS", "2Cor"}, // II Corinthians
+ {"2 E", "2Esd"}, // II Esdras
+ {"2 ESDRAS", "2Esd"}, // II Esdras
+ {"2 JN", "2John"}, // II John
+ {"2 JOHN", "2John"}, // II John
+ {"2 K", "2Kgs"}, // II Kings
+ {"2 KGDMS", "2Sam"}, // II Samuel
+ {"2 KGS", "2Kgs"}, // II Kings
+ {"2 KING", "2Kgs"}, // II Kings
+ {"2 KINGDOMS", "2Sam"}, // II Samuel
+ {"2 KINGS", "2Kgs"}, // II Kings
+ {"2 MACCABEES", "2Macc"}, // II Maccabees
+ {"2 MAKABIAN", "2Meq"}, // II Meqabyan
+ {"2 MEQABYAN", "2Meq"}, // II Meqabyan
+ {"2 P", "2Pet"}, // II Peter
+ {"2 PARALIPOMENON", "2Chr"}, // II Chronicles
+ {"2 PETER", "2Pet"}, // II Peter
+ {"2 PTR", "2Pet"}, // II Peter
+ {"2 SAMUEL", "2Sam"}, // II Samuel
+ {"2 THESSALONIANS", "2Thess"}, // II Thessalonians
+ {"2 TIMOTHY", "2Tim"}, // II Timothy
+ {"2BAR", "2Bar"}, // 2Baruch
+ {"2BARUCH", "2Bar"}, // 2Baruch
+ {"2C", "2Cor"}, // II Corinthians
+ {"2CHR", "2Chr"}, // II Chronicles
+ {"2CHRONICLES", "2Chr"}, // II Chronicles
+ {"2COR", "2Cor"}, // II Corinthians
+ {"2CORINTHIANS", "2Cor"}, // II Corinthians
+ {"2E", "2Esd"}, // II Esdras
+ {"2ESD", "2Esd"}, // II Esdras
+ {"2ESDRAS", "2Esd"}, // II Esdras
+ {"2JN", "2John"}, // II John
+ {"2JOHN", "2John"}, // II John
+ {"2K", "2Kgs"}, // II Kings
+ {"2KGDMS", "2Sam"}, // II Samuel
+ {"2KGS", "2Kgs"}, // II Kings
+ {"2KING", "2Kgs"}, // II Kings
+ {"2KINGDOMS", "2Sam"}, // II Samuel
+ {"2KINGS", "2Kgs"}, // II Kings
+ {"2MACC", "2Macc"}, // II Maccabees
+ {"2MACCABEES", "2Macc"}, // II Maccabees
+ {"2MAKABIAN", "2Meq"}, // II Meqabyan
+ {"2MEQ", "2Meq"}, // II Meqabyan
+ {"2MEQABYAN", "2Meq"}, // II Meqabyan
+ {"2P", "2Pet"}, // II Peter
+ {"2PARALIPOMENON", "2Chr"}, // II Chronicles
+ {"2PET", "2Pet"}, // II Peter
+ {"2PETER", "2Pet"}, // II Peter
+ {"2PTR", "2Pet"}, // II Peter
+ {"2SAM", "2Sam"}, // II Samuel
+ {"2SAMUEL", "2Sam"}, // II Samuel
+ {"2THESS", "2Thess"}, // II Thessalonians
+ {"2THESSALONIANS", "2Thess"}, // II Thessalonians
+ {"2TIM", "2Tim"}, // II Timothy
+ {"2TIMOTHY", "2Tim"}, // II Timothy
+ {"3 EZRA", "1Esd"}, // I Esdras
+ {"3 JN", "3John"}, // III John
+ {"3 JOHN", "3John"}, // III John
+ {"3 KGDMS", "1Kgs"}, // I Kings
+ {"3 KGS", "1Kgs"}, // I Kings
+ {"3 KINGDOMS", "1Kgs"}, // I Kings
+ {"3 KINGS", "1Kgs"}, // I Kings
+ {"3 MACCABEES", "3Macc"}, // III Maccabees
+ {"3 MAKABIAN", "3Meq"}, // III Meqabyan
+ {"3 MEQABYAN", "3Meq"}, // III Meqabyan
+ {"3EZRA", "1Esd"}, // I Esdras
+ {"3JN", "3John"}, // III John
+ {"3JOHN", "3John"}, // III John
+ {"3KGDMS", "1Kgs"}, // I Kings
+ {"3KGS", "1Kgs"}, // I Kings
+ {"3KINGDOMS", "1Kgs"}, // I Kings
+ {"3KINGS", "1Kgs"}, // I Kings
+ {"3MACC", "3Macc"}, // III Maccabees
+ {"3MACCABEES", "3Macc"}, // III Maccabees
+ {"3MAKABIAN", "3Meq"}, // III Meqabyan
+ {"3MEQ", "3Meq"}, // III Meqabyan
+ {"3MEQABYAN", "3Meq"}, // III Meqabyan
+ {"4 BARUCH", "4Bar"}, // IV Baruch
+ {"4 EZRA", "2Esd"}, // II Esdras
+ {"4 KGDMS", "2Kgs"}, // II Kings
+ {"4 KGS", "2Kgs"}, // II Kings
+ {"4 KINGDOMS", "2Kgs"}, // II Kings
+ {"4 KINGS", "2Kgs"}, // II Kings
+ {"4 MACCABEES", "4Macc"}, // IV Maccabees
+ {"4BAR", "4Bar"}, // IV Baruch
+ {"4BARUCH", "4Bar"}, // IV Baruch
+ {"4EZRA", "2Esd"}, // II Esdras
+ {"4KGDMS", "2Kgs"}, // II Kings
+ {"4KGS", "2Kgs"}, // II Kings
+ {"4KINGDOMS", "2Kgs"}, // II Kings
+ {"4KINGS", "2Kgs"}, // II Kings
+ {"4MACC", "4Macc"}, // IV Maccabees
+ {"4MACCABEES", "4Macc"}, // IV Maccabees
+ {"5APOCSYRPSS", "AddPs"}, // Additional Psalm
+ {"ACTS", "Acts"}, // Acts
+ {"ADDDAN", "AddDan"}, // Additions to Daniel
+ {"ADDESTH", "AddEsth"}, // Additions to Esther
+ {"ADDITIONAL PSALM", "AddPs"}, // Additional Psalm
+ {"ADDITIONS TO DANIEL", "AddDan"}, // Additions to Daniel
+ {"ADDITIONS TO ESTHER", "AddEsth"}, // Additions to Esther
+ {"ADDPS", "AddPs"}, // Additional Psalm
+ {"AMOS", "Amos"}, // Amos
+ {"APOCALYPSE OF JOHN", "Rev"}, // Revelation of John
+ {"AZA", "PrAzar"}, // Prayer of Azariah
+ {"AZAR", "PrAzar"}, // Prayer of Azariah
+ {"AZARIAH", "PrAzar"}, // Prayer of Azariah
+ {"BAR", "Bar"}, // Baruch
+ {"BARUCH", "Bar"}, // Baruch
+ {"BEL", "Bel"}, // Bel and the Dragon
+ {"BEL AND THE DRAGON", "Bel"}, // Bel and the Dragon
+ {"C", "Col"}, // Colossians
+ {"CANTICLE OF CANTICLES", "Song"}, // Song of Solomon
+ {"COL", "Col"}, // Colossians
+ {"COLOSSIANS", "Col"}, // Colossians
+ {"D", "Deut"}, // Deuteronomy
+ {"DAN", "Dan"}, // Daniel
+ {"DANGR", "DanGr"}, // Daniel (Greek)
+ {"DANIEL", "Dan"}, // Daniel
+ {"DANIEL (ADDITIONS)", "AddDan"}, // Additions to Daniel
+ {"DANIEL (GREEK)", "DanGr"}, // Daniel (Greek)
+ {"DEUT", "Deut"}, // Deuteronomy
+ {"DEUTERONOMY", "Deut"}, // Deuteronomy
+ {"DT", "Deut"}, // Deuteronomy
+ {"E", "Exod"}, // Exodus
+ {"ECCL", "Eccl"}, // Ecclesiastes
+ {"ECCLESIASTES", "Eccl"}, // Ecclesiastes
+ {"ECCLESIASTICUS", "Sir"}, // Sirach
+ {"ECCLUS", "Sir"}, // Sirach
+ {"EK", "Ezek"}, // Ezekiel
+ {"ENOCH", "1En"}, // I Enoch
+ {"EPH", "Eph"}, // Ephesians
+ {"EPHESIANS", "Eph"}, // Ephesians
+ {"EPISTLE OF JEREMIAH", "EpJer"}, // Epistle of Jeremiah
+ {"EPJ", "EpJer"}, // Epistle of Jeremiah
+ {"EPJER", "EpJer"}, // Epistle of Jeremiah
+ {"EPLAO", "EpLao"}, // Laodiceans
+ {"ES", "Esth"}, // Esther
+ {"ESDRAS A", "1Esd"}, // I Esdras
+ {"ESDRAS B", "2Esd"}, // II Esdras
+ {"ESDRASA", "1Esd"}, // I Esdras
+ {"ESDRASB", "2Esd"}, // II Esdras
+ {"ESG", "EsthGr"}, // Esther (Greek)
+ {"ESTER", "Esth"}, // Esther
+ {"ESTH", "Esth"}, // Esther
+ {"ESTHER", "Esth"}, // Esther
+ {"ESTHER (ADDITIONS)", "AddEsth"}, // Additions to Esther
+ {"ESTHER (GREEK)", "EsthGr"}, // Esther (Greek)
+ {"ESTHGR", "EsthGr"}, // Esther (Greek)
+ {"ETHIOPIC APOCALYPSE OF ENOCH", "1En"}, // I Enoch
+ {"EXOD", "Exod"}, // Exodus
+ {"EXODUS", "Exod"}, // Exodus
+ {"EZEK", "Ezek"}, // Ezekiel
+ {"EZEKIEL", "Ezek"}, // Ezekiel
+ {"EZK", "Ezek"}, // Ezekiel
+ {"EZRA", "Ezra"}, // Ezra
+ {"FIVE APOCRYPHAL SYRIAC PSALMS", "AddPs"}, // Additional Psalm
+ {"G", "Gen"}, // Genesis
+ {"GAL", "Gal"}, // Galatians
+ {"GALATIANS", "Gal"}, // Galatians
+ {"GEN", "Gen"}, // Genesis
+ {"GENESIS", "Gen"}, // Genesis
+ {"GN", "Gen"}, // Genesis
+ {"GRDAN", "DanGr"}, // Daniel (Greek)
+ {"GREEK DANIEL", "DanGr"}, // Daniel (Greek)
+ {"GREEK ESTHER", "EsthGr"}, // Esther (Greek)
+ {"GRESTH", "EsthGr"}, // Esther (Greek)
+ {"H", "Heb"}, // Hebrews
+ {"HAB", "Hab"}, // Habakkuk
+ {"HABAKKUK", "Hab"}, // Habakkuk
+ {"HAG", "Hag"}, // Haggai
+ {"HAGGAI", "Hag"}, // Haggai
+ {"HEB", "Heb"}, // Hebrews
+ {"HEBREWS", "Heb"}, // Hebrews
+ {"HOS", "Hos"}, // Hosea
+ {"HOSEA", "Hos"}, // Hosea
+ {"I", "Isa"}, // Isaiah
+ {"I BARUCH", "Bar"}, // Baruch
+ {"I C", "1Cor"}, // I Corinthians
+ {"I CHRONICLES", "1Chr"}, // I Chronicles
+ {"I CORINTHIANS", "1Cor"}, // I Corinthians
+ {"I E", "1Esd"}, // I Esdras
+ {"I ENOCH", "1En"}, // I Enoch
+ {"I ESDRAS", "1Esd"}, // I Esdras
+ {"I JN", "1John"}, // I John
+ {"I JOHN", "1John"}, // I John
+ {"I K", "1Kgs"}, // I Kings
+ {"I KGDMS", "1Sam"}, // I Samuel
+ {"I KGS", "1Kgs"}, // I Kings
+ {"I KING", "1Kgs"}, // I Kings
+ {"I KINGDOMS", "1Sam"}, // I Samuel
+ {"I KINGS", "1Kgs"}, // I Kings
+ {"I MACCABEES", "1Macc"}, // I Maccabees
+ {"I MAKABIAN", "1Meq"}, // I Meqabyan
+ {"I MEQABYAN", "1Meq"}, // I Meqabyan
+ {"I P", "1Pet"}, // I Peter
+ {"I PARALIPOMENON", "1Chr"}, // I Chronicles
+ {"I PETER", "1Pet"}, // I Peter
+ {"I PTR", "1Pet"}, // I Peter
+ {"I SAMUEL", "1Sam"}, // I Samuel
+ {"I THESSALONIANS", "1Thess"}, // I Thessalonians
+ {"I TIMOTHY", "1Tim"}, // I Timothy
+ {"IBARUCH", "Bar"}, // Baruch
+ {"IC", "1Cor"}, // I Corinthians
+ {"ICHRONICLES", "1Chr"}, // I Chronicles
+ {"ICORINTHIANS", "1Cor"}, // I Corinthians
+ {"IE", "1Esd"}, // I Esdras
+ {"IENOCH", "1En"}, // I Enoch
+ {"IESDRAS", "1Esd"}, // I Esdras
+ {"II BARUCH", "2Bar"}, // 2Baruch
+ {"II C", "2Cor"}, // II Corinthians
+ {"II CHRONICLES", "2Chr"}, // II Chronicles
+ {"II CORINTHIANS", "2Cor"}, // II Corinthians
+ {"II E", "2Esd"}, // II Esdras
+ {"II ESDRAS", "2Esd"}, // II Esdras
+ {"II JN", "2John"}, // II John
+ {"II JOHN", "2John"}, // II John
+ {"II K", "2Kgs"}, // II Kings
+ {"II KGDMS", "2Sam"}, // II Samuel
+ {"II KGS", "2Kgs"}, // II Kings
+ {"II KING", "2Kgs"}, // II Kings
+ {"II KINGDOMS", "2Sam"}, // II Samuel
+ {"II KINGS", "2Kgs"}, // II Kings
+ {"II MACCABEES", "2Macc"}, // II Maccabees
+ {"II MAKABIAN", "2Meq"}, // II Meqabyan
+ {"II MEQABYAN", "2Meq"}, // II Meqabyan
+ {"II P", "2Pet"}, // II Peter
+ {"II PARALIPOMENON", "2Chr"}, // II Chronicles
+ {"II PETER", "2Pet"}, // II Peter
+ {"II PTR", "2Pet"}, // II Peter
+ {"II SAMUEL", "2Sam"}, // II Samuel
+ {"II THESSALONIANS", "2Thess"}, // II Thessalonians
+ {"II TIMOTHY", "2Tim"}, // II Timothy
+ {"IIBARUCH", "2Bar"}, // 2Baruch
+ {"IIC", "2Cor"}, // II Corinthians
+ {"IICHRONICLES", "2Chr"}, // II Chronicles
+ {"IICORINTHIANS", "2Cor"}, // II Corinthians
+ {"IIE", "2Esd"}, // II Esdras
+ {"IIESDRAS", "2Esd"}, // II Esdras
+ {"III EZRA", "1Esd"}, // I Esdras
+ {"III JN", "3John"}, // III John
+ {"III JOHN", "3John"}, // III John
+ {"III KGDMS", "1Kgs"}, // I Kings
+ {"III KGS", "1Kgs"}, // I Kings
+ {"III KINGDOMS", "1Kgs"}, // I Kings
+ {"III KINGS", "1Kgs"}, // I Kings
+ {"III MACCABEES", "3Macc"}, // III Maccabees
+ {"III MAKABIAN", "3Meq"}, // III Meqabyan
+ {"III MEQABYAN", "3Meq"}, // III Meqabyan
+ {"IIIEZRA", "1Esd"}, // I Esdras
+ {"IIIJN", "3John"}, // III John
+ {"IIIJOHN", "3John"}, // III John
+ {"IIIKGDMS", "1Kgs"}, // I Kings
+ {"IIIKGS", "1Kgs"}, // I Kings
+ {"IIIKINGDOMS", "1Kgs"}, // I Kings
+ {"IIIKINGS", "1Kgs"}, // I Kings
+ {"IIIMACCABEES", "3Macc"}, // III Maccabees
+ {"IIIMAKABIAN", "3Meq"}, // III Meqabyan
+ {"IIIMEQABYAN", "3Meq"}, // III Meqabyan
+ {"IIJN", "2John"}, // II John
+ {"IIJOHN", "2John"}, // II John
+ {"IIK", "2Kgs"}, // II Kings
+ {"IIKGDMS", "2Sam"}, // II Samuel
+ {"IIKGS", "2Kgs"}, // II Kings
+ {"IIKING", "2Kgs"}, // II Kings
+ {"IIKINGDOMS", "2Sam"}, // II Samuel
+ {"IIKINGS", "2Kgs"}, // II Kings
+ {"IIMACCABEES", "2Macc"}, // II Maccabees
+ {"IIMAKABIAN", "2Meq"}, // II Meqabyan
+ {"IIMEQABYAN", "2Meq"}, // II Meqabyan
+ {"IIP", "2Pet"}, // II Peter
+ {"IIPARALIPOMENON", "2Chr"}, // II Chronicles
+ {"IIPETER", "2Pet"}, // II Peter
+ {"IIPTR", "2Pet"}, // II Peter
+ {"IISAMUEL", "2Sam"}, // II Samuel
+ {"IITHESSALONIANS", "2Thess"}, // II Thessalonians
+ {"IITIMOTHY", "2Tim"}, // II Timothy
+ {"IJN", "1John"}, // I John
+ {"IJOHN", "1John"}, // I John
+ {"IK", "1Kgs"}, // I Kings
+ {"IKGDMS", "1Sam"}, // I Samuel
+ {"IKGS", "1Kgs"}, // I Kings
+ {"IKING", "1Kgs"}, // I Kings
+ {"IKINGDOMS", "1Sam"}, // I Samuel
+ {"IKINGS", "1Kgs"}, // I Kings
+ {"IMACCABEES", "1Macc"}, // I Maccabees
+ {"IMAKABIAN", "1Meq"}, // I Meqabyan
+ {"IMEQABYAN", "1Meq"}, // I Meqabyan
+ {"IP", "1Pet"}, // I Peter
+ {"IPARALIPOMENON", "1Chr"}, // I Chronicles
+ {"IPETER", "1Pet"}, // I Peter
+ {"IPTR", "1Pet"}, // I Peter
+ {"ISA", "Isa"}, // Isaiah
+ {"ISAIAH", "Isa"}, // Isaiah
+ {"ISAMUEL", "1Sam"}, // I Samuel
+ {"ITHESSALONIANS", "1Thess"}, // I Thessalonians
+ {"ITIMOTHY", "1Tim"}, // I Timothy
+ {"IV BARUCH", "4Bar"}, // IV Baruch
+ {"IV EZRA", "2Esd"}, // II Esdras
+ {"IV KGDMS", "2Kgs"}, // II Kings
+ {"IV KGS", "2Kgs"}, // II Kings
+ {"IV KINGDOMS", "2Kgs"}, // II Kings
+ {"IV KINGS", "2Kgs"}, // II Kings
+ {"IV MACCABEES", "4Macc"}, // IV Maccabees
+ {"IVBARUCH", "4Bar"}, // IV Baruch
+ {"IVEZRA", "2Esd"}, // II Esdras
+ {"IVKGDMS", "2Kgs"}, // II Kings
+ {"IVKGS", "2Kgs"}, // II Kings
+ {"IVKINGDOMS", "2Kgs"}, // II Kings
+ {"IVKINGS", "2Kgs"}, // II Kings
+ {"IVMACCABEES", "4Macc"}, // IV Maccabees
+ {"J", "Josh"}, // Joshua
+ {"JAMES", "Jas"}, // James
+ {"JAS", "Jas"}, // James
+ {"JB", "Job"}, // Job
+ {"JD", "Judg"}, // Judges
+ {"JDGS", "Judg"}, // Judges
+ {"JDT", "Jdt"}, // Judith
+ {"JER", "Jer"}, // Jeremiah
+ {"JEREMIAH", "Jer"}, // Jeremiah
+ {"JHN", "John"}, // John
+ {"JN", "John"}, // John
+ {"JO", "John"}, // John
+ {"JOB", "Job"}, // Job
+ {"JOEL", "Joel"}, // Joel
+ {"JOHN", "John"}, // John
+ {"JOL", "Joel"}, // Joel
+ {"JONAH", "Jonah"}, // Jonah
+ {"JOSH", "Josh"}, // Joshua
+ {"JOSHUA", "Josh"}, // Joshua
+ {"JS", "Josh"}, // Joshua
+ {"JU", "Jude"}, // Jude
+ {"JUB", "Jub"}, // Jubilees
+ {"JUBILEES", "Jub"}, // Jubilees
+ {"JUDE", "Jude"}, // Jude
+ {"JUDG", "Judg"}, // Judges
+ {"JUDGES", "Judg"}, // Judges
+ {"JUDITH", "Jdt"}, // Judith
+ {"L", "Luke"}, // Luke
+ {"LAM", "Lam"}, // Lamentations
+ {"LAMENTATIONS", "Lam"}, // Lamentations
+ {"LAO", "EpLao"}, // Laodiceans
+ {"LAODICEANS", "EpLao"}, // Laodiceans
+ {"LE", "Lev"}, // Leviticus
+ {"LETJER", "EpJer"}, // Epistle of Jeremiah
+ {"LETTER OF JEREMIAH", "EpJer"}, // Epistle of Jeremiah
+ {"LEV", "Lev"}, // Leviticus
+ {"LEVITICUS", "Lev"}, // Leviticus
+ {"LK", "Luke"}, // Luke
+ {"LUKE", "Luke"}, // Luke
+ {"LV", "Lev"}, // Leviticus
+ {"MA", "Matt"}, // Matthew
+ {"MAL", "Mal"}, // Malachi
+ {"MALACHI", "Mal"}, // Malachi
+ {"MAN", "PrMan"}, // Prayer of Manasses
+ {"MANASSEH", "PrMan"}, // Prayer of Manasses
+ {"MANASSES", "PrMan"}, // Prayer of Manasses
+ {"MARK", "Mark"}, // Mark
+ {"MATT", "Matt"}, // Matthew
+ {"MATTHEW", "Matt"}, // Matthew
+ {"MIC", "Mic"}, // Micah
+ {"MICAH", "Mic"}, // Micah
+ {"MK", "Mark"}, // Mark
+ {"MRK", "Mark"}, // Mark
+ {"MT", "Matt"}, // Matthew
+ {"N", "Num"}, // Numbers
+ {"NAH", "Nah"}, // Nahum
+ {"NAHUM", "Nah"}, // Nahum
+ {"NAM", "Nah"}, // Nahum
+ {"NEH", "Neh"}, // Nehemiah
+ {"NEHEMIAH", "Neh"}, // Nehemiah
+ {"NM", "Num"}, // Numbers
+ {"NUM", "Num"}, // Numbers
+ {"NUMBERS", "Num"}, // Numbers
+ {"OBAD", "Obad"}, // Obadiah
+ {"OBADIAH", "Obad"}, // Obadiah
+ {"ODES", "Odes"}, // Odes
+ {"P", "Ps"}, // Psalms
+ {"PARALEIPOMENA JEREMIOU", "4Bar"}, // IV Baruch
+ {"PARALIPOMENA OF JEREMIAH", "4Bar"}, // IV Baruch
+ {"PHIL", "Phil"}, // Philippians
+ {"PHILEMON", "Phlm"}, // Philemon
+ {"PHILIPPIANS", "Phil"}, // Philippians
+ {"PHLM", "Phlm"}, // Philemon
+ {"PHM", "Phlm"}, // Philemon
+ {"PHP", "Phil"}, // Philippians
+ {"PR", "Prov"}, // Proverbs
+ {"PRA", "PrAzar"}, // Prayer of Azariah
+ {"PRAYER OF AZARIAH", "PrAzar"}, // Prayer of Azariah
+ {"PRAYER OF MANASSEH", "PrMan"}, // Prayer of Manasses
+ {"PRAYER OF MANASSES", "PrMan"}, // Prayer of Manasses
+ {"PRAZAR", "PrAzar"}, // Prayer of Azariah
+ {"PRM", "PrMan"}, // Prayer of Manasses
+ {"PRMAN", "PrMan"}, // Prayer of Manasses
+ {"PROV", "Prov"}, // Proverbs
+ {"PROVERBS", "Prov"}, // Proverbs
+ {"PS", "Ps"}, // Psalms
+// {"PS 151", "AddPs"}, // Additional Psalm
+// {"PS151", "AddPs"}, // Additional Psalm
+ {"PSALM", "Ps"}, // Psalms
+// {"PSALM 151", "AddPs"}, // Additional Psalm
+// {"PSALM151", "AddPs"}, // Additional Psalm
+ {"PSALMS", "Ps"}, // Psalms
+ {"PSALMS OF SOLOMON", "PssSol"}, // Psalms of Solomon
+ {"PSM", "Ps"}, // Psalms
+ {"PSS", "Ps"}, // Psalms
+ {"PSSSOL", "PssSol"}, // Psalms of Solomon
+ {"QOHELET", "Eccl"}, // Ecclesiastes
+ {"QOHELETH", "Eccl"}, // Ecclesiastes
+ {"REV", "Rev"}, // Revelation of John
+ {"REVELATION OF JOHN", "Rev"}, // Revelation of John
+ {"ROM", "Rom"}, // Romans
+ {"ROMANS", "Rom"}, // Romans
+ {"RUTH", "Ruth"}, // Ruth
+ {"S", "Song"}, // Song of Solomon
+// {"S3Y", "PrAzar"}, // Prayer of Azariah
+ {"SI", "Sir"}, // Sirach
+ {"SIP", "SirP"}, // Sirach (Prologue)
+ {"SIR", "Sir"}, // Sirach
+ {"SIRACH", "Sir"}, // Sirach
+ {"SIRACH (PROLOGUE)", "SirP"}, // Sirach (Prologue)
+ {"SIRP", "SirP"}, // Sirach (Prologue)
+ {"SNG", "Song"}, // Song of Solomon
+ {"SOLOMON", "Song"}, // Song of Solomon
+ {"SONG", "Song"}, // Song of Solomon
+ {"SONG OF SOLOMON", "Song"}, // Song of Solomon
+ {"SONG OF SONGS", "Song"}, // Song of Solomon
+ {"SONG OF THE THREE CHILDREN", "PrAzar"}, // Prayer of Azariah
+ {"SUS", "Sus"}, // Susanna
+ {"SUSANNA", "Sus"}, // Susanna
+ {"SYRIAC APOCALYPSE OF BARUCH", "2Bar"}, // 2Baruch
+ {"T", "Titus"}, // Titus
+ {"TB", "Tob"}, // Tobit
+ {"TBT", "Tob"}, // Tobit
+ {"TITUS", "Titus"}, // Titus
+ {"TOB", "Tob"}, // Tobit
+ {"TOBIT", "Tob"}, // Tobit
+ {"WIS", "Wis"}, // Wisdom
+ {"WISDOM", "Wis"}, // Wisdom
+ {"WISDOM OF BEN SIRA", "Sir"}, // Sirach
+ {"WISDOM OF JESUS SON OF SIRACH", "Sir"}, // Sirach
+ {"WISDOM OF SOLOMON", "Wis"}, // Wisdom
+ {"ZECH", "Zech"}, // Zechariah
+ {"ZECHARIAH", "Zech"}, // Zechariah
+ {"ZEPH", "Zeph"}, // Zephaniah
+ {"ZEPHANIAH", "Zeph"}, // Zephaniah
+ {"", ""}
+};
+
+
+SWORD_NAMESPACE_END
+
+
+#endif
diff --git a/include/canon_kjva.h b/include/canon_kjva.h
new file mode 100644
index 0000000..866ec83
--- /dev/null
+++ b/include/canon_kjva.h
@@ -0,0 +1,262 @@
+/******************************************************************************
+ * canon_kjva.h - Versification data for the KJVA system
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef CANON_KJVA_H
+#define CANON_KJVA_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: KJVA
+// Book order: Gen Exod Lev Num Deut Josh Judg Ruth 1Sam 2Sam 1Kgs 2Kgs 1Chr 2Chr Ezra Neh Esth Job Ps Prov Eccl Song Isa Jer Lam Ezek Dan Hos Joel Amos Obad Jonah Mic Nah Hab Zeph Hag Zech Mal 1Esd 2Esd Tob Jdt AddEsth Wis Sir Bar PrAzar Sus Bel PrMan 1Macc 2Macc Matt Mark Luke John Acts Rom 1Cor 2Cor Gal Eph Phil Col 1Thess 2Thess 1Tim 2Tim Titus Phlm Heb Jas 1Pet 2Pet 1John 2John 3John Jude Rev
+
+/******************************************************************************
+ * [on]tbooks_kjva - initialize static instance for all canonical
+ * text names and chapmax
+ */
+struct sbook otbooks_kjva[] = {
+ {"Genesis", "Gen", "Gen", 50},
+ {"Exodus", "Exod", "Exod", 40},
+ {"Leviticus", "Lev", "Lev", 27},
+ {"Numbers", "Num", "Num", 36},
+ {"Deuteronomy", "Deut", "Deut", 34},
+ {"Joshua", "Josh", "Josh", 24},
+ {"Judges", "Judg", "Judg", 21},
+ {"Ruth", "Ruth", "Ruth", 4},
+ {"I Samuel", "1Sam", "1Sam", 31},
+ {"II Samuel", "2Sam", "2Sam", 24},
+ {"I Kings", "1Kgs", "1Kgs", 22},
+ {"II Kings", "2Kgs", "2Kgs", 25},
+ {"I Chronicles", "1Chr", "1Chr", 29},
+ {"II Chronicles", "2Chr", "2Chr", 36},
+ {"Ezra", "Ezra", "Ezra", 10},
+ {"Nehemiah", "Neh", "Neh", 13},
+ {"Esther", "Esth", "Esth", 10},
+ {"Job", "Job", "Job", 42},
+ {"Psalms", "Ps", "Ps", 150},
+ {"Proverbs", "Prov", "Prov", 31},
+ {"Ecclesiastes", "Eccl", "Eccl", 12},
+ {"Song of Solomon", "Song", "Song", 8},
+ {"Isaiah", "Isa", "Isa", 66},
+ {"Jeremiah", "Jer", "Jer", 52},
+ {"Lamentations", "Lam", "Lam", 5},
+ {"Ezekiel", "Ezek", "Ezek", 48},
+ {"Daniel", "Dan", "Dan", 12},
+ {"Hosea", "Hos", "Hos", 14},
+ {"Joel", "Joel", "Joel", 3},
+ {"Amos", "Amos", "Amos", 9},
+ {"Obadiah", "Obad", "Obad", 1},
+ {"Jonah", "Jonah", "Jonah", 4},
+ {"Micah", "Mic", "Mic", 7},
+ {"Nahum", "Nah", "Nah", 3},
+ {"Habakkuk", "Hab", "Hab", 3},
+ {"Zephaniah", "Zeph", "Zeph", 3},
+ {"Haggai", "Hag", "Hag", 2},
+ {"Zechariah", "Zech", "Zech", 14},
+ {"Malachi", "Mal", "Mal", 4},
+ {"I Esdras", "1Esd", "1Esd", 9},
+ {"II Esdras", "2Esd", "2Esd", 16},
+ {"Tobit", "Tob", "Tob", 14},
+ {"Judith", "Jdt", "Jdt", 16},
+ {"Additions to Esther", "AddEsth", "AddEsth", 16},
+ {"Wisdom", "Wis", "Wis", 19},
+ {"Sirach", "Sir", "Sir", 51},
+ {"Baruch", "Bar", "Bar", 6},
+ {"Prayer of Azariah", "PrAzar", "PrAzar", 1},
+ {"Susanna", "Sus", "Sus", 1},
+ {"Bel and the Dragon", "Bel", "Bel", 1},
+ {"Prayer of Manasses", "PrMan", "PrMan", 1},
+ {"I Maccabees", "1Macc", "1Macc", 16},
+ {"II Maccabees", "2Macc", "2Macc", 15},
+ {"", "", "", 0}
+};
+
+// for ntbooks_kjva, use ntbooks
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_kjva[] = {
+ // Genesis
+ 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26,
+ // Exodus
+ 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38,
+ // Leviticus
+ 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34,
+ // Numbers
+ 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65, 23, 31, 40, 16, 54, 42, 56, 29, 34, 13,
+ // Deuteronomy
+ 46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 32, 18, 29, 23, 22, 20, 22, 21, 20, 23, 30, 25, 22, 19, 19, 26, 68, 29, 20, 30, 52, 29, 12,
+ // Joshua
+ 18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33,
+ // Judges
+ 36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25,
+ // Ruth
+ 22, 23, 18, 22,
+ // I Samuel
+ 28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 15, 23, 29, 22, 44, 25, 12, 25, 11, 31, 13,
+ // II Samuel
+ 27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 33, 43, 26, 22, 51, 39, 25,
+ // I Kings
+ 53, 46, 28, 34, 18, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 53,
+ // II Kings
+ 18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 21, 21, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30,
+ // I Chronicles
+ 54, 55, 24, 43, 26, 81, 40, 40, 44, 14, 47, 40, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30,
+ // II Chronicles
+ 17, 18, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 22, 15, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23,
+ // Ezra
+ 11, 70, 13, 24, 17, 22, 28, 36, 15, 44,
+ // Nehemiah
+ 11, 20, 32, 23, 19, 19, 73, 18, 38, 39, 36, 47, 31,
+ // Esther
+ 22, 23, 15, 17, 14, 14, 10, 17, 32, 3,
+ // Job
+ 22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 24, 34, 17,
+ // Psalms
+ 6, 12, 8, 8, 12, 10, 17, 9, 20, 18, 7, 8, 6, 7, 5, 11, 15, 50, 14, 9, 13, 31, 6, 10, 22, 12, 14, 9, 11, 12, 24, 11, 22, 22, 28, 12, 40, 22, 13, 17, 13, 11, 5, 26, 17, 11, 9, 14, 20, 23, 19, 9, 6, 7, 23, 13, 11, 11, 17, 12, 8, 12, 11, 10, 13, 20, 7, 35, 36, 5, 24, 20, 28, 23, 10, 12, 20, 72, 13, 19, 16, 8, 18, 12, 13, 17, 7, 18, 52, 17, 16, 15, 5, 23, 11, 13, 12, 9, 9, 5, 8, 28, 22, 35, 45, 48, 43, 13, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 13, 10, 7, 12, 15, 21, 10, 20, 14, 9, 6,
+ // Proverbs
+ 33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29, 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31,
+ // Ecclesiastes
+ 18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 13, 13, 14,
+ // Isaiah
+ 31, 22, 26, 6, 30, 13, 25, 22, 21, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 12, 25, 24,
+ // Jeremiah
+ 19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34,
+ // Lamentations
+ 22, 22, 66, 22, 22,
+ // Ezekiel
+ 28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35,
+ // Daniel
+ 21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13,
+ // Hosea
+ 11, 23, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 16, 9,
+ // Joel
+ 20, 32, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 17, 10, 10, 11,
+ // Micah
+ 16, 13, 12, 13, 15, 16, 20,
+ // Nahum
+ 15, 13, 19,
+ // Habakkuk
+ 17, 20, 19,
+ // Zephaniah
+ 18, 15, 20,
+ // Haggai
+ 15, 23,
+ // Zechariah
+ 21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21,
+ // Malachi
+ 14, 17, 18, 6,
+ // I Esdras
+ 58, 30, 24, 63, 73, 34, 15, 96, 55,
+ // II Esdras
+ 40, 48, 36, 52, 56, 59, 70, 63, 47, 59, 46, 51, 58, 48, 63, 78,
+ // Tobit
+ 22, 14, 17, 21, 22, 17, 18, 21, 6, 12, 19, 22, 18, 15,
+ // Judith
+ 16, 28, 10, 15, 24, 21, 32, 36, 14, 23, 23, 20, 20, 19, 13, 25,
+ // Additions to Esther
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 13, 12, 6, 18, 19, 16, 24,
+ // Wisdom
+ 16, 24, 19, 20, 23, 25, 30, 21, 18, 21, 26, 27, 19, 31, 19, 29, 21, 25, 22,
+ // Sirach
+ 30, 18, 31, 31, 15, 37, 36, 19, 18, 31, 34, 18, 26, 27, 20, 30, 32, 33, 30, 32, 28, 27, 28, 34, 26, 29, 30, 26, 28, 25, 31, 24, 31, 26, 20, 26, 31, 34, 35, 30, 24, 25, 33, 22, 26, 20, 25, 25, 16, 29, 30,
+ // Baruch
+ 22, 35, 37, 37, 9, 73,
+ // Prayer of Azariah
+ 68,
+ // Susanna
+ 64,
+ // Bel and the Dragon
+ 42,
+ // Prayer of Manasses
+ 1,
+ // I Maccabees
+ 64, 70, 60, 61, 68, 63, 50, 32, 73, 89, 74, 53, 53, 49, 41, 24,
+ // II Maccabees
+ 36, 32, 40, 50, 27, 31, 42, 36, 29, 38, 38, 45, 26, 46, 39,
+ // Matthew
+ 25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30, 34, 46, 46, 39, 51, 46, 75, 66, 20,
+ // Mark
+ 45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20,
+ // Luke
+ 80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48, 47, 38, 71, 56, 53,
+ // John
+ 51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25,
+ // Acts
+ 26, 47, 26, 37, 42, 15, 60, 40, 43, 48, 30, 25, 52, 28, 41, 40, 34, 28, 41, 38, 40, 30, 35, 27, 27, 32, 44, 31,
+ // Romans
+ 32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27,
+ // I Corinthians
+ 31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24,
+ // II Corinthians
+ 24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 14,
+ // Galatians
+ 24, 21, 29, 31, 26, 18,
+ // Ephesians
+ 23, 22, 21, 32, 33, 24,
+ // Philippians
+ 30, 30, 21, 23,
+ // Colossians
+ 29, 23, 25, 18,
+ // I Thessalonians
+ 10, 20, 13, 18, 28,
+ // II Thessalonians
+ 12, 17, 18,
+ // I Timothy
+ 20, 15, 16, 16, 25, 21,
+ // II Timothy
+ 18, 26, 17, 22,
+ // Titus
+ 16, 15, 15,
+ // Philemon
+ 25,
+ // Hebrews
+ 14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25,
+ // James
+ 27, 26, 18, 17, 20,
+ // I Peter
+ 25, 25, 22, 19, 14,
+ // II Peter
+ 21, 22, 18,
+ // I John
+ 10, 29, 24, 21, 21,
+ // II John
+ 13,
+ // III John
+ 14,
+ // Jude
+ 25,
+ // Revelation of John
+ 20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 17, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21
+};
+
+
+SWORD_NAMESPACE_END
+
+
+#endif
diff --git a/include/canon_leningrad.h b/include/canon_leningrad.h
new file mode 100644
index 0000000..54b1669
--- /dev/null
+++ b/include/canon_leningrad.h
@@ -0,0 +1,166 @@
+/******************************************************************************
+ * canon_leningrad.h - Versification data for the Leningrad system
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef CANON_LENINGRAD_H
+#define CANON_LENINGRAD_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: Leningrad
+// Book order: Gen Exod Lev Num Deut Josh Judg 1Sam 2Sam 1Kgs 2Kgs Isa Jer Ezek Hos Joel Amos Obad Jonah Mic Nah Hab Zeph Hag Zech Mal 1Chr 2Chr Ps Job Prov Ruth Song Eccl Lam Esth Dan Ezra Neh
+
+/******************************************************************************
+ * [on]tbooks_leningrad - initialize static instance for all canonical
+ * text names and chapmax
+ */
+struct sbook otbooks_leningrad[] = {
+ {"Genesis", "Gen", "Gen", 50},
+ {"Exodus", "Exod", "Exod", 40},
+ {"Leviticus", "Lev", "Lev", 27},
+ {"Numbers", "Num", "Num", 36},
+ {"Deuteronomy", "Deut", "Deut", 34},
+ {"Joshua", "Josh", "Josh", 24},
+ {"Judges", "Judg", "Judg", 21},
+ {"I Samuel", "1Sam", "1Sam", 31},
+ {"II Samuel", "2Sam", "2Sam", 24},
+ {"I Kings", "1Kgs", "1Kgs", 22},
+ {"II Kings", "2Kgs", "2Kgs", 25},
+ {"Isaiah", "Isa", "Isa", 66},
+ {"Jeremiah", "Jer", "Jer", 52},
+ {"Ezekiel", "Ezek", "Ezek", 48},
+ {"Hosea", "Hos", "Hos", 14},
+ {"Joel", "Joel", "Joel", 4},
+ {"Amos", "Amos", "Amos", 9},
+ {"Obadiah", "Obad", "Obad", 1},
+ {"Jonah", "Jonah", "Jonah", 4},
+ {"Micah", "Mic", "Mic", 7},
+ {"Nahum", "Nah", "Nah", 3},
+ {"Habakkuk", "Hab", "Hab", 3},
+ {"Zephaniah", "Zeph", "Zeph", 3},
+ {"Haggai", "Hag", "Hag", 2},
+ {"Zechariah", "Zech", "Zech", 14},
+ {"Malachi", "Mal", "Mal", 3},
+ {"I Chronicles", "1Chr", "1Chr", 29},
+ {"II Chronicles", "2Chr", "2Chr", 36},
+ {"Psalms", "Ps", "Ps", 150},
+ {"Job", "Job", "Job", 42},
+ {"Proverbs", "Prov", "Prov", 31},
+ {"Ruth", "Ruth", "Ruth", 4},
+ {"Song of Solomon", "Song", "Song", 8},
+ {"Ecclesiastes", "Eccl", "Eccl", 12},
+ {"Lamentations", "Lam", "Lam", 5},
+ {"Esther", "Esth", "Esth", 10},
+ {"Daniel", "Dan", "Dan", 12},
+ {"Ezra", "Ezra", "Ezra", 10},
+ {"Nehemiah", "Neh", "Neh", 13},
+ {"", "", "", 0}
+};
+
+// for ntbooks_mt, use ntbooks_null
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_leningrad[] = {
+ // Genesis
+ 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 54, 33, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26,
+ // Exodus
+ 22, 25, 22, 31, 23, 30, 29, 28, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 37, 30, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38,
+ // Leviticus
+ 17, 16, 17, 35, 26, 23, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34,
+ // Numbers
+ 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 35, 28, 32, 22, 29, 35, 41, 30, 25, 19, 65, 23, 31, 39, 17, 54, 42, 56, 29, 34, 13,
+ // Deuteronomy
+ 46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 31, 19, 29, 23, 22, 20, 22, 21, 20, 23, 29, 26, 22, 19, 19, 26, 69, 28, 20, 30, 52, 29, 12,
+ // Joshua
+ 18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33,
+ // Judges
+ 36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25,
+ // I Samuel
+ 28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 16, 23, 28, 23, 44, 25, 12, 25, 11, 31, 13,
+ // II Samuel
+ 27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 32, 44, 26, 22, 51, 39, 25,
+ // I Kings
+ 53, 46, 28, 20, 32, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 54,
+ // II Kings
+ 18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 20, 22, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30,
+ // Isaiah
+ 31, 22, 26, 6, 30, 13, 25, 23, 20, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 11, 25, 24,
+ // Jeremiah
+ 19, 37, 25, 31, 31, 30, 34, 23, 25, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34,
+ // Ezekiel
+ 28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 44, 37, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35,
+ // Hosea
+ 9, 25, 5, 19, 15, 11, 16, 14, 17, 15, 11, 15, 15, 10,
+ // Joel
+ 20, 27, 5, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 16, 11, 10, 11,
+ // Micah
+ 16, 13, 12, 14, 14, 16, 20,
+ // Nahum
+ 14, 14, 19,
+ // Habakkuk
+ 17, 20, 19,
+ // Zephaniah
+ 18, 15, 20,
+ // Haggai
+ 15, 23,
+ // Zechariah
+ 17, 17, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21,
+ // Malachi
+ 14, 17, 24,
+ // I Chronicles
+ 54, 55, 24, 43, 41, 66, 40, 40, 44, 14, 47, 41, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30,
+ // II Chronicles
+ 18, 17, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 23, 14, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23,
+ // Psalms
+ 6, 12, 9, 9, 13, 11, 18, 10, 21, 18, 7, 9, 6, 7, 5, 11, 15, 51, 15, 10, 14, 32, 6, 10, 22, 12, 14, 9, 11, 13, 25, 11, 22, 23, 28, 13, 40, 23, 14, 18, 14, 12, 5, 27, 18, 12, 10, 15, 21, 23, 21, 11, 7, 9, 24, 14, 12, 12, 18, 14, 9, 13, 12, 11, 14, 20, 8, 36, 37, 6, 24, 20, 28, 23, 11, 13, 21, 72, 13, 20, 17, 8, 19, 13, 14, 17, 7, 19, 53, 17, 16, 16, 5, 23, 11, 13, 12, 9, 9, 5, 8, 29, 22, 35, 45, 48, 43, 14, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 14, 10, 8, 12, 15, 21, 10, 20, 14, 9, 6,
+ // Job
+ 22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 32, 26, 17,
+ // Proverbs
+ 33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29, 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31,
+ // Ruth
+ 22, 23, 18, 22,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 12, 14, 14,
+ // Ecclesiastes
+ 18, 26, 22, 17, 19, 12, 29, 17, 18, 20, 10, 14,
+ // Lamentations
+ 22, 22, 66, 22, 22,
+ // Esther
+ 22, 23, 15, 17, 14, 14, 10, 17, 32, 3,
+ // Daniel
+ 21, 49, 33, 34, 30, 29, 28, 27, 27, 21, 45, 13,
+ // Ezra
+ 11, 70, 13, 24, 17, 22, 28, 36, 15, 44,
+ // Nehemiah
+ 11, 20, 38, 17, 19, 19, 72, 18, 37, 40, 36, 47, 31
+};
+
+
+SWORD_NAMESPACE_END
+
+
+#endif
diff --git a/include/canon_mt.h b/include/canon_mt.h
new file mode 100644
index 0000000..c350bb4
--- /dev/null
+++ b/include/canon_mt.h
@@ -0,0 +1,166 @@
+/******************************************************************************
+ * canon_mt.h - Versification data for the Masoretic Text (MT) system
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef CANON_MT_H
+#define CANON_MT_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: MT
+// Book order: Gen Exod Lev Num Deut Josh Judg 1Sam 2Sam 1Kgs 2Kgs Isa Jer Ezek Hos Joel Amos Obad Jonah Mic Nah Hab Zeph Hag Zech Mal Ps Job Prov Ruth Song Eccl Lam Esth Dan Ezra Neh 1Chr 2Chr
+
+/******************************************************************************
+ * [on]tbooks_mt - initialize static instance for all canonical
+ * text names and chapmax
+ */
+struct sbook otbooks_mt[] = {
+ {"Genesis", "Gen", "Gen", 50},
+ {"Exodus", "Exod", "Exod", 40},
+ {"Leviticus", "Lev", "Lev", 27},
+ {"Numbers", "Num", "Num", 36},
+ {"Deuteronomy", "Deut", "Deut", 34},
+ {"Joshua", "Josh", "Josh", 24},
+ {"Judges", "Judg", "Judg", 21},
+ {"I Samuel", "1Sam", "1Sam", 31},
+ {"II Samuel", "2Sam", "2Sam", 24},
+ {"I Kings", "1Kgs", "1Kgs", 22},
+ {"II Kings", "2Kgs", "2Kgs", 25},
+ {"Isaiah", "Isa", "Isa", 66},
+ {"Jeremiah", "Jer", "Jer", 52},
+ {"Ezekiel", "Ezek", "Ezek", 48},
+ {"Hosea", "Hos", "Hos", 14},
+ {"Joel", "Joel", "Joel", 4},
+ {"Amos", "Amos", "Amos", 9},
+ {"Obadiah", "Obad", "Obad", 1},
+ {"Jonah", "Jonah", "Jonah", 4},
+ {"Micah", "Mic", "Mic", 7},
+ {"Nahum", "Nah", "Nah", 3},
+ {"Habakkuk", "Hab", "Hab", 3},
+ {"Zephaniah", "Zeph", "Zeph", 3},
+ {"Haggai", "Hag", "Hag", 2},
+ {"Zechariah", "Zech", "Zech", 14},
+ {"Malachi", "Mal", "Mal", 3},
+ {"Psalms", "Ps", "Ps", 150},
+ {"Job", "Job", "Job", 42},
+ {"Proverbs", "Prov", "Prov", 31},
+ {"Ruth", "Ruth", "Ruth", 4},
+ {"Song of Solomon", "Song", "Song", 8},
+ {"Ecclesiastes", "Eccl", "Eccl", 12},
+ {"Lamentations", "Lam", "Lam", 5},
+ {"Esther", "Esth", "Esth", 10},
+ {"Daniel", "Dan", "Dan", 12},
+ {"Ezra", "Ezra", "Ezra", 10},
+ {"Nehemiah", "Neh", "Neh", 13},
+ {"I Chronicles", "1Chr", "1Chr", 29},
+ {"II Chronicles", "2Chr", "2Chr", 36},
+ {"", "", "", 0}
+};
+
+// for ntbooks_mt, use ntbooks_null
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_mt[] = {
+ // Genesis
+ 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 54, 33, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26,
+ // Exodus
+ 22, 25, 22, 31, 23, 30, 29, 28, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 37, 30, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38,
+ // Leviticus
+ 17, 16, 17, 35, 26, 23, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34,
+ // Numbers
+ 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 35, 28, 32, 22, 29, 35, 41, 30, 25, 19, 65, 23, 31, 39, 17, 54, 42, 56, 29, 34, 13,
+ // Deuteronomy
+ 46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 31, 19, 29, 23, 22, 20, 22, 21, 20, 23, 29, 26, 22, 19, 19, 26, 69, 28, 20, 30, 52, 29, 12,
+ // Joshua
+ 18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33,
+ // Judges
+ 36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25,
+ // I Samuel
+ 28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 16, 23, 28, 23, 44, 25, 12, 25, 11, 31, 13,
+ // II Samuel
+ 27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 32, 44, 26, 22, 51, 39, 25,
+ // I Kings
+ 53, 46, 28, 20, 32, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 54,
+ // II Kings
+ 18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 20, 22, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30,
+ // Isaiah
+ 31, 22, 26, 6, 30, 13, 25, 23, 20, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 11, 25, 24,
+ // Jeremiah
+ 19, 37, 25, 31, 31, 30, 34, 23, 25, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34,
+ // Ezekiel
+ 28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 44, 37, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35,
+ // Hosea
+ 9, 25, 5, 19, 15, 11, 16, 14, 17, 15, 11, 15, 15, 10,
+ // Joel
+ 20, 27, 5, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 16, 11, 10, 11,
+ // Micah
+ 16, 13, 12, 14, 14, 16, 20,
+ // Nahum
+ 14, 14, 19,
+ // Habakkuk
+ 17, 20, 19,
+ // Zephaniah
+ 18, 15, 20,
+ // Haggai
+ 15, 23,
+ // Zechariah
+ 17, 17, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21,
+ // Malachi
+ 14, 17, 24,
+ // Psalms
+ 6, 12, 9, 9, 13, 11, 18, 10, 21, 18, 7, 9, 6, 7, 5, 11, 15, 51, 15, 10, 14, 32, 6, 10, 22, 12, 14, 9, 11, 13, 25, 11, 22, 23, 28, 13, 40, 23, 14, 18, 14, 12, 5, 27, 18, 12, 10, 15, 21, 23, 21, 11, 7, 9, 24, 14, 12, 12, 18, 14, 9, 13, 12, 11, 14, 20, 8, 36, 37, 6, 24, 20, 28, 23, 11, 13, 21, 72, 13, 20, 17, 8, 19, 13, 14, 17, 7, 19, 53, 17, 16, 16, 5, 23, 11, 13, 12, 9, 9, 5, 8, 29, 22, 35, 45, 48, 43, 14, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 14, 10, 8, 12, 15, 21, 10, 20, 14, 9, 6,
+ // Job
+ 22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 32, 26, 17,
+ // Proverbs
+ 33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29, 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31,
+ // Ruth
+ 22, 23, 18, 22,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 12, 14, 14,
+ // Ecclesiastes
+ 18, 26, 22, 17, 19, 12, 29, 17, 18, 20, 10, 14,
+ // Lamentations
+ 22, 22, 66, 22, 22,
+ // Esther
+ 22, 23, 15, 17, 14, 14, 10, 17, 32, 3,
+ // Daniel
+ 21, 49, 33, 34, 30, 29, 28, 27, 27, 21, 45, 13,
+ // Ezra
+ 11, 70, 13, 24, 17, 22, 28, 36, 15, 44,
+ // Nehemiah
+ 11, 20, 38, 17, 19, 19, 72, 18, 37, 40, 36, 47, 31,
+ // I Chronicles
+ 54, 55, 24, 43, 41, 66, 40, 40, 44, 14, 47, 41, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30,
+ // II Chronicles
+ 18, 17, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 23, 14, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23
+};
+
+
+SWORD_NAMESPACE_END
+
+
+#endif
diff --git a/include/canon_nrsv.h b/include/canon_nrsv.h
new file mode 100644
index 0000000..d6042de
--- /dev/null
+++ b/include/canon_nrsv.h
@@ -0,0 +1,179 @@
+/******************************************************************************
+ * canon_nrsv.h - Versification data for the NRSV system
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef CANON_NRSV_H
+#define CANON_NRSV_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: NRSV
+// Book order: Gen Exod Lev Num Deut Josh Judg Ruth 1Sam 2Sam 1Kgs 2Kgs 1Chr 2Chr Ezra Neh Esth Job Ps Prov Eccl Song Isa Jer Lam Ezek Dan Hos Joel Amos Obad Jonah Mic Nah Hab Zeph Hag Zech Mal Matt Mark Luke John Acts Rom 1Cor 2Cor Gal Eph Phil Col 1Thess 2Thess 1Tim 2Tim Titus Phlm Heb Jas 1Pet 2Pet 1John 2John 3John Jude Rev
+
+/******************************************************************************
+ * [on]tbooks_nrsv - initialize static instance for all canonical
+ * text names and chapmax
+ */
+// for otbooks_nrsv, use otbooks
+
+// for ntbooks_nrsv, use ntbooks
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_nrsv[] = {
+ // Genesis
+ 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26,
+ // Exodus
+ 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38,
+ // Leviticus
+ 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34,
+ // Numbers
+ 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65, 23, 31, 40, 16, 54, 42, 56, 29, 34, 13,
+ // Deuteronomy
+ 46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 32, 18, 29, 23, 22, 20, 22, 21, 20, 23, 30, 25, 22, 19, 19, 26, 68, 29, 20, 30, 52, 29, 12,
+ // Joshua
+ 18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33,
+ // Judges
+ 36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25,
+ // Ruth
+ 22, 23, 18, 22,
+ // I Samuel
+ 28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 15, 23, 29, 22, 44, 25, 12, 25, 11, 31, 13,
+ // II Samuel
+ 27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 33, 43, 26, 22, 51, 39, 25,
+ // I Kings
+ 53, 46, 28, 34, 18, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 53,
+ // II Kings
+ 18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 21, 21, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30,
+ // I Chronicles
+ 54, 55, 24, 43, 26, 81, 40, 40, 44, 14, 47, 40, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30,
+ // II Chronicles
+ 17, 18, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 22, 15, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23,
+ // Ezra
+ 11, 70, 13, 24, 17, 22, 28, 36, 15, 44,
+ // Nehemiah
+ 11, 20, 32, 23, 19, 19, 73, 18, 38, 39, 36, 47, 31,
+ // Esther
+ 22, 23, 15, 17, 14, 14, 10, 17, 32, 3,
+ // Job
+ 22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 24, 34, 17,
+ // Psalms
+ 6, 12, 8, 8, 12, 10, 17, 9, 20, 18, 7, 8, 6, 7, 5, 11, 15, 50, 14, 9, 13, 31, 6, 10, 22, 12, 14, 9, 11, 12, 24, 11, 22, 22, 28, 12, 40, 22, 13, 17, 13, 11, 5, 26, 17, 11, 9, 14, 20, 23, 19, 9, 6, 7, 23, 13, 11, 11, 17, 12, 8, 12, 11, 10, 13, 20, 7, 35, 36, 5, 24, 20, 28, 23, 10, 12, 20, 72, 13, 19, 16, 8, 18, 12, 13, 17, 7, 18, 52, 17, 16, 15, 5, 23, 11, 13, 12, 9, 9, 5, 8, 28, 22, 35, 45, 48, 43, 13, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 13, 10, 7, 12, 15, 21, 10, 20, 14, 9, 6,
+ // Proverbs
+ 33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29, 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31,
+ // Ecclesiastes
+ 18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 13, 13, 14,
+ // Isaiah
+ 31, 22, 26, 6, 30, 13, 25, 22, 21, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 12, 25, 24,
+ // Jeremiah
+ 19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34,
+ // Lamentations
+ 22, 22, 66, 22, 22,
+ // Ezekiel
+ 28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35,
+ // Daniel
+ 21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13,
+ // Hosea
+ 11, 23, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 16, 9,
+ // Joel
+ 20, 32, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 17, 10, 10, 11,
+ // Micah
+ 16, 13, 12, 13, 15, 16, 20,
+ // Nahum
+ 15, 13, 19,
+ // Habakkuk
+ 17, 20, 19,
+ // Zephaniah
+ 18, 15, 20,
+ // Haggai
+ 15, 23,
+ // Zechariah
+ 21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21,
+ // Malachi
+ 14, 17, 18, 6,
+ // Matthew
+ 25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30, 34, 46, 46, 39, 51, 46, 75, 66, 20,
+ // Mark
+ 45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20,
+ // Luke
+ 80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48, 47, 38, 71, 56, 53,
+ // John
+ 51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25,
+ // Acts
+ 26, 47, 26, 37, 42, 15, 60, 40, 43, 48, 30, 25, 52, 28, 41, 40, 34, 28, 41, 38, 40, 30, 35, 27, 27, 32, 44, 31,
+ // Romans
+ 32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27,
+ // I Corinthians
+ 31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24,
+ // II Corinthians
+ 24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 14,
+ // Galatians
+ 24, 21, 29, 31, 26, 18,
+ // Ephesians
+ 23, 22, 21, 32, 33, 24,
+ // Philippians
+ 30, 30, 21, 23,
+ // Colossians
+ 29, 23, 25, 18,
+ // I Thessalonians
+ 10, 20, 13, 18, 28,
+ // II Thessalonians
+ 12, 17, 18,
+ // I Timothy
+ 20, 15, 16, 16, 25, 21,
+ // II Timothy
+ 18, 26, 17, 22,
+ // Titus
+ 16, 15, 15,
+ // Philemon
+ 25,
+ // Hebrews
+ 14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25,
+ // James
+ 27, 26, 18, 17, 20,
+ // I Peter
+ 25, 25, 22, 19, 14,
+ // II Peter
+ 21, 22, 18,
+ // I John
+ 10, 29, 24, 21, 21,
+ // II John
+ 13,
+ // III John
+ 15,
+ // Jude
+ 25,
+ // Revelation of John
+ 20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21
+};
+
+
+SWORD_NAMESPACE_END
+
+
+#endif
diff --git a/include/canon_nrsva.h b/include/canon_nrsva.h
new file mode 100644
index 0000000..47ada7d
--- /dev/null
+++ b/include/canon_nrsva.h
@@ -0,0 +1,271 @@
+/******************************************************************************
+ * canon_nrsva.h - Versification data for the NRSVA system
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef CANON_NRSVA_H
+#define CANON_NRSVA_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: NRSVA
+// Book order: Gen Exod Lev Num Deut Josh Judg Ruth 1Sam 2Sam 1Kgs 2Kgs 1Chr 2Chr Ezra Neh Esth Job Ps Prov Eccl Song Isa Jer Lam Ezek Dan Hos Joel Amos Obad Jonah Mic Nah Hab Zeph Hag Zech Mal Tob Jdt EsthGr Wis Sir Bar PrAzar Sus Bel 1Macc 2Macc 1Esd PrMan AddPs 3Macc 2Esd 4Macc Matt Mark Luke John Acts Rom 1Cor 2Cor Gal Eph Phil Col 1Thess 2Thess 1Tim 2Tim Titus Phlm Heb Jas 1Pet 2Pet 1John 2John 3John Jude Rev
+
+/******************************************************************************
+ * [on]tbooks_nrsva - initialize static instance for all canonical
+ * text names and chapmax
+ */
+struct sbook otbooks_nrsva[] = {
+ {"Genesis", "Gen", "Gen", 50},
+ {"Exodus", "Exod", "Exod", 40},
+ {"Leviticus", "Lev", "Lev", 27},
+ {"Numbers", "Num", "Num", 36},
+ {"Deuteronomy", "Deut", "Deut", 34},
+ {"Joshua", "Josh", "Josh", 24},
+ {"Judges", "Judg", "Judg", 21},
+ {"Ruth", "Ruth", "Ruth", 4},
+ {"I Samuel", "1Sam", "1Sam", 31},
+ {"II Samuel", "2Sam", "2Sam", 24},
+ {"I Kings", "1Kgs", "1Kgs", 22},
+ {"II Kings", "2Kgs", "2Kgs", 25},
+ {"I Chronicles", "1Chr", "1Chr", 29},
+ {"II Chronicles", "2Chr", "2Chr", 36},
+ {"Ezra", "Ezra", "Ezra", 10},
+ {"Nehemiah", "Neh", "Neh", 13},
+ {"Esther", "Esth", "Esth", 10},
+ {"Job", "Job", "Job", 42},
+ {"Psalms", "Ps", "Ps", 150},
+ {"Proverbs", "Prov", "Prov", 31},
+ {"Ecclesiastes", "Eccl", "Eccl", 12},
+ {"Song of Solomon", "Song", "Song", 8},
+ {"Isaiah", "Isa", "Isa", 66},
+ {"Jeremiah", "Jer", "Jer", 52},
+ {"Lamentations", "Lam", "Lam", 5},
+ {"Ezekiel", "Ezek", "Ezek", 48},
+ {"Daniel", "Dan", "Dan", 12},
+ {"Hosea", "Hos", "Hos", 14},
+ {"Joel", "Joel", "Joel", 3},
+ {"Amos", "Amos", "Amos", 9},
+ {"Obadiah", "Obad", "Obad", 1},
+ {"Jonah", "Jonah", "Jonah", 4},
+ {"Micah", "Mic", "Mic", 7},
+ {"Nahum", "Nah", "Nah", 3},
+ {"Habakkuk", "Hab", "Hab", 3},
+ {"Zephaniah", "Zeph", "Zeph", 3},
+ {"Haggai", "Hag", "Hag", 2},
+ {"Zechariah", "Zech", "Zech", 14},
+ {"Malachi", "Mal", "Mal", 4},
+ {"Tobit", "Tob", "Tob", 14},
+ {"Judith", "Jdt", "Jdt", 16},
+ {"Esther (Greek)", "EsthGr", "EsthGr", 16},
+ {"Wisdom", "Wis", "Wis", 19},
+ {"Sirach", "Sir", "Sir", 51},
+ {"Baruch", "Bar", "Bar", 6},
+ {"Prayer of Azariah", "PrAzar", "PrAzar", 1},
+ {"Susanna", "Sus", "Sus", 1},
+ {"Bel and the Dragon", "Bel", "Bel", 1},
+ {"I Maccabees", "1Macc", "1Macc", 16},
+ {"II Maccabees", "2Macc", "2Macc", 15},
+ {"I Esdras", "1Esd", "1Esd", 9},
+ {"Prayer of Manasses", "PrMan", "PrMan", 1},
+ {"Additional Psalm", "AddPs", "AddPs", 1},
+ {"III Maccabees", "3Macc", "3Macc", 7},
+ {"II Esdras", "2Esd", "2Esd", 16},
+ {"IV Maccabees", "4Macc", "4Macc", 18},
+ {"", "", "", 0}
+};
+
+// for ntbooks_nrsva, use ntbooks
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_nrsva[] = {
+ // Genesis
+ 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26,
+ // Exodus
+ 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25, 26, 36, 31, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29, 31, 43, 38,
+ // Leviticus
+ 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37, 27, 24, 33, 44, 23, 55, 46, 34,
+ // Numbers
+ 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22, 29, 35, 41, 30, 25, 18, 65, 23, 31, 40, 16, 54, 42, 56, 29, 34, 13,
+ // Deuteronomy
+ 46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 32, 18, 29, 23, 22, 20, 22, 21, 20, 23, 30, 25, 22, 19, 19, 26, 68, 29, 20, 30, 52, 29, 12,
+ // Joshua
+ 18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33,
+ // Judges
+ 36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25,
+ // Ruth
+ 22, 23, 18, 22,
+ // I Samuel
+ 28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 15, 23, 29, 22, 44, 25, 12, 25, 11, 31, 13,
+ // II Samuel
+ 27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 33, 43, 26, 22, 51, 39, 25,
+ // I Kings
+ 53, 46, 28, 34, 18, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 53,
+ // II Kings
+ 18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 21, 21, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30,
+ // I Chronicles
+ 54, 55, 24, 43, 26, 81, 40, 40, 44, 14, 47, 40, 14, 17, 29, 43, 27, 17, 19, 8, 30, 19, 32, 31, 31, 32, 34, 21, 30,
+ // II Chronicles
+ 17, 18, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 22, 15, 19, 14, 19, 34, 11, 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23,
+ // Ezra
+ 11, 70, 13, 24, 17, 22, 28, 36, 15, 44,
+ // Nehemiah
+ 11, 20, 32, 23, 19, 19, 73, 18, 38, 39, 36, 47, 31,
+ // Esther
+ 22, 23, 15, 17, 14, 14, 10, 17, 32, 3,
+ // Job
+ 22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29, 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41, 30, 24, 34, 17,
+ // Psalms
+ 6, 12, 8, 8, 12, 10, 17, 9, 20, 18, 7, 8, 6, 7, 5, 11, 15, 50, 14, 9, 13, 31, 6, 10, 22, 12, 14, 9, 11, 12, 24, 11, 22, 22, 28, 12, 40, 22, 13, 17, 13, 11, 5, 26, 17, 11, 9, 14, 20, 23, 19, 9, 6, 7, 23, 13, 11, 11, 17, 12, 8, 12, 11, 10, 13, 20, 7, 35, 36, 5, 24, 20, 28, 23, 10, 12, 20, 72, 13, 19, 16, 8, 18, 12, 13, 17, 7, 18, 52, 17, 16, 15, 5, 23, 11, 13, 12, 9, 9, 5, 8, 28, 22, 35, 45, 48, 43, 13, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176, 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 13, 10, 7, 12, 15, 21, 10, 20, 14, 9, 6,
+ // Proverbs
+ 33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29, 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31,
+ // Ecclesiastes
+ 18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 13, 13, 14,
+ // Isaiah
+ 31, 22, 26, 6, 30, 13, 25, 22, 21, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 12, 25, 24,
+ // Jeremiah
+ 19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34,
+ // Lamentations
+ 22, 22, 66, 22, 22,
+ // Ezekiel
+ 28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35,
+ // Daniel
+ 21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13,
+ // Hosea
+ 11, 23, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 16, 9,
+ // Joel
+ 20, 32, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 17, 10, 10, 11,
+ // Micah
+ 16, 13, 12, 13, 15, 16, 20,
+ // Nahum
+ 15, 13, 19,
+ // Habakkuk
+ 17, 20, 19,
+ // Zephaniah
+ 18, 15, 20,
+ // Haggai
+ 15, 23,
+ // Zechariah
+ 21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21,
+ // Malachi
+ 14, 17, 18, 6,
+ // Tobit
+ 22, 14, 17, 21, 22, 18, 16, 21, 6, 13, 18, 22, 17, 15,
+ // Judith
+ 16, 28, 10, 15, 24, 21, 32, 36, 14, 23, 23, 20, 20, 19, 14, 25,
+ // Esther (Greek)
+ 22, 23, 15, 17, 14, 14, 10, 17, 32, 13, 12, 6, 18, 19, 16, 24,
+ // Wisdom
+ 16, 24, 19, 20, 23, 25, 30, 21, 18, 21, 26, 27, 19, 31, 19, 29, 21, 25, 22,
+ // Sirach
+ 30, 18, 31, 31, 15, 37, 36, 19, 18, 31, 34, 18, 26, 27, 20, 30, 32, 33, 30, 31, 28, 27, 27, 34, 26, 29, 30, 26, 28, 25, 31, 24, 33, 31, 26, 31, 31, 34, 35, 30, 22, 25, 33, 23, 26, 20, 25, 25, 16, 29, 30,
+ // Baruch
+ 22, 35, 37, 37, 9, 73,
+ // Prayer of Azariah
+ 68,
+ // Susanna
+ 64,
+ // Bel and the Dragon
+ 42,
+ // I Maccabees
+ 64, 70, 60, 61, 68, 63, 50, 32, 73, 89, 74, 53, 53, 49, 41, 24,
+ // II Maccabees
+ 36, 32, 40, 50, 27, 31, 42, 36, 29, 38, 38, 45, 26, 46, 39,
+ // I Esdras
+ 58, 30, 24, 63, 73, 34, 15, 96, 55,
+ // Prayer of Manasses
+ 15,
+ // Additional Psalm
+ 7,
+ // III Maccabees
+ 29, 33, 30, 21, 51, 41, 23,
+ // II Esdras
+ 40, 48, 36, 52, 56, 59, 140, 63, 47, 59, 46, 51, 58, 48, 63, 78,
+ // IV Maccabees
+ 35, 24, 21, 26, 38, 35, 23, 29, 32, 21, 27, 19, 27, 20, 32, 25, 24, 24,
+ // Matthew
+ 25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30, 34, 46, 46, 39, 51, 46, 75, 66, 20,
+ // Mark
+ 45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20,
+ // Luke
+ 80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48, 47, 38, 71, 56, 53,
+ // John
+ 51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25,
+ // Acts
+ 26, 47, 26, 37, 42, 15, 60, 40, 43, 48, 30, 25, 52, 28, 41, 40, 34, 28, 41, 38, 40, 30, 35, 27, 27, 32, 44, 31,
+ // Romans
+ 32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27,
+ // I Corinthians
+ 31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24,
+ // II Corinthians
+ 24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 14,
+ // Galatians
+ 24, 21, 29, 31, 26, 18,
+ // Ephesians
+ 23, 22, 21, 32, 33, 24,
+ // Philippians
+ 30, 30, 21, 23,
+ // Colossians
+ 29, 23, 25, 18,
+ // I Thessalonians
+ 10, 20, 13, 18, 28,
+ // II Thessalonians
+ 12, 17, 18,
+ // I Timothy
+ 20, 15, 16, 16, 25, 21,
+ // II Timothy
+ 18, 26, 17, 22,
+ // Titus
+ 16, 15, 15,
+ // Philemon
+ 25,
+ // Hebrews
+ 14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25,
+ // James
+ 27, 26, 18, 17, 20,
+ // I Peter
+ 25, 25, 22, 19, 14,
+ // II Peter
+ 21, 22, 18,
+ // I John
+ 10, 29, 24, 21, 21,
+ // II John
+ 13,
+ // III John
+ 15,
+ // Jude
+ 25,
+ // Revelation of John
+ 20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 18, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21
+};
+
+
+SWORD_NAMESPACE_END
+
+
+#endif
diff --git a/include/canon_null.h b/include/canon_null.h
new file mode 100644
index 0000000..ade2276
--- /dev/null
+++ b/include/canon_null.h
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * canon_null.h - Versification data for the null system
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ */
+
+#ifndef CANON_NULL_H
+#define CANON_NULL_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: null
+// Book order:
+// This is not a real versification system. Rather, use these [on]tbooks values for other versifications that are missing entire testaments.
+
+/******************************************************************************
+ * [on]tbooks_null - initialize static instance for all canonical
+ * text names and chapmax
+ */
+struct sbook otbooks_null[] = {
+ {"", "", "", 0}
+};
+
+struct sbook ntbooks_null[] = {
+ {"", "", "", 0}
+};
+
+SWORD_NAMESPACE_END
+
+
+#endif
diff --git a/include/config.h b/include/config.h
index 08b25a9..5088073 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1,6 +1,9 @@
/* include/config.h. Generated from config.h.in by configure. */
/* include/config.h.in. Generated from configure.ac by autoheader. */
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
@@ -37,6 +40,10 @@
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
/* Name of package */
#define PACKAGE "sword"
@@ -47,20 +54,28 @@
#define PACKAGE_NAME "sword"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "sword 1.5.11"
+#define PACKAGE_STRING "sword 1.6.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "sword"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.5.11"
+#define PACKAGE_VERSION "1.6.0"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
-#define VERSION "1.5.11"
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
+#define VERSION "1.6.0"
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* # undef WORDS_BIGENDIAN */
+# endif
+#endif
diff --git a/include/config.h.in b/include/config.h.in
index 9cf654f..a37d095 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -1,5 +1,8 @@
/* include/config.h.in. Generated from configure.ac by autoheader. */
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -36,6 +39,10 @@
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Name of package */
#undef PACKAGE
@@ -60,6 +67,14 @@
/* Version number of package */
#undef VERSION
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-#undef WORDS_BIGENDIAN
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
diff --git a/include/curlftpt.h b/include/curlftpt.h
index 7949814..41fd23b 100644
--- a/include/curlftpt.h
+++ b/include/curlftpt.h
@@ -1,3 +1,23 @@
+/******************************************************************************
+* curlftpt.h - code for CURL impl of FTP Transport
+*
+* $Id: swbuf.h 2218 2008-12-23 09:33:38Z scribe $
+*
+* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+* CrossWire Bible Society
+* P. O. Box 2528
+* Tempe, AZ 85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+*/
#ifndef CURLFTPT_H
#define CURLFTPT_H
diff --git a/include/curlhttpt.h b/include/curlhttpt.h
new file mode 100644
index 0000000..6236daf
--- /dev/null
+++ b/include/curlhttpt.h
@@ -0,0 +1,52 @@
+/******************************************************************************
+* curlhttpt.h - code for CURL impl of HTTP Transport
+*
+* $Id: swbuf.h 2218 2008-12-23 09:33:38Z scribe $
+*
+* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+* CrossWire Bible Society
+* P. O. Box 2528
+* Tempe, AZ 85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+*/
+#ifndef CURLHTTPT_H
+#define CURLHTTPT_H
+
+#include <defs.h>
+#include <ftptrans.h>
+
+SWORD_NAMESPACE_START
+
+class CURL;
+
+// initialize/cleanup SYSTEMWIDE library with life of this static.
+class CURLHTTPTransport_init {
+public:
+ CURLHTTPTransport_init();
+ ~CURLHTTPTransport_init();
+};
+
+
+class SWDLLEXPORT CURLHTTPTransport : public FTPTransport {
+ CURL *session;
+
+public:
+ CURLHTTPTransport(const char *host, StatusReporter *statusReporter = 0);
+ ~CURLHTTPTransport();
+
+ virtual char getURL(const char *destPath, const char *sourceURL, SWBuf *destBuf = 0);
+};
+
+
+SWORD_NAMESPACE_END
+
+#endif
diff --git a/include/defs.h b/include/defs.h
index be04f49..cba55e2 100644
--- a/include/defs.h
+++ b/include/defs.h
@@ -103,7 +103,7 @@ SWORD_NAMESPACE_START
enum {DIRECTION_LTR = 0, DIRECTION_RTL, DIRECTION_BIDI};
enum {FMT_UNKNOWN = 0, FMT_PLAIN, FMT_THML, FMT_GBF, FMT_HTML, FMT_HTMLHREF, FMT_RTF, FMT_OSIS, FMT_WEBIF, FMT_TEI};
-enum {ENC_UNKNOWN = 0, ENC_LATIN1, ENC_UTF8, ENC_SCSU, ENC_UTF16, ENC_RTF, ENC_HTML};
+enum {ENC_UNKNOWN = 0, ENC_LATIN1, ENC_UTF8, ENC_UTF16, ENC_RTF, ENC_HTML};
SWORD_NAMESPACE_END
#endif //SWORDDEFS_H
diff --git a/include/encfiltmgr.h b/include/encfiltmgr.h
index 1080994..8afc208 100644
--- a/include/encfiltmgr.h
+++ b/include/encfiltmgr.h
@@ -37,7 +37,6 @@ class SWDLLEXPORT EncodingFilterMgr : public SWFilterMgr {
protected:
SWFilter *latin1utf8;
- SWFilter *scsuutf8;
SWFilter *targetenc;
diff --git a/include/filemgr.h b/include/filemgr.h
index 86b8334..6ee584d 100644
--- a/include/filemgr.h
+++ b/include/filemgr.h
@@ -1,7 +1,7 @@
/******************************************************************************
* filemgr.h - definition of class FileMgr used for pooling file handles
*
-* $Id: filemgr.h 2108 2007-10-13 20:35:02Z scribe $
+* $Id: filemgr.h 2295 2009-03-29 17:11:27Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -143,7 +143,7 @@ public:
* Will only close the file if it was created by this FileMgr object.
* @param file The file to close.
*/
- void close(FileDesc * file);
+ void close(FileDesc *file);
/** Cacher methods overridden
*/
diff --git a/include/flatapi.h b/include/flatapi.h
index 51cdeea..1123a0e 100644
--- a/include/flatapi.h
+++ b/include/flatapi.h
@@ -2,7 +2,7 @@
* swordapi.h - This file contains an api usable by non-C++
* environments
*
- * $Id: flatapi.h 2152 2008-05-04 03:52:06Z scribe $
+ * $Id: flatapi.h 2324 2009-04-20 18:40:15Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -97,7 +97,7 @@ const char * SWDLLEXPORT SWModule_getFootnoteType(SWHANDLE hmodule, const char *
const char * SWDLLEXPORT SWModule_getFootnoteBody(SWHANDLE hmodule, const char *key, const char *note);
const char * SWDLLEXPORT SWModule_getFootnoteRefList(SWHANDLE hmodule, const char *key, const char *note);
-SWHANDLE SWDLLEXPORT listkey_getVerselistIterator(const char * list, const char * key);
+SWHANDLE SWDLLEXPORT listkey_getVerselistIterator(const char *list, const char *key, const char *v11n = "KJV");
}
#ifdef __cplusplus
diff --git a/include/ftplibftpt.h b/include/ftplibftpt.h
index 7aa9e13..d07c68b 100644
--- a/include/ftplibftpt.h
+++ b/include/ftplibftpt.h
@@ -1,3 +1,23 @@
+/******************************************************************************
+* ftplibftpt.h - code for ftplib impl of FTP Transport
+*
+* $Id: swbuf.h 2218 2008-12-23 09:33:38Z scribe $
+*
+* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+* CrossWire Bible Society
+* P. O. Box 2528
+* Tempe, AZ 85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+*/
#ifndef FTPLIBFTPT_H
#define FTPLIBFTPT_H
diff --git a/include/ftptrans.h b/include/ftptrans.h
index c6a025a..87502d2 100644
--- a/include/ftptrans.h
+++ b/include/ftptrans.h
@@ -1,3 +1,26 @@
+/******************************************************************************
+* ftptrans.h - code for FTP Transport
+*
+* $Id: swbuf.h 2218 2008-12-23 09:33:38Z scribe $
+*
+* Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+* CrossWire Bible Society
+* P. O. Box 2528
+* Tempe, AZ 85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+*/
+
+// TODO: Rename this to RemoteTransport in 1.7.x
+
#ifndef FTPTRANS_H
#define FTPTRANS_H
@@ -5,13 +28,6 @@
#include <defs.h>
#include <swbuf.h>
-//SWORD_NAMESPACE_START
-
-
-// move this include to cpp once struct ftpparse isn't exposed anymore
-extern "C" {
-#include <ftpparse.h>
-}
SWORD_NAMESPACE_START
@@ -22,7 +38,7 @@ public:
virtual ~StatusReporter() {};
/** Messages before stages of a batch download */
virtual void preStatus(long totalBytes, long completedBytes, const char *message);
-
+
/** frequently called throughout a download, to report status */
virtual void statusUpdate(double dtTotal, double dlNow);
};
@@ -31,21 +47,23 @@ public:
/** TODO: document
* A base class to be used for reimplementation of network services.
*/
-class SWDLLEXPORT FTPTransport {
+class SWDLLEXPORT FTPTransport { // TODO: rename to more generic RemoteTransport
protected:
StatusReporter *statusReporter;
bool passive;
bool term;
SWBuf host;
-
+ SWBuf u;
+ SWBuf p;
+
public:
FTPTransport(const char *host, StatusReporter *statusReporter = 0);
virtual ~FTPTransport();
/***********
* override this method in your real impl
- *
+ *
* if destBuf then write to buffer instead of file
*/
virtual char getURL(const char *destPath, const char *sourceURL, SWBuf *destBuf = 0);
@@ -55,6 +73,8 @@ public:
virtual std::vector<struct DirEntry> getDirList(const char *dirURL);
void setPassive(bool passive) { this->passive = passive; }
+ void setUser(const char *user) { u = user; }
+ void setPasswd(const char *passwd) { p = passwd; }
void terminate() { term = true; }
};
diff --git a/include/installmgr.h b/include/installmgr.h
index f4d48e9..b3972b6 100644
--- a/include/installmgr.h
+++ b/include/installmgr.h
@@ -14,7 +14,7 @@ class SWConfig;
class FTPTransport;
class StatusReporter;
-/** TODO: document
+/** A remote installation source configuration
*/
class SWDLLEXPORT InstallSource {
SWMgr *mgr;
@@ -22,37 +22,53 @@ public:
InstallSource(const char *type, const char *confEnt = 0);
virtual ~InstallSource();
SWBuf getConfEnt() {
- return caption +"|" + source + "|" + directory;
+ return caption +"|" + source + "|" + directory + "|" + u + "|" + p + "|" + uid;
}
- SWBuf type;
+ SWBuf caption;
SWBuf source;
SWBuf directory;
- SWBuf caption;
+ SWBuf u;
+ SWBuf p;
+ SWBuf uid;
+
+ SWBuf type;
SWBuf localShadow;
void *userData;
SWMgr *getMgr();
void flush();
};
+/** A standard map of remote install sources.
+ */
typedef std::map<SWBuf, InstallSource *> InstallSourceMap;
-/** TODO: document
-*/
+/** Class to handle installation and maintenance of a SWORD library of books.
+ */
class SWDLLEXPORT InstallMgr {
protected:
+ bool userDisclaimerConfirmed;
std::set<SWBuf> defaultMods;
char *privatePath;
+ SWBuf confPath;
StatusReporter *statusReporter;
bool passive;
-
- // override this method and provide your own custom FTPTransport subclass
+ SWBuf u, p;
+
+ /** override this method and provide your own custom FTPTransport subclass
+ */
virtual FTPTransport *createFTPTransport(const char *host, StatusReporter *statusReporter);
- // we have a transport member to set as current running transport so we
- // can ask it to terminate below, if user requests
- FTPTransport *transport;
-
+ /** override this method and provide your own custom HTTP RemoteTransport (still called FTPTransport in pre 1.7.x) subclass
+ */
+ virtual FTPTransport *createHTTPTransport(const char *host, StatusReporter *statusReporter);
+
+
+ /** we have a transport member to set as current running transport so we
+ * can ask it to terminate below, if user requests
+ */
+ FTPTransport *transport;
+
public:
static const int MODSTAT_OLDER;
@@ -63,23 +79,156 @@ public:
static const int MODSTAT_CIPHERKEYPRESENT;
SWConfig *installConf;
+
+ /** all remote sources configured for this installmgr. Use this to gain access
+ * to individual remote sources.
+ */
InstallSourceMap sources;
- bool term;
- InstallMgr(const char *privatePath = "./", StatusReporter *statusReporter = 0);
+ /** Username and Password supplied here can be used to identify your frontend
+ * by supplying a valid anon password like installmgr@macsword.com
+ * This will get overridden if a password is required and provided in an indivual
+ * source configuration.
+ */
+ InstallMgr(const char *privatePath = "./", StatusReporter *statusReporter = 0, SWBuf u="ftp", SWBuf p="installmgr@user.com");
virtual ~InstallMgr();
+ /** Call to re-read InstallMgr.conf
+ */
+ void readInstallConf();
+
+ /** Call to dump sources and other settings to InstallMgr.conf
+ */
+ void saveInstallConf();
+
+ /** Removes all configured sources from memory. Call saveInstallConf() to persist
+ */
+ void clearSources();
+
+ /** call to delete all files of a locally installed module.
+ */
virtual int removeModule(SWMgr *manager, const char *modName);
+
+ /** mostly an internally used method to ftp download from an remote source to a local destination
+ */
virtual int ftpCopy(InstallSource *is, const char *src, const char *dest, bool dirTransfer = false, const char *suffix = "");
+
+ /** call to install a module from a local path (fromLocation) or remote InstallSource (is) (leave the other 0)
+ */
virtual int installModule(SWMgr *destMgr, const char *fromLocation, const char *modName, InstallSource *is = 0);
-
+
+ /** call to obtain and locally cache the available content list of the remote source
+ */
virtual int refreshRemoteSource(InstallSource *is);
- virtual bool getCipherCode(const char *modName, SWConfig *config);
+
+ /** call to populate installmgr configuration with all known
+ * remote sources from the master list at CrossWire
+ */
+ virtual int refreshRemoteSourceConfiguration();
+
+ /** Override this and provide an input mechanism to allow your users
+ * to confirm that they understand this important disclaimer.
+ * This method will be called immediately before attempting to perform
+ * any network function.
+ * If you would like your confirmation to always show at a predefined
+ * time before attempting network operations, then you can call this
+ * method yourself at the desired time.
+ *
+ * Return true if your user confirms.
+ *
+ * User disclaimer should ask user for confirmation of 2 critical items:
+ * and the default answer should be NO
+ * (possibly the wrong language for the disclaimer)
+ *
+
+A sample impl:
+
+ static bool confirmed = false;
+ if (!confirmed) {
+ cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
+ cout << " -=+* WARNING *+=- -=+* WARNING *+=-\n\n\n";
+ cout << "Although Install Manager provides a convenient way for installing\n";
+ cout << "and upgrading SWORD components, it also uses a systematic method\n";
+ cout << "for accessing sites which gives packet sniffers a target to lock\n";
+ cout << "into for singling out users. \n\n\n";
+ cout << "IF YOU LIVE IN A PERSECUTED COUNTRY AND DO NOT WISH TO RISK DETECTION,\n";
+ cout << "YOU SHOULD *NOT* USE INSTALL MANAGER'S REMOTE SOURCE FEATURES.\n\n\n";
+ cout << "Also, Remote Sources other than CrossWire may contain less than\n";
+ cout << "quality modules, modules with unorthodox content, or even modules\n";
+ cout << "which are not legitimately distributable. Many repositories\n";
+ cout << "contain wonderfully useful content. These repositories simply\n";
+ cout << "are not reviewed or maintained by CrossWire and CrossWire\n";
+ cout << "cannot be held responsible for their content. CAVEAT EMPTOR.\n\n\n";
+ cout << "If you understand this and are willing to enable remote source features\n";
+ cout << "then type yes at the prompt\n\n";
+ cout << "enable? [no] ";
+
+ char prompt[10];
+ fgets(prompt, 9, stdin);
+ confirmed = (!strcmp(prompt, "yes\n"));
+ }
+ return confirmed;
+
+ */
+ virtual bool isUserDisclaimerConfirmed() const { return userDisclaimerConfirmed; }
+
+ /** Preferred method of reporting user disclaimer confirmation is to override the above method
+ * instead of using the setter below. This is provided for clients who don't wish to inherit
+ * InstallMgr and override method.
+ */
+ void setUserDisclaimerConfirmed(bool val) { userDisclaimerConfirmed = val; }
+
+
+ /** override this and provide an input mechanism to allow your users
+ * to enter the decipher code for a module.
+ * return true you added the cipher code to the config.
+ * default to return 'aborted'
+
+A sample implementation, roughly taken from the windows installmgr:
+
+ SectionMap::iterator section;
+ ConfigEntMap::iterator entry;
+ SWBuf tmpBuf;
+ section = config->Sections.find(modName);
+ if (section != config->Sections.end()) {
+ entry = section->second.find("CipherKey");
+ if (entry != section->second.end()) {
+ entry->second = GET_USER_INPUT();
+ config->Save();
+
+ // LET'S SHOW THE USER SOME SAMPLE TEXT FROM THE MODULE
+ SWMgr *mgr = new SWMgr();
+ SWModule *mod = mgr->getModule(modName);
+ mod->setKey("Ipet 2:12");
+ tmpBuf = mod->StripText();
+ mod->setKey("gen 1:10");
+ tmpBuf += "\n\n";
+ tmpBuf += mod->StripText();
+ SOME_DIALOG_CONTROL->SETTEXT(tmpBuf.c_str());
+ delete mgr;
+
+ // if USER CLICKS OK means we should return true
+ return true;
+ }
+ }
+ return false;
+}
+ */
+ virtual bool getCipherCode(const char *modName, SWConfig *config) { return false; }
+
+
+
+ /** whether or not to use passive mode when doing ftp transfers
+ */
void setFTPPassive(bool passive) { this->passive = passive; }
+ bool isFTPPassive() { return passive; }
+
+ /** call from another thread to terminate the installation process
+ */
void terminate();
/************************************************************************
- * getModuleStatus - compare the modules of two SWMgrs and return a
+ * getModuleStatus - compare the modules of two SWMgrs and return a
* vector describing the status of each. See MODSTAT_*
*/
static std::map<SWModule *, int> getModuleStatus(const SWMgr &base, const SWMgr &other);
diff --git a/include/listkey.h b/include/listkey.h
index e939248..2c0a611 100644
--- a/include/listkey.h
+++ b/include/listkey.h
@@ -4,7 +4,7 @@
* (e.g. verse, word,
* place, etc.)
*
- * $Id: listkey.h 1958 2006-08-22 00:15:10Z scribe $
+ * $Id: listkey.h 2195 2008-09-11 00:20:58Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -117,15 +117,16 @@ public:
/** Decrements a number of elements
*/
- virtual void decrement(int step);
+ virtual void decrement(int step = 1);
/** Increments a number of elements
*/
- virtual void increment(int step);
+ virtual void increment(int step = 1);
virtual bool isTraversable() const { return true; }
virtual long Index() const { return arraypos; }
virtual const char *getRangeText() const;
+ virtual const char *getOSISRefRangeText() const;
/**
* Returns the index for the new one given as as parameter.
diff --git a/include/osisbook.h b/include/osisbook.h
deleted file mode 100644
index a3750f6..0000000
--- a/include/osisbook.h
+++ /dev/null
@@ -1,640 +0,0 @@
-/******************************************************************************
- * osisbook.h - Canonical text information to be included by VerseKey2.cpp
- *
- * $Id: osisbook.h 1688 2005-01-01 04:42:26Z scribe $
- *
- * Copyright 2004 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-
-/******************************************************************************
- * [on]tbooks - initialize static instance for all canonical text names
- * and chapmax
- * taken from http://whi.wts.edu/OSIS/Projects/Markup/specs/BibleBookNames.html
- */
-
-#define TESTAMENT_HEADING 255
-//#define NTOFFSET 24115 //24115 is offset to start of NT
-#if 0
-#define OSISBMAX 68
-#endif
-#define BUILTINABBREVCNT 195
-
-struct sbook2 VerseKey2::osisbooks[] = {
-//Module Heading
-{"Module Heading", "ZZZ"},//0
-//Old Testament
-{"Old Testament", "OT"},//1
-{"Genesis", "Gen"},
-{"Exodus", "Exod"},
-{"Leviticus", "Lev"},
-{"Numbers", "Num"},
-{"Deuteronomy", "Deut"},
-{"Joshua", "Josh"},
-{"Judges", "Judg"},
-{"Ruth", "Ruth"},
-{"1 Samuel", "1Sam"},//10
-{"2 Samuel", "2Sam"},
-{"1 Kings", "1Kgs"},
-{"2 Kings", "2Kgs"},
-{"1 Chronicles", "1Chr"},
-{"2 Chronicles", "2Chr"},
-{"Ezra", "Ezra"},
-{"Nehemiah", "Neh"},
-{"Esther", "Esth"},
-{"Job", "Job"},
-{"Psalms", "Ps"},//20
-{"Proverbs", "Prov"},
-{"Ecclesiastes", "Eccl"}, // Qohelot
-{"Song of Solomon", "Song"}, // Canticle of Canticles
-{"Isaiah", "Isa"},
-{"Jeremiah", "Jer"},
-{"Lamentations", "Lam"},
-{"Ezekiel", "Ezek"},
-{"Daniel", "Dan"},
-{"Hosea", "Hos"},
-{"Joel", "Joel"},//30
-{"Amos", "Amos"},
-{"Obadiah", "Obad"},
-{"Jonah", "Jonah"},
-{"Micah", "Mic"},
-{"Nahum", "Nah"},
-{"Habakkuk", "Hab"},
-{"Zephaniah", "Zeph"},
-{"Haggai", "Hag"},
-{"Zechariah", "Zech"},
-{"Malachi", "Mal"},//40
-
-//Roman Catholic Deuterocanon
-{"Deuterocanon", "DC"},//41
-{"Tobit", "Tob"},//(70)
-{"Judith", "Jdt"},
-{"Wisdom", "Wis"}, // Wisdom of Solomon
-{"Sirach", "Sir"}, // Ecclesiasticus
-{"Baruch", "Bar"}, // 1 Baruch
-{"Letter of Jeremiah", "EpJer"},//(75)
-{"1 Esdras", "1Esd"}, // 3Ezra Esdras A
-{"2 Esdras", "2Esd"}, // 4Ezra Esdras B
-{"1 Maccabees", "1Macc"},//(78)50
-{"2 Maccabees", "2Macc"},//51
-
-
-//Septuagint
-{"3 Maccabees", "3Macc"},//(80)52
-{"4 Maccabees", "4Macc"},
-{"Odes of Solomon", "OdesSol"},
-{"Psalms of Solomon", "PssSol"},//55
-
-
-//Vulgate
-{"Epistle to the Laodiceans", "EpLao"},//(84)56
-
-
-//Orthodox Canon
-{"1 Enoch", "1En"},//(85)57 // Ethiopic Apocalypse of Enoch
-{"Jubilees", "Jub"},//(86)58
-
-
-//Protestant Apocrypha
-{"Apocrypha", "Apoc"},//(87)59
-{"Additions to Esther", "AddEsth"},
-{"Prayer of Azariah", "PrAzar"}, // Song of the Three Children
-{"Susanna", "Sus"},//(90)
-{"Bel and the Dragon", "Bel"},
-{"Prayer of Manasses", "PrMan"},
-{"Psalm 151", "Ps151"},//(93)65
-
-
-//New Testament
-{"New Testament", "NT"},//66
-{"Matthew", "Matt"},
-{"Mark", "Mark"},
-{"Luke", "Luke"},
-{"John", "John"},//70
-{"Acts", "Acts"},
-{"Romans", "Rom"},
-{"1 Corinthians", "1Cor"},
-{"2 Corinthians", "2Cor"},
-{"Galatians", "Gal"},//(50)
-{"Ephesians", "Eph"},
-{"Philippians", "Phil"},
-{"Colossians", "Col"},
-{"1 Thessalonians", "1Thess"},
-{"2 Thessalonians", "2Thess"},//80
-{"1 Timothy", "1Tim"},
-{"2 Timothy", "2Tim"},
-{"Titus", "Titus"},
-{"Philemon", "Phlm"},
-{"Hebrews", "Heb"},//(60)
-{"James", "Jas"},
-{"1 Peter", "1Pet"},
-{"2 Peter", "2Pet"},
-{"1 John", "1John"},
-{"2 John", "2John"},//90
-{"3 John", "3John"},
-{"Jude", "Jude"},
-{"Revelation", "Rev"}//(68)93
-
-
-};
-
-/* the en abbrevs will be in a conf file as well
-*/
-
-/*
-const struct abbrev2
- VerseKey2::builtin_abbrevs[] = {
- {"1 C", 48}, // 1 Corinthians
- {"1 CHRONICLES", 14}, // 1 Chronicles
- {"1 CORINTHIANS", 48}, // 1 Corinthians
- {"1 JN", 64}, // 1 John
- {"1 JOHN", 64}, // 1 John
- {"1 KGS", 12}, // 1 Kings
- {"1 KINGS", 12}, // 1 Kings
- {"1 PETER", 62}, // 1 Peter
- {"1 PTR", 62}, // 1 Peter
- {"1 SAMUEL", 10}, // 1 Samuel
- {"1 THESSALONIANS", 54}, // 1 Thessalonians
- {"1 TIMOTHY", 56}, // 1 Timothy
- {"1C", 48}, // 1 Corinthians
- {"1CHRONICLES", 14}, // 1 Chronicles
- {"1CORINTHIANS", 48}, // 1 Corinthians
- {"1JN", 64}, // 1 John
- {"1JOHN", 64}, // 1 John
- {"1KGS", 12}, // 1 Kings
- {"1KINGS", 12}, // 1 Kings
- {"1PETER", 62}, // 1 Peter
- {"1PTR", 62}, // 1 Peter
- {"1SAMUEL", 10}, // 1 Samuel
- {"1THESSALONIANS", 54}, // 1 Thessalonians
- {"1TIMOTHY", 56}, // 1 Timothy
- {"2 C", 49}, // 2 Corinthians
- {"2 CHRONICLES", 15}, // 2 Chronicles
- {"2 CORINTHIANS", 49}, // 2 Corinthians
- {"2 JN", 65}, // 2 John
- {"2 JOHN", 65}, // 2 John
- {"2 KGS", 13}, // 2 Kings
- {"2 KINGS", 13}, // 2 Kings
- {"2 PETER", 63}, // 2 Peter
- {"2 PTR", 63}, // 2 Peter
- {"2 SAMUEL", 11}, // 2 Samuel
- {"2 THESSALONIANS", 55}, // 2 Thessalonians
- {"2 TIMOTHY", 57}, // 2 Timothy
- {"2C", 49}, // 2 Corinthians
- {"2CHRONICLES", 15}, // 2 Chronicles
- {"2CORINTHIANS", 49}, // 2 Corinthians
- {"2JN", 65}, // 2 John
- {"2JOHN", 65}, // 2 John
- {"2KGS", 13}, // 2 Kings
- {"2KINGS", 13}, // 2 Kings
- {"2PETER", 63}, // 2 Peter
- {"2PTR", 63}, // 2 Peter
- {"2SAMUEL", 11}, // 2 Samuel
- {"2THESSALONIANS", 55}, // 2 Thessalonians
- {"2TIMOTHY", 57}, // 2 Timothy
- {"3 JN", 66}, // 3 John
- {"3 JOHN", 66}, // 3 John
- {"3JN", 66}, // 3 John
- {"3JOHN", 66}, // 3 John
- {"ACTS", 46}, // Acts
- {"AMOS", 31}, // Amos
- {"APOCALYPSE OF ST. JOHN", 68}, // Apocalypse of St. John (Rev.)
- {"C", 53}, // Colossians
- {"CANTICLE OF CANTICLES", 23}, // Canticle of Canticles (Song of S.)
- {"COLOSSIANS", 53}, // Colossians
- {"D", 6}, // Deuteronomy
- {"DANIEL", 28}, // Daniel
- {"DEUTERONOMY", 6}, // Deuteronomy
- {"E", 51}, // Ephesians
- {"ECCLESIASTES", 22}, // Ecclesiastes
- {"EPHESIANS", 51}, // Ephesians
- {"ESTER", 18}, // Esther
- {"ESTHER", 18}, // Esther
- {"EXODUS", 3}, // Exodus
- {"EZEKIEL", 27}, // Ezekiel
- {"EZK", 27}, // Ezekiel
- {"EZRA", 16}, // Ezra
- {"G", 2}, // Genesis
- {"GALATIANS", 50}, // Galatians
- {"GENESIS", 2}, // Genesis
- {"H", 60}, // Hebrews
- {"HABAKKUK", 36}, // Habakkuk
- {"HAGGAI", 38}, // Haggai
- {"HEBREWS", 60}, // Hebrews
- {"HOSEA", 29}, // Hosea
- {"I C", 48}, // 1 Corinthians
- {"I CHRONICLES", 14}, // 1 Chronicles
- {"I CORINTHIANS", 48}, // 1 Corinthians
- {"I JN", 64}, // 1 John
- {"I JOHN", 64}, // 1 John
- {"I KGS", 12}, // 1 Kings
- {"I KINGS", 12}, // 1 Kings
- {"I PETER", 62}, // 1 Peter
- {"I PTR", 62}, // 1 Peter
- {"I SAMUEL", 10}, // 1 Samuel
- {"I THESSALONIANS", 54}, // 1 Thessalonians
- {"I TIMOTHY", 56}, // 1 Timothy
- {"IC", 48}, // 1 Corinthians
- {"ICHRONICLES", 14}, // 1 Chronicles
- {"ICORINTHIANS", 48}, // 1 Corinthians
- {"II C", 49}, // 2 Corinthians
- {"II CHRONICLES", 15}, // 2 Chronicles
- {"II CORINTHIANS", 49}, // 2 Corinthians
- {"II JN", 65}, // 2 John
- {"II JOHN", 65}, // 2 John
- {"II KGS", 13}, // 2 Kings
- {"II KINGS", 13}, // 2 Kings
- {"II PETER", 63}, // 2 Peter
- {"II PTR", 63}, // 2 Peter
- {"II SAMUEL", 11}, // 2 Samuel
- {"II THESSALONIANS", 55}, // 2 Thessalonians
- {"II TIMOTHY", 57}, // 2 Timothy
- {"IIC", 49}, // 2 Corinthians
- {"IICHRONICLES", 15}, // 2 Chronicles
- {"IICORINTHIANS", 49}, // 2 Corinthians
- {"III JN", 66}, // 3 John
- {"III JOHN", 66}, // 3 John
- {"IIIJN", 66}, // 3 John
- {"IIIJOHN", 66}, // 3 John
- {"IIJN", 65}, // 2 John
- {"IIJOHN", 65}, // 2 John
- {"IIKGS", 13}, // 2 Kings
- {"IIKINGS", 13}, // 2 Kings
- {"IIPETER", 63}, // 2 Peter
- {"IIPTR", 63}, // 2 Peter
- {"IISAMUEL", 11}, // 2 Samuel
- {"IITHESSALONIANS", 55}, // 2 Thessalonians
- {"IITIMOTHY", 55}, // 2 Timothy
- {"IJN", 64}, // 1 John
- {"IJOHN", 64}, // 1 John
- {"IKGS", 12}, // 1 Kings
- {"IKINGS", 12}, // 1 Kings
- {"IPETER", 62}, // 1 Peter
- {"IPTR", 62}, // 1 Peter
- {"ISA", 24}, // Isaiah
- {"ISAIAH", 24}, // Isaiah
- {"ISAMUEL", 10}, // 1 Samuel
- {"ITHESSALONIANS", 54}, // 1 Thessalonians
- {"ITIMOTHY", 56}, // 1 Timothy
- {"J", 45}, // John
- {"JAMES", 61}, // James
- {"JAS", 61}, // James
- {"JDGS", 8}, // Judges
- {"JEREMIAH", 25}, // Jeremiah
- {"JHN", 45}, // John
- {"JN", 45}, // John
- {"JO", 45}, // John
- {"JOB", 19}, // Job
- {"JOEL", 30}, // Joel
- {"JOHN", 45}, // John
- {"JOL", 30}, // Joel
- {"JONAH", 33}, // Jonah
- {"JOSHUA", 7}, // Joshua
- {"JUDE", 67}, // Jude
- {"JUDGES", 8}, // Judges
- {"L", 44}, // Luke
- {"LAMENTATIONS", 26}, // Lamentations
- {"LEVITICUS", 4}, // Leviticus
- {"LK", 44}, // Luke
- {"LUKE", 44}, // Luke
- {"MA", 42}, // Matthew
- {"MALACHI", 40}, // Malachi
- {"MARK", 43}, // Mark
- {"MATTHEW", 42}, // Matthew
- {"MICAH", 34}, // Micah
- {"MODULE HEADING", 0}, // Module Heading
- {"MK", 43}, // Mark
- {"MRK", 43}, // Mark
- {"MT", 42}, // Matthew
- {"N", 5}, // Numbers
- {"NAHUM", 35}, // Nahum
- {"NAM", 35}, // Nahum
- {"NEHEMIAH", 17}, // Nehemiah
- {"NEW TESTAMENT", 41}, // New Testament
- {"NUMBERS", 5}, // Numbers
- {"OBADIAH", 32}, // Obadiah
- {"OLD TESTAMENT", 1}, // Old Testament
- {"P", 20}, // Psalms
- {"PHIL", 52}, // Philippians
- {"PHILEMON", 59}, // Philemon
- {"PHILIPPIANS", 52}, // Philippians
- {"PHLM", 59}, // Philemon
- {"PHM", 59}, // Philemon
- {"PHP", 52}, // Philippians
- {"PR", 21}, // Proverbs
- {"PROVERBS", 21}, // Proverbs
- {"PSA", 20}, // Psalms
- {"PSALMS", 20}, // Psalms
- {"PSM", 20}, // Psalms
- {"PSS", 20}, // Psalms
- {"QOHELETH", 22}, // Qohelet (Ecclesiastes)
- {"REVELATION OF JOHN", 68}, // Revelation
- {"ROMANS", 47}, // Romans
- {"RUTH", 9}, // Ruth
- {"SNG", 23}, // Song of Solomon
- {"SOLOMON", 23}, // Song of Solomon
- {"SONG OF SOLOMON", 23}, // Song of Solomon
- {"SONG OF SONGS", 23}, // Song of Solomon
- {"SOS", 23}, // Song of Solomon
- {"TITUS", 58}, // Titus
- {"ZECHARIAH", 39}, // Zechariah
- {"ZEPHANIAH", 37}, // Zephaniah
- {"", -1}
-};
-*/
-
-/* includes all osis books - use the locale osis.conf instead
-const struct abbrev
- VerseKey2::builtin_abbrevs[] = {
- {"1 C", 46}, // 1 Corinthians
- {"1 CHRONICLES", 13}, // 1 Chronicles
- {"1 CORINTHIANS", 47}, // 1 Corinthians
- {"1 ENOCH", 84},
- {"1 ESDRAS", 75},
- {"1 JN", 63}, // 1 John
- {"1 JOHN", 63}, // 1 John
- {"1 KGS", 11}, // 1 Kings
- {"1 KINGS", 11}, // 1 Kings
- {"1 MACCABEES", 77},
- {"1 PETER", 61}, // 1 Peter
- {"1 PTR", 61}, // 1 Peter
- {"1 SAMUEL", 9}, // 1 Samuel
- {"1 THESSALONIANS", 53}, // 1 Thessalonians
- {"1 TIMOTHY", 55}, // 1 Timothy
- {"1C", 47}, // 1 Corinthians
- {"1CHRONICLES", 13}, // 1 Chronicles
- {"1CORINTHIANS", 47}, // 1 Corinthians
- {"1ENOCH", 84},
- {"1ESDRAS", 75},
- {"1JN", 63}, // 1 John
- {"1JOHN", 63}, // 1 John
- {"1KGS", 11}, // 1 Kings
- {"1KINGS", 11}, // 1 Kings
- {"1MACCABEES", 77},
- {"1PETER", 61}, // 1 Peter
- {"1PTR", 61}, // 1 Peter
- {"1SAMUEL", 9}, // 1 Samuel
- {"1THESSALONIANS", 53}, // 1 Thessalonians
- {"1TIMOTHY", 55}, // 1 Timothy
- {"2 C", 48}, // 2 Corinthians
- {"2 CHRONICLES", 14}, // 2 Chronicles
- {"2 CORINTHIANS", 48}, // 2 Corinthians
- {"2 ESDRAS", 76},
- {"2 JN", 64}, // 2 John
- {"2 JOHN", 64}, // 2 John
- {"2 KGS", 12}, // 2 Kings
- {"2 KINGS", 12}, // 2 Kings
- {"2 MACCABEES", 78},
- {"2 PETER", 62}, // 2 Peter
- {"2 PTR", 62}, // 2 Peter
- {"2 SAMUEL", 10}, // 2 Samuel
- {"2 THESSALONIANS", 54}, // 2 Thessalonians
- {"2 TIMOTHY", 56}, // 2 Timothy
- {"2C", 48}, // 2 Corinthians
- {"2CHRONICLES", 14}, // 2 Chronicles
- {"2CORINTHIANS", 48}, // 2 Corinthians
- {"2ESDRAS", 76},
- {"2JN", 64}, // 2 John
- {"2JOHN", 64}, // 2 John
- {"2KGS", 12}, // 2 Kings
- {"2KINGS", 12}, // 2 Kings
- {"2MACCABEES", 78},
- {"2PETER", 62}, // 2 Peter
- {"2PTR", 62}, // 2 Peter
- {"2SAMUEL", 10}, // 2 Samuel
- {"2THESSALONIANS", 54}, // 2 Thessalonians
- {"2TIMOTHY", 56}, // 2 Timothy
- {"3 JN", 65}, // 3 John
- {"3 JOHN", 65}, // 3 John
- {"3JN", 65}, // 3 John
- {"3JOHN", 65}, // 3 John
- {"3 MACCABEES", 79},
- {"3MACCABEES", 79},
- {"4 MACCABEES", 80},
- {"4MACCABEES", 80},
- {"ACTS", 45}, // Acts
- {"ADDESTHER", 87},
- {"ADDITIONS TO ESTHER", 87},
- {"AMOS", 30}, // Amos
- {"APOCALYPSE OF ST. JOHN", 67}, // Apocalypse of St. John (Rev.)
- {"APOCRYPHA", 86},
- {"BARUCH", 73},
- {"BEL AND THE DRAGON",90},
- {"BEN SIRACH", 72},
- {"C", 52}, // Colossians
- {"CANTICLE OF CANTICLES", 22}, // Canticle of Canticles (Song of S.)
- {"COLOSSIANS", 52}, // Colossians
- {"D", 5}, // Deuteronomy
- {"DANIEL", 27}, // Daniel
- {"DEUTERO", 5}, // Deuteronomy
- {"DEUTEROCANON", 68}, // Deuteronomy
- {"DEUTERONOMY", 5}, // Deuteronomy
- {"E", 50}, // Ephesians
- {"ECCLESIASTES", 21}, // Ecclesiastes
- {"ECCLESIASTICUS", 73},
- {"EPHESIANS", 50}, // Ephesians
- {"EPISTLE OF JEREMIAH", 74},
- {"EPISTLE TO THE LAODICEANS", 83},
- {"EPJER", 74},
- {"EPLAO", 83},
- {"ESTER", 17}, // Esther
- {"ESTHER", 17}, // Esther
- {"EXODUS", 2}, // Exodus
- {"EZEKIEL", 26}, // Ezekiel
- {"EZK", 26}, // Ezekiel
- {"EZRA", 15}, // Ezra
- {"G", 1}, // Genesis
- {"GALATIANS", 49}, // Galatians
- {"GENESIS", 1}, // Genesis
- {"H", 59}, // Hebrews
- {"HABAKKUK", 35}, // Habakkuk
- {"HAGGAI", 37}, // Haggai
- {"HEBREWS", 59}, // Hebrews
- {"HOSEA", 28}, // Hosea
- {"I C", 47}, // 1 Corinthians
- {"I CHRONICLES", 13}, // 1 Chronicles
- {"I CORINTHIANS", 47}, // 1 Corinthians
- {"I ENOCH", 84},
- {"I ESDRAS", 76},
- {"I JN", 63}, // 1 John
- {"I JOHN", 63}, // 1 John
- {"I KGS", 11}, // 1 Kings
- {"I KINGS", 11}, // 1 Kings
- {"I MACCABEES", 78},
- {"I PETER", 61}, // 1 Peter
- {"I PTR", 61}, // 1 Peter
- {"I SAMUEL", 9}, // 1 Samuel
- {"I THESSALONIANS", 53}, // 1 Thessalonians
- {"I TIMOTHY", 55}, // 1 Timothy
- {"IC", 47}, // 1 Corinthians
- {"ICHRONICLES", 13}, // 1 Chronicles
- {"ICORINTHIANS", 47}, // 1 Corinthians
- {"IENOCH", 84},
- {"IESDRAS", 76},
- {"II C", 48}, // 2 Corinthians
- {"II CHRONICLES", 14}, // 2 Chronicles
- {"II CORINTHIANS", 48}, // 2 Corinthians
- {"II ESDRAS", 77},
- {"II JN", 64}, // 2 John
- {"II JOHN", 64}, // 2 John
- {"II KGS", 12}, // 2 Kings
- {"II KINGS", 12}, // 2 Kings
- {"II MACCABEES", 79},
- {"II PETER", 62}, // 2 Peter
- {"II PTR", 62}, // 2 Peter
- {"II SAMUEL", 10}, // 2 Samuel
- {"II THESSALONIANS", 54}, // 2 Thessalonians
- {"II TIMOTHY", 56}, // 2 Timothy
- {"IIC", 48}, // 2 Corinthians
- {"IICHRONICLES", 14}, // 2 Chronicles
- {"IICORINTHIANS", 48}, // 2 Corinthians
- {"IIESDRAS", 77},
- {"III JN", 65}, // 3 John
- {"III JOHN", 65}, // 3 John
- {"IIIJN", 65}, // 3 John
- {"IIIJOHN", 65}, // 3 John
- {"III MACCABEES", 80},
- {"IIII MACCABEES", 81},
- {"IIIIMACCABEES", 81},
- {"IIIMACCABEES", 80},
- {"IIJN", 64}, // 2 John
- {"IIJOHN", 64}, // 2 John
- {"IIKGS", 12}, // 2 Kings
- {"IIKINGS", 12}, // 2 Kings
- {"IIMACCABEES", 79},
- {"IIPETER", 62}, // 2 Peter
- {"IIPTR", 62}, // 2 Peter
- {"IISAMUEL", 10}, // 2 Samuel
- {"IITHESSALONIANS", 54}, // 2 Thessalonians
- {"IITIMOTHY", 56}, // 2 Timothy
- {"IJN", 63}, // 1 John
- {"IJOHN", 63}, // 1 John
- {"IKGS", 11}, // 1 Kings
- {"IKINGS", 11}, // 1 Kings
- {"IMACCABEES", 78},
- {"IPETER", 61}, // 1 Peter
- {"IPTR", 61}, // 1 Peter
- {"ISA", 23}, // Isaiah
- {"ISAIAH", 23}, // Isaiah
- {"ISAMUEL", 9}, // 1 Samuel
- {"ITHESSALONIANS", 53}, // 1 Thessalonians
- {"ITIMOTHY", 55}, // 1 Timothy
- {"IV MACCABEES", 81},
- {"IVMACCABEES", 81},
- {"J", 44}, // John
- {"JAMES", 60}, // James
- {"JAS", 60}, // James
- {"JDGS", 7}, // Judges
- {"JDT", 70},
- {"JEREMIAH", 24}, // Jeremiah
- {"JESUS BEN SIRACH", 73},
- {"JHN", 44}, // John
- {"JN", 44}, // John
- {"JO", 44}, // John
- {"JOB", 18}, // Job
- {"JOEL", 29}, // Joel
- {"JOHN", 44}, // John
- {"JOL", 29}, // Joel
- {"JONAH", 32}, // Jonah
- {"JOSHUA", 6}, // Joshua
- {"JUBILEES", 85},
- {"JUDE", 66}, // Jude
- {"JUDGES", 7}, // Judges
- {"JUDITH", 70},
- {"L", 43}, // Luke
- {"LAMENTATIONS", 25}, // Lamentations
- {"LAODICEANS", 83},
- {"LETTER OF JEREMIAH", 74},
- {"LEVITICUS", 3}, // Leviticus
- {"LK", 43}, // Luke
- {"LUKE", 43}, // Luke
- {"MA", 41}, // Matthew
- {"MALACHI", 39}, // Malachi
- {"MANASSEH", 91},
- {"MANASSES", 91},
- {"MARK", 42}, // Mark
- {"MATTHEW", 41}, // Matthew
- {"MICAH", 33}, // Micah
- {"MK", 42}, // Mark
- {"MRK", 42}, // Mark
- {"MT", 41}, // Matthew
- {"N", 4}, // Numbers
- {"NAHUM", 34}, // Nahum
- {"NAM", 34}, // Nahum
- {"NEHEMIAH", 16}, // Nehemiah
- {"NEW TESTAMENT", 40}, // New Testament
- {"NUMBERS", 4}, // Numbers
- {"OBADIAH", 31}, // Obadiah
- {"ODES OF SOLOMON", 81},
- {"OLD TESTAMENT", 0}, // Old Testament
- {"P", 19}, // Psalms
- {"PHIL", 51}, // Philippians
- {"PHILEMON", 58}, // Philemon
- {"PHILIPPIANS", 51}, // Philippians
- {"PHLM", 58}, // Philemon
- {"PHM", 58}, // Philemon
- {"PHP", 51}, // Philippians
- {"PR", 20}, // Proverbs
- {"PRAYER OF AZARIAH", 88},
- {"PRAYER OF MANASSEH", 91},
- {"PRAYER OF MANASSES", 91},
- {"PRAZAR", 88},
- {"PRMAN", 91},
- {"PROVERBS", 20}, // Proverbs
- {"PS151", 92},
- {"PSA", 19}, // Psalms
- {"PSALM ", 19},
- {"PSALM 151", 92},
- {"PSALM151", 92},
- {"PSALMS", 19}, // Psalms
- {"PSALMS OF SOLOMON", 82},
- {"PSM", 19}, // Psalms
- {"PSS", 19}, // Psalms
- {"PSSOL", 82},
- {"PSSSOL", 82},
- {"QOHELETH", 21}, // Qohelet (Ecclesiastes)
- {"REVELATION OF JOHN", 67}, // Revelation
- {"ROMANS", 46}, // Romans
- {"RUTH", 8}, // Ruth
- {"SIRACH", 72},
- {"SNG", 22}, // Song of Solomon
- {"SOLOMON", 22}, // Song of Solomon
- {"SONG OF SOLOMON", 22}, // Song of Solomon
- {"SONG OF SONGS", 22}, // Song of Solomon
- {"SOS", 22}, // Song of Solomon
- {"SUSANNA", 89},
- {"TITUS", 57}, // Titus
- {"TOBIT", 69},
- {"WISDOM", 71},//250
- {"WISDOM OF JESUS BEN SIRACH", 72},
- {"ZECHARIAH", 38}, // Zechariah
- {"ZEPHANIAH", 36}, // Zephaniah
- {"", -1}
-};
-*/
-
-/* The default versification scheme is KJV */
-/*
- 0, 1, 52, 93, 121, 158,
- 193, 218, 240, 245, 277, 302, 325,
- 351, 381, 418, 429, 443, 454, 497,
- 648, 680, 693, 702, 769, 822, 828,
- 877, 890, 905, 909, 919, 921, 926,
- 934, 938, 942, 946, 949, 964
-*/
-
-
-
-
diff --git a/include/osishtmlhref.h b/include/osishtmlhref.h
index af8fab2..d8cf58e 100644
--- a/include/osishtmlhref.h
+++ b/include/osishtmlhref.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * $Id: osishtmlhref.h 2091 2007-09-28 01:49:45Z scribe $
+ * $Id: osishtmlhref.h 2391 2009-05-08 02:02:16Z chrislit $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -33,7 +33,7 @@ private:
protected:
// used by derived classes so we have it in the header
class QuoteStack;
- class MyUserData : public BasicFilterUserData {
+ class SWDLLEXPORT MyUserData : public BasicFilterUserData {
public:
bool osisQToTick;
bool inBold;
diff --git a/include/osismorphsegmentation.h b/include/osismorphsegmentation.h
index 45bbec7..807237d 100644
--- a/include/osismorphsegmentation.h
+++ b/include/osismorphsegmentation.h
@@ -29,7 +29,7 @@ SWORD_NAMESPACE_START
* (for morpheme segmented Hebrew in the WLC)
*/
-class OSISMorphSegmentation : public SWOptionFilter {
+class SWDLLEXPORT OSISMorphSegmentation : public SWOptionFilter {
public:
OSISMorphSegmentation();
diff --git a/include/osisplain.h b/include/osisplain.h
index 19aee17..facbd67 100644
--- a/include/osisplain.h
+++ b/include/osisplain.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * $Id: osisplain.h 1688 2005-01-01 04:42:26Z scribe $
+ * $Id: osisplain.h 2187 2008-07-22 11:00:16Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -31,15 +31,7 @@ SWORD_NAMESPACE_START
class SWDLLEXPORT OSISPlain : public SWBasicFilter {
public:
protected:
- class MyUserData : public BasicFilterUserData {
- public:
- SWBuf w;
- XMLTag tag;
- MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {}
- };
- virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) {
- return new MyUserData(module, key);
- }
+ virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key);
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
public:
OSISPlain();
diff --git a/include/scsuutf8.h b/include/osisruby.h
index 000cdd6..07cbe49 100644
--- a/include/scsuutf8.h
+++ b/include/osisruby.h
@@ -1,40 +1,38 @@
-/******************************************************************************
- *
- * $Id: scsuutf8.h 1688 2005-01-01 04:42:26Z scribe $
- *
- * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
- * CrossWire Bible Society
- * P. O. Box 2528
- * Tempe, AZ 85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- */
-
-#ifndef SCSUUTF8_H
-#define SCSUUTF8_H
-
-#include <swfilter.h>
-
-SWORD_NAMESPACE_START
-
-/** This filter converts SCSU compressed (encoded) text to UTF-8
- */
-class SWDLLEXPORT SCSUUTF8 : public SWFilter {
- unsigned long c, d;
- unsigned char* UTF8Output(unsigned long, unsigned char* text);
-
-public:
- SCSUUTF8();
- virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
-};
-
-SWORD_NAMESPACE_END
-#endif
+/******************************************************************************
+ *
+ * $Id: osisruby.h 1688 2005-01-01 04:42:26Z scribe $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef OSISRUBY_H
+#define OSISRUBY_H
+
+#include <swoptfilter.h>
+
+SWORD_NAMESPACE_START
+
+/** This Filter shows/hides headings in a OSIS text
+ */
+class SWDLLEXPORT OSISRuby : public SWOptionFilter {
+public:
+ OSISRuby();
+ virtual ~OSISRuby();
+ virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
+};
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/rawcom.h b/include/rawcom.h
index c5f7895..4811b40 100644
--- a/include/rawcom.h
+++ b/include/rawcom.h
@@ -2,7 +2,7 @@
* rawcom.h - code for class 'RawCom'- a module that reads raw commentary
* files: ot and nt using indexs ??.bks ??.cps ??.vss
*
- * $Id: rawcom.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: rawcom.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -36,24 +36,28 @@ class SWDLLEXPORT RawCom : public RawVerse, public SWCom {
public:
RawCom(const char *ipath, const char *iname = 0, const char *idesc = 0,
- SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
- const char* ilang = 0);
+ const char *ilang = 0, const char *versification = "KJV");
virtual ~RawCom();
virtual SWBuf &getRawEntryBuf();
- virtual void increment(int steps);
- virtual void decrement(int steps) { increment(-steps); }
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
// write interface ----------------------------
virtual bool isWritable();
- static char createModule(const char *path) { return RawVerse::createModule(path); }
+ static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse::createModule(path, v11n); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
// end write interface ------------------------
+ virtual bool isLinked(const SWKey *k1, const SWKey *k2) const;
+ virtual bool hasEntry(const SWKey *k) const;
+
+
SWMODULE_OPERATORS
};
diff --git a/include/rawcom4.h b/include/rawcom4.h
index 8cd0574..f489799 100644
--- a/include/rawcom4.h
+++ b/include/rawcom4.h
@@ -36,24 +36,27 @@ class SWDLLEXPORT RawCom4 : public RawVerse4, public SWCom {
public:
RawCom4(const char *ipath, const char *iname = 0, const char *idesc = 0,
- SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
- const char* ilang = 0);
+ const char *ilang = 0, const char *versification = "KJV");
virtual ~RawCom4();
virtual SWBuf &getRawEntryBuf();
- virtual void increment(int steps);
- virtual void decrement(int steps) { increment(-steps); }
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
// write interface ----------------------------
virtual bool isWritable();
- static char createModule(const char *path) { return RawVerse4::createModule(path); }
+ static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse4::createModule(path, v11n); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
// end write interface ------------------------
+ virtual bool isLinked(const SWKey *k1, const SWKey *k2) const;
+ virtual bool hasEntry(const SWKey *k) const;
+
SWMODULE_OPERATORS
};
diff --git a/include/rawgenbook.h b/include/rawgenbook.h
index a915b4e..ba07478 100644
--- a/include/rawgenbook.h
+++ b/include/rawgenbook.h
@@ -2,7 +2,7 @@
* rawtext.h - code for class 'RawText'- a module that reads raw text files:
* ot and nt using indexs ??.bks ??.cps ??.vss
*
- * $Id: rawgenbook.h 1917 2006-05-22 01:07:17Z scribe $
+ * $Id: rawgenbook.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -51,9 +51,10 @@ public:
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey * linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
- virtual SWKey *CreateKey();
+ virtual SWKey *CreateKey() const;
// end write interface ------------------------
+ virtual bool hasEntry(const SWKey *k) const;
// OPERATORS -----------------------------------------------------------------
diff --git a/include/rawld.h b/include/rawld.h
index 7afe9b9..782900b 100644
--- a/include/rawld.h
+++ b/include/rawld.h
@@ -2,7 +2,7 @@
* rawld.cpp - code for class 'RawLD'- a module that reads raw lexicon and
* dictionary files: *.dat *.idx
*
- * $Id: rawld.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: rawld.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -31,7 +31,6 @@
SWORD_NAMESPACE_START
class SWDLLEXPORT RawLD : public RawStr, public SWLD {
- void strongsPad(char *buf);
char getEntry(long away = 0);
public:
@@ -55,6 +54,9 @@ public:
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
// end write interface ------------------------
+ virtual long getEntryCount() const;
+ virtual long getEntryForKey(const char *key) const;
+ virtual char *getKeyForEntry(long entry) const;
// OPERATORS -----------------------------------------------------------------
diff --git a/include/rawld4.h b/include/rawld4.h
index 616b992..d0118df 100644
--- a/include/rawld4.h
+++ b/include/rawld4.h
@@ -2,7 +2,7 @@
* rawld.cpp - code for class 'RawLD'- a module that reads raw lexicon and
* dictionary files: *.dat *.idx
*
- * $Id: rawld4.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: rawld4.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -31,7 +31,6 @@
SWORD_NAMESPACE_START
class SWDLLEXPORT RawLD4 : public RawStr4, public SWLD {
- void strongsPad(char *buf);
char getEntry(long away = 0);
public:
@@ -55,6 +54,9 @@ public:
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
// end write interface ------------------------
+ virtual long getEntryCount() const;
+ virtual long getEntryForKey(const char *key) const;
+ virtual char *getKeyForEntry(long entry) const;
// OPERATORS -----------------------------------------------------------------
diff --git a/include/rawstr.h b/include/rawstr.h
index 4367851..41d65d5 100644
--- a/include/rawstr.h
+++ b/include/rawstr.h
@@ -4,7 +4,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: rawstr.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -26,6 +26,7 @@
#define RAWSTR_H
#include <defs.h>
+#include <sysdata.h>
SWORD_NAMESPACE_START
@@ -35,22 +36,24 @@ class FileDesc;
class SWDLLEXPORT RawStr {
static int instance; // number of instantiated RawStr objects or derivitives
char *path;
- long lastoff;
+ mutable long lastoff; // for caching and optimizing
+
protected:
FileDesc *idxfd;
FileDesc *datfd;
void doSetText(const char *key, const char *buf, long len = -1);
void doLinkEntry(const char *destkey, const char *srckey);
+ static const int IDXENTRYSIZE;
+
public:
- static void prepText(SWBuf &buf);
static char nl;
RawStr(const char *ipath, int fileMode = -1);
virtual ~RawStr();
- void getIDXBuf(long ioffset, char **buf);
- void getIDXBufDat(long ioffset, char **buf);
- signed char findOffset(const char *key, long *start, unsigned short *size, long away = 0, long *idxoff = 0);
- void readText(long start, unsigned short *size, char **idxbuf, SWBuf &buf);
+ void getIDXBuf(long ioffset, char **buf) const;
+ void getIDXBufDat(long ioffset, char **buf) const;
+ signed char findOffset(const char *key, __u32 *start, __u16 *size, long away = 0, __u32 *idxoff = 0) const;
+ void readText(__u32 start, __u16 *size, char **idxbuf, SWBuf &buf);
static signed char createModule(const char *path);
};
diff --git a/include/rawstr4.h b/include/rawstr4.h
index 32734ef..91710bc 100644
--- a/include/rawstr4.h
+++ b/include/rawstr4.h
@@ -4,7 +4,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr4.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: rawstr4.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -26,6 +26,7 @@
#define RAWSTR4_H
#include <defs.h>
+#include <sysdata.h>
SWORD_NAMESPACE_START
@@ -35,23 +36,23 @@ class SWBuf;
class SWDLLEXPORT RawStr4 {
static int instance; // number of instantiated RawStr4 objects or derivitives
char *path;
- long lastoff;
+ mutable long lastoff; // for caching and optimizations
protected:
+ static const int IDXENTRYSIZE;
+
FileDesc *idxfd;
FileDesc *datfd;
- void prepText(SWBuf &buf);
void doSetText(const char *key, const char *buf, long len = -1);
void doLinkEntry(const char *destkey, const char *srckey);
public:
char nl;
RawStr4(const char *ipath, int fileMode = -1);
virtual ~RawStr4();
- void getIDXBuf(long ioffset, char **buf);
- void getIDXBufDat(long ioffset, char **buf);
- signed char findOffset(const char *key, long *start, unsigned long *size,
- long away = 0, long *idxoff = 0);
- void readText(long start, unsigned long *size, char **idxbuf, SWBuf &buf);
+ void getIDXBuf(long ioffset, char **buf) const;
+ void getIDXBufDat(long ioffset, char **buf) const;
+ signed char findOffset(const char *key, __u32 *start, __u32 *size, long away = 0, __u32 *idxoff = 0) const;
+ void readText(__u32 start, __u32 *size, char **idxbuf, SWBuf &buf);
static signed char createModule(const char *path);
};
diff --git a/include/rawtext.h b/include/rawtext.h
index 32986fe..cfff611 100644
--- a/include/rawtext.h
+++ b/include/rawtext.h
@@ -2,7 +2,7 @@
* rawtext.h - code for class 'RawText'- a module that reads raw text files:
* ot and nt using indexs ??.bks ??.cps ??.vss
*
- * $Id: rawtext.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: rawtext.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -34,30 +34,25 @@ class RawStr;
class SWDLLEXPORT RawText : public SWText, public RawVerse {
- RawStr *fastSearch[2];
-
public:
- RawText(const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
- const char* ilang = 0);
+ RawText(const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0, const char *versification = "KJV");
virtual ~RawText();
virtual SWBuf &getRawEntryBuf();
virtual void increment(int steps = 1);
virtual void decrement(int steps = 1) { increment(-steps); }
- virtual signed char createSearchFramework(
- void (*percent) (char, void *) = &nullPercent,
- void *percentUserData = 0);
- virtual void deleteSearchFramework();
- virtual bool hasSearchFramework() { return true; }
- virtual ListKey &search(const char *istr, int searchType = 0, int flags = 0, SWKey * scope = 0, bool * justCheckIfSupported = 0, void (*percent)(char, void *) = &SWModule::nullPercent, void *percentUserData = 0);
// write interface ----------------------------
virtual bool isWritable();
- static char createModule(const char *path) { return RawVerse::createModule(path); }
+ static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse::createModule(path, v11n); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
// end write interface ------------------------
+ virtual bool isLinked(const SWKey *k1, const SWKey *k2) const;
+ virtual bool hasEntry(const SWKey *k) const;
+
+
SWMODULE_OPERATORS
};
diff --git a/include/rawtext4.h b/include/rawtext4.h
index 39552ac..a3d0369 100644
--- a/include/rawtext4.h
+++ b/include/rawtext4.h
@@ -35,30 +35,24 @@ class RawStr;
class SWDLLEXPORT RawText4 : public SWText, public RawVerse4 {
- RawStr4 *fastSearch[2];
-
public:
- RawText4(const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
- const char* ilang = 0);
+ RawText4(const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0, const char *versification = "KJV");
virtual ~RawText4();
virtual SWBuf &getRawEntryBuf();
virtual void increment(int steps = 1);
virtual void decrement(int steps = 1) { increment(-steps); }
- virtual signed char createSearchFramework(
- void (*percent) (char, void *) = &nullPercent,
- void *percentUserData = 0);
- virtual void deleteSearchFramework();
- virtual bool hasSearchFramework() { return true; }
- virtual ListKey &search(const char *istr, int searchType = 0, int flags = 0, SWKey * scope = 0, bool * justCheckIfSupported = 0, void (*percent)(char, void *) = &SWModule::nullPercent, void *percentUserData = 0);
// write interface ----------------------------
virtual bool isWritable();
- static char createModule(const char *path) { return RawVerse4::createModule(path); }
+ static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse4::createModule(path, v11n); }
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
// end write interface ------------------------
+ virtual bool isLinked(const SWKey *k1, const SWKey *k2) const;
+ virtual bool hasEntry(const SWKey *k) const;
+
SWMODULE_OPERATORS
};
diff --git a/include/rawverse.h b/include/rawverse.h
index 00abff0..3ce4794 100644
--- a/include/rawverse.h
+++ b/include/rawverse.h
@@ -25,7 +25,6 @@ protected:
FileDesc *textfp[2];
char *path;
- void prepText(SWBuf &buf);
void doSetText(char testmt, long idxoff, const char *buf, long len = -1);
void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
@@ -33,9 +32,9 @@ public:
static const char *nl;
RawVerse(const char *ipath, int fileMode = -1);
virtual ~RawVerse();
- void findOffset(char testmt, long idxoff, long *start, unsigned short *end);
+ void findOffset(char testmt, long idxoff, long *start, unsigned short *end) const;
void readText(char testmt, long start, unsigned short size, SWBuf &buf);
- static char createModule(const char *path);
+ static char createModule(const char *path, const char *v11n = "KJV");
};
SWORD_NAMESPACE_END
diff --git a/include/rawverse4.h b/include/rawverse4.h
index 0b3a767..fee51c3 100644
--- a/include/rawverse4.h
+++ b/include/rawverse4.h
@@ -25,7 +25,6 @@ protected:
FileDesc *textfp[2];
char *path;
- void prepText(SWBuf &buf);
void doSetText(char testmt, long idxoff, const char *buf, long len = -1);
void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
@@ -33,9 +32,9 @@ public:
static const char *nl;
RawVerse4(const char *ipath, int fileMode = -1);
virtual ~RawVerse4();
- void findOffset(char testmt, long idxoff, long *start, unsigned long *end);
+ void findOffset(char testmt, long idxoff, long *start, unsigned long *end) const;
void readText(char testmt, long start, unsigned long size, SWBuf &buf);
- static char createModule(const char *path);
+ static char createModule(const char *path, const char *v11n = "KJV");
};
SWORD_NAMESPACE_END
diff --git a/include/regex.h b/include/regex.h
deleted file mode 100644
index a81e07d..0000000
--- a/include/regex.h
+++ /dev/null
@@ -1,545 +0,0 @@
-/* Definitions for data structures and routines for the regular
- expression library, version 0.12.
- Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
-
- the C library, however. The master source lives in /gd/gnu/lib.
-
-NOTE: The canonical source of this file is maintained with the
-GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-This program is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software Foundation,
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifndef _REGEX_H
-#define _REGEX_H 1
-
-/* Allow the use in C++ code. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/* POSIX says that <sys/types.h> must be included (by the caller) before
- <regex.h>. */
-
-#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS)
-/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
- should be there. */
-#include <stddef.h>
-#endif
-
-/* The following two types have to be signed and unsigned integer type
- wide enough to hold a value of a pointer. For most ANSI compilers
- ptrdiff_t and size_t should be likely OK. Still size of these two
- types is 2 for Microsoft C. Ugh... */
- typedef long int s_reg_t;
- typedef unsigned long int active_reg_t;
-
-/* The following bits are used to determine the regexp syntax we
- recognize. The set/not-set meanings are chosen so that Emacs syntax
- remains the value 0. The bits are given in alphabetical order, and
- the definitions shifted by one from the previous bit; thus, when we
- add or remove a bit, only one other definition need change. */
- typedef unsigned long int reg_syntax_t;
-
-/* If this bit is not set, then \ inside a bracket expression is literal.
- If set, then such a \ quotes the following character. */
-#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
-
-/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
- If set, then \+ and \? are operators and + and ? are literals. */
-#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
-
-/* If this bit is set, then character classes are supported. They are:
- [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
- [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
- If not set, then character classes are not supported. */
-#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
-
-/* If this bit is set, then ^ and $ are always anchors (outside bracket
- expressions, of course).
- If this bit is not set, then it depends:
- ^ is an anchor if it is at the beginning of a regular
- expression or after an open-group or an alternation operator;
- $ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
-
- This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
- POSIX draft 11.2 says that * etc. in leading positions is undefined.
- We already implemented a previous draft which made those constructs
- invalid, though, so we haven't changed the code back. */
-#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
-
-/* If this bit is set, then special characters are always special
- regardless of where they are in the pattern.
- If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
- * + ? and intervals are only special when not after the beginning,
- open-group, or alternation operator. */
-#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
-
-/* If this bit is set, then *, +, ?, and { cannot be first in an re or
- immediately after an alternation or begin-group operator. */
-#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
-
-/* If this bit is set, then . matches newline.
- If not set, then it doesn't. */
-#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
-
-/* If this bit is set, then . doesn't match NUL.
- If not set, then it does. */
-#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
-
-/* If this bit is set, nonmatching lists [^...] do not match newline.
- If not set, they do. */
-#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
-
-/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
- If not set, \{, \}, {, and } are literals. */
-#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
-
-/* If this bit is set, +, ? and | aren't recognized as operators.
- If not set, they are. */
-#define RE_LIMITED_OPS (RE_INTERVALS << 1)
-
-/* If this bit is set, newline is an alternation operator.
- If not set, newline is literal. */
-#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
-
-/* If this bit is set, then `{...}' defines an interval, and \{ and \}
- are literals.
- If not set, then `\{...\}' defines an interval. */
-#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
-
-/* If this bit is set, (...) defines a group, and \( and \) are literals.
- If not set, \(...\) defines a group, and ( and ) are literals. */
-#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
-
-/* If this bit is set, then \<digit> matches <digit>.
- If not set, then \<digit> is a back-reference. */
-#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-
-/* If this bit is set, then | is an alternation operator, and \| is literal.
- If not set, then \| is an alternation operator, and | is literal. */
-#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
-
-/* If this bit is set, then an ending range point collating higher
- than the starting range point, as in [z-a], is invalid.
- If not set, then when ending range point collates higher than the
- starting range point, the range is ignored. */
-#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
-
-/* If this bit is set, then an unmatched ) is ordinary.
- If not set, then an unmatched ) is invalid. */
-#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
-
-/* If this bit is set, succeed as soon as we match the whole pattern,
- without further backtracking. */
-#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
-
-/* If this bit is set, do not process the GNU regex operators.
- If not set, then the GNU regex operators are recognized. */
-#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
-
-/* If this bit is set, turn on internal regex debugging.
- If not set, and debugging was on, turn it off.
- This only works if regex.c is compiled -DDEBUG.
- We define this bit always, so that all that's needed to turn on
- debugging is to recompile regex.c; the calling code can always have
- this bit set, and it won't affect anything in the normal case. */
-#define RE_DEBUG (RE_NO_GNU_OPS << 1)
-
-/* This global variable defines the particular regexp syntax to use (for
- some interfaces). When a regexp is compiled, the syntax used is
- stored in the pattern buffer, so changing this does not affect
- already-compiled regexps. */
- extern reg_syntax_t re_syntax_options;
-
-/* Define combinations of the above bits for the standard possibilities.
- (The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
-/* [[[begin syntaxes]]] */
-#define RE_SYNTAX_EMACS 0
-
-#define RE_SYNTAX_AWK \
- (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
- | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
- | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
- | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
-
-#define RE_SYNTAX_GNU_AWK \
- ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
- & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
-
-#define RE_SYNTAX_POSIX_AWK \
- (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
- | RE_INTERVALS | RE_NO_GNU_OPS)
-
-#define RE_SYNTAX_GREP \
- (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
- | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
- | RE_NEWLINE_ALT)
-
-#define RE_SYNTAX_EGREP \
- (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
- | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
- | RE_NO_BK_VBAR)
-
-#define RE_SYNTAX_POSIX_EGREP \
- (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
-
-/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
-#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
-
-#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
-
-/* Syntax bits common to both basic and extended POSIX regex syntax. */
-#define _RE_SYNTAX_POSIX_COMMON \
- (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
- | RE_INTERVALS | RE_NO_EMPTY_RANGES)
-
-#define RE_SYNTAX_POSIX_BASIC \
- (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
-
-/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
- RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
- isn't minimal, since other operators, such as \`, aren't disabled. */
-#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
- (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
-
-#define RE_SYNTAX_POSIX_EXTENDED \
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
- | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
- | RE_UNMATCHED_RIGHT_PAREN_ORD)
-
-/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
- replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
-#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
- (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
- | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
- | RE_NO_BK_PARENS | RE_NO_BK_REFS \
- | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
-/* [[[end syntaxes]]] */
-
-/* Maximum number of duplicates an interval can allow. Some systems
- (erroneously) define this in other header files, but we want our
- value, so remove any previous define. */
-#ifdef RE_DUP_MAX
-#undef RE_DUP_MAX
-#endif
-/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
-#define RE_DUP_MAX (0x7fff)
-
-
-/* POSIX `cflags' bits (i.e., information for `regcomp'). */
-
-/* If this bit is set, then use extended regular expression syntax.
- If not set, then use basic regular expression syntax. */
-#define REG_EXTENDED 1
-
-/* If this bit is set, then ignore case when matching.
- If not set, then case is significant. */
-#define REG_ICASE (REG_EXTENDED << 1)
-
-/* If this bit is set, then anchors do not match at newline
- characters in the string.
- If not set, then anchors do match at newlines. */
-#define REG_NEWLINE (REG_ICASE << 1)
-
-/* If this bit is set, then report only success or fail in regexec.
- If not set, then returns differ between not matching and errors. */
-#define REG_NOSUB (REG_NEWLINE << 1)
-
-
-/* POSIX `eflags' bits (i.e., information for regexec). */
-
-/* If this bit is set, then the beginning-of-line operator doesn't match
- the beginning of the string (presumably because it's not the
- beginning of a line).
- If not set, then the beginning-of-line operator does match the
- beginning of the string. */
-#define REG_NOTBOL 1
-
-/* Like REG_NOTBOL, except for the end-of-line. */
-#define REG_NOTEOL (1 << 1)
-
-
-/* If any error codes are removed, changed, or added, update the
- `re_error_msg' table in regex.c. */
- typedef enum
- {
- REG_NOERROR = 0, /* Success. */
- REG_NOMATCH, /* Didn't find a match (for regexec). */
-
- /* POSIX regcomp return error codes. (In the order listed in the
- standard.) */
- REG_BADPAT, /* Invalid pattern. */
- REG_ECOLLATE, /* Not implemented. */
- REG_ECTYPE, /* Invalid character class name. */
- REG_EESCAPE, /* Trailing backslash. */
- REG_ESUBREG, /* Invalid back reference. */
- REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
- REG_EBRACE, /* Unmatched \{. */
- REG_BADBR, /* Invalid contents of \{\}. */
- REG_ERANGE, /* Invalid range end. */
- REG_ESPACE, /* Ran out of memory. */
- REG_BADRPT, /* No preceding re for repetition op. */
-
- /* Error codes we've added. */
- REG_EEND, /* Premature end. */
- REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
- REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
- }
- reg_errcode_t;
-
-/* This data structure represents a compiled pattern. Before calling
- the pattern compiler, the fields `buffer', `allocated', `fastmap',
- `translate', and `no_sub' can be set. After the pattern has been
- compiled, the `re_nsub' field is available. All other fields are
- private to the regex routines. */
-
-#ifndef RE_TRANSLATE_TYPE
-#define RE_TRANSLATE_TYPE char *
-#endif
-
- struct re_pattern_buffer
- {
-/* [[[begin pattern_buffer]]] */
- /* Space that holds the compiled pattern. It is declared as
- `unsigned char *' because its elements are
- sometimes used as array indexes. */
- unsigned char *buffer;
-
- /* Number of bytes to which `buffer' points. */
- unsigned long int allocated;
-
- /* Number of bytes actually used in `buffer'. */
- unsigned long int used;
-
- /* Syntax setting with which the pattern was compiled. */
- reg_syntax_t syntax;
-
- /* Pointer to a fastmap, if any, otherwise zero. re_search uses
- the fastmap, if there is one, to skip over impossible
- starting points for matches. */
- char *fastmap;
-
- /* Either a translate table to apply to all characters before
- comparing them, or zero for no translation. The translation
- is applied to a pattern when it is compiled and to a string
- when it is matched. */
- RE_TRANSLATE_TYPE translate;
-
- /* Number of subexpressions found by the compiler. */
- size_t re_nsub;
-
- /* Zero if this pattern cannot match the empty string, one else.
- Well, in truth it's used only in `re_search_2', to see
- whether or not we should use the fastmap, so we don't set
- this absolutely perfectly; see `re_compile_fastmap' (the
- `duplicate' case). */
- unsigned can_be_null:1;
-
- /* If REGS_UNALLOCATED, allocate space in the `regs' structure
- for `max (RE_NREGS, re_nsub + 1)' groups.
- If REGS_REALLOCATE, reallocate space if necessary.
- If REGS_FIXED, use what's there. */
-#define REGS_UNALLOCATED 0
-#define REGS_REALLOCATE 1
-#define REGS_FIXED 2
- unsigned regs_allocated:2;
-
- /* Set to zero when `regex_compile' compiles a pattern; set to one
- by `re_compile_fastmap' if it updates the fastmap. */
- unsigned fastmap_accurate:1;
-
- /* If set, `re_match_2' does not return information about
- subexpressions. */
- unsigned no_sub:1;
-
- /* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
- unsigned not_bol:1;
-
- /* Similarly for an end-of-line anchor. */
- unsigned not_eol:1;
-
- /* If true, an anchor at a newline matches. */
- unsigned newline_anchor:1;
-
-/* [[[end pattern_buffer]]] */
- };
-
- typedef struct re_pattern_buffer regex_t;
-
-/* Type for byte offsets within the string. POSIX mandates this. */
- typedef int regoff_t;
-
-
-/* This is the structure we store register match data in. See
- regex.texinfo for a full description of what registers match. */
- struct re_registers
- {
- unsigned num_regs;
- regoff_t *start;
- regoff_t *end;
- };
-
-
-/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
- `re_match_2' returns information about at least this many registers
- the first time a `regs' structure is passed. */
-#ifndef RE_NREGS
-#define RE_NREGS 30
-#endif
-
-
-/* POSIX specification for registers. Aside from the different names than
- `re_registers', POSIX uses an array of structures, instead of a
- structure of arrays. */
- typedef struct
- {
- regoff_t rm_so; /* Byte offset from string's start to substring's start. */
- regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
- }
- regmatch_t;
-
-/* Declarations for routines. */
-
-/* To avoid duplicating every routine declaration -- once with a
- prototype (if we are ANSI), and once without (if we aren't) -- we
- use the following macro to declare argument types. This
- unfortunately clutters up the declarations a bit, but I think it's
- worth it. */
-#ifndef __STDC__
-#define __STDC__ 1
-#endif
-#if __STDC__
-
-#define _RE_ARGS(args) args
-
-#else /* not __STDC__ */
-
-#define _RE_ARGS(args) ()
-
-#endif /* not __STDC__ */
-
-/* Sets the current default syntax to SYNTAX, and return the old syntax.
- You can also simply assign to the `re_syntax_options' variable. */
- extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
-
-/* Compile the regular expression PATTERN, with length LENGTH
- and syntax given by the global `re_syntax_options', into the buffer
- BUFFER. Return NULL if successful, and an error string if not. */
- extern const char *re_compile_pattern
- _RE_ARGS ((const char *pattern, size_t length,
- struct re_pattern_buffer * buffer));
-
-
-/* Compile a fastmap for the compiled pattern in BUFFER; used to
- accelerate searches. Return 0 if successful and -2 if was an
- internal error. */
- extern int re_compile_fastmap
- _RE_ARGS ((struct re_pattern_buffer * buffer));
-
-
-/* Search in the string STRING (with length LENGTH) for the pattern
- compiled into BUFFER. Start searching at position START, for RANGE
- characters. Return the starting position of the match, -1 for no
- match, or -2 for an internal error. Also return register
- information in REGS (if REGS and BUFFER->no_sub are nonzero). */
- extern int re_search
- _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string,
- int length, int start, int range, struct re_registers * regs));
-
-
-/* Like `re_search', but search in the concatenation of STRING1 and
- STRING2. Also, stop searching at index START + STOP. */
- extern int re_search_2
- _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string1,
- int length1, const char *string2, int length2,
- int start, int range, struct re_registers * regs, int stop));
-
-
-/* Like `re_search', but return how many characters in STRING the regexp
- in BUFFER matched, starting at position START. */
- extern int re_match
- _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string,
- int length, int start, struct re_registers * regs));
-
-
-/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
- extern int re_match_2
- _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string1,
- int length1, const char *string2, int length2,
- int start, struct re_registers * regs, int stop));
-
-
-/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
- ENDS. Subsequent matches using BUFFER and REGS will use this memory
- for recording register information. STARTS and ENDS must be
- allocated with malloc, and must each be at least `NUM_REGS * sizeof
- (regoff_t)' bytes long.
-
- If NUM_REGS == 0, then subsequent matches should allocate their own
- register data.
-
- Unless this function is called, the first search or match using
- PATTERN_BUFFER will allocate its own register data, without
- freeing the old data. */
- extern void re_set_registers
- _RE_ARGS ((struct re_pattern_buffer * buffer, struct re_registers * regs,
- unsigned num_regs, regoff_t * starts, regoff_t * ends));
-
-#ifdef _REGEX_RE_COMP
-#ifndef _CRAY
-/* 4.2 bsd compatibility. */
- extern char *re_comp _RE_ARGS ((const char *));
- extern int re_exec _RE_ARGS ((const char *));
-#endif
-#endif
-
-/* POSIX compatibility. */
- extern int regcomp
- _RE_ARGS ((regex_t * preg, const char *pattern, int cflags));
- extern int regexec
- _RE_ARGS (
- (const regex_t * preg, const char *string, size_t nmatch,
- regmatch_t pmatch[], int eflags));
- extern size_t regerror
- _RE_ARGS (
- (int errcode, const regex_t * preg, char *errbuf,
- size_t errbuf_size));
- extern void regfree _RE_ARGS ((regex_t * preg));
-
-
-#ifdef __cplusplus
-}
-#endif /* C++ */
-
-#endif /* regex.h */
-
-/*
-Local variables:
-make-backup-files: t
-version-control: t
-trim-versions-without-asking: nil
-End:
-*/
diff --git a/include/roman.h b/include/roman.h
index dd1acbd..37e4d1d 100644
--- a/include/roman.h
+++ b/include/roman.h
@@ -24,7 +24,7 @@ SWORD_NAMESPACE_START
/** Checks if a string is a roman numeral.
*/
-char isroman(const char *);
+char isroman(const char *, int maxchars = 0);
/* char* to_rom(int num, char *p); */
/** Converts a roman numeral to a string.
diff --git a/include/swbuf.h b/include/swbuf.h
index 6ae6958..eac0e70 100644
--- a/include/swbuf.h
+++ b/include/swbuf.h
@@ -1,7 +1,7 @@
/******************************************************************************
* swbuf.h - code for SWBuf used as a transport and utility for data buffers
*
-* $Id: swbuf.h 2116 2007-10-17 00:12:27Z scribe $
+* $Id: swbuf.h 2378 2009-05-04 23:18:51Z scribe $
*
* Copyright 2003 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -213,7 +213,7 @@ public:
* @param format The format string. Same syntax as printf, for example.
* @param ... Add all arguments here.
*/
- void setFormatted(const char *format, ...);
+ SWBuf &setFormatted(const char *format, ...);
/**
* SWBuf::setSize - Size this buffer to a specific length.
@@ -373,9 +373,14 @@ public:
* Strip a prefix from this buffer up to a separator byte.
* Returns the prefix and modifies this buffer, shifting left to remove prefix
* @param separator to use (e.g. ':')
+ * @param endOfStringAsSeparator - also count end of string as separator.
+ * this is useful for tokenizing entire string like:
+ * x|y|z
+ * if true it will also include 'z'.
+ *
* @return prefix if separator character found; otherwise, null and leaves buffer unmodified
*/
- inline const char *stripPrefix(char separator) { const char *m = strchr(buf, separator); if (m) { int len = m-buf; char *hold = new char[len]; memcpy(hold, buf, len); *this << (len+1); memcpy(end+1, hold, len); delete [] hold; end[len+1] = 0; } return (m) ? end+1 : 0; } // safe. we know we don't actually realloc and shrink buffer when shifting, so we can place our return val at end.
+ inline const char *stripPrefix(char separator, bool endOfStringAsSeparator = false) { const char *m = strchr(buf, separator); if (!m && endOfStringAsSeparator) { if (*buf) { operator >>(1); *buf=0; end = buf; return buf + 1;} else return buf; } if (m) { int len = m-buf; char *hold = new char[len]; memcpy(hold, buf, len); *this << (len+1); memcpy(end+1, hold, len); delete [] hold; end[len+1] = 0; } return (m) ? end+1 : 0; } // safe. we know we don't actually realloc and shrink buffer when shifting, so we can place our return val at end.
// this could be nicer, like replacing a contiguous series of target bytes with single replacement; offering replacement const char *
/**
@@ -415,13 +420,14 @@ public:
*/
inline bool endsWith(const char *postfix) const { unsigned int psize = strlen(postfix); return (size() >= psize)?!strncmp(end-psize, postfix, psize):false; }
- inline int compare(const char *other) const { return strcmp(c_str(), other); }
+ // be sure we've been given a valid pointer to compare. If not, we return !=; specifically less-than, for lack of better options
+ inline int compare(const char *other) const { return (other?strcmp(c_str(), other):-1); }
inline bool operator ==(const char *other) const { return compare(other) == 0; }
inline bool operator !=(const char *other) const { return compare(other) != 0; }
- inline bool operator > (const char *other) const { return compare(other) > 0; }
- inline bool operator < (const char *other) const { return compare(other) < 0; }
- inline bool operator <=(const char *other) const { return compare(other) <= 0; }
- inline bool operator >=(const char *other) const { return compare(other) >= 0; }
+ inline bool operator > (const char *other) const { return other && compare(other) > 0; }
+ inline bool operator < (const char *other) const { return other && compare(other) < 0; }
+ inline bool operator <=(const char *other) const { return other && compare(other) <= 0; }
+ inline bool operator >=(const char *other) const { return other && compare(other) >= 0; }
};
diff --git a/include/swcom.h b/include/swcom.h
index 5b17d83..3b07ccd 100644
--- a/include/swcom.h
+++ b/include/swcom.h
@@ -1,8 +1,20 @@
/******************************************************************************
* swcom.h - code for base class 'SWCom'. SWCom is the basis for all
- * types of commentary modules
+ * types of commentary modules.
+ * It is traditionally close to the same as the SWText
+ * module type, but has defaults set which more
+ * closely represent how a commentary will be used and how
+ * the bulk of our commentaries expect to be used. For example,
+ * most commentaries consist of entries for a range of text
+ * (Matt.1.1-6: "Matthew begins with by telling us..."). This
+ * same entry will be returned when any verse between Matt.1.1-6
+ * is requested from the engine. This is done with verse linking.
+ * Since linking is used heavily in commentaries, the flag
+ * skipConsecutiveLinks is defaulted to true so when the
+ * commentary is incremented, it will go to the next ENTRY,
+ * not the next verse (likely Matt.1.7, from our example above).
*
- * $Id: swcom.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: swcom.h 2362 2009-04-29 07:21:35Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -36,10 +48,13 @@ class SWKey;
*/
class SWDLLEXPORT SWCom : public SWModule {
- mutable VerseKey *tmpVK;
+ mutable VerseKey *tmpVK1;
+ mutable VerseKey *tmpVK2;
+ mutable bool tmpSecond;
+ char *versification;
protected:
- VerseKey &getVerseKey() const;
+ VerseKey &getVerseKey(const SWKey *key = 0) const;
public:
@@ -47,12 +62,13 @@ public:
/** Initializes data for instance of SWCom
*/
SWCom(const char *imodname = 0, const char *imoddesc = 0,
- SWDisplay * idisp = 0, SWTextEncoding enc = ENC_UNKNOWN,
+ SWDisplay *idisp = 0, SWTextEncoding enc = ENC_UNKNOWN,
SWTextDirection dir = DIRECTION_LTR,
- SWTextMarkup mark = FMT_UNKNOWN, const char* ilang = 0);
+ SWTextMarkup mark = FMT_UNKNOWN, const char *ilang = 0,
+ const char *versification = "KJV");
virtual ~SWCom();
- virtual SWKey *CreateKey();
+ virtual SWKey *CreateKey() const;
virtual long Index() const;
virtual long Index(long iindex);
diff --git a/include/swconfig.h b/include/swconfig.h
index 5bc46d9..2139d3e 100644
--- a/include/swconfig.h
+++ b/include/swconfig.h
@@ -2,7 +2,7 @@
* swconfig.h - definition of Class SWConfig used for saving and retrieval
* of configuration information
*
- * $Id: swconfig.h 2094 2007-09-29 00:34:03Z chrislit $
+ * $Id: swconfig.h 2180 2008-07-13 20:29:25Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -54,6 +54,7 @@ public:
* @param ifilename The file, which should be used for this config.
*/
SWConfig(const char *ifilename);
+ SWConfig();
virtual ~SWConfig();
/** Load from disk
diff --git a/include/swgenbook.h b/include/swgenbook.h
index 3cfa785..d4f3d8f 100644
--- a/include/swgenbook.h
+++ b/include/swgenbook.h
@@ -1,7 +1,7 @@
/******************************************************************************
* swgenbook.h
*
-* $Id: swgenbook.h 1864 2005-11-20 06:06:40Z scribe $
+* $Id: swgenbook.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -22,9 +22,11 @@
#ifndef SWGENBOOK_H
#define SWGENBOOK_H
+#include <defs.h>
+
#include <swmodule.h>
+#include <treekey.h>
-#include <defs.h>
SWORD_NAMESPACE_START
@@ -34,6 +36,8 @@ class SWDLLEXPORT SWGenBook : public SWModule {
protected:
char *entkeytxt;
+ mutable TreeKey *tmpTreeKey;
+ TreeKey &getTreeKey(const SWKey *k = 0) const;
public:
/** Initializes data for instance of SWGenBook
@@ -44,7 +48,7 @@ public:
SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
virtual ~SWGenBook();
- virtual SWKey *CreateKey() = 0;
+ virtual SWKey *CreateKey() const = 0;
// OPERATORS -----------------------------------------------------------------
diff --git a/include/swkey.h b/include/swkey.h
index ed62e67..eea2135 100644
--- a/include/swkey.h
+++ b/include/swkey.h
@@ -3,7 +3,7 @@
* types of keys for indexing into modules (e.g. verse, word,
* place, etc.)
*
- * $Id: swkey.h 2121 2007-11-24 16:42:32Z scribe $
+ * $Id: swkey.h 2324 2009-04-20 18:40:15Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -27,6 +27,7 @@
#include <swobject.h>
#include <defs.h>
+#include <utilstr.h>
SWORD_NAMESPACE_START
@@ -34,7 +35,7 @@ SWORD_NAMESPACE_START
#define SWKEY_OPERATORS \
SWKey &operator =(const char *ikey) { setText(ikey); return *this; } \
- SWKey &operator =(const SWKey &ikey) { copyFrom(ikey); return *this; } \
+ SWKey &operator =(const SWKey &ikey) { positionFrom(ikey); return *this; } \
SWKey &operator =(SW_POSITION pos) { setPosition(pos); return *this; } \
operator const char *() const { return getText(); } \
bool operator ==(const SWKey &ikey) { return equals(ikey); } \
@@ -45,8 +46,10 @@ SWORD_NAMESPACE_START
virtual bool operator <=(const SWKey &ikey) { return (compare(ikey) < 1); } \
SWKey &operator -=(int steps) { decrement(steps); return *this; } \
SWKey &operator +=(int steps) { increment(steps); return *this; } \
- SWKey &operator++(int) { return *this += 1; } \
- SWKey &operator--(int) { return *this -= 1; }
+ SWKey &operator ++() { increment(1); return *this; } \
+ SWKey operator ++(int) { SWKey temp = *this; increment(1); return temp; } \
+ SWKey &operator --() { decrement(1); return *this; } \
+ SWKey operator --(int) { SWKey temp = *this; decrement(1); return temp; }
/** For use with = operator to position key.
@@ -64,15 +67,37 @@ public:
#define TOP SW_POSITION(POS_TOP)
#define BOTTOM SW_POSITION(POS_BOTTOM)
+class SWLocale;
+
/** SWKey is used for positioning an SWModule to a specific entry.
* It always represents a possible location into a module and can additionally represent
* a domain of entries (e.g. "John 3:16" in the domain "John 1:1 - Mark 5:25")
*/
class SWDLLEXPORT SWKey : public SWObject {
+
+ class LocaleCache {
+ public:
+ char *name;
+ SWLocale *locale;
+ LocaleCache() {
+ name = 0;
+ locale = 0;
+ }
+ virtual ~LocaleCache() {
+ if (name)
+ delete[]name;
+ }
+ };
+ static LocaleCache localeCache;
+ // for caching; don't use directly, call getPrivateLocale()
+ mutable SWLocale *locale;
+
+
long index;
static SWClass classdef;
void init();
+
protected:
char *keytext;
mutable char *rangeText;
@@ -80,6 +105,10 @@ protected:
char persist;
char error;
+ char *localeName;
+ SWLocale *getPrivateLocale() const;
+
+
public:
// misc pointer for whatever
@@ -124,6 +153,7 @@ public:
* @return error status
*/
virtual char Error();
+ virtual void setError(char err) { error = err; }
/** Sets this SWKey with a character string
* @param ikey string used to set this key
@@ -134,12 +164,14 @@ public:
* @param ikey other SWKey object from which to copy
*/
virtual void copyFrom(const SWKey &ikey);
+ virtual void positionFrom(const SWKey &ikey) { copyFrom(ikey); }
- /** returns string representation of this key
+ /** returns string representation of this key
*/
virtual const char *getText() const;
virtual const char *getShortText() const { return getText(); }
virtual const char *getRangeText() const;
+ virtual const char *getOSISRefRangeText() const;
virtual bool isBoundSet() const { return boundSet; }
virtual void clearBound() const { boundSet = false; }
@@ -179,26 +211,10 @@ public:
*/
virtual bool isTraversable() const { return false; }
+ char *getLocale() const { return localeName; }
+ void setLocale(const char *name) { stdstr(&localeName, name); locale = 0; } // this will force an on demand lookup of our locale
+
/** Use this function to get an index position within a module.
- * Here's a small example how to use this function and @ref Index(long).
- * This function uses the GerLut module and chooses a random verse from the
- * Bible and returns it.
- * @code
- * const char* randomVerse() {
- * VerseKey vk;
- * SWMgr mgr;
- * LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName("de");
- *
- * SWModule* module = mgr->Modules("GerLut");
- * srand( time(0) );
- * const double newIndex = (double(rand())/RAND_MAX)*(24108+8224);
- * vk.Index(newIndex);
- * module->setKey(vk);
- *
- * char* text;
- * sprintf(text, "%s: %s",(const char*)vk ,module->StripText(&vk));
- * return text;
- * @endcode
*/
virtual long Index() const { return index; }
diff --git a/include/swld.h b/include/swld.h
index 28d416b..bc14ca0 100644
--- a/include/swld.h
+++ b/include/swld.h
@@ -2,7 +2,7 @@
* swld.h - code for base class 'SWLD'. SWLD is the basis for all
* types of Lexicon and Dictionary modules (hence the 'LD').
*
- * $Id: swld.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: swld.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -35,6 +35,7 @@ SWORD_NAMESPACE_START
class SWDLLEXPORT SWLD : public SWModule {
protected:
char *entkeytxt;
+ static void strongsPad(char *buf);
public:
/** Initializes data for instance of SWLD
*/
@@ -44,7 +45,7 @@ public:
SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
virtual ~SWLD();
- virtual SWKey *CreateKey();
+ virtual SWKey *CreateKey() const;
/** Sets/gets module KeyText, getting from saved text if key is persistent
*
@@ -56,6 +57,12 @@ public:
virtual void setPosition(SW_POSITION pos);
+ virtual long getEntryCount() const = 0;
+ virtual long getEntryForKey(const char *key) const = 0;
+ virtual char *getKeyForEntry(long entry) const = 0;
+
+ virtual bool hasEntry(const SWKey *k) const;
+
// OPERATORS -----------------------------------------------------------------
SWMODULE_OPERATORS
diff --git a/include/swlocale.h b/include/swlocale.h
index afe45a1..1b77a6d 100644
--- a/include/swlocale.h
+++ b/include/swlocale.h
@@ -2,7 +2,7 @@
* swlocale.h - definition of Class SWLocale used for retrieval
* of locale lookups
*
- * $Id: swlocale.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: swlocale.h 2191 2008-08-16 16:16:03Z scribe $
*
* Copyright 2000 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -48,8 +48,9 @@ class Private;
char *description;
char *encoding;
struct abbrev *bookAbbrevs;
- char *BMAX;
- struct sbook **books;
+ int abbrevsCnt;
+ const char **bookLongNames;
+ const char **bookPrefAbbrev;
public:
SWLocale(const char *ifilename);
@@ -68,8 +69,8 @@ public:
virtual const char *translate(const char *text);
virtual void augment(SWLocale &addFrom);
virtual SWLocale & operator +=(SWLocale &addFrom) { augment(addFrom); return *this; }
- virtual const struct abbrev *getBookAbbrevs();
- virtual void getBooks(char **iBMAX, struct sbook ***ibooks);
+ virtual const struct abbrev *getBookAbbrevs(int *retSize);
+ static const char *DEFAULT_LOCALE_NAME;
};
SWORD_NAMESPACE_END
diff --git a/include/swmgr.h b/include/swmgr.h
index 7991933..6e7236f 100644
--- a/include/swmgr.h
+++ b/include/swmgr.h
@@ -2,7 +2,7 @@
* swmgr.h - definition of class SWMgr used to interact with an install
* base of sword modules.
*
- * $Id: swmgr.h 2149 2008-03-31 04:44:30Z scribe $
+ * $Id: swmgr.h 2340 2009-04-26 13:51:42Z scribe $
*
* Copyright 1998-2008 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -43,9 +43,11 @@
* if you decide to start a new project.
*
* Well known frontends are:\n
+ * -BibleTime (http://www.bibletime.info)\n
+ * -BPBible (http://bpbible.com)\n
+ * -MacSword (http://www.macsword.com)\n
+ * -Xiphos (http://xiphos.org)\n
* -SWORD for Windows (http://crosswire.org/sword/software/biblecs/)\n
- * -GnomeSword (http://gnomesword.sourceforge.net/)\n
- * -BibleTime (http://www.bibletime.info/)\n
*/
#ifndef SWMGR_H
@@ -82,7 +84,7 @@ class SWOptionFilter;
* SWMgr exposes an installed module set and can be asked to configure the desired
* markup and options which modules will produce.
*
- * @version $Id: swmgr.h 2149 2008-03-31 04:44:30Z scribe $
+ * @version $Id: swmgr.h 2340 2009-04-26 13:51:42Z scribe $
*/
class SWDLLEXPORT SWMgr {
@@ -157,14 +159,15 @@ public:
static bool isICU;
static const char *globalConfPath;
+ static SWBuf getHomeDir();
/**
*
*/
- static void findConfig(char *configType, char **prefixPath, char **configPath, StringList *augPaths = 0, SWConfig *providedSysConf = 0);
+ static void findConfig(char *configType, char **prefixPath, char **configPath, StringList *augPaths = 0, SWConfig **providedSysConf = 0);
SWConfig *config;
- SWConfig *sysconfig;
+ SWConfig *sysConfig;
/** The path to main module set and locales
*/
diff --git a/include/swmodule.h b/include/swmodule.h
index f1db7e9..86ff822 100644
--- a/include/swmodule.h
+++ b/include/swmodule.h
@@ -3,7 +3,7 @@
* types of modules (e.g. texts, commentaries, maps, lexicons,
* etc.)
*
- * $Id: swmodule.h 2093 2007-09-28 19:20:22Z scribe $
+ * $Id: swmodule.h 2318 2009-04-10 21:22:16Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -78,7 +78,7 @@ typedef std::map < SWBuf, AttributeList, std::less < SWBuf > > AttributeTypeList
// cache data. But if we don't do this, then we need another mechanism to
// check if we are an SWCacher. Maybe make SWModule extend SWObject (which
// it probably should anyway. But then we need to add all the cheezy
-// heirarchy info to all he decendent classes for our SWDYNAMIC_CAST and
+// heirarchy info to all the decendent classes for our SWDYNAMIC_CAST and
// then we can see if we implement SWCacher so we know whether or not to add
// to the yet to be developed cachemgr.
// Just leave for now. This lets us always able to call module->flush()
@@ -103,7 +103,7 @@ protected:
char *modname;
char *moddesc;
char *modtype;
- char *modlang;
+ char *modlang;
char direction;
char markup;
@@ -133,6 +133,8 @@ protected:
int entrySize;
mutable long entryIndex; // internal common storage for index
+ static void prepText(SWBuf &buf);
+
public:
@@ -153,7 +155,7 @@ public:
* @param markup Source Markup of the module (e.g. OSIS)
* @param modlang Language of the module (e.g. en)
*/
- SWModule(const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, char *imodtype = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* modlang = 0);
+ SWModule(const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, const char *imodtype = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char *modlang = 0);
/** SWModule d-tor
*/
@@ -168,7 +170,7 @@ public:
/**
* @return True if this module is encoded in Unicode, otherwise returns false.
*/
- virtual const bool isUnicode() const { return (encoding == (char)ENC_UTF8 || encoding == (char)ENC_SCSU); }
+ virtual bool isUnicode() const { return (encoding == (char)ENC_UTF8); }
// These methods are useful for modules that come from a standard SWORD install (most do).
// SWMgr will call setConfig. The user may use getConfig and getConfigEntry (if they
@@ -180,7 +182,7 @@ public:
/**
* @return The size of the text entry for the module's current key position.
*/
- virtual const int getEntrySize() const { return entrySize; }
+ virtual int getEntrySize() const { return entrySize; }
/**
* Sets a key to this module for position to a particular record
@@ -204,7 +206,7 @@ public:
* @deprecated Use setKey() instead.
*/
char SetKey(const SWKey &ikey) { return setKey(ikey); }
- /**
+ /**
* @deprecated Use setKey() instead.
*/
char Key(const SWKey & ikey) { return setKey(ikey); }
@@ -233,12 +235,12 @@ public:
* gets the key text for the module.
* do we really need this?
*/
-
+
virtual const char *getKeyText() const {
return *getKey();
}
-
+
virtual long Index() const { return entryIndex; }
virtual long Index(long iindex) { entryIndex = iindex; return entryIndex; }
@@ -260,7 +262,7 @@ public:
*/
virtual void setDisplay(SWDisplay * idisp);
- /**
+ /**
* @deprecated Use get/setDisplay() instead.
*/
SWDisplay *Disp(SWDisplay * idisp = 0) {
@@ -379,7 +381,7 @@ public:
* @see VerseKey, ListKey, SWText, SWLD, SWCom
* @return pointer to allocated key
*/
- virtual SWKey *CreateKey();
+ virtual SWKey *CreateKey() const;
/** This function is reimplemented by the different kinds
* of module objects
@@ -436,19 +438,19 @@ public:
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void filterBuffer(OptionFilterList *filters, SWBuf &buf, SWKey *key);
+ virtual void filterBuffer(OptionFilterList *filters, SWBuf &buf, const SWKey *key);
/** FilterBuffer a text buffer
* @param filters the FilterList of filters to iterate
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void filterBuffer(FilterList *filters, SWBuf &buf, SWKey *key);
+ virtual void filterBuffer(FilterList *filters, SWBuf &buf, const SWKey *key);
/** Adds a RenderFilter to this module's renderFilters queue.
* Render Filters are called when the module is asked to produce
* renderable text.
- * @param newFilter the filter to add
+ * @param newfilter the filter to add
* @return *this
*/
virtual SWModule &AddRenderFilter(SWFilter *newfilter) {
@@ -491,7 +493,7 @@ public:
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void renderFilter(SWBuf &buf, SWKey *key) {
+ virtual void renderFilter(SWBuf &buf, const SWKey *key) {
filterBuffer(renderFilters, buf, key);
}
@@ -534,7 +536,7 @@ public:
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void encodingFilter(SWBuf &buf, SWKey *key) {
+ virtual void encodingFilter(SWBuf &buf, const SWKey *key) {
filterBuffer(encodingFilters, buf, key);
}
@@ -562,7 +564,7 @@ public:
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void stripFilter(SWBuf &buf, SWKey *key) {
+ virtual void stripFilter(SWBuf &buf, const SWKey *key) {
filterBuffer(stripFilters, buf, key);
}
@@ -571,7 +573,7 @@ public:
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void rawFilter(SWBuf &buf, SWKey *key) {
+ virtual void rawFilter(SWBuf &buf, const SWKey *key) {
filterBuffer(rawFilters, buf, key);
}
@@ -591,7 +593,7 @@ public:
* @param buf the buffer to filter
* @param key key location from where this buffer was extracted
*/
- virtual void optionFilter(SWBuf &buf, SWKey *key) {
+ virtual void optionFilter(SWBuf &buf, const SWKey *key) {
filterBuffer(optionFilters, buf, key);
}
@@ -619,13 +621,13 @@ public:
* @param tmpKey desired module entry
* @return result buffer
*/
- virtual const char *StripText(SWKey *tmpKey);
+ virtual const char *StripText(const SWKey *tmpKey);
/** Produces renderable text of the module entry at the supplied key
* @param tmpKey key to use to grab text
* @return this module's text at specified key location massaged by Render filters
*/
- virtual const char *RenderText(SWKey *tmpKey);
+ virtual const char *RenderText(const SWKey *tmpKey);
/** Whether or not to only hit one entry when iterating encounters
* consecutive links when iterating
@@ -637,6 +639,9 @@ public:
* consecutive links when iterating
*/
virtual bool getSkipConsecutiveLinks() { return skipConsecutiveLinks; }
+
+ virtual bool isLinked(const SWKey *k1, const SWKey *k2) const { return false; }
+ virtual bool hasEntry(const SWKey *k) const { return false; }
/** Entry Attributes are special data pertaining to the current entry.
* To see what Entry Attributes exists for a specific entry of a module,
@@ -657,14 +662,15 @@ public:
*/
virtual bool isProcessEntryAttributes() const { return procEntAttr; }
- // OPERATORS -----------------------------------------------------------------
-
+
+ // SWSearchable Interface Impl -----------------------------------------------
virtual signed char createSearchFramework(
void (*percent) (char, void *) = &nullPercent,
void *percentUserData = 0);
virtual void deleteSearchFramework();
virtual bool hasSearchFramework();
+ // OPERATORS -----------------------------------------------------------------
SWMODULE_OPERATORS
};
diff --git a/include/swtext.h b/include/swtext.h
index cb8d1d5..37a2f16 100644
--- a/include/swtext.h
+++ b/include/swtext.h
@@ -2,7 +2,7 @@
* swtext.h - code for base class 'SWText'. SWText is the basis for all
* types of text modules
*
- * $Id: swtext.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: swtext.h 2324 2009-04-20 18:40:15Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -36,24 +36,28 @@ class VerseKey;
class SWDLLEXPORT SWText : public SWModule {
// for conversion if we have been set with a different internal key type
- mutable VerseKey *tmpVK;
+ mutable VerseKey *tmpVK1;
+ mutable VerseKey *tmpVK2;
+ mutable bool tmpSecond;
+ char *versification;
protected:
- VerseKey &getVerseKey() const;
+ VerseKey &getVerseKey(const SWKey* key=0) const;
public:
/** Initializes data for instance of SWText
*/
SWText(const char *imodname = 0, const char *imoddesc = 0,
- SWDisplay * idisp = 0,
+ SWDisplay *idisp = 0,
SWTextEncoding encoding = ENC_UNKNOWN,
SWTextDirection dir = DIRECTION_LTR,
- SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ SWTextMarkup markup = FMT_UNKNOWN, const char *ilang = 0,
+ const char *versification = "KJV");
virtual ~SWText();
/** Create the correct key (VerseKey) for use with SWText
*/
- virtual SWKey *CreateKey();
+ virtual SWKey *CreateKey() const;
virtual long Index() const;
virtual long Index(long iindex);
diff --git a/include/teirtf.h b/include/teirtf.h
index 9c115e4..d8a7b7f 100644
--- a/include/teirtf.h
+++ b/include/teirtf.h
@@ -34,6 +34,7 @@ protected:
class MyUserData : public BasicFilterUserData {
public:
bool BiblicalText;
+ bool inOsisRef;
SWBuf w;
SWBuf version;
MyUserData(const SWModule *module, const SWKey *key);
diff --git a/include/treekey.h b/include/treekey.h
index 1e7c773..749460b 100644
--- a/include/treekey.h
+++ b/include/treekey.h
@@ -1,7 +1,7 @@
/******************************************************************************
* versekey.h - code for class 'versekey'- a standard Biblical verse key
*
- * $Id: treekey.h 1958 2006-08-22 00:15:10Z scribe $
+ * $Id: treekey.h 2280 2009-03-07 15:34:36Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -44,7 +44,24 @@ protected:
// This better conforms to the SWORD write methodology: mod.setKey, mod.setEntry
mutable SWBuf unsnappedKeyText;
+ // called whenever position of this key is changed. Should we move this
+ // to a more base class?
+ void positionChanged() { if (posChangeListener) posChangeListener->positionChanged(); }
+
public:
+
+ class PositionChangeListener {
+ TreeKey *treeKey;
+ public:
+ PositionChangeListener() {}
+ virtual ~PositionChangeListener() {}
+ virtual void positionChanged() = 0;
+ TreeKey *getTreeKey() { return treeKey; }
+ void setTreeKey(TreeKey *tk) { treeKey = tk; }
+ } *posChangeListener;
+
+ void setPositionChangeListener(PositionChangeListener *pcl) { posChangeListener = pcl; posChangeListener->setTreeKey(this); }
+
// TreeKey (const char *ikey = 0);
// TreeKey (const SWKey * ikey);
// TreeKey (TreeKey const &k);
@@ -55,7 +72,9 @@ public:
virtual const char *getLocalName() = 0;
virtual const char *setLocalName(const char *) = 0;
- virtual const char *getUserData(int *size = 0) = 0;
+ virtual int getLevel() { long bm = getOffset(); int level = 0; do { level++; } while (parent()); setOffset(bm); return level; }
+
+ virtual const char *getUserData(int *size = 0) const = 0;
virtual void setUserData(const char *userData, int size = 0) = 0;
/** Go to the root node
@@ -109,7 +128,7 @@ public:
/** Set the key to this path. If the path doesn't exist, then
* nodes are created as necessary
- * @keyPath = path to set/create; if unsupplied, then use any unsnapped setText value.
+ * @param keyPath path to set/create; if unsupplied, then use any unsnapped setText value.
*/
virtual void assureKeyPath(const char *keyPath = 0);
virtual void save() {}
diff --git a/include/treekeyidx.h b/include/treekeyidx.h
index 4a9fc99..e6515e5 100644
--- a/include/treekeyidx.h
+++ b/include/treekeyidx.h
@@ -1,7 +1,7 @@
/******************************************************************************
* versekey.h - code for class 'versekey'- a standard Biblical verse key
*
- * $Id: treekeyidx.h 2009 2006-11-25 21:24:43Z dglassey $
+ * $Id: treekeyidx.h 2280 2009-03-07 15:34:36Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -35,7 +35,7 @@ class FileDesc;
* The TreeKey implementation used for all tree-based modules in Sword, such as GenBooks.
*/
class SWDLLEXPORT TreeKeyIdx : public TreeKey {
-
+
class TreeNode {
public:
TreeNode();
@@ -57,23 +57,25 @@ class SWDLLEXPORT TreeKeyIdx : public TreeKey {
FileDesc *idxfd;
FileDesc *datfd;
+ void init();
+
void getTreeNodeFromDatOffset(long ioffset, TreeNode *buf) const;
char getTreeNodeFromIdxOffset(long ioffset, TreeNode *node) const;
void saveTreeNode(TreeNode *node);
void saveTreeNodeOffsets(TreeNode *node);
- void init();
+
public:
TreeKeyIdx(const TreeKeyIdx &ikey);
- TreeKeyIdx (const char *idxPath, int fileMode = -1);
- ~TreeKeyIdx ();
+ TreeKeyIdx(const char *idxPath, int fileMode = -1);
+ virtual ~TreeKeyIdx();
virtual SWKey *clone() const;
virtual const char *getLocalName();
virtual const char *setLocalName(const char *);
- virtual const char *getUserData(int *size = 0);
+ virtual const char *getUserData(int *size = 0) const;
virtual void setUserData(const char *userData, int size = 0);
virtual void root();
@@ -98,6 +100,8 @@ public:
void setOffset(unsigned long offset);
unsigned long getOffset() const;
+ virtual int getLevel();
+
// OPERATORS ------------------------------------------------------------
diff --git a/include/utf8arabicpoints.h b/include/utf8arabicpoints.h
new file mode 100644
index 0000000..34707a5
--- /dev/null
+++ b/include/utf8arabicpoints.h
@@ -0,0 +1,40 @@
+/******************************************************************************
+ *
+ * UTF8ArabicPoints - SWFilter descendant to remove UTF-8 Arabic vowel points
+ *
+ * $Id: utf8arabicpoints.h 1688 2008-11-30 04:42:26Z refdoc $
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF8ARABICPOINTS_H
+#define UTF8ARABICPOINTS_H
+
+#include <swoptfilter.h>
+
+SWORD_NAMESPACE_START
+
+/** This Filter shows/hides Arabic vowel points in UTF8 text
+ */
+class SWDLLEXPORT UTF8ArabicPoints : public SWOptionFilter {
+public:
+ UTF8ArabicPoints();
+ virtual ~UTF8ArabicPoints();
+ virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
+};
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/utf8transliterator.h b/include/utf8transliterator.h
index d539ac3..6022cde 100644
--- a/include/utf8transliterator.h
+++ b/include/utf8transliterator.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * $Id: utf8transliterator.h 2088 2007-09-26 23:42:44Z chrislit $
+ * $Id: utf8transliterator.h 2278 2009-03-06 23:29:48Z scribe $
*
* Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -21,9 +21,18 @@
#ifndef UTF8TRANSLITERATOR_H
#define UTF8TRANSLITERATOR_H
-enum scriptEnum {SE_OFF, SE_LATIN, /*one-way (to) transliterators*/ SE_IPA, SE_BASICLATIN, SE_SBL, SE_TC, SE_BETA, SE_BGREEK, SE_SERA, SE_HUGOYE, SE_UNGEGN, SE_ISO, SE_ALALC, SE_BGNPCGN, /*two-way transliterators*/ SE_GREEK, SE_HEBREW, SE_CYRILLIC, SE_ARABIC, SE_SYRIAC, SE_KATAKANA, SE_HIRAGANA, SE_HANGUL, SE_DEVANAGARI, SE_TAMIL, SE_BENGALI, SE_GURMUKHI, SE_GUJARATI, SE_ORIYA, SE_TELUGU, SE_KANNADA, SE_MALAYALAM, SE_THAI, SE_GEORGIAN, SE_ARMENIAN, SE_ETHIOPIC, SE_GOTHIC, SE_UGARITIC, SE_COPTIC, SE_MEROITIC, SE_LINEARB, SE_CYPRIOT, SE_RUNIC, SE_OGHAM, SE_THAANA, SE_GLAGOLITIC, /*SE_TENGWAR, SE_CIRTH,*/ /*one-way (from) transliterators*/ SE_JAMO, SE_HAN, SE_KANJI};
+enum scriptEnum {SE_OFF, SE_LATIN,
+/*one-way (to) transliterators*/
+SE_IPA, SE_BASICLATIN, SE_SBL, SE_TC, SE_BETA, SE_BGREEK, SE_SERA, SE_HUGOYE, SE_UNGEGN, SE_ISO, SE_ALALC, SE_BGN,
+/*two-way transliterators*/
+SE_GREEK, SE_HEBREW, SE_CYRILLIC, SE_ARABIC, SE_SYRIAC, SE_KATAKANA, SE_HIRAGANA, SE_HANGUL, SE_DEVANAGARI, SE_TAMIL, SE_BENGALI, SE_GURMUKHI, SE_GUJARATI, SE_ORIYA, SE_TELUGU, SE_KANNADA, SE_MALAYALAM, SE_THAI, SE_GEORGIAN, SE_ARMENIAN, SE_ETHIOPIC, SE_GOTHIC, SE_UGARITIC, SE_COPTIC, SE_MEROITIC, SE_LINEARB, SE_CYPRIOT, SE_RUNIC, SE_OGHAM, SE_THAANA, SE_GLAGOLITIC,
+/*SE_TENGWAR, SE_CIRTH,*/
+/*one-way (from) transliterators*/
+SE_JAMO, SE_HAN, SE_KANJI
+};
+
#define NUMSCRIPTS 48
-#define NUMTARGETSCRIPTS NUMSCRIPTS-3//6
+#define NUMTARGETSCRIPTS 2 //NUMSCRIPTS-3//6
#include <swoptfilter.h>
@@ -75,6 +84,7 @@ private:
public:
UTF8Transliterator();
+ ~UTF8Transliterator();
virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
virtual const char *getOptionName() { return optName; }
virtual const char *getOptionTip() { return optTip; }
diff --git a/include/utilstr.h b/include/utilstr.h
index 2e3a65e..1864edb 100644
--- a/include/utilstr.h
+++ b/include/utilstr.h
@@ -1,7 +1,7 @@
/******************************************************************************
* utilstr.h - prototypes for string utility functions
*
- * $Id: utilstr.h 2062 2007-07-19 17:27:31Z scribe $
+ * $Id: utilstr.h 2391 2009-05-08 02:02:16Z chrislit $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -23,16 +23,17 @@
#define UTILSTR_H
#include <defs.h>
+#include <sysdata.h>
SWORD_NAMESPACE_START
/** stdstr - clone a string
*/
-char *stdstr (char **iistr, const char *istr, unsigned int memPadFactor = 1);
-char *strstrip (char *istr);
-const char *stristr (const char *s1, const char *s2);
-int strnicmp(const char *s1, const char *s2, int len);
-int stricmp(const char *s1, const char *s2);
+SWDLLEXPORT char *stdstr (char **iistr, const char *istr, unsigned int memPadFactor = 1);
+SWDLLEXPORT char *strstrip (char *istr);
+SWDLLEXPORT const char *stristr (const char *s1, const char *s2);
+SWDLLEXPORT int strnicmp(const char *s1, const char *s2, int len);
+SWDLLEXPORT int stricmp(const char *s1, const char *s2);
/******************************************************************************
* SW_toupper - array of uppercase values for any given Latin-1 value
@@ -42,5 +43,18 @@ int stricmp(const char *s1, const char *s2);
extern const unsigned char SW_toupper_array[256];
#define SW_toupper(c) SW_toupper_array[(unsigned char)c]
+/******************************************************************************
+ * getUniCharFromUTF8 - retrieves the next Unicode codepoint from a UTF8 string
+ * and increments buf to start of next codepoint
+ *
+ * ENT: buf - address of a utf8 buffer
+ *
+ * RET: buf - incremented past last byte used in computing the current codepoint
+ * unicode codepoint value (0 with buf incremented is invalid UTF8 byte
+ */
+
+__u32 getUniCharFromUTF8(const unsigned char **buf);
+
+
SWORD_NAMESPACE_END
#endif
diff --git a/include/utilxml.h b/include/utilxml.h
index dc5e9d8..5a9c994 100644
--- a/include/utilxml.h
+++ b/include/utilxml.h
@@ -1,7 +1,7 @@
/******************************************************************************
* utilxml.h - definition of class that deal with xml constructs
*
- * $Id: utilxml.h 2096 2007-10-07 00:40:00Z scribe $
+ * $Id: utilxml.h 2378 2009-05-04 23:18:51Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -50,6 +50,7 @@ private:
public:
XMLTag(const char *tagString = 0);
+ XMLTag(const XMLTag& tag);
~XMLTag();
void setText(const char *tagString);
@@ -69,7 +70,11 @@ public:
endTag = false;
}
- inline bool isEndTag() const { return endTag; }
+ /***
+ * if an eID is provided, then we check to be sure we have an attribute <tag eID="xxx"/> value xxx equiv to what is given us
+ * otherwise, we return if we're a simple XML end </tag>.
+ */
+ bool isEndTag(const char *eID = 0) const;
const StringList getAttributeNames() const;
int getAttributePartCount(const char *attribName, char partSplit = '|') const;
diff --git a/include/versekey.h b/include/versekey.h
index 42127bf..4639c69 100644
--- a/include/versekey.h
+++ b/include/versekey.h
@@ -1,7 +1,7 @@
/******************************************************************************
* versekey.h - code for class 'versekey'- a standard Biblical verse key
*
- * $Id: versekey.h 2169 2008-05-18 02:50:53Z scribe $
+ * $Id: versekey.h 2377 2009-05-04 08:04:55Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -26,6 +26,7 @@
#include <swkey.h>
#include <swmacs.h>
#include <listkey.h>
+#include <versemgr.h>
#include <defs.h>
@@ -40,32 +41,6 @@ SWORD_NAMESPACE_START
#define MAXBOOK SW_POSITION(POS_MAXBOOK)
-struct sbook
-{
- /**Name of book
- */
- const char *name;
-
- /**Preferred Abbreviation
- */
- const char *prefAbbrev;
-
- /**Maximum chapters in book
- */
- unsigned char chapmax;
- /** Array[chapmax] of maximum verses in chapters
- */
- int *versemax;
-};
-
-struct abbrev
-{
- const char *ab;
- int book;
-};
-
-
-class SWLocale;
/**
* Class VerseKey
@@ -73,56 +48,16 @@ class SWLocale;
*/
class SWDLLEXPORT VerseKey : public SWKey {
- class LocaleCache {
- public:
- char *name;
- unsigned int abbrevsCnt;
- SWLocale *locale;
- LocaleCache() {
- name = 0;
- abbrevsCnt = 0;
- locale = 0;
- }
- virtual ~LocaleCache() {
- if (name)
- delete[]name;
- }
- };
-
static SWClass classdef;
- static long *offsets[2][2];
- static int offsize[2][2];
- /** number of instantiated VerseKey objects or derivitives
+ /** number of instantiated VerseKey objects or derivitives
*/
static int instance;
- static struct sbook otbooks[];
- static struct sbook ntbooks[];
- static const char *osisotbooks[];
- static const char *osisntbooks[];
- static const char **osisbooks[];
-#if 1
- static long otbks[];
- static long otcps[];
- static long ntbks[];
- static long ntcps[];
-#endif
- static int vm[];
- static LocaleCache localeCache;
ListKey internalListKey;
- const struct abbrev *abbrevs;
- char *locale;
- int abbrevsCnt;
-
- /** The Testament: 0 - Old; 1 - New
- */
- signed char testament;
- mutable signed char book;
- mutable signed int chapter;
- mutable signed int verse;
+ const VerseMgr::System *refSys;
- /** flag for auto normalization
+ /** flag for auto normalization
*/
char autonorm;
@@ -130,16 +65,19 @@ class SWDLLEXPORT VerseKey : public SWKey {
*/
char headings;
- int getBookAbbrev(const char *abbr);
- void initBounds() const;
-
/** initialize and allocate books array
*/
void initstatics();
/** initializes this VerseKey()
*/
- void init();
+ void init(const char *v11n = "KJV");
+
+ // bounds caching is mutable, thus const
+ void initBounds() const;
+
+ // private with no bounds check
+ void setFromOther(const VerseKey &vk);
/** Binary search to find the index closest, but less
* than the given value.
@@ -151,17 +89,39 @@ class SWDLLEXPORT VerseKey : public SWKey {
*/
int findindex(long *array, int size, long value);
- mutable VerseKey *lowerBound, *upperBound;
+ // internal upper/lower bounds optimizations
+ mutable long lowerBound, upperBound; // if autonorms is on
+ mutable VerseKey *tmpClone;
+
+ typedef struct { int test; int book; int chap; int verse; } VerseComponents;
+ mutable VerseComponents lowerBoundComponents, upperBoundComponents; // if autonorms is off, we can't optimize with index
protected:
+ /** The Testament: 0 - Module Heading; 1 - Old; 2 - New
+ */
+ signed char testament;
+ signed char book;
+ signed int chapter;
+ signed int verse;
+ signed char suffix;
+
+ /************************************************************************
+ * VerseKey::getBookAbbrev - Attempts to find a book no from a name or
+ * abbreviation
+ *
+ * ENT: @param abbr - key for which to search;
+ * RET: @return book number or < 0 = not valid
+ */
+ virtual int getBookAbbrev(const char *abbr) const;
+
/** Refresh keytext based on testament|book|chapter|verse
* default auto normalization to true
* default display headings option is false
*/
void freshtext() const;
- /** Parse a character array into testament|book|chapter|verse
+ /** Parse a character array into testament|book|chapter|verse
*
*/
virtual char parse(bool checkNormalize = true);
@@ -172,11 +132,7 @@ public:
static long ntbks[];
static long ntcps[];
#endif
- static const char builtin_BMAX[2];
- static struct sbook *builtin_books[2];
- static const struct abbrev builtin_abbrevs[];
- const char *BMAX;
- struct sbook **books;
+ int BMAX[2];
/**
* VerseKey Constructor - initializes Instance of VerseKey
@@ -185,23 +141,23 @@ public:
* See parse() for more detailed information)
*/
VerseKey(const char *ikey = 0);
-
+
/**
* VerseKey Constructor - initializes instance of VerseKey
*
* @param ikey base key (will take various forms of 'BOOK CH:VS'.
* See parse() for more detailed information)
- */
+ */
VerseKey(const SWKey *ikey);
-
+
/** VerseKey Constructor - initializes instance of VerseKey
* with boundariess - see also LowerBound()
* and UpperBound()
* @param min the lower boundary of the new VerseKey
* @param max the upper boundary of the new VerseKey
- */
- VerseKey(const char *min, const char *max);
-
+ */
+ VerseKey(const char *min, const char *max, const char *v11n = "KJV");
+
/** VerseKey Copy Constructor - will create a new VerseKey
* based on an existing SWKey
*
@@ -215,7 +171,7 @@ public:
* @param k the VerseKey to copy from
*/
VerseKey(const VerseKey &k);
-
+
/** VerseKey Destructor
* Cleans up an instance of VerseKey
*/
@@ -224,37 +180,37 @@ public:
/** sets the lower boundary for this VerseKey
* and returns the new boundary
*
- * @param lb the new lower boundary for this VerseKey
+ * @param ub the new upper boundary for this VerseKey
* @return the lower boundary the key was set to
*/
- VerseKey &LowerBound(const char *lb);
-
+ VerseKey &LowerBound(const VerseKey &ub);
+
/** sets the upper boundary for this VerseKey
* and returns the new boundary
* @param ub the new upper boundary for this VerseKey
* @return the upper boundary the key was set to
*/
- VerseKey &UpperBound(const char *ub);
-
+ VerseKey &UpperBound(const VerseKey &ub);
+
/** gets the lower boundary of this VerseKey
* @return the lower boundary of this VerseKey
*/
VerseKey &LowerBound() const;
-
+
/** gets the upper boundary of this VerseKey
* @return the upper boundary of this VerseKey
*/
VerseKey &UpperBound() const;
-
+
/** clears the boundaries of this VerseKey
*/
void ClearBounds();
-
+
/** Creates a new SWKey based on the current VerseKey
* see also the Copy Constructor
*/
virtual SWKey *clone() const;
-
+
/** refreshes keytext before returning if cast to
* a (char *) is requested
*/
@@ -263,59 +219,79 @@ public:
virtual void setText(const char *ikey, bool checkNormalize) { SWKey::setText(ikey); parse(checkNormalize); }
virtual void setText(const char *ikey) { SWKey::setText(ikey); parse(); }
virtual void copyFrom(const SWKey &ikey);
-
+
/** Equates this VerseKey to another VerseKey
*/
virtual void copyFrom(const VerseKey &ikey);
-
+
+ /** Only repositions this VerseKey to another VerseKey
+ */
+ virtual void positionFrom(const SWKey &ikey);
+
/** Positions this key
*
* @param newpos Position to set to.
* @return *this
*/
virtual void setPosition(SW_POSITION newpos);
-
+
/** Decrements key a number of verses
*
* @param steps Number of verses to jump backward
* @return *this
*/
- virtual void decrement(int steps);
-
+ virtual void decrement(int steps = 1);
+
/** Increments key a number of verses
*
* @param steps Number of verses to jump forward
* @return *this
*/
- virtual void increment(int steps);
+ virtual void increment(int steps = 1);
virtual bool isTraversable() const { return true; }
+ /** Get/Set position of this key by Book Name
+ */
virtual const char *getBookName() const;
+ virtual void setBookName(const char *bname);
+
virtual const char *getBookAbbrev() const;
/** Gets testament
*
* @return value of testament
*/
- virtual char Testament() const;
-
+ virtual char Testament() const { return getTestament(); } // deprecated
+ virtual char getTestament() const;
+
/** Gets book
*
* @return value of book
*/
- virtual char Book() const;
-
+ virtual char Book() const { return getBook(); } // deprecated
+ virtual char getBook() const;
+
/** Gets chapter
*
* @return value of chapter
*/
- virtual int Chapter() const;
-
+ virtual int Chapter() const { return getChapter(); } // deprecated
+ virtual int getChapter() const;
+ virtual int getChapterMax() const;
+
/** Gets verse
*
* @return value of verse
*/
- virtual int Verse() const;
-
+ virtual int Verse() const { return getVerse(); } // deprecated
+ virtual int getVerse() const;
+ virtual int getVerseMax() const;
+
+ /** Gets verse suffix
+ *
+ * @return value of verse suffix
+ */
+ virtual char getSuffix() const;
+
/** Sets/gets testament
*
* @param itestament value which to set testament
@@ -323,8 +299,9 @@ public:
* @return if unchanged -> value of testament,
* if changed -> previous value of testament
*/
- virtual char Testament(char itestament);
-
+ virtual char Testament(char itestament) { char retVal = getTestament(); setTestament(itestament); return retVal; } // deprecated
+ virtual void setTestament(char itestament);
+
/** Sets/gets book
*
* @param ibook value which to set book
@@ -332,8 +309,9 @@ public:
* @return if unchanged -> value of book,
* if changed -> previous value of book
*/
- virtual char Book(char ibook);
-
+ virtual char Book(char ibook) { char retVal = getBook(); setBook(ibook); return retVal; } // deprecated
+ virtual void setBook(char ibook);
+
/** Sets/gets chapter
*
* @param ichapter value which to set chapter
@@ -341,8 +319,9 @@ public:
* @return if unchanged -> value of chapter,
* if changed -> previous value of chapter
*/
- virtual int Chapter(int ichapter);
-
+ virtual int Chapter(int ichapter) { char retVal = getChapter(); setChapter(ichapter); return retVal; } // deprecated
+ virtual void setChapter(int ichapter);
+
/** Sets/gets verse
*
* @param iverse value which to set verse
@@ -350,8 +329,15 @@ public:
* @return if unchanged -> value of verse,
* if changed -> previous value of verse
*/
- virtual int Verse(int iverse);
-
+ virtual int Verse(int iverse) { char retVal = getVerse(); setVerse(iverse); return retVal; } // deprecated;
+ virtual void setVerse(int iverse);
+
+ /** Sets/gets verse suffix
+ *
+ * @param isuffix value which to set verse suffix
+ */
+ virtual void setSuffix(char isuffix);
+
/** checks limits and normalizes if necessary (e.g.
* Matthew 29:47 = Mark 2:2). If last verse is
* exceeded, key is set to last Book CH:VS
@@ -359,7 +345,7 @@ public:
* @return *this
*/
virtual void Normalize(char autocheck = 0);
-
+
/** Sets/gets flag that tells VerseKey to
* automatically normalize itself when modified
*
@@ -368,8 +354,12 @@ public:
* @return if unchanged -> value of autonorm,
* if changed -> previous value of autonorm
*/
- virtual char AutoNormalize(char iautonorm = MAXPOS(char));
-
+ virtual char AutoNormalize(char iautonorm) { char retVal = isAutoNormalize()?1:0; setAutoNormalize(iautonorm); return retVal; } // deprecated
+ virtual char AutoNormalize() const { return isAutoNormalize()?1:0; } // deprecated
+
+ virtual bool isAutoNormalize() const;
+ virtual void setAutoNormalize(bool iautonorm);
+
/** Sets/gets flag that tells VerseKey to include
* chapter/book/testament/module headings
*
@@ -379,15 +369,13 @@ public:
* if changed -> previous value of headings
*/
virtual char Headings(char iheadings = MAXPOS(char));
-
- virtual long NewIndex() const;
-
+
/** Gets index based upon current verse
*
* @return offset
*/
virtual long Index() const;
-
+
/** Sets index based upon current verse
*
* @param iindex value to set index to
@@ -395,8 +383,14 @@ public:
*/
virtual long Index(long iindex);
+ /** Gets index into current testament based upon current verse
+ *
+ * @return offset
+ */
+ virtual long TestamentIndex() const;
+
virtual const char *getOSISRef() const;
- static const int getOSISBookNum(const char *bookab);
+ virtual const char *getOSISBookName() const;
/** Tries to parse a string and convert it into an OSIS reference
* @param inRef reference string to try to parse
@@ -404,8 +398,9 @@ public:
*/
static const char *convertToOSIS(const char *inRef, const SWKey *defaultKey);
- virtual ListKey ParseVerseList(const char *buf, const char *defaultKey = 0, bool expandRange = false);
+ virtual ListKey ParseVerseList(const char *buf, const char *defaultKey = 0, bool expandRange = false, bool useChapterAsVerse = false);
virtual const char *getRangeText() const;
+ virtual const char *getOSISRefRangeText() const;
/** Compares another SWKey object
*
* @param ikey key to compare with this one
@@ -413,8 +408,8 @@ public:
* <0 if this VerseKey is smaller than compare SWKey,
* 0 if the keys are the same
*/
- virtual int compare(const SWKey & ikey);
-
+ virtual int compare(const SWKey &ikey);
+
/** Compares another VerseKey object
*
* @param ikey key to compare with this one
@@ -422,13 +417,13 @@ public:
* <0 if this VerseKey is smaller than compare VerseKey,
* 0 if the keys are the same
*/
- virtual int _compare(const VerseKey & ikey);
-
- virtual void setBookAbbrevs(const struct abbrev *bookAbbrevs, unsigned int size = 0 /* default determine size */ );
- virtual void setBooks(const char *iBMAX, struct sbook **ibooks);
- virtual void setLocale(const char *name);
- virtual const char *getLocale() const { return locale; }
+ virtual int _compare(const VerseKey &ikey);
+
+ virtual void setVersificationSystem(const char *name);
+ virtual const char *getVersificationSystem() const;
+ // DEBUG
+ void validateCurrentLocale() const;
// OPERATORS --------------------------------------------------------------------
@@ -436,7 +431,7 @@ public:
SWKEY_OPERATORS
- virtual SWKey & operator =(const VerseKey & ikey) { copyFrom(ikey); return *this; }
+ virtual SWKey &operator =(const VerseKey &ikey) { positionFrom(ikey); return *this; }
};
SWORD_NAMESPACE_END
diff --git a/include/versemgr.h b/include/versemgr.h
new file mode 100644
index 0000000..6f59d94
--- /dev/null
+++ b/include/versemgr.h
@@ -0,0 +1,163 @@
+/******************************************************************************
+ * versemgr.h - definition of class VerseMgr used for managing
+ * versification systems
+ *
+ * $Id: versemgr.cpp 2108 2007-10-13 20:35:02Z scribe $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <list>
+#include <defs.h>
+#include <swcacher.h>
+#include <swbuf.h>
+
+
+#ifndef VERSEMGR_H
+#define VERSEMGR_H
+
+
+SWORD_NAMESPACE_START
+
+typedef std::list <SWBuf>StringList;
+
+struct sbook;
+class TreeKey;
+
+
+struct abbrev
+{
+ const char *ab;
+ const char *osis;
+};
+
+struct sbook {
+ /**Name of book
+ */
+ const char *name;
+
+ /**OSIS name
+ */
+ const char *osis;
+
+ /**Preferred Abbreviation
+ */
+ const char *prefAbbrev;
+
+ /**Maximum chapters in book
+ */
+ unsigned char chapmax;
+ /** Array[chapmax] of maximum verses in chapters
+ */
+ int *versemax;
+};
+
+
+class SWDLLEXPORT VerseMgr : public SWCacher {
+
+
+public:
+ class System;
+
+private:
+ friend class __staticsystemVerseMgr;
+
+ class Private;
+ Private *p;
+
+ void init();
+
+protected:
+ static VerseMgr *systemVerseMgr;
+
+public:
+ class SWDLLEXPORT Book {
+ friend class System;
+ friend struct BookOffsetLess;
+ class Private;
+ Private *p;
+
+ /** book name */
+ SWBuf longName;
+
+ /** OSIS Abbreviation */
+ SWBuf osisName;
+
+ /** Preferred Abbreviation */
+ SWBuf prefAbbrev;
+
+ /** Maximum chapters in book */
+ unsigned int chapMax;
+
+ void init();
+
+ public:
+ Book() { init(); }
+ Book(const Book &other);
+ Book &operator =(const Book &other);
+ Book(const char *longName, const char *osisName, const char *prefAbbrev, int chapMax) {
+ this->longName = longName;
+ this->osisName = osisName;
+ this->prefAbbrev = prefAbbrev;
+ this->chapMax = chapMax;
+ init();
+ }
+ ~Book();
+ const char *getLongName() const { return longName.c_str(); }
+ const char *getOSISName() const { return osisName.c_str(); }
+ const char *getPreferredAbbreviation() const { return prefAbbrev.c_str(); }
+ int getChapterMax() const { return chapMax; }
+ int getVerseMax(int chapter) const;
+ };
+
+ class SWDLLEXPORT System {
+ class Private;
+ Private *p;
+ SWBuf name;
+ int BMAX[2];
+ long ntStartOffset;
+ void init();
+ public:
+ System() { this->name = ""; init(); }
+ System(const System &other);
+ System &operator =(const System &other);
+ System(const char *name) { this->name = name; init(); }
+ ~System();
+ const char *getName() const { return name.c_str(); }
+ const Book *getBookByName(const char *bookName) const;
+ int getBookNumberByOSISName(const char *bookName) const;
+ const Book *getBook(int number) const;
+ int getBookCount() const;
+ void loadFromSBook(const sbook *ot, const sbook *nt, int *chMax);
+ long getOffsetFromVerse(int book, int chapter, int verse) const;
+ char getVerseFromOffset(long offset, int *book, int *chapter, int *verse) const;
+ const int *getBMAX() const { return BMAX; };
+ long getNTStartOffset() const { return ntStartOffset; }
+ };
+ VerseMgr() { init(); }
+ ~VerseMgr();
+ static VerseMgr *getSystemVerseMgr();
+ static void setSystemVerseMgr(VerseMgr *newVerseMgr);
+ const StringList getVersificationSystems() const;
+ const System *getVersificationSystem(const char *name) const;
+ void registerVersificationSystem(const char *name, const sbook *ot, const sbook *nt, int *chMax);
+ void registerVersificationSystem(const char *name, const TreeKey *);
+};
+
+SWDLLEXPORT extern const struct abbrev builtin_abbrevs[];
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/versetreekey.h b/include/versetreekey.h
index 574c026..ab1d108 100644
--- a/include/versetreekey.h
+++ b/include/versetreekey.h
@@ -36,16 +36,25 @@ SWORD_NAMESPACE_START
* Class VerseKey
* The SWKey implementation used for verse based modules like Bibles or commentaries.
*/
-class SWDLLEXPORT VerseTreeKey : public VerseKey {
+class SWDLLEXPORT VerseTreeKey : public VerseKey, public TreeKey::PositionChangeListener {
static SWClass classdef;
TreeKey *treeKey;
+// vector<struct sbook> books;
+
+ void init(TreeKey *treeKey);
+ void syncVerseToTree();
+ long lastGoodOffset;
+
+protected:
+ virtual int getBookAbbrev(const char *abbr);
public:
/**
* VerseKey Constructor - initializes Instance of VerseKey
*
+ * @param treeKey a TreeKey which will form the basis of this VerseTreeKey
* @param ikey text key (will take various forms of 'BOOK CH:VS'.
* See parse() for more detailed information)
*/
@@ -54,6 +63,7 @@ public:
/**
* VerseKey Constructor - initializes instance of VerseKey
*
+ * @param treeKey a TreeKey which will form the basis of this VerseTreeKey
* @param ikey base key (will take various forms of 'BOOK CH:VS'.
* See parse() for more detailed information)
*/
@@ -62,6 +72,7 @@ public:
/** VerseKey Constructor - initializes instance of VerseKey
* with boundariess - see also LowerBound()
* and UpperBound()
+ * @param treeKey a TreeKey which will form the basis of this VerseTreeKey
* @param min the lower boundary of the new VerseKey
* @param max the upper boundary of the new VerseKey
*/
@@ -74,6 +85,7 @@ public:
*/
VerseTreeKey(const VerseTreeKey &k);
+
/** VerseKey Destructor
* Cleans up an instance of VerseKey
*/
@@ -86,15 +98,26 @@ public:
virtual bool isTraversable() const { return true; }
- virtual TreeKey *getTreeKey() { return treeKey; }
+ virtual TreeKey *getTreeKey();
+
+ // TreeKey::PositionChangeListener interface
+ virtual void positionChanged();
+ bool internalPosChange;
+
+ virtual void decrement(int steps = 1);
+ virtual void increment(int steps = 1);
+ virtual void Normalize(char autocheck = 0);
+ virtual void setPosition(SW_POSITION newpos);
+ virtual long NewIndex() const;
// OPERATORS --------------------------------------------------------------------
SWKEY_OPERATORS
virtual SWKey & operator = (const VerseKey & ikey) { copyFrom(ikey); return *this; }
+// virtual void copyFrom(const VerseTreeKey &ikey);
};
SWORD_NAMESPACE_END
diff --git a/include/zcom.h b/include/zcom.h
index 137c5c3..90132d5 100644
--- a/include/zcom.h
+++ b/include/zcom.h
@@ -2,7 +2,7 @@
* zcom.h - code for class 'zCom'- a module that reads compressed text
* files: ot and nt using indexs ??.vss
*
- * $Id: zcom.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: zcom.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -39,10 +39,11 @@ class SWDLLEXPORT zCom : public zVerse, public SWCom {
public:
zCom(const char *ipath, const char *iname = 0, const char *idesc = 0,
- int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0,
- SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ int blockType = CHAPTERBLOCKS, SWCompress *icomp = 0,
+ SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
SWTextDirection dir = DIRECTION_LTR,
- SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ SWTextMarkup markup = FMT_UNKNOWN, const char *ilang = 0,
+ const char *versification = "KJV");
virtual ~zCom();
virtual SWBuf &getRawEntryBuf();
virtual void increment(int steps = 1);
@@ -50,8 +51,8 @@ public:
// write interface ----------------------------
virtual bool isWritable();
- static char createModule(const char *path, int blockBound) {
- return zVerse::createModule(path, blockBound);
+ static char createModule(const char *path, int blockBound, const char *v11n = "KJV") {
+ return zVerse::createModule(path, blockBound, v11n);
}
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
virtual void linkEntry(const SWKey * linkKey); // Link current module entry to other module entry
@@ -64,6 +65,9 @@ public:
virtual void flush() { flushCache(); }
// end swcacher interface ----------------------
+ virtual bool isLinked(const SWKey *k1, const SWKey *k2) const;
+ virtual bool hasEntry(const SWKey *k) const;
+
SWMODULE_OPERATORS
};
diff --git a/include/zld.h b/include/zld.h
index 1046c33..de4788c 100644
--- a/include/zld.h
+++ b/include/zld.h
@@ -2,7 +2,7 @@
* zld.cpp - code for class 'zLD'- a module that reads compressed lexicon and
* dictionary files.
*
- * $Id: zld.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: zld.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -31,8 +31,6 @@
SWORD_NAMESPACE_START
class SWDLLEXPORT zLD : public zStr, public SWLD {
-
- void strongsPad(char *buf);
char getEntry(long away = 0);
public:
@@ -63,6 +61,10 @@ public:
virtual void flush() { flushCache(); }
// end swcacher interface ----------------------
+ virtual long getEntryCount() const;
+ virtual long getEntryForKey(const char *key) const;
+ virtual char *getKeyForEntry(long entry) const;
+
// OPERATORS -----------------------------------------------------------------
diff --git a/include/zlib.h b/include/zlib.h
deleted file mode 100644
index 52cb529..0000000
--- a/include/zlib.h
+++ /dev/null
@@ -1,893 +0,0 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.1.4, March 11th, 2002
-
- Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
- Jean-loup Gailly Mark Adler
- jloup@gzip.org madler@alumni.caltech.edu
-
-
- The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
-*/
-
-#ifndef _ZLIB_H
-#define _ZLIB_H
-
-#include "zconf.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define ZLIB_VERSION "1.1.4"
-
-/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed
- data. This version of the library supports only one compression method
- (deflation) but other algorithms will be added later and will have the same
- stream interface.
-
- Compression can be done in a single step if the buffers are large
- enough (for example if an input file is mmap'ed), or can be done by
- repeated calls of the compression function. In the latter case, the
- application must provide more input and/or consume the output
- (providing more output space) before each call.
-
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio.
-
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never
- crash even in case of corrupted input.
-*/
-
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
-typedef void (*free_func) OF((voidpf opaque, voidpf address));
-
-struct internal_state;
-
-typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
- uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
-
- Bytef *next_out; /* next output byte should be put there */
- uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
-
- char *msg; /* last error message, NULL if no error */
- struct internal_state FAR *state; /* not visible by applications */
-
- alloc_func zalloc; /* used to allocate the internal state */
- free_func zfree; /* used to free the internal state */
- voidpf opaque; /* private data object passed to zalloc and zfree */
-
- int data_type; /* best guess about the data type: ascii or binary */
- uLong adler; /* adler32 value of the uncompressed data */
- uLong reserved; /* reserved for future use */
-} z_stream;
-
-typedef z_stream FAR *z_streamp;
-
-/*
- The application must update next_in and avail_in when avail_in has
- dropped to zero. It must update next_out and avail_out when avail_out
- has dropped to zero. The application must initialize zalloc, zfree and
- opaque before calling the init function. All other fields are set by the
- compression library and must not be updated by the application.
-
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
- opaque value.
-
- zalloc must return Z_NULL if there is not enough memory for the object.
- If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this
- if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
- pointers returned by zalloc for objects of exactly 65536 bytes *must*
- have their offset normalized to zero. The default allocation function
- provided by this library ensures this (see zutil.c). To reduce memory
- requirements and avoid any allocation of 64K objects, at the expense of
- compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or
- progress reports. After compression, total_in holds the total size of
- the uncompressed data and may be saved for use in the decompressor
- (particularly if the decompressor wants to decompress everything in
- a single step).
-*/
-
- /* constants */
-
-#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
-#define Z_SYNC_FLUSH 2
-#define Z_FULL_FLUSH 3
-#define Z_FINISH 4
-/* Allowed flush values; see deflate() below for details */
-
-#define Z_OK 0
-#define Z_STREAM_END 1
-#define Z_NEED_DICT 2
-#define Z_ERRNO (-1)
-#define Z_STREAM_ERROR (-2)
-#define Z_DATA_ERROR (-3)
-#define Z_MEM_ERROR (-4)
-#define Z_BUF_ERROR (-5)
-#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
- */
-
-#define Z_NO_COMPRESSION 0
-#define Z_BEST_SPEED 1
-#define Z_BEST_COMPRESSION 9
-#define Z_DEFAULT_COMPRESSION (-1)
-/* compression levels */
-
-#define Z_FILTERED 1
-#define Z_HUFFMAN_ONLY 2
-#define Z_DEFAULT_STRATEGY 0
-/* compression strategy; see deflateInit2() below for details */
-
-#define Z_BINARY 0
-#define Z_ASCII 1
-#define Z_UNKNOWN 2
-/* Possible values of the data_type field */
-
-#define Z_DEFLATED 8
-/* The deflate compression method (the only one supported in this version) */
-
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
-
-#define zlib_version zlibVersion()
-/* for compatibility with versions < 1.0.2 */
-
- /* basic functions */
-
-ZEXTERN const char * ZEXPORT zlibVersion OF((void));
-/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is
- not compatible with the zlib.h header file used by the application.
- This check is automatically made by deflateInit and inflateInit.
- */
-
-/*
-ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
-
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller.
- If zalloc and zfree are set to Z_NULL, deflateInit updates them to
- use default allocation functions.
-
- The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at
- all (the input data is simply copied a block at a time).
- Z_DEFAULT_COMPRESSION requests a default compromise between speed and
- compression (currently equivalent to level 6).
-
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if level is not a valid compression level,
- Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION).
- msg is set to null if there is no error message. deflateInit does not
- perform any compression: this will be done by deflate().
-*/
-
-
-ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
-/*
- deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce some
- output latency (reading input without producing any output) except when
- forced to flush.
-
- The detailed semantics are as follows. deflate performs one or both of the
- following actions:
-
- - Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in and avail_in are updated and
- processing will resume at this point for the next call of deflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
- Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications).
- Some output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating avail_in or avail_out accordingly; avail_out
- should never be zero before the call. The application can consume the
- compressed output when it wants, for example when the output buffer is full
- (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
- and with zero avail_out, it must be called again after making room in the
- output buffer because there might be more output pending.
-
- If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
- flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In particular
- avail_in is zero after the call if enough output space has been provided
- before the call.) Flushing may degrade compression for some compression
- algorithms and so it should be used only when necessary.
-
- If flush is set to Z_FULL_FLUSH, all output is flushed as with
- Z_SYNC_FLUSH, and the compression state is reset so that decompression can
- restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- the compression.
-
- If deflate returns with avail_out == 0, this function must be called again
- with the same value of the flush parameter and more output space (updated
- avail_out), until the flush is complete (deflate returns with non-zero
- avail_out).
-
- If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there
- was enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the
- stream are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least
- 0.1% larger than avail_in plus 12 bytes. If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update data_type if it can make a good guess about
- the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect
- the compression algorithm in any manner.
-
- deflate() returns Z_OK if some progress has been made (more input
- processed or more output produced), Z_STREAM_END if all input has been
- consumed and all output has been produced (only when flush is set to
- Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero).
-*/
-
-
-ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
- stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case,
- msg may be set but then points to a static string (which must not be
- deallocated).
-*/
-
-
-/*
-ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
-
- Initializes the internal stream state for decompression. The fields
- next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
- value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
-
- inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller. msg is set to null if there is no error
- message. inflateInit does not perform any decompression apart from reading
- the zlib header if present: this will be done by inflate(). (So next_in and
- avail_in may be modified, but next_out and avail_out are unchanged.)
-*/
-
-
-ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
-/*
- inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may some
- introduce some output latency (reading input without producing any output)
- except when forced to flush.
-
- The detailed semantics are as follows. inflate performs one or both of the
- following actions:
-
- - Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing
- will resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there
- is no more input data or no more space in the output buffer (see below
- about the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating the next_* and avail_* values accordingly.
- The application can consume the uncompressed output when it wants, for
- example when the output buffer is full (avail_out == 0), or after each
- call of inflate(). If inflate returns Z_OK and with zero avail_out, it
- must be called again after making room in the output buffer because there
- might be more output pending.
-
- If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
- output as possible to the output buffer. The flushing behavior of inflate is
- not specified for values of the flush parameter other than Z_SYNC_FLUSH
- and Z_FINISH, but the current implementation actually flushes as much output
- as possible anyway.
-
- inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step
- (a single call of inflate), the parameter flush should be set to
- Z_FINISH. In this case all pending input is processed and all pending
- output is flushed; avail_out must be large enough to hold all the
- uncompressed data. (The size of the uncompressed data may have been saved
- by the compressor for this purpose.) The next operation on this stream must
- be inflateEnd to deallocate the decompression state. The use of Z_FINISH
- is never required, but can be used to inform inflate that a faster routine
- may be used for the single inflate() call.
-
- If a preset dictionary is needed at this point (see inflateSetDictionary
- below), inflate sets strm-adler to the adler32 checksum of the
- dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
- it sets strm->adler to the adler32 checksum of all output produced
- so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
- an error code as described below. At the end of the stream, inflate()
- checks that its computed adler32 checksum is equal to that saved by the
- compressor and returns Z_STREAM_END only if the checksum is correct.
-
- inflate() returns Z_OK if some progress has been made (more input processed
- or more output produced), Z_STREAM_END if the end of the compressed data has
- been reached and all uncompressed output has been produced, Z_NEED_DICT if a
- preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect
- adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
- (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if no progress is possible or if there was not
- enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
- case, the application may then call inflateSync to look for a good
- compression block.
-*/
-
-
-ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
-/*
- All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
-
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
-*/
-
- /* Advanced functions */
-
-/*
- The following functions are needed only in some special applications.
-*/
-
-/*
-ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
- int level,
- int method,
- int windowBits,
- int memLevel,
- int strategy));
-
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by
- the caller.
-
- The method parameter is the compression method. It must be Z_DEFLATED in
- this version of the library.
-
- The windowBits parameter is the base two logarithm of the window size
- (the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
- deflateInit is used instead.
-
- The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but
- is slow and reduces compression ratio; memLevel=9 uses maximum memory
- for optimal speed. The default value is 8. See zconf.h for total memory
- usage as a function of windowBits and memLevel.
-
- The strategy parameter is used to tune the compression algorithm. Use the
- value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match). Filtered data consists mostly of small values with a
- somewhat random distribution. In this case, the compression algorithm is
- tuned to compress them better. The effect of Z_FILTERED is to force more
- Huffman coding and less string matching; it is somewhat intermediate
- between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
- the compression ratio but not the correctness of the compressed output even
- if it is not set appropriately.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
- method). msg is set to null if there is no error message. deflateInit2 does
- not perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any
- call of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
-
- The dictionary should consist of strings (byte sequences) that are likely
- to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
- dictionary is most useful when the data to be compressed is short and can be
- predicted with good accuracy; the data can then be compressed better than
- with the default empty dictionary.
-
- Depending on the size of the compression data structures selected by
- deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size in
- deflate or deflate2. Thus the strings most likely to be useful should be
- put at the end of the dictionary, not at the front.
-
- Upon return of this function, strm->adler is set to the Adler32 value
- of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The Adler32 value
- applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.)
-
- deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
-*/
-
-ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
- z_streamp source));
-/*
- Sets the destination stream as a complete copy of the source stream.
-
- This function can be useful when several compression strategies will be
- tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
- by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and
- can consume lots of memory.
-
- deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
- destination.
-*/
-
-ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
-/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state.
- The stream will keep the same compression level and any other attributes
- that may have been set by deflateInit2.
-
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
- int level,
- int strategy));
-/*
- Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
- used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different
- strategy. If the compression level is changed, the input available so far
- is compressed with the old level (and may be flushed); the new level will
- take effect only at the next call of deflate().
-
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to
- be compressed and flushed. In particular, strm->avail_out must be non-zero.
-
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
- if strm->avail_out was zero.
-*/
-
-/*
-ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
- int windowBits));
-
- This is another version of inflateInit with an extra parameter. The
- fields next_in, avail_in, zalloc, zfree and opaque must be initialized
- before by the caller.
-
- The windowBits parameter is the base two logarithm of the maximum window
- size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. If a compressed stream with a larger window size is given as
- input, inflate() will return with the error code Z_DATA_ERROR instead of
- trying to allocate a larger window.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
- memLevel). msg is set to null if there is no error message. inflateInit2
- does not perform any decompression apart from reading the zlib header if
- present: this will be done by inflate(). (So next_in and avail_in may be
- modified, but next_out and avail_out are unchanged.)
-*/
-
-ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
- const Bytef *dictionary,
- uInt dictLength));
-/*
- Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate
- if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the Adler32 value returned by this call of
- inflate. The compressor and decompressor must use exactly the same
- dictionary (see deflateSetDictionary).
-
- inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
- inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect Adler32 value). inflateSetDictionary does not
- perform any decompression: this will be done by subsequent calls of
- inflate().
-*/
-
-ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
-/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
-
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been found,
- or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
- case, the application may save the current current value of total_in which
- indicates where valid compressed data was found. In the error case, the
- application may repeatedly call inflateSync, providing more input each time,
- until success or end of the input data.
-*/
-
-ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
-/*
- This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state.
- The stream will keep attributes that may have been set by inflateInit2.
-
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
-*/
-
-
- /* utility functions */
-
-/*
- The following utility functions are implemented on top of the
- basic stream-oriented functions. To simplify the interface, some
- default options are assumed (compression level and memory usage,
- standard memory allocation functions). The source code of these
- utility functions can easily be modified if you need special options.
-*/
-
-ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be at least 0.1% larger than
- sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
- compressed buffer.
- This function can be used to compress a whole file at once if the
- input file is mmap'ed.
- compress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer.
-*/
-
-ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen,
- int level));
-/*
- Compresses the source buffer into the destination buffer. The level
- parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least 0.1% larger than sourceLen plus
- 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
-
- compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_BUF_ERROR if there was not enough room in the output buffer,
- Z_STREAM_ERROR if the level parameter is invalid.
-*/
-
-ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
- const Bytef *source, uLong sourceLen));
-/*
- Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be large enough to hold the
- entire uncompressed data. (The size of the uncompressed data must have
- been saved previously by the compressor and transmitted to the decompressor
- by some mechanism outside the scope of this compression library.)
- Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
-
- uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted.
-*/
-
-
-typedef voidp gzFile;
-
-ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
-/*
- Opens a gzip (.gz) file for reading or writing. The mode parameter
- is as in fopen ("rb" or "wb") but can also include a compression level
- ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
- Huffman only compression as in "wb1h". (See the description
- of deflateInit2 for more information about the strategy parameter.)
-
- gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
-
- gzopen returns NULL if the file could not be opened or if there was
- insufficient memory to allocate the (de)compression state; errno
- can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR). */
-
-ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
-/*
- gzdopen() associates a gzFile with the file descriptor fd. File
- descriptors are obtained from calls like open, dup, creat, pipe or
- fileno (in the file has been previously opened with fopen).
- The mode parameter is as in gzopen.
- The next call of gzclose on the returned gzFile will also close the
- file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
- descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
- gzdopen returns NULL if there was insufficient memory to allocate
- the (de)compression state.
-*/
-
-ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
-/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
-*/
-
-ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
-/*
- Reads the given number of uncompressed bytes from the compressed file.
- If the input file was not in gzip format, gzread copies the given number
- of bytes into the buffer.
- gzread returns the number of uncompressed bytes actually read (0 for
- end of file, -1 for error). */
-
-ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
- const voidp buf, unsigned len));
-/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes actually written
- (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
-/*
- Converts, formats, and writes the args to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written (0 in case of error).
-*/
-
-ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
-/*
- Writes the given null-terminated string to the compressed file, excluding
- the terminating null character.
- gzputs returns the number of characters written, or -1 in case of error.
-*/
-
-ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
-/*
- Reads bytes from the compressed file until len-1 characters are read, or
- a newline character is read and transferred to buf, or an end-of-file
- condition is encountered. The string is then terminated with a null
- character.
- gzgets returns buf, or Z_NULL in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
-/*
- Writes c, converted to an unsigned char, into the compressed file.
- gzputc returns the value that was written, or -1 in case of error.
-*/
-
-ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
-/*
- Reads one byte from the compressed file. gzgetc returns this byte
- or -1 in case of end of file or error.
-*/
-
-ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
-/*
- Flushes all pending output into the compressed file. The parameter
- flush is as in the deflate() function. The return value is the zlib
- error number (see function gzerror below). gzflush returns Z_OK if
- the flush parameter is Z_FINISH and all output could be flushed.
- gzflush should be called only when strictly necessary because it can
- degrade compression.
-*/
-
-ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
- z_off_t offset, int whence));
-/*
- Sets the starting position for the next gzread or gzwrite on the
- given compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
- the value SEEK_END is not supported.
- If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
- supported; gzseek then compresses a sequence of zeroes up to the new
- starting position.
-
- gzseek returns the resulting offset location as measured in bytes from
- the beginning of the uncompressed stream, or -1 in case of error, in
- particular if the file is opened for writing and the new starting position
- would be before the current position.
-*/
-
-ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
-/*
- Rewinds the given file. This function is supported only for reading.
-
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
-*/
-
-ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
-/*
- Returns the starting position for the next gzread or gzwrite on the
- given compressed file. This position represents a number of bytes in the
- uncompressed data stream.
-
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
-*/
-
-ZEXTERN int ZEXPORT gzeof OF((gzFile file));
-/*
- Returns 1 when EOF has previously been detected reading the given
- input stream, otherwise zero.
-*/
-
-ZEXTERN int ZEXPORT gzclose OF((gzFile file));
-/*
- Flushes all pending output if necessary, closes the compressed file
- and deallocates all the (de)compression state. The return value is the zlib
- error number (see function gzerror below).
-*/
-
-ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
-/*
- Returns the error message for the last error which occurred on the
- given compressed file. errnum is set to zlib error number. If an
- error occurred in the file system and not in the compression library,
- errnum is set to Z_ERRNO and the application may consult errno
- to get the exact error code.
-*/
-
- /* checksum functions */
-
-/*
- These functions are not related to compression but are exported
- anyway because they might be useful in applications using the
- compression library.
-*/
-
-ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
-
-/*
- Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is NULL, this function returns
- the required initial value for the checksum.
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster. Usage example:
-
- uLong adler = adler32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- adler = adler32(adler, buffer, length);
- }
- if (adler != original_adler) error();
-*/
-
-ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
-/*
- Update a running crc with the bytes buf[0..len-1] and return the updated
- crc. If buf is NULL, this function returns the required initial value
- for the crc. Pre- and post-conditioning (one's complement) is performed
- within this function so it shouldn't be done by the application.
- Usage example:
-
- uLong crc = crc32(0L, Z_NULL, 0);
-
- while (read_buffer(buffer, length) != EOF) {
- crc = crc32(crc, buffer, length);
- }
- if (crc != original_crc) error();
-*/
-
-
- /* various hacks, don't look :) */
-
-/* deflateInit and inflateInit are macros to allow checking the zlib version
- * and the compiler's view of z_stream:
- */
-ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
- const char *version, int stream_size));
-ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
- int windowBits, int memLevel,
- int strategy, const char *version,
- int stream_size));
-ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
- const char *version, int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
-
-
-#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
- struct internal_state {int dummy;}; /* hack for buggy compilers */
-#endif
-
-ZEXTERN const char * ZEXPORT zError OF((int err));
-ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
-ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ZLIB_H */
diff --git a/include/zstr.h b/include/zstr.h
index 2622ca7..f9842f4 100644
--- a/include/zstr.h
+++ b/include/zstr.h
@@ -4,7 +4,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: zstr.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: zstr.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -42,7 +42,7 @@ private:
long cacheBlockIndex;
bool cacheDirty;
char *path;
- long lastoff;
+ mutable long lastoff; // for caching and optimization
long blockCount;
SWCompress *compressor;
@@ -56,15 +56,14 @@ protected:
void getCompressedText(long block, long entry, char **buf);
void flushCache();
- void prepText(SWBuf &buf);
- void getKeyFromDatOffset(long ioffset, char **buf);
- void getKeyFromIdxOffset(long ioffset, char **buf);
+ void getKeyFromDatOffset(long ioffset, char **buf) const;
+ void getKeyFromIdxOffset(long ioffset, char **buf) const;
public:
char nl;
zStr(const char *ipath, int fileMode = -1, long blockCount = 100, SWCompress *icomp = 0);
virtual ~zStr();
- signed char findKeyIndex(const char *ikey, long *idxoff, long away = 0);
+ signed char findKeyIndex(const char *ikey, long *idxoff, long away = 0) const;
void getText(long index, char **idxbuf, char **buf);
void setText(const char *ikey, const char *buf, long len = -1);
void linkEntry(const char *destkey, const char *srckey);
diff --git a/include/ztext.h b/include/ztext.h
index 461dc45..2f0b111 100644
--- a/include/ztext.h
+++ b/include/ztext.h
@@ -2,7 +2,7 @@
* ztext.h - code for class 'zText'- a module that reads compressed text
* files: ot and nt using indexs ??.vss
*
- * $Id: ztext.h 1864 2005-11-20 06:06:40Z scribe $
+ * $Id: ztext.h 2303 2009-04-06 13:38:34Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -52,10 +52,11 @@ class SWDLLEXPORT zText:public zVerse, public SWText {
public:
zText(const char *ipath, const char *iname = 0, const char *idesc = 0,
- int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0,
- SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ int blockType = CHAPTERBLOCKS, SWCompress *icomp = 0,
+ SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
SWTextDirection dir = DIRECTION_LTR,
- SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ SWTextMarkup markup = FMT_UNKNOWN, const char *ilang = 0,
+ const char *versification = "KJV");
virtual ~zText();
virtual SWBuf &getRawEntryBuf();
@@ -65,8 +66,8 @@ public:
// write interface ----------------------------
virtual bool isWritable();
- static char createModule(const char *path, int blockBound) {
- return zVerse::createModule(path, blockBound);
+ static char createModule(const char *path, int blockBound, const char *v11n = "KJV") {
+ return zVerse::createModule(path, blockBound, v11n);
}
virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
@@ -80,6 +81,9 @@ public:
virtual void flush() { flushCache(); }
// end swcacher interface ----------------------
+ virtual bool isLinked(const SWKey *k1, const SWKey *k2) const;
+ virtual bool hasEntry(const SWKey *k) const;
+
SWMODULE_OPERATORS
};
diff --git a/include/zverse.h b/include/zverse.h
index 6323025..1e5d1f3 100644
--- a/include/zverse.h
+++ b/include/zverse.h
@@ -26,11 +26,11 @@ protected:
FileDesc *textfp[2];
FileDesc *compfp[2];
char *path;
- void prepText(SWBuf &buf);
void doSetText(char testmt, long idxoff, const char *buf, long len = 0);
void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
void flushCache();
char *cacheBuf;
+ unsigned int cacheBufSize;
char cacheTestament;
long cacheBufIdx;
bool dirtyCache;
@@ -49,10 +49,10 @@ public:
zVerse(const char *ipath, int fileMode = -1, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0);
virtual ~zVerse();
- void findOffset(char testmt, long idxoff, long *start, unsigned short *end);
- void zReadText(char testmt, long start, unsigned short size, SWBuf &buf);
+ void findOffset(char testmt, long idxoff, long *start, unsigned short *size, unsigned long *buffnum) const;
+ void zReadText(char testmt, long start, unsigned short size, unsigned long buffnum, SWBuf &buf);
virtual void rawZFilter(SWBuf &buf, char direction = 0) {}
- static char createModule(const char *path, int blockBound);
+ static char createModule(const char *path, int blockBound, const char *v11n = "KJV");
};
SWORD_NAMESPACE_END