summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am17
-rw-r--r--include/bz2comprs.h2
-rw-r--r--include/canon_abbrevs.h2
-rw-r--r--include/canon_calvin.h395
-rw-r--r--include/canon_darbyfr.h311
-rw-r--r--include/canon_nrsv.h8
-rw-r--r--include/canon_segond.h390
-rw-r--r--include/canon_synodal.h195
-rw-r--r--include/canon_vulg.h284
-rw-r--r--include/config.h.in9
-rw-r--r--include/defs.h4
-rw-r--r--include/encfiltmgr.h19
-rw-r--r--include/femain.h5
-rw-r--r--include/filemgr.h121
-rw-r--r--include/flatapi.h90
-rw-r--r--include/gbflatex.h52
-rw-r--r--include/gbfredletterwords.h4
-rw-r--r--include/hebrewmcim.h4
-rw-r--r--include/installmgr.h9
-rw-r--r--include/listkey.h7
-rw-r--r--include/osishtmlhref.h4
-rw-r--r--include/osislatex.h77
-rw-r--r--include/osisplain.h3
-rw-r--r--include/osisreferencelinks.h2
-rw-r--r--include/osiswebif.h3
-rw-r--r--include/osisxhtml.h8
-rw-r--r--include/rawstr.h2
-rw-r--r--include/rawstr4.h2
-rw-r--r--include/rawverse.h2
-rw-r--r--include/rawverse4.h2
-rw-r--r--include/remotetrans.h13
-rw-r--r--include/rtranspgdrive.h45
-rw-r--r--include/sapphire.h5
-rw-r--r--include/scsuutf8.h28
-rw-r--r--include/swbasicfilter.h6
-rw-r--r--include/swbuf.h65
-rw-r--r--include/swcomprs.h9
-rw-r--r--include/swconfig.h125
-rw-r--r--include/swkey.h3
-rw-r--r--include/swld.h2
-rw-r--r--include/swmgr.h326
-rw-r--r--include/swmodule.h67
-rw-r--r--include/swobject.h2
-rw-r--r--include/swoptfilter.h4
-rw-r--r--include/swversion.h8
-rw-r--r--include/sysdata.h10
-rw-r--r--include/teihtmlhref.h4
-rw-r--r--include/teilatex.h57
-rw-r--r--include/teirtf.h4
-rw-r--r--include/teixhtml.h5
-rw-r--r--include/thmlhtml.h6
-rw-r--r--include/thmlhtmlhref.h6
-rw-r--r--include/thmllatex.h60
-rw-r--r--include/thmlrtf.h6
-rw-r--r--include/thmlxhtml.h6
-rw-r--r--include/utf8nfc.h2
-rw-r--r--include/utf8scsu.h49
-rw-r--r--include/utilstr.h189
-rw-r--r--include/versekey.h13
-rw-r--r--include/versificationmgr.h7
-rw-r--r--include/xzcomprs.h6
-rw-r--r--include/zcom.h1
-rw-r--r--include/zcom4.h78
-rw-r--r--include/zconf.h279
-rw-r--r--include/ztext.h2
-rw-r--r--include/ztext4.h90
-rw-r--r--include/zverse.h4
-rw-r--r--include/zverse4.h77
68 files changed, 3378 insertions, 324 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index de34949..122d893 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -15,6 +15,7 @@ pkginclude_HEADERS += $(swincludedir)/versificationmgr.h
pkginclude_HEADERS += $(swincludedir)/flatapi.h
pkginclude_HEADERS += $(swincludedir)/ftpparse.h
pkginclude_HEADERS += $(swincludedir)/remotetrans.h
+pkginclude_HEADERS += $(swincludedir)/rtranspgdrive.h
pkginclude_HEADERS += $(swincludedir)/ftplibftpt.h
pkginclude_HEADERS += $(swincludedir)/ftplib.h
@@ -32,8 +33,9 @@ pkginclude_HEADERS += $(swincludedir)/gbfrtf.h
pkginclude_HEADERS += $(swincludedir)/gbfstrongs.h
pkginclude_HEADERS += $(swincludedir)/gbfwordjs.h
pkginclude_HEADERS += $(swincludedir)/gbfthml.h
-pkginclude_HEADERS += $(swincludedir)/greeklexattribs.h
+pkginclude_HEADERS += $(swincludedir)/gbflatex.h
+pkginclude_HEADERS += $(swincludedir)/greeklexattribs.h
pkginclude_HEADERS += $(swincludedir)/hebrewmcim.h
pkginclude_HEADERS += $(swincludedir)/hrefcom.h
pkginclude_HEADERS += $(swincludedir)/installmgr.h
@@ -61,10 +63,12 @@ pkginclude_HEADERS += $(swincludedir)/osisstrongs.h
pkginclude_HEADERS += $(swincludedir)/osisfootnotes.h
pkginclude_HEADERS += $(swincludedir)/osislemma.h
pkginclude_HEADERS += $(swincludedir)/osisredletterwords.h
+pkginclude_HEADERS += $(swincludedir)/osisreferencelinks.h
pkginclude_HEADERS += $(swincludedir)/osisscripref.h
pkginclude_HEADERS += $(swincludedir)/osiswordjs.h
pkginclude_HEADERS += $(swincludedir)/osisvariants.h
pkginclude_HEADERS += $(swincludedir)/osisxlit.h
+pkginclude_HEADERS += $(swincludedir)/osislatex.h
pkginclude_HEADERS += $(swincludedir)/papyriplain.h
pkginclude_HEADERS += $(swincludedir)/rawcom.h
@@ -130,11 +134,13 @@ pkginclude_HEADERS += $(swincludedir)/thmlscripref.h
pkginclude_HEADERS += $(swincludedir)/thmlstrongs.h
pkginclude_HEADERS += $(swincludedir)/thmlvariants.h
pkginclude_HEADERS += $(swincludedir)/thmlwordjs.h
+pkginclude_HEADERS += $(swincludedir)/thmllatex.h
pkginclude_HEADERS += $(swincludedir)/teiplain.h
pkginclude_HEADERS += $(swincludedir)/teirtf.h
pkginclude_HEADERS += $(swincludedir)/teixhtml.h
pkginclude_HEADERS += $(swincludedir)/teihtmlhref.h
+pkginclude_HEADERS += $(swincludedir)/teilatex.h
pkginclude_HEADERS += $(swincludedir)/treekey.h
pkginclude_HEADERS += $(swincludedir)/treekeyidx.h
@@ -152,6 +158,7 @@ pkginclude_HEADERS += $(swincludedir)/utf8html.h
pkginclude_HEADERS += $(swincludedir)/utf8latin1.h
pkginclude_HEADERS += $(swincludedir)/utf8nfc.h
pkginclude_HEADERS += $(swincludedir)/utf8nfkd.h
+pkginclude_HEADERS += $(swincludedir)/utf8scsu.h
pkginclude_HEADERS += $(swincludedir)/utf8transliterator.h
pkginclude_HEADERS += $(swincludedir)/utf8utf16.h
pkginclude_HEADERS += $(swincludedir)/utilstr.h
@@ -160,11 +167,16 @@ pkginclude_HEADERS += $(swincludedir)/utilxml.h
pkginclude_HEADERS += $(swincludedir)/versekey.h
pkginclude_HEADERS += $(swincludedir)/versetreekey.h
pkginclude_HEADERS += $(swincludedir)/zcom.h
+pkginclude_HEADERS += $(swincludedir)/zcom4.h
pkginclude_HEADERS += $(swincludedir)/zipcomprs.h
+pkginclude_HEADERS += $(swincludedir)/bz2comprs.h
+pkginclude_HEADERS += $(swincludedir)/xzcomprs.h
pkginclude_HEADERS += $(swincludedir)/zld.h
pkginclude_HEADERS += $(swincludedir)/zstr.h
pkginclude_HEADERS += $(swincludedir)/ztext.h
+pkginclude_HEADERS += $(swincludedir)/ztext4.h
pkginclude_HEADERS += $(swincludedir)/zverse.h
+pkginclude_HEADERS += $(swincludedir)/zverse4.h
pkginclude_HEADERS += $(swincludedir)/canon_kjva.h
pkginclude_HEADERS += $(swincludedir)/canon_leningrad.h
@@ -181,4 +193,7 @@ pkginclude_HEADERS += $(swincludedir)/canon_catholic2.h
pkginclude_HEADERS += $(swincludedir)/canon_lxx.h
pkginclude_HEADERS += $(swincludedir)/canon_orthodox.h
pkginclude_HEADERS += $(swincludedir)/canon_null.h
+pkginclude_HEADERS += $(swincludedir)/canon_segond.h
+pkginclude_HEADERS += $(swincludedir)/canon_calvin.h
+pkginclude_HEADERS += $(swincludedir)/canon_darbyfr.h
diff --git a/include/bz2comprs.h b/include/bz2comprs.h
index 8452dfc..449a385 100644
--- a/include/bz2comprs.h
+++ b/include/bz2comprs.h
@@ -3,7 +3,7 @@
* bz2comprs.h - Bzip2Compress, a driver class that provides bzip2
* compression (Burrows–Wheeler with Huffman coding)
*
- * $Id: bz2comprs.h 3156 2014-04-17 03:50:37Z greg.hellings $
+ * $Id: bz2comprs.h 3045 2014-03-02 07:53:52Z chrislit $
*
* Copyright 2000-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/canon_abbrevs.h b/include/canon_abbrevs.h
index a5fc320..60dea94 100644
--- a/include/canon_abbrevs.h
+++ b/include/canon_abbrevs.h
@@ -24,6 +24,8 @@
#ifndef CANON_ABBREVS_H
#define CANON_ABBREVS_H
+#include <versificationmgr.h>
+
SWORD_NAMESPACE_START
diff --git a/include/canon_calvin.h b/include/canon_calvin.h
new file mode 100644
index 0000000..b13e4ca
--- /dev/null
+++ b/include/canon_calvin.h
@@ -0,0 +1,395 @@
+/******************************************************************************
+ *
+ * canon_calvin.h - Versification data for French Bibles de Genève
+ * (Bibles de Genève, Épée, Martin, Ostervald)
+ *
+ * $Id$
+ *
+ * Copyright 1998-2013 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_CALVIN_H
+#define CANON_CALVIN_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: Calvin
+
+/* 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
+*/
+
+/* The first Bible de Genève, a revision of the Bible d'Olivétan, was
+ released in 1560 by Jean Calvin. The Bible d'Olivétan was printed
+ without verse division.
+ Because Bibles employing this versification system, introduced by
+ Robert 'Stephanus' Estienne in 1553 differ subtly in versification,
+ this is not based on any single edition, although some may
+ eventually match, but on multiple editions of these bibles.
+*/
+
+// Apocryphal books are not included.
+
+
+/******************************************************************************
+ * [on]tbooks_calvin - initialize static instance for all canonical
+ * text names and chapmax
+ *
+ * for otbooks_calvin, use otbooks
+ *
+ * for ntbooks_calvin, use ntbooks
+ *
+ ******************************************************************************/
+
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_calvin[] = {
+ // 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, 15, 34, 45, 41, 50, 13, 32, 22, 29,
+ 35, 41, 30, 25, 18, 65, 23, 31, 39, 17,
+ 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, 43,
+ 15, 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, 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, 54,
+ // 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, 38, 38, 28,
+ 25, 17,
+ // 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,
+ // 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,
+ 8, 16,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 13, 13, 14,
+ // 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, 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, 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,
+ // Daniel
+ 21, 49, 30, 37, 31, 28, 28, 27, 27, 21,
+ 45, 13,
+ // Hosea
+ 11, 23, 5, 19, 15, 11, 16, 14, 17, 15,
+ 11, 15, 16, 9,
+ // Joel
+ 20, 32, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 16, 11, 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, 51, 53,
+ 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, 40, 38,
+ 40, 30, 35, 28, 27, 32, 44, 31,
+ // Romans
+ 32, 29, 30, 25, 21, 23, 25, 38, 33, 21,
+ 36, 21, 14, 23, 33, 27,
+ // I Corinthians
+ 31, 16, 22, 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, 13,
+ // 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
+};
+
+unsigned char mappings_calvin[] = {
+ 0,
+ 4, 13, 1, 0, 12, 16, 0,
+ 4, 13, 2, 0, 13, 1, 0,
+ 4, 30, 1, 0, 29, 40, 0,
+ 4, 30, 2, 0, 30, 1, 0,
+ 9, 20, 43, 0, 20, 42, 0,
+ 9, 24, 1, 0, 23, 29, 0,
+ 9, 24, 2, 0, 24, 1, 0,
+ 11, 22, 44, 0, 22, 43, 0,
+ 18, 39, 1, 0, 38, 39, 0,
+ 18, 39, 4, 0, 39, 1, 0,
+ 18, 39, 34, 0, 40, 1, 0,
+ 18, 40, 1, 0, 40, 6, 0,
+ 18, 40, 20, 0, 41, 1, 0,
+ 18, 41, 1, 0, 41, 10, 0,
+ 19, 3, 2, 0, 3, 1, 0,
+ 19, 4, 2, 0, 4, 1, 0,
+ 19, 5, 2, 0, 5, 1, 0,
+ 19, 6, 2, 0, 6, 1, 0,
+ 19, 7, 2, 0, 7, 1, 0,
+ 19, 8, 2, 0, 8, 1, 0,
+ 19, 9, 2, 0, 9, 1, 0,
+ 19, 12, 2, 0, 12, 1, 0,
+ 19, 18, 2, 0, 18, 1, 0,
+ 19, 19, 2, 0, 19, 1, 0,
+ 19, 20, 2, 0, 20, 1, 0,
+ 19, 21, 2, 0, 21, 1, 0,
+ 19, 22, 2, 0, 22, 1, 0,
+ 19, 30, 2, 0, 30, 1, 0,
+ 19, 31, 2, 0, 31, 1, 0,
+ 19, 34, 2, 0, 34, 1, 0,
+ 19, 36, 2, 0, 36, 1, 0,
+ 19, 38, 2, 0, 38, 1, 0,
+ 19, 39, 2, 0, 39, 1, 0,
+ 19, 40, 2, 0, 40, 1, 0,
+ 19, 41, 2, 0, 41, 1, 0,
+ 19, 42, 2, 0, 42, 1, 0,
+ 19, 44, 2, 0, 44, 1, 0,
+ 19, 45, 2, 0, 45, 1, 0,
+ 19, 46, 2, 0, 46, 1, 0,
+ 19, 47, 2, 0, 47, 1, 0,
+ 19, 48, 2, 0, 48, 1, 0,
+ 19, 49, 2, 0, 49, 1, 0,
+ 19, 51, 2, 0, 51, 1, 0,
+ 19, 51, 3, 0, 51, 1, 0,
+ 19, 52, 2, 0, 52, 1, 0,
+ 19, 52, 3, 0, 52, 1, 0,
+ 19, 53, 2, 0, 53, 1, 0,
+ 19, 54, 3, 0, 54, 1, 0,
+ 19, 55, 2, 0, 55, 1, 0,
+ 19, 56, 2, 0, 56, 1, 0,
+ 19, 57, 2, 0, 57, 1, 0,
+ 19, 58, 2, 0, 58, 1, 0,
+ 19, 59, 2, 0, 59, 1, 0,
+ 19, 60, 2, 0, 60, 1, 0,
+ 19, 60, 3, 0, 60, 1, 0,
+ 19, 61, 2, 0, 61, 1, 0,
+ 19, 62, 2, 0, 62, 1, 0,
+ 19, 63, 2, 0, 63, 1, 0,
+ 19, 64, 2, 0, 64, 1, 0,
+ 19, 65, 2, 0, 65, 1, 0,
+ 19, 67, 2, 0, 67, 1, 0,
+ 19, 68, 2, 0, 68, 1, 0,
+ 19, 69, 2, 0, 69, 1, 0,
+ 19, 70, 2, 0, 70, 1, 0,
+ 19, 75, 2, 0, 75, 1, 0,
+ 19, 76, 2, 0, 76, 1, 0,
+ 19, 77, 2, 0, 77, 1, 0,
+ 19, 80, 2, 0, 80, 1, 0,
+ 19, 81, 2, 0, 81, 1, 0,
+ 19, 83, 2, 0, 83, 1, 0,
+ 19, 84, 2, 0, 84, 1, 0,
+ 19, 85, 2, 0, 85, 1, 0,
+ 19, 88, 2, 0, 88, 1, 0,
+ 19, 89, 2, 0, 89, 1, 0,
+ 19, 92, 2, 0, 92, 1, 0,
+ 19, 102, 2, 0, 102, 1, 0,
+ 19, 108, 2, 0, 108, 1, 0,
+ 19, 140, 2, 0, 140, 1, 0,
+ 19, 142, 2, 0, 142, 1, 0,
+ 21, 12, 1, 0, 11, 9, 0,
+ 21, 12, 3, 0, 12, 1, 0,
+ 23, 8, 23, 0, 9, 1, 0,
+ 23, 9, 1, 0, 9, 2, 0,
+ 26, 21, 1, 0, 20, 45, 0,
+ 26, 21, 6, 0, 21, 1, 0,
+ 28, 12, 1, 0, 11, 12, 0,
+ 28, 12, 2, 0, 12, 1, 0,
+ 32, 2, 1, 0, 1, 17, 0,
+ 32, 2, 2, 0, 2, 1, 0,
+ 41, 9, 51, 0, 9, 50, 0,
+ 41, 10, 53, 0, 10, 52, 0,
+ 44, 19, 40, 0, 19, 41, 0,
+ 45, 3, 23, 0, 3, 24, 0,
+ 46, 3, 22, 0, 3, 23, 0,
+ 64, 1, 15, 0, 1, 14, 0,
+ 66, 12, 18, 0, 13, 1, 0,
+ 0
+};
+
+SWORD_NAMESPACE_END
+
+#endif
diff --git a/include/canon_darbyfr.h b/include/canon_darbyfr.h
new file mode 100644
index 0000000..cd54ba5
--- /dev/null
+++ b/include/canon_darbyfr.h
@@ -0,0 +1,311 @@
+/******************************************************************************
+ *
+ * canon_darbyfr.h - Versification data for the French Darby Bibles
+ *
+ * $Id$
+ *
+ * Copyright 1998-2015 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_DARBYFR_H
+#define CANON_DARBYFR_H
+
+SWORD_NAMESPACE_START
+
+
+// Versification system: DarbyFR
+// 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
+
+// This versification scheme is based on the French Darby translation.
+
+
+/******************************************************************************
+ * [on]tbooks_darbyfr - initialize static instance for all canonical
+ * text names and chapmax
+ *
+ * for otbooks_darbyfr, use otbooks
+ *
+ * for ntbooks_darbyfr, use ntbooks
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_darbyfr[] = {
+ // 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, 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, 15, 34, 45, 41, 50, 13, 32, 22, 29,
+ 35, 41, 30, 25, 18, 65, 23, 31, 40, 17,
+ 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, 69, 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, 43,
+ 15, 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, 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, 54,
+ // 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, 38, 38, 27,
+ 25, 17,
+ // Psalms
+ 6, 12, 8, 8, 12, 10, 17, 9, 20, 18,
+ 7, 8, 5, 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, 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,
+ // Daniel
+ 21, 49, 30, 37, 31, 28, 28, 27, 27, 21,
+ 45, 13,
+ // Hosea
+ 11, 23, 5, 19, 15, 11, 16, 14, 17, 15,
+ 11, 15, 16, 9,
+ // Joel
+ 20, 32, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 16, 11, 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, 51, 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
+ 52, 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, 13,
+ // 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
+};
+
+unsigned char mappings_darbyfr[] = {
+ 0,
+ 3, 5, 20, 0, 6, 1, 0,
+ 3, 6, 1, 0, 6, 8, 0,
+ 4, 13, 1, 0, 12, 16, 0,
+ 4, 13, 2, 0, 13, 1, 0,
+ 4, 30, 2, 0, 30, 1, 0,
+ 5, 28, 69, 0, 29, 1, 0,
+ 5, 29, 1, 0, 29, 2, 0,
+ 9, 20, 43, 0, 20, 42, 0,
+ 9, 24, 1, 0, 23, 29, 0,
+ 9, 24, 2, 0, 24, 1, 0,
+ 11, 22, 44, 0, 22, 43, 0,
+ 18, 39, 1, 0, 38, 39, 0,
+ 18, 39, 4, 0, 39, 1, 0,
+ 18, 39, 34, 0, 40, 1, 0,
+ 18, 40, 1, 0, 40, 6, 0,
+ 18, 40, 20, 0, 41, 1, 0,
+ 18, 41, 1, 0, 41, 9, 0,
+ 18, 41, 1, 0, 41, 10, 0,
+ 19, 13, 1, 0, 13, 2, 0,
+ 26, 21, 1, 0, 20, 45, 0,
+ 26, 21, 6, 0, 21, 1, 0,
+ 28, 12, 1, 0, 11, 12, 0,
+ 28, 12, 2, 0, 12, 1, 0,
+ 32, 2, 1, 0, 1, 17, 0,
+ 32, 2, 2, 0, 2, 1, 0,
+ 41, 9, 51, 0, 9, 50, 0,
+ 43, 1, 39, 0, 1, 38, 0,
+ 47, 13, 13, 0, 13, 14, 0,
+ 64, 1, 15, 0, 1, 14, 0,
+ 66, 12, 18, 0, 13, 1, 0,
+ 0
+};
+
+SWORD_NAMESPACE_END
+
+#endif
diff --git a/include/canon_nrsv.h b/include/canon_nrsv.h
index 6959512..e131e2e 100644
--- a/include/canon_nrsv.h
+++ b/include/canon_nrsv.h
@@ -2,7 +2,7 @@
*
* canon_nrsv.h - Versification data for the NRSV system
*
- * $Id: canon_nrsv.h 2915 2013-07-23 16:55:54Z chrislit $
+ * $Id: canon_nrsv.h 3240 2014-07-12 16:27:35Z scribe $
*
* Copyright 2009-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -264,6 +264,12 @@ int vm_nrsv[] = {
27, 21
};
+unsigned char mappings_nrsv[] = {
+ 0,
+ 66, 12, 18, 19, 13, 1, 0,
+ 66, 13, 1, 1, 13, 1, 0,
+ 0
+};
SWORD_NAMESPACE_END
diff --git a/include/canon_segond.h b/include/canon_segond.h
new file mode 100644
index 0000000..16b5f4d
--- /dev/null
+++ b/include/canon_segond.h
@@ -0,0 +1,390 @@
+/******************************************************************************
+ *
+ * canon_segond.h - Versification data for French Louis Segond original
+ * and revised Bibles
+ *
+ * $Id$
+ *
+ * Copyright 1998-2013 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_SEGOND_H
+#define CANON_SEGOND_H
+
+SWORD_NAMESPACE_START
+
+// Versification system: Segond
+
+// 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
+
+// Because different editions of the L. Segond Bibles employing this versification system differ subtly in versification, this is not based on any single edition, but on multiple editions of these Bibles.
+
+
+/******************************************************************************
+ * [on]tbooks_segond - initialize static instance for all canonical text names
+ * and chapmax
+ *
+ * for otbooks_segond, use otbooks
+ *
+ * for ntbooks_segond, use ntbooks
+ *
+ ******************************************************************************/
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int vm_segond[] = {
+ // 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, 29, 28, 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, 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, 50, 13, 32, 22, 29,
+ 35, 41, 30, 25, 18, 65, 23, 31, 39, 17,
+ 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, 43,
+ 15, 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, 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, 54,
+ // 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, 23, 14, 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, 38, 38, 28,
+ 25, 17,
+ // 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,
+ // 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, 17, 19, 12, 29, 17, 18, 20,
+ 8, 16,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 12, 14, 14,
+ // 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, 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, 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,
+ // Daniel
+ 21, 49, 30, 37, 31, 28, 28, 27, 27, 21,
+ 45, 13,
+ // Hosea
+ 9, 25, 5, 19, 15, 11, 16, 14, 17, 15,
+ 11, 15, 16, 9,
+ // Joel
+ 20, 32, 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
+ 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, 51, 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, 40, 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, 13,
+ // 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
+};
+
+unsigned char mappings_segond[] = {
+ 0,
+ 2, 7, 26, 0, 8, 1, 0,
+ 2, 8, 1, 0, 8, 5, 0,
+ 3, 5, 20, 0, 6, 1, 0,
+ 3, 6, 1, 0, 6, 8, 0,
+ 4, 30, 1, 0, 29, 40, 0,
+ 4, 30, 2, 0, 30, 1, 0,
+ 9, 20, 43, 0, 20, 42, 0,
+ 9, 24, 1, 0, 23, 29, 0,
+ 9, 24, 2, 0, 24, 1, 0,
+ 11, 22, 44, 0, 22, 43, 0,
+ 18, 39, 1, 0, 38, 39, 0,
+ 18, 39, 4, 0, 39, 1, 0,
+ 18, 39, 34, 0, 40, 1, 0,
+ 18, 40, 1, 0, 40, 6, 0,
+ 18, 40, 20, 0, 41, 1, 0,
+ 18, 41, 1, 0, 41, 10, 0,
+ 19, 3, 2, 0, 3, 1, 0,
+ 19, 4, 2, 0, 4, 1, 0,
+ 19, 5, 2, 0, 5, 1, 0,
+ 19, 6, 2, 0, 6, 1, 0,
+ 19, 7, 2, 0, 7, 1, 0,
+ 19, 8, 2, 0, 8, 1, 0,
+ 19, 9, 2, 0, 9, 1, 0,
+ 19, 12, 2, 0, 12, 1, 0,
+ 19, 18, 2, 0, 18, 1, 0,
+ 19, 19, 2, 0, 19, 1, 0,
+ 19, 20, 2, 0, 20, 1, 0,
+ 19, 21, 2, 0, 21, 1, 0,
+ 19, 22, 2, 0, 22, 1, 0,
+ 19, 30, 2, 0, 30, 1, 0,
+ 19, 31, 2, 0, 31, 1, 0,
+ 19, 34, 2, 0, 34, 1, 0,
+ 19, 36, 2, 0, 36, 1, 0,
+ 19, 38, 2, 0, 38, 1, 0,
+ 19, 39, 2, 0, 39, 1, 0,
+ 19, 40, 2, 0, 40, 1, 0,
+ 19, 41, 2, 0, 41, 1, 0,
+ 19, 42, 2, 0, 42, 1, 0,
+ 19, 44, 2, 0, 44, 1, 0,
+ 19, 45, 2, 0, 45, 1, 0,
+ 19, 46, 2, 0, 46, 1, 0,
+ 19, 47, 2, 0, 47, 1, 0,
+ 19, 48, 2, 0, 48, 1, 0,
+ 19, 49, 2, 0, 49, 1, 0,
+ 19, 51, 2, 0, 51, 1, 0,
+ 19, 51, 3, 0, 51, 1, 0,
+ 19, 52, 2, 0, 52, 1, 0,
+ 19, 52, 3, 0, 52, 1, 0,
+ 19, 53, 2, 0, 53, 1, 0,
+ 19, 54, 3, 0, 54, 1, 0,
+ 19, 55, 2, 0, 55, 1, 0,
+ 19, 56, 2, 0, 56, 1, 0,
+ 19, 57, 2, 0, 57, 1, 0,
+ 19, 58, 2, 0, 58, 1, 0,
+ 19, 59, 2, 0, 59, 1, 0,
+ 19, 60, 2, 0, 60, 1, 0,
+ 19, 60, 3, 0, 60, 1, 0,
+ 19, 61, 2, 0, 61, 1, 0,
+ 19, 62, 2, 0, 62, 1, 0,
+ 19, 63, 2, 0, 63, 1, 0,
+ 19, 64, 2, 0, 64, 1, 0,
+ 19, 65, 2, 0, 65, 1, 0,
+ 19, 67, 2, 0, 67, 1, 0,
+ 19, 68, 2, 0, 68, 1, 0,
+ 19, 69, 2, 0, 69, 1, 0,
+ 19, 70, 2, 0, 70, 1, 0,
+ 19, 75, 2, 0, 75, 1, 0,
+ 19, 76, 2, 0, 76, 1, 0,
+ 19, 77, 2, 0, 77, 1, 0,
+ 19, 80, 2, 0, 80, 1, 0,
+ 19, 81, 2, 0, 81, 1, 0,
+ 19, 83, 2, 0, 83, 1, 0,
+ 19, 84, 2, 0, 84, 1, 0,
+ 19, 85, 2, 0, 85, 1, 0,
+ 19, 88, 2, 0, 88, 1, 0,
+ 19, 89, 2, 0, 89, 1, 0,
+ 19, 92, 2, 0, 92, 1, 0,
+ 19, 102, 2, 0, 102, 1, 0,
+ 19, 108, 2, 0, 108, 1, 0,
+ 19, 140, 2, 0, 140, 1, 0,
+ 19, 142, 2, 0, 142, 1, 0,
+ 21, 4, 17, 0, 5, 1, 0,
+ 21, 5, 1, 0, 5, 2, 0,
+ 21, 12, 1, 0, 11, 9, 0,
+ 21, 12, 3, 0, 12, 1, 0,
+ 22, 7, 1, 0, 6, 13, 0,
+ 22, 7, 2, 0, 7, 1, 0,
+ 23, 8, 23, 0, 9, 1, 0,
+ 23, 9, 1, 0, 9, 2, 0,
+ 23, 63, 19, 0, 64, 1, 0,
+ 23, 64, 2, 0, 64, 3, 0,
+ 26, 21, 1, 0, 20, 45, 0,
+ 26, 21, 6, 0, 21, 1, 0,
+ 28, 2, 1, 0, 1, 10, 0,
+ 28, 2, 3, 0, 2, 1, 0,
+ 28, 12, 1, 0, 11, 12, 0,
+ 28, 12, 2, 0, 12, 1, 0,
+ 32, 2, 1, 0, 1, 17, 0,
+ 32, 2, 2, 0, 2, 1, 0,
+ 33, 4, 14, 0, 5, 1, 0,
+ 33, 5, 1, 0, 5, 2, 0,
+ 34, 2, 1, 0, 1, 15, 0,
+ 34, 2, 2, 0, 2, 1, 0,
+ 41, 9, 51, 0, 9, 50, 0,
+ 44, 19, 40, 0, 19, 41, 0,
+ 47, 13, 12, 0, 13, 13, 0,
+ 64, 1, 15, 0, 1, 14, 0,
+ 66, 12, 18, 0, 13, 1, 0,
+ 0
+};
+
+SWORD_NAMESPACE_END
+
+#endif
diff --git a/include/canon_synodal.h b/include/canon_synodal.h
index c153d81..9fb4119 100644
--- a/include/canon_synodal.h
+++ b/include/canon_synodal.h
@@ -2,7 +2,7 @@
*
* canon_synodal.h - Versification data for the Synodal system
*
- * $Id: canon_synodal.h 2915 2013-07-23 16:55:54Z chrislit $
+ * $Id: canon_synodal.h 3240 2014-07-12 16:27:35Z scribe $
*
* Copyright 2009-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -393,6 +393,199 @@ int vm_synodal[] = {
27, 21
};
+unsigned char mappings_synodal[] = {
+ 'P', 'r', 'A', 'z', 'a', 'r', 0,
+ 'S', 'u', 's', 0,
+ 'B', 'e', 'l', 0,
+ 0,
+ 3, 14, 55, 0, 14, 55, 56,
+ 4, 13, 1, 0, 12, 16, 0,
+ 4, 13, 2, 0, 13, 1, 0,
+ 4, 30, 1, 0, 29, 40, 0,
+ 4, 30, 2, 0, 30, 1, 0,
+ 6, 5, 16, 0, 6, 1, 0,
+ 6, 6, 1, 0, 6, 2, 0,
+ 9, 24, 1, 0, 23, 29, 0,
+ 9, 24, 2, 0, 24, 1, 0,
+ 22, 39, 31, 0, 40, 1, 0,
+ 22, 40, 1, 0, 40, 6, 0,
+ 22, 40, 20, 0, 41, 1, 0,
+ 22, 41, 1, 0, 41, 9, 0,
+ 23, 3, 1, 0, 3, 0, 0,
+ 23, 4, 1, 0, 4, 0, 0,
+ 23, 5, 1, 0, 5, 0, 0,
+ 23, 6, 1, 0, 6, 0, 0,
+ 23, 7, 1, 0, 7, 0, 0,
+ 23, 8, 1, 0, 8, 0, 0,
+ 23, 9, 1, 0, 9, 0, 0,
+ 23, 9, 22, 0, 10, 1, 0,
+ 23, 10, 1, 0, 11, 0, 1,
+ 23, 11, 1, 0, 12, 0, 0,
+ 23, 12, 1, 0, 13, 0, 0,
+ 23, 12, 6, 0, 13, 5, 6,
+ 23, 13, 1, 0, 14, 0, 1,
+ 23, 14, 1, 0, 15, 0, 1,
+ 23, 15, 1, 0, 16, 0, 1,
+ 23, 16, 1, 0, 17, 0, 1,
+ 23, 17, 1, 0, 18, 0, 0,
+ 23, 18, 1, 0, 19, 0, 0,
+ 23, 19, 1, 0, 20, 0, 0,
+ 23, 20, 1, 0, 21, 0, 0,
+ 23, 21, 1, 0, 22, 0, 0,
+ 23, 22, 1, 0, 23, 0, 1,
+ 23, 23, 1, 0, 24, 0, 1,
+ 23, 24, 1, 0, 25, 0, 1,
+ 23, 25, 1, 0, 26, 0, 1,
+ 23, 26, 1, 0, 27, 0, 1,
+ 23, 27, 1, 0, 28, 0, 1,
+ 23, 28, 1, 0, 29, 0, 1,
+ 23, 29, 1, 0, 30, 0, 0,
+ 23, 30, 1, 0, 31, 0, 0,
+ 23, 31, 1, 0, 32, 0, 1,
+ 23, 32, 1, 0, 33, 0, 1,
+ 23, 33, 1, 0, 34, 0, 0,
+ 23, 34, 1, 0, 35, 0, 1,
+ 23, 35, 1, 0, 36, 0, 0,
+ 23, 36, 1, 0, 37, 0, 1,
+ 23, 37, 1, 0, 38, 0, 0,
+ 23, 38, 1, 0, 39, 0, 0,
+ 23, 39, 1, 0, 40, 0, 0,
+ 23, 40, 1, 0, 41, 0, 0,
+ 23, 41, 1, 0, 42, 0, 0,
+ 23, 42, 0, 0, 43, 0, 0,
+ 23, 43, 1, 0, 44, 0, 0,
+ 23, 44, 1, 0, 45, 0, 0,
+ 23, 45, 1, 0, 46, 0, 0,
+ 23, 46, 1, 0, 47, 0, 0,
+ 23, 47, 1, 0, 48, 0, 0,
+ 23, 48, 1, 0, 49, 0, 0,
+ 23, 49, 0, 0, 50, 0, 0,
+ 23, 50, 1, 2, 51, 0, 0,
+ 23, 51, 1, 2, 52, 0, 0,
+ 23, 52, 1, 0, 53, 0, 0,
+ 23, 53, 1, 2, 54, 0, 0,
+ 23, 54, 1, 0, 55, 0, 0,
+ 23, 55, 1, 0, 56, 0, 0,
+ 23, 56, 1, 0, 57, 0, 0,
+ 23, 57, 1, 0, 58, 0, 0,
+ 23, 58, 1, 0, 59, 0, 0,
+ 23, 59, 1, 2, 60, 0, 0,
+ 23, 60, 1, 0, 61, 0, 0,
+ 23, 61, 1, 0, 62, 0, 0,
+ 23, 62, 1, 0, 63, 0, 0,
+ 23, 63, 1, 0, 64, 0, 0,
+ 23, 64, 1, 0, 65, 0, 0,
+ 23, 65, 1, 0, 66, 0, 1,
+ 23, 66, 1, 0, 67, 0, 0,
+ 23, 67, 1, 0, 68, 0, 0,
+ 23, 68, 1, 0, 69, 0, 0,
+ 23, 69, 1, 0, 70, 0, 0,
+ 23, 70, 0, 0, 71, 0, 0,
+ 23, 71, 0, 0, 72, 0, 0,
+ 23, 72, 0, 0, 73, 0, 0,
+ 23, 73, 0, 0, 74, 0, 0,
+ 23, 74, 1, 0, 75, 0, 0,
+ 23, 75, 1, 0, 76, 0, 0,
+ 23, 76, 1, 0, 77, 0, 0,
+ 23, 77, 0, 0, 78, 0, 0,
+ 23, 78, 0, 0, 79, 0, 0,
+ 23, 79, 1, 0, 80, 0, 0,
+ 23, 80, 1, 0, 81, 0, 0,
+ 23, 81, 0, 0, 82, 0, 0,
+ 23, 82, 1, 0, 83, 0, 0,
+ 23, 83, 1, 0, 84, 0, 0,
+ 23, 84, 1, 0, 85, 0, 0,
+ 23, 85, 0, 0, 86, 0, 0,
+ 23, 86, 1, 0, 87, 0, 0,
+ 23, 86, 2, 0, 87, 1, 2,
+ 23, 87, 1, 0, 88, 0, 0,
+ 23, 88, 1, 0, 89, 0, 0,
+ 23, 89, 1, 0, 90, 0, 0,
+ 23, 89, 6, 0, 90, 5, 6,
+ 23, 90, 0, 0, 91, 0, 0,
+ 23, 91, 1, 0, 92, 0, 0,
+ 23, 92, 0, 0, 93, 0, 0,
+ 23, 93, 0, 0, 94, 0, 0,
+ 23, 94, 0, 0, 95, 0, 0,
+ 23, 95, 0, 0, 96, 0, 0,
+ 23, 96, 0, 0, 97, 0, 0,
+ 23, 97, 0, 0, 98, 0, 0,
+ 23, 98, 0, 0, 99, 0, 0,
+ 23, 99, 0, 0, 100, 0, 0,
+ 23, 100, 0, 0, 101, 0, 0,
+ 23, 101, 1, 0, 102, 0, 0,
+ 23, 102, 0, 0, 103, 0, 0,
+ 23, 103, 0, 0, 104, 0, 0,
+ 23, 104, 0, 0, 105, 0, 0,
+ 23, 105, 0, 0, 106, 0, 0,
+ 23, 106, 0, 0, 107, 0, 0,
+ 23, 107, 1, 0, 108, 0, 0,
+ 23, 108, 0, 0, 109, 0, 0,
+ 23, 109, 0, 0, 110, 0, 0,
+ 23, 110, 0, 0, 111, 0, 0,
+ 23, 111, 0, 1, 112, 1, 0,
+ 23, 112, 0, 1, 113, 1, 0,
+ 23, 113, 0, 0, 114, 0, 0,
+ 23, 113, 9, 0, 115, 1, 0,
+ 23, 114, 0, 0, 116, 0, 0,
+ 23, 115, 1, 0, 116, 10, 0,
+ 23, 116, 0, 0, 117, 0, 0,
+ 23, 117, 0, 0, 118, 0, 0,
+ 23, 118, 0, 0, 119, 0, 0,
+ 23, 119, 0, 0, 120, 0, 0,
+ 23, 120, 0, 0, 121, 0, 0,
+ 23, 121, 0, 0, 122, 0, 0,
+ 23, 122, 0, 0, 123, 0, 0,
+ 23, 123, 0, 0, 124, 0, 0,
+ 23, 124, 0, 0, 125, 0, 0,
+ 23, 125, 0, 0, 126, 0, 0,
+ 23, 126, 0, 0, 127, 0, 0,
+ 23, 127, 0, 0, 128, 0, 0,
+ 23, 128, 0, 0, 129, 0, 0,
+ 23, 129, 0, 0, 130, 0, 0,
+ 23, 130, 0, 0, 131, 0, 0,
+ 23, 131, 0, 0, 132, 0, 0,
+ 23, 132, 0, 0, 133, 0, 0,
+ 23, 133, 0, 0, 134, 0, 0,
+ 23, 134, 0, 1, 135, 1, 0,
+ 23, 135, 0, 0, 136, 0, 0,
+ 23, 136, 0, 0, 137, 0, 0,
+ 23, 137, 0, 0, 138, 0, 0,
+ 23, 138, 0, 0, 139, 0, 0,
+ 23, 139, 1, 0, 140, 0, 0,
+ 23, 140, 0, 0, 141, 0, 0,
+ 23, 141, 0, 0, 142, 0, 0,
+ 23, 142, 0, 0, 143, 0, 0,
+ 23, 143, 0, 0, 144, 0, 0,
+ 23, 144, 0, 0, 145, 0, 0,
+ 23, 145, 0, 1, 146, 1, 0,
+ 23, 146, 0, 1, 147, 1, 0,
+ 23, 147, 1, 0, 147, 12, 0,
+ 23, 148, 0, 1, 148, 1, 0,
+ 23, 149, 0, 1, 149, 1, 0,
+ 23, 150, 0, 1, 150, 1, 0,
+ 25, 4, 17, 0, 5, 1, 0,
+ 25, 5, 1, 0, 5, 2, 0,
+ 26, 1, 0, 0, 1, 1, 0,
+ 26, 7, 1, 0, 6, 13, 0,
+ 26, 7, 2, 0, 7, 1, 0,
+ 79, 3, 24, 0, 1, 1, 0, 35,
+ 79, 3, 52, 0, 1, 29, 30, 35,
+ 35, 3, 91, 0, 3, 24, 0,
+ 35, 3, 98, 0, 4, 1, 0,
+ 35, 4, 1, 0, 4, 4, 0,
+ 80, 13, 1, 0, 1, 1, 0, 35,
+ 81, 14, 1, 0, 1, 1, 0, 35,
+ 36, 14, 1, 0, 13, 16, 0,
+ 36, 14, 2, 0, 14, 1, 0,
+ 40, 2, 1, 0, 1, 17, 0,
+ 40, 2, 2, 0, 2, 1, 0,
+ 56, 19, 40, 0, 19, 40, 41,
+ 64, 14, 24, 0, 16, 25, 0,
+ 66, 13, 12, 0, 13, 12, 13,
+ 62, 1, 14, 15, 1, 14, 0,
+ 0
+};
SWORD_NAMESPACE_END
diff --git a/include/canon_vulg.h b/include/canon_vulg.h
index 9fa8e04..5822193 100644
--- a/include/canon_vulg.h
+++ b/include/canon_vulg.h
@@ -2,7 +2,7 @@
*
* canon_vulg.h - Versification data for the Vulg system
*
- * $Id: canon_vulg.h 2915 2013-07-23 16:55:54Z chrislit $
+ * $Id: canon_vulg.h 3240 2014-07-12 16:27:35Z scribe $
*
* Copyright 2009-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -386,6 +386,288 @@ int vm_vulg[] = {
20
};
+unsigned char mappings_vulg[] = {
+ 'E', 'p', 'J', 'e', 'r', 0,
+ 'P', 'r', 'A', 'z', 'a', 'r', 0,
+ 'S', 'u', 's', 0,
+ 'B', 'e', 'l', 0,
+ 0,
+ 1, 49, 31, 0, 49, 31, 32,
+ 1, 50, 22, 0, 50, 22, 23,
+ 2, 40, 13, 0, 40, 13, 15,
+ 3, 26, 45, 0, 26, 45, 46,
+ 4, 11, 34, 0, 11, 34, 35,
+ 4, 13, 1, 0, 12, 16, 0,
+ 4, 13, 2, 0, 13, 1, 0,
+ 4, 20, 29, 0, 20, 28, 0,
+ 4, 26, 1, 0, 25, 19, 0,
+ 4, 26, 1, 0, 26, 1, 0,
+ 6, 4, 24, 0, 4, 23, 0,
+ 6, 5, 15, 0, 5, 14, 0,
+ 6, 21, 36, 0, 21, 36, 37,
+ 6, 21, 37, 0, 21, 38, 39,
+ 7, 5, 32, 0, 5, 31, 0,
+ 7, 21, 24, 0, 21, 24, 25,
+ 9, 20, 41, 0, 20, 42, 0,
+ 9, 20, 43, 0, 21, 1, 0,
+ 9, 24, 1, 0, 23, 28, 29,
+ 9, 24, 2, 0, 24, 1, 0,
+ 13, 11, 46, 0, 11, 46, 47,
+ 13, 20, 7, 0, 20, 7, 8,
+ 16, 3, 30, 0, 3, 30, 31,
+ 16, 12, 33, 0, 12, 33, 34,
+ 20, 16, 5, 0, 16, 4, 0,
+ 20, 39, 31, 0, 40, 1, 0,
+ 20, 40, 1, 0, 40, 6, 0,
+ 20, 40, 20, 0, 41, 1, 0,
+ 20, 41, 1, 0, 41, 10, 0,
+ 20, 42, 16, 0, 42, 16, 17,
+ 21, 2, 13, 0, 2, 12, 0,
+ 21, 3, 2, 0, 3, 1, 0,
+ 21, 4, 2, 0, 4, 1, 0,
+ 21, 4, 9, 10, 4, 8, 0,
+ 21, 5, 2, 0, 5, 1, 0,
+ 21, 6, 2, 0, 6, 1, 0,
+ 21, 7, 2, 0, 7, 1, 0,
+ 21, 8, 2, 0, 8, 1, 0,
+ 21, 9, 2, 0, 9, 1, 0,
+ 21, 9, 22, 0, 10, 1, 0,
+ 21, 10, 1, 2, 11, 1, 0,
+ 21, 11, 0, 0, 12, 0, 0,
+ 21, 12, 1, 0, 13, 1, 0,
+ 21, 12, 2, 3, 13, 2, 0,
+ 21, 13, 0, 0, 14, 0, 0,
+ 21, 14, 1, 0, 15, 1, 0,
+ 21, 15, 0, 0, 16, 0, 0,
+ 21, 15, 10, 0, 16, 10, 11,
+ 21, 16, 0, 0, 17, 0, 0,
+ 21, 17, 1, 2, 18, 1, 0,
+ 21, 18, 1, 2, 19, 1, 0,
+ 21, 19, 1, 2, 20, 1, 0,
+ 21, 20, 1, 2, 21, 1, 0,
+ 21, 21, 1, 2, 22, 1, 0,
+ 21, 22, 0, 0, 23, 0, 0,
+ 21, 23, 0, 0, 24, 0, 0,
+ 21, 24, 0, 0, 25, 0, 0,
+ 21, 25, 0, 0, 26, 0, 0,
+ 21, 26, 0, 0, 27, 0, 0,
+ 21, 27, 0, 0, 28, 0, 0,
+ 21, 28, 0, 0, 29, 0, 0,
+ 21, 29, 1, 2, 30, 1, 0,
+ 21, 30, 1, 2, 31, 1, 0,
+ 21, 31, 0, 0, 32, 0, 0,
+ 21, 32, 0, 0, 33, 0, 0,
+ 21, 33, 1, 2, 34, 1, 0,
+ 21, 34, 0, 0, 35, 0, 0,
+ 21, 35, 1, 2, 36, 1, 0,
+ 21, 36, 0, 0, 37, 0, 0,
+ 21, 37, 1, 2, 38, 1, 0,
+ 21, 38, 1, 2, 39, 1, 0,
+ 21, 39, 1, 2, 40, 1, 0,
+ 21, 40, 1, 2, 41, 1, 0,
+ 21, 41, 1, 2, 42, 1, 0,
+ 21, 42, 0, 0, 43, 0, 0,
+ 21, 43, 1, 2, 44, 1, 0,
+ 21, 43, 22, 0, 44, 21, 22,
+ 21, 44, 1, 2, 45, 1, 0,
+ 21, 45, 1, 2, 46, 1, 0,
+ 21, 46, 1, 2, 47, 1, 0,
+ 21, 47, 1, 2, 48, 1, 0,
+ 21, 48, 1, 2, 49, 1, 0,
+ 21, 49, 0, 0, 50, 0, 0,
+ 21, 50, 1, 3, 51, 1, 0,
+ 21, 51, 1, 3, 52, 1, 0,
+ 21, 52, 1, 2, 53, 1, 0,
+ 21, 53, 1, 3, 54, 1, 0,
+ 21, 54, 1, 2, 55, 1, 0,
+ 21, 55, 1, 2, 56, 1, 0,
+ 21, 55, 11, 0, 56, 10, 11,
+ 21, 56, 1, 2, 57, 1, 0,
+ 21, 57, 1, 2, 58, 1, 0,
+ 21, 58, 1, 2, 59, 1, 0,
+ 21, 59, 1, 3, 60, 1, 0,
+ 21, 60, 1, 2, 61, 1, 0,
+ 21, 61, 1, 2, 62, 1, 0,
+ 21, 62, 1, 2, 63, 1, 0,
+ 21, 63, 1, 2, 64, 1, 0,
+ 21, 64, 1, 2, 65, 1, 0,
+ 21, 65, 0, 0, 66, 0, 0,
+ 21, 66, 1, 2, 67, 1, 0,
+ 21, 67, 1, 2, 68, 1, 0,
+ 21, 68, 1, 2, 69, 1, 0,
+ 21, 69, 1, 2, 70, 1, 0,
+ 21, 70, 0, 0, 71, 0, 0,
+ 21, 71, 0, 0, 72, 0, 0,
+ 21, 72, 0, 0, 73, 0, 0,
+ 21, 73, 0, 0, 74, 0, 0,
+ 21, 74, 1, 2, 75, 1, 0,
+ 21, 75, 1, 2, 76, 1, 0,
+ 21, 76, 1, 2, 77, 1, 0,
+ 21, 77, 0, 0, 78, 0, 0,
+ 21, 78, 0, 0, 79, 0, 0,
+ 21, 79, 1, 2, 80, 1, 0,
+ 21, 80, 1, 2, 81, 1, 0,
+ 21, 81, 0, 0, 82, 0, 0,
+ 21, 82, 1, 2, 83, 1, 0,
+ 21, 83, 1, 2, 84, 1, 0,
+ 21, 84, 1, 2, 85, 1, 0,
+ 21, 85, 0, 0, 86, 0, 0,
+ 21, 86, 0, 0, 87, 0, 0,
+ 21, 87, 1, 2, 88, 1, 0,
+ 21, 88, 1, 2, 89, 1, 0,
+ 21, 89, 0, 0, 90, 0, 0,
+ 21, 90, 0, 0, 91, 0, 0,
+ 21, 91, 1, 2, 92, 1, 0,
+ 21, 92, 0, 0, 93, 0, 0,
+ 21, 93, 0, 0, 94, 0, 0,
+ 21, 94, 0, 0, 95, 0, 0,
+ 21, 95, 0, 0, 96, 0, 0,
+ 21, 96, 0, 0, 97, 0, 0,
+ 21, 97, 0, 0, 98, 0, 0,
+ 21, 98, 0, 0, 99, 0, 0,
+ 21, 99, 0, 0, 100, 0, 0,
+ 21, 100, 0, 0, 101, 0, 0,
+ 21, 101, 1, 2, 102, 1, 0,
+ 21, 102, 0, 0, 103, 0, 0,
+ 21, 103, 0, 0, 104, 0, 0,
+ 21, 104, 0, 0, 105, 0, 0,
+ 21, 105, 0, 0, 106, 0, 0,
+ 21, 106, 0, 0, 107, 0, 0,
+ 21, 107, 1, 2, 108, 1, 0,
+ 21, 108, 0, 0, 109, 0, 0,
+ 21, 109, 0, 0, 110, 0, 0,
+ 21, 110, 0, 0, 111, 0, 0,
+ 21, 111, 0, 0, 112, 0, 0,
+ 21, 112, 0, 0, 113, 0, 0,
+ 21, 113, 0, 0, 114, 0, 0,
+ 21, 113, 9, 0, 115, 1, 0,
+ 21, 114, 0, 0, 116, 0, 0,
+ 21, 115, 1, 0, 116, 10, 0,
+ 21, 116, 0, 0, 117, 0, 0,
+ 21, 117, 0, 0, 118, 0, 0,
+ 21, 118, 0, 0, 119, 0, 0,
+ 21, 119, 0, 0, 120, 0, 0,
+ 21, 120, 0, 0, 121, 0, 0,
+ 21, 121, 0, 0, 122, 0, 0,
+ 21, 122, 0, 0, 123, 0, 0,
+ 21, 123, 0, 0, 124, 0, 0,
+ 21, 124, 0, 0, 125, 0, 0,
+ 21, 125, 0, 0, 126, 0, 0,
+ 21, 126, 0, 0, 127, 0, 0,
+ 21, 127, 0, 0, 128, 0, 0,
+ 21, 128, 0, 0, 129, 0, 0,
+ 21, 129, 0, 0, 130, 0, 0,
+ 21, 130, 0, 0, 131, 0, 0,
+ 21, 131, 0, 0, 132, 0, 0,
+ 21, 132, 0, 0, 133, 0, 0,
+ 21, 133, 0, 0, 134, 0, 0,
+ 21, 134, 0, 0, 135, 0, 0,
+ 21, 135, 0, 0, 136, 0, 0,
+ 21, 136, 0, 0, 137, 0, 0,
+ 21, 137, 0, 0, 138, 0, 0,
+ 21, 138, 0, 0, 139, 0, 0,
+ 21, 139, 1, 2, 140, 1, 0,
+ 21, 140, 0, 0, 141, 0, 0,
+ 21, 141, 1, 2, 142, 1, 0,
+ 21, 142, 0, 0, 143, 0, 0,
+ 21, 143, 0, 0, 144, 0, 0,
+ 21, 144, 0, 0, 145, 0, 0,
+ 21, 145, 1, 0, 146, 0, 0,
+ 21, 145, 2, 0, 146, 1, 2,
+ 21, 146, 0, 0, 147, 0, 0,
+ 21, 147, 1, 0, 147, 12, 0,
+ 23, 4, 17, 0, 5, 1, 0,
+ 23, 5, 1, 0, 5, 2, 0,
+ 23, 7, 1, 0, 6, 12, 0,
+ 23, 7, 2, 0, 7, 1, 0,
+ 24, 1, 1, 0, 1, 1, 2,
+ 24, 5, 17, 0, 6, 1, 0,
+ 24, 6, 1, 0, 6, 2, 0,
+ 25, 2, 25, 0, 2, 24, 0,
+ 25, 5, 14, 0, 5, 13, 0,
+ 25, 6, 2, 0, 6, 1, 0,
+ 25, 6, 22, 23, 6, 21, 0,
+ 25, 9, 19, 0, 9, 18, 0,
+ 25, 11, 6, 0, 11, 5, 0,
+ 25, 19, 12, 0, 19, 12, 13,
+ 27, 8, 22, 0, 8, 22, 23,
+ 28, 37, 4, 0, 37, 4, 5,
+ 79, 6, 1, 0, 6, 1, 0, 30,
+ 31, 2, 9, 0, 2, 9, 10,
+ 80, 3, 24, 0, 1, 1, 0, 32,
+ 80, 3, 52, 0, 1, 29, 30, 32,
+ 32, 3, 91, 0, 3, 24, 0,
+ 32, 3, 98, 0, 4, 1, 0,
+ 32, 4, 1, 0, 4, 4, 0,
+ 81, 13, 1, 0, 1, 1, 0, 32,
+ 81, 13, 64, 65, 1, 64, 0, 32,
+ 82, 14, 1, 0, 1, 1, 0, 32,
+ 82, 14, 41, 42, 1, 41, 0, 32,
+ 33, 14, 1, 0, 13, 16, 0,
+ 33, 14, 2, 0, 14, 1, 0,
+ 35, 6, 11, 0, 6, 10, 0,
+ 42, 2, 1, 0, 1, 15, 0,
+ 42, 2, 2, 0, 2, 1, 0,
+ 45, 1, 5, 0, 1, 4, 0,
+ 45, 1, 31, 32, 1, 30, 0,
+ 45, 1, 36, 0, 1, 34, 35,
+ 45, 1, 37, 0, 1, 35, 0,
+ 45, 1, 47, 48, 1, 45, 0,
+ 45, 12, 54, 0, 12, 53, 0,
+ 45, 13, 53, 0, 13, 52, 0,
+ 46, 2, 19, 0, 2, 18, 0,
+ 46, 12, 46, 0, 12, 45, 0,
+ 46, 15, 37, 0, 15, 36, 0,
+ 47, 17, 15, 0, 17, 16, 0,
+ 48, 4, 40, 0, 4, 40, 41,
+ 48, 8, 39, 0, 9, 1, 0,
+ 48, 9, 1, 0, 9, 2, 0,
+ 50, 6, 52, 0, 6, 51, 0,
+ 51, 7, 55, 0, 7, 55, 56,
+ 51, 14, 6, 0, 14, 6, 7,
+ 51, 19, 40, 0, 19, 40, 41,
+ 73, 12, 18, 19, 13, 1, 0,
+ 73, 13, 1, 0, 13, 1, 0,
+ 75, 1, 4, 0, 1, 3, 4,
+ 75, 1, 10, 0, 1, 10, 11,
+ 75, 1, 11, 0, 1, 12, 13,
+ 75, 1, 12, 0, 1, 13, 0,
+ 75, 1, 16, 0, 1, 15, 0,
+ 75, 1, 17, 18, 1, 16, 0,
+ 75, 1, 51, 52, 1, 49, 0,
+ 75, 2, 2, 0, 2, 1, 0,
+ 75, 2, 3, 4, 2, 2, 0,
+ 75, 2, 6, 7, 2, 4, 0,
+ 75, 2, 11, 12, 2, 8, 0,
+ 75, 2, 13, 0, 2, 9, 10,
+ 75, 2, 14, 15, 2, 11, 0,
+ 75, 2, 20, 21, 2, 16, 0,
+ 75, 2, 22, 23, 2, 17, 0,
+ 75, 2, 26, 0, 2, 20, 21,
+ 75, 2, 30, 0, 2, 25, 26,
+ 75, 3, 15, 0, 3, 14, 0,
+ 75, 3, 17, 0, 3, 16, 17,
+ 75, 4, 10, 0, 4, 10, 11,
+ 75, 4, 40, 0, 4, 39, 40,
+ 75, 5, 42, 0, 5, 41, 0,
+ 75, 5, 54, 55, 5, 53, 0,
+ 75, 5, 58, 0, 5, 56, 57,
+ 75, 5, 59, 60, 5, 57, 0,
+ 75, 5, 73, 0, 5, 70, 71,
+ 75, 6, 9, 0, 6, 8, 0,
+ 75, 8, 6, 0, 8, 5, 0,
+ 75, 8, 20, 0, 8, 19, 20,
+ 75, 8, 44, 0, 8, 43, 0,
+ 75, 8, 50, 0, 8, 49, 50,
+ 75, 8, 57, 0, 8, 56, 0,
+ 75, 8, 63, 64, 8, 62, 0,
+ 75, 8, 65, 66, 8, 63, 0,
+ 75, 8, 86, 0, 8, 83, 84,
+ 75, 8, 87, 0, 8, 84, 0,
+ 75, 8, 93, 94, 8, 90, 0,
+ 0
+ };
+
SWORD_NAMESPACE_END
#endif
diff --git a/include/config.h.in b/include/config.h.in
index cde8a27..06203e0 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -9,6 +9,15 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `bz2' library (-lbz2). */
+#undef HAVE_LIBBZ2
+
+/* Define to 1 if you have the `lzma' library (-llzma). */
+#undef HAVE_LIBLZMA
+
+/* Define to 1 if you have the `xapian' library (-lxapian). */
+#undef HAVE_LIBXAPIAN
+
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
diff --git a/include/defs.h b/include/defs.h
index fdad3db..d950cc9 100644
--- a/include/defs.h
+++ b/include/defs.h
@@ -2,7 +2,7 @@
*
* defs.h - Global defines, mostly platform-specific stuff
*
- * $Id: defs.h 3156 2014-04-17 03:50:37Z greg.hellings $
+ * $Id: defs.h 3029 2014-02-25 13:00:49Z scribe $
*
* Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -162,7 +162,7 @@ SWORD_NAMESPACE_START
#ifdef __cplusplus
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, FMT_XHTML};
+enum {FMT_UNKNOWN = 0, FMT_PLAIN, FMT_THML, FMT_GBF, FMT_HTML, FMT_HTMLHREF, FMT_RTF, FMT_OSIS, FMT_WEBIF, FMT_TEI, FMT_XHTML, FMT_LATEX};
enum {ENC_UNKNOWN = 0, ENC_LATIN1, ENC_UTF8, ENC_SCSU, ENC_UTF16, ENC_RTF, ENC_HTML};
enum {BIB_BIBTEX = 0, /* possible future formats: BIB_MARCXML, BIB_MARC21, BIB_DCMI BIB_OSISHEADER, BIB_SBL_XHTML, BIB_MLA_XHTML, BIB_APA_XHTML, BIB_CHICAGO_XHTML */};
#endif
diff --git a/include/encfiltmgr.h b/include/encfiltmgr.h
index bf62756..76a758a 100644
--- a/include/encfiltmgr.h
+++ b/include/encfiltmgr.h
@@ -4,7 +4,7 @@
* used to transcode all module text to a requested
* markup
*
- * $Id: encfiltmgr.h 2846 2013-06-29 14:48:47Z chrislit $
+ * $Id: encfiltmgr.h 3076 2014-03-05 04:49:08Z chrislit $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -39,15 +39,16 @@ class SWFilter;
class SWDLLEXPORT EncodingFilterMgr : public SWFilterMgr {
protected:
- SWFilter *latin1utf8;
+ SWFilter *latin1utf8;
SWFilter *scsuutf8;
- SWFilter *targetenc;
+ SWFilter *utf16utf8;
+ SWFilter *targetenc;
/*
* current encoding value
*/
- char encoding;
+ char encoding;
public:
@@ -56,33 +57,33 @@ public:
*
* @param encoding The desired encoding.
*/
- EncodingFilterMgr (char encoding = ENC_UTF8);
+ EncodingFilterMgr (char encoding = ENC_UTF8);
/**
* The destructor of SWEncodingMgr.
*/
- ~EncodingFilterMgr();
+ ~EncodingFilterMgr();
/** Markup sets/gets the encoding after initialization
*
* @param enc The new encoding or ENC_UNKNOWN if you just want to get the current markup.
* @return The current (possibly changed) encoding format.
*/
- char Encoding(char enc);
+ char Encoding(char enc);
/**
* Adds the raw filters which are defined in "section" to the SWModule object "module".
* @param module To this module the raw filter(s) are added
* @param section We use this section to get a list of filters we should apply to the module
*/
- virtual void AddRawFilters(SWModule *module, ConfigEntMap &section);
+ virtual void AddRawFilters(SWModule *module, ConfigEntMap &section);
/**
* Adds the encoding filters which are defined in "section" to the SWModule object "module".
* @param module To this module the encoding filter(s) are added
* @param section We use this section to get a list of filters we should apply to the module
*/
- virtual void AddEncodingFilters(SWModule *module, ConfigEntMap &section);
+ virtual void AddEncodingFilters(SWModule *module, ConfigEntMap &section);
};
SWORD_NAMESPACE_END
diff --git a/include/femain.h b/include/femain.h
index 3eec2c6..01c0042 100644
--- a/include/femain.h
+++ b/include/femain.h
@@ -23,12 +23,15 @@
#ifndef FEMAIN_H
#define FEMAIN_H
+#include <list>
+#include <swdisp.h>
+
class FEMain
{
public:
FEMain ();
virtual ~FEMain ();
- list < SWDisplay * >displays; // so we can delete each display we create
+ std::list < sword::SWDisplay * >displays; // so we can delete each display we create
};
#endif
diff --git a/include/filemgr.h b/include/filemgr.h
index eedfbcc..8d0e511 100644
--- a/include/filemgr.h
+++ b/include/filemgr.h
@@ -2,7 +2,7 @@
*
* filemgr.h - definition of class FileMgr used for pooling file handles
*
- * $Id: filemgr.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: filemgr.h 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -32,7 +32,7 @@
SWORD_NAMESPACE_START
-class SWDLLEXPORT FileMgr;
+class SWDLLEXPORT FileDesc;
struct SWDLLEXPORT DirEntry {
public:
@@ -40,49 +40,23 @@ public:
unsigned long size;
bool isDirectory;
};
-/**
-* This class represents one file. It works with the FileMgr object.
-*/
-class SWDLLEXPORT FileDesc {
-
- friend class FileMgr;
-
- long offset;
- int fd; // -77 closed;
- FileMgr *parent;
- FileDesc *next;
-
- FileDesc(FileMgr * parent, const char *path, int mode, int perms, bool tryDowngrade);
- virtual ~FileDesc();
-
-public:
- /** @return File handle.
- */
- int getFd();
-
- long seek(long offset, int whence);
- long read(void *buf, long count);
- long write(const void *buf, long count);
-
- /** Path to file.
- */
- char *path;
- /** File access mode.
- */
- int mode;
- /** File permissions.
- */
- int perms;
- /**
- */
- bool tryDowngrade;
-};
/**
-* This class ist used make file access operations easier.
-* It keeps a list of all open files internally and closes them
-* when the destructor is called.
-*/
+ * This class isolates all file io for SWORD, making OS
+ * level quirks easier to fix. This class is typically
+ * copied and replaced if necessary to get SWORD to run on
+ * a specific platform (e.g., Windows Mobile), but in
+ * the future, statics should be removed to make possible to
+ * instead simply subclass and override necessary methods.
+ *
+ * This class also provides many convenience methods which
+ * make working with data storage easier.
+ *
+ * Conceptually, this factory exposes an interface which
+ * allows SWORD to 'open' every file it wants, without
+ * worrying about OS limits, and takes care of opening and
+ * closing the actual file descriptors when necessary.
+ */
class SWDLLEXPORT FileMgr : public SWCacher {
friend class FileDesc;
@@ -151,13 +125,13 @@ public:
virtual void flush();
virtual long resourceConsumption();
- /** Checks for the existence of a file.
+ /** Checks for the existence and readability of a file.
* @param ipath Path to file.
* @param ifileName Name of file to check for.
*/
static signed char existsFile(const char *ipath, const char *ifileName = 0);
- /** Checks for the existence of a directory.
+ /** Checks for the existence and readability of a directory.
* @param ipath Path to directory.
* @param idirName Name of directory to check for.
*/
@@ -184,6 +158,63 @@ public:
static int removeFile(const char *fName);
static char getLine(FileDesc *fDesc, SWBuf &line);
+ /**
+ * Determines where SWORD looks for the user's home folder. This is
+ * typically used as a place to find any additional personal SWORD
+ * modules which a user might wish to be added to a system-wide
+ * library (e.g., added from ~/.sword/mods.d/ or ~/sword/mods.d/)
+ *
+ * or if a user or UI wishes to override SWORD system configuration
+ * settings (e.g., /etc/sword.conf) with a custom configuration
+ * (e.g., ~/.sword/sword.conf)
+ */
+ SWBuf getHomeDir();
+
+};
+
+/**
+* This class represents one file. It works with the FileMgr object.
+*/
+class SWDLLEXPORT FileDesc {
+
+ friend class FileMgr;
+
+ long offset;
+ int fd; // -77 closed;
+ FileMgr *parent;
+ FileDesc *next;
+
+ FileDesc(FileMgr * parent, const char *path, int mode, int perms, bool tryDowngrade);
+ virtual ~FileDesc();
+
+public:
+ /** @return File handle.
+ * NOTE: magic file descriptor -77 = closed to avoid os limits
+ */
+ inline int getFd() {
+ if (fd == -77)
+ fd = parent->sysOpen(this);
+// if ((fd < -1) && (fd != -77)) // kludge to handle ce
+// return 777;
+ return fd;
+ }
+
+ long seek(long offset, int whence);
+ long read(void *buf, long count);
+ long write(const void *buf, long count);
+
+ /** Path to file.
+ */
+ char *path;
+ /** File access mode.
+ */
+ int mode;
+ /** File permissions.
+ */
+ int perms;
+ /**
+ */
+ bool tryDowngrade;
};
diff --git a/include/flatapi.h b/include/flatapi.h
index c5f8412..2f57841 100644
--- a/include/flatapi.h
+++ b/include/flatapi.h
@@ -2,7 +2,7 @@
*
* flatapi.h - This file contains an api usable by non-C++ environments
*
- * $Id: flatapi.h 3184 2014-04-17 04:30:54Z greg.hellings $
+ * $Id: flatapi.h 3561 2018-01-07 06:45:42Z greg.hellings $
*
* Copyright 2002-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -24,7 +24,7 @@
#define SWORDFLATAPI_H
#include <inttypes.h>
-#include <defs.h>
+#include "defs.h"
#ifdef __cplusplus
extern "C" {
@@ -60,6 +60,21 @@ struct org_crosswire_sword_SearchHit {
#undef org_crosswire_sword_SWModule_SEARCHTYPE_LUCENE
#define org_crosswire_sword_SWModule_SEARCHTYPE_LUCENE -4L
+ const int org_crosswire_sword_SWModule_VERSEKEY_TESTAMENT = 0;
+ const int org_crosswire_sword_SWModule_VERSEKEY_BOOK = 1;
+ const int org_crosswire_sword_SWModule_VERSEKEY_CHAPTER = 2;
+ const int org_crosswire_sword_SWModule_VERSEKEY_VERSE = 3;
+ const int org_crosswire_sword_SWModule_VERSEKEY_CHAPMAX = 4;
+ const int org_crosswire_sword_SWModule_VERSEKEY_VERSEMAX = 5;
+ const int org_crosswire_sword_SWModule_VERSEKEY_BOOKNAME = 6;
+ const int org_crosswire_sword_SWModule_VERSEKEY_OSISREF = 7;
+ const int org_crosswire_sword_SWModule_VERSEKEY_SHORTTEXT = 8;
+ const int org_crosswire_sword_SWModule_VERSEKEY_BOOKABBREV = 9;
+
+
+
+
+
/*
* Class: org_crosswire_sword_SWModule
* Method: terminateSearch
@@ -68,13 +83,15 @@ struct org_crosswire_sword_SearchHit {
void SWDLLEXPORT org_crosswire_sword_SWModule_terminateSearch
(SWHANDLE hSWModule);
+typedef void (*org_crosswire_sword_SWModule_SearchCallback)(int);
+
/*
* Class: org_crosswire_sword_SWModule
* Method: search
* Signature: (Ljava/lang/String;IJLjava/lang/String;Lorg/crosswire/android/sword/SWModule/SearchProgressReporter;)[Lorg/crosswire/android/sword/SWModule/SearchHit;
*/
const struct org_crosswire_sword_SearchHit * SWDLLEXPORT org_crosswire_sword_SWModule_search
- (SWHANDLE hSWModule, const char *searchString, int searchType, long flags, const char *scope, SWHANDLE progressReporter);
+ (SWHANDLE hSWModule, const char *searchString, int searchType, long flags, const char *scope, org_crosswire_sword_SWModule_SearchCallback progressReporter);
/*
* Class: org_crosswire_sword_SWModule
@@ -281,6 +298,15 @@ SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_new
/*
* Class: org_crosswire_sword_SWMgr
+ * Method: newWithPath
+ * Signature: ()V
+ * Signature: (Ljava/lang/String;)V
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_newWithPath
+ (const char *path);
+
+/*
+ * Class: org_crosswire_sword_SWMgr
* Method: delete
* Signature: ()V
*/
@@ -367,6 +393,47 @@ const char * SWDLLEXPORT org_crosswire_sword_SWMgr_filterText
const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptions
(SWHANDLE hSWMgr);
+
+/*
+ * Class: org_crosswire_sword_SWConfig
+ * Method: getSections
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWConfig_getSections
+ (const char *confPath);
+
+/*
+ * Class: org_crosswire_sword_SWConfig
+ * Method: getSectionKeys
+ * Signature: (Ljava/lang/String;)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWConfig_getSectionKeys
+ (const char *confPath, const char *section);
+
+/*
+ * Class: org_crosswire_sword_SWConfig
+ * Method: getKeyValue
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWConfig_getKeyValue
+ (const char *confPath, const char *section, const char *key);
+
+/*
+ * Class: org_crosswire_sword_SWConfig
+ * Method: setKeyValue
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWConfig_setKeyValue
+ (const char *confPath, const char *section, const char *key, const char *value);
+
+/*
+ * Class: org_crosswire_sword_SWConfig
+ * Method: augmentConfig
+ * Signature: (Ljava/lang/String;)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWConfig_augmentConfig
+ (const char *confPath, const char *configBlob);
+
/*
* Class: org_crosswire_sword_SWMgr
* Method: getGlobalOptionValues
@@ -424,6 +491,7 @@ const char * SWDLLEXPORT org_crosswire_sword_SWMgr_translate
//
//
+typedef void (*org_crosswire_sword_InstallMgr_StatusCallback)(const char *, unsigned long, unsigned long);
/*
* Class: org_crosswire_sword_InstallMgr
@@ -431,7 +499,15 @@ const char * SWDLLEXPORT org_crosswire_sword_SWMgr_translate
* Signature: (Ljava/lang/String;Lorg/crosswire/android/sword/SWModule/SearchProgressReporter;)V
*/
SWHANDLE SWDLLEXPORT org_crosswire_sword_InstallMgr_new
- (const char *baseDir, SWHANDLE statusReporter);
+ (const char *baseDir, org_crosswire_sword_InstallMgr_StatusCallback statusReporter);
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: delete
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_InstallMgr_delete
+ (SWHANDLE hInstallMgr);
/*
* Class: org_crosswire_sword_InstallMgr
@@ -497,6 +573,12 @@ int SWDLLEXPORT org_crosswire_sword_InstallMgr_remoteInstallModule
SWHANDLE SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteModuleByName
(SWHANDLE hInstallMgr, const char *sourceName, const char *modName);
+void SWDLLEXPORT org_crosswire_sword_SWlog_logError(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWlog_logDebug(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWlog_logWarning(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWlog_logInformation(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWlog_logTimedInformation(const char *msg);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/gbflatex.h b/include/gbflatex.h
new file mode 100644
index 0000000..a0c50f0
--- /dev/null
+++ b/include/gbflatex.h
@@ -0,0 +1,52 @@
+/******************************************************************************
+ *
+ * gbflatex.h - Implementation of GBFLaTeX
+ *
+ * $Id: gbflatex.h 3074 2014-03-05 00:30:21Z chrislit $
+ *
+ * Copyright 2011-2014 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 GBFLATEX_H
+#define GBFLATEX_H
+
+#include <swbasicfilter.h>
+
+SWORD_NAMESPACE_START
+
+/** this filter converts GBF text to classed LaTeX text
+ */
+class SWDLLEXPORT GBFLaTeX : public SWBasicFilter {
+ bool renderNoteNumbers;
+protected:
+ class MyUserData : public BasicFilterUserData {
+ public:
+ MyUserData(const SWModule *module, const SWKey *key);
+ bool hasFootnotePreTag;
+ SWBuf version;
+ };
+ virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) {
+ return new MyUserData(module, key);
+ }
+ virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
+public:
+ GBFLaTeX();
+ virtual const char *getHeader() const;
+ void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; }
+};
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/gbfredletterwords.h b/include/gbfredletterwords.h
index 4fa1963..36b98a3 100644
--- a/include/gbfredletterwords.h
+++ b/include/gbfredletterwords.h
@@ -2,7 +2,7 @@
*
* gbfredletterwords.h - Implementation of GBFRedLetterWords
*
- * $Id: gbfredletterwords.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: gbfredletterwords.h 3451 2017-03-29 22:42:00Z scribe $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -20,7 +20,7 @@
*
*/
-#ifndef GBFSREDLETTERWORDS_H
+#ifndef GBFREDLETTERWORDS_H
#define GBFREDLETTERWORDS_H
#include <swoptfilter.h>
diff --git a/include/hebrewmcim.h b/include/hebrewmcim.h
index ffcb9a1..43b97b3 100644
--- a/include/hebrewmcim.h
+++ b/include/hebrewmcim.h
@@ -42,8 +42,8 @@ class SWDLLEXPORT HebrewMCIM : public SWInputMethod {
void init();
int subst[255];
- map<int, int> subst2[12];
- map<int, int*> multiChars;
+ std::map<int, int> subst2[12];
+ std::map<int, int*> multiChars;
public:
HebrewMCIM();
diff --git a/include/installmgr.h b/include/installmgr.h
index 56ebf7e..56f879a 100644
--- a/include/installmgr.h
+++ b/include/installmgr.h
@@ -2,7 +2,7 @@
*
* installmgr.h - Implementation of InstallMgr
*
- * $Id: installmgr.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: installmgr.h 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -76,6 +76,7 @@ protected:
StatusReporter *statusReporter;
bool passive;
SWBuf u, p;
+ bool unverifiedPeerAllowed;
/** override this method and provide your own custom RemoteTransport subclass
*/
@@ -236,7 +237,8 @@ A sample implementation, roughly taken from the windows installmgr:
return false;
}
*/
- virtual bool getCipherCode(const char *modName, SWConfig *config) { (void) modName; (void) config; return false; }
+
+ virtual bool getCipherCode(const char *modName, SWConfig *config) { (void) modName; (void) config; return false; }
@@ -245,6 +247,9 @@ A sample implementation, roughly taken from the windows installmgr:
void setFTPPassive(bool passive) { this->passive = passive; }
bool isFTPPassive() { return passive; }
+ void setUnverifiedPeerAllowed(bool allowed) { this->unverifiedPeerAllowed = allowed; }
+ bool isUnverifiedPeerAllowed() { return unverifiedPeerAllowed; }
+
/** call from another thread to terminate the installation process
*/
void terminate();
diff --git a/include/listkey.h b/include/listkey.h
index a388a06..e081a32 100644
--- a/include/listkey.h
+++ b/include/listkey.h
@@ -4,7 +4,7 @@
* types of keys for indexing into modules
* (e.g. verse, word, place, etc.)
*
- * $Id: listkey.h 2893 2013-07-16 03:07:02Z scribe $
+ * $Id: listkey.h 3541 2017-12-03 18:40:33Z scribe $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -89,7 +89,7 @@ public:
* @return error status
* deprecated use setToElement
*/
- virtual char setToElement(int ielement, SW_POSITION = TOP);
+ virtual char setToElement(int ielement, SW_POSITION pos = TOP);
// deprecated use setToElement
SWDEPRECATED virtual char SetToElement(int ielement, SW_POSITION pos = TOP) { return setToElement(ielement, pos); }
@@ -122,7 +122,6 @@ public:
/** Positions this key
*
* @param pos position
- * @return *this
*/
virtual void setPosition(SW_POSITION pos);
@@ -144,7 +143,7 @@ public:
* Returns the index for the new one given as as parameter.
* The first parameter is the new index.
*/
- virtual void setIndex(long index) { setToElement(index); }
+ virtual void setIndex(long index) { setToElement((int)index); }
virtual const char *getText() const;
virtual void setText(const char *ikey);
virtual void sort();
diff --git a/include/osishtmlhref.h b/include/osishtmlhref.h
index dedd79b..fef86a7 100644
--- a/include/osishtmlhref.h
+++ b/include/osishtmlhref.h
@@ -2,7 +2,7 @@
*
* osishtmlhref.h - Implementation of OSISHTMLHREF
*
- * $Id: osishtmlhref.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: osishtmlhref.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -41,7 +41,7 @@ protected:
bool osisQToTick;
bool inBold; // TODO: obsolete. left for binary compat for 1.6.x
bool inXRefNote;
- bool BiblicalText;
+ bool isBiblicalText;
int suspendLevel;
SWBuf wordsOfChristStart;
SWBuf wordsOfChristEnd;
diff --git a/include/osislatex.h b/include/osislatex.h
new file mode 100644
index 0000000..ce18fd9
--- /dev/null
+++ b/include/osislatex.h
@@ -0,0 +1,77 @@
+/******************************************************************************
+ *
+ * osislatex.h - Render filter for LaTeX of an OSIS module
+ *
+ * $Id: osislatex.h 3548 2017-12-10 05:11:38Z scribe $
+ *
+ * Copyright 2011-2014 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 OSISLATEX_H
+#define OSISLATEX_H
+
+#include <swbasicfilter.h>
+
+SWORD_NAMESPACE_START
+
+/** this filter converts OSIS text to classed XHTML
+ */
+class SWDLLEXPORT OSISLaTeX : public SWBasicFilter {
+private:
+ bool morphFirst;
+ bool renderNoteNumbers;
+protected:
+
+ class TagStack;
+ // used by derived classes so we have it in the header
+ virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key);
+ virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
+
+
+ class MyUserData : public BasicFilterUserData {
+ public:
+ bool osisQToTick;
+ bool inXRefNote;
+ bool isBiblicalText;
+ int suspendLevel;
+ bool firstCell; // for tables, indicates whether a cell is the first one in a row
+ SWBuf wordsOfChristStart;
+ SWBuf wordsOfChristEnd;
+ SWBuf divLevel; // divLevel "module", "testament, "bookgroup", "book", "majorsection", "section", "paragraph" , ignore others.
+
+ TagStack *quoteStack;
+ TagStack *hiStack;
+ TagStack *titleStack;
+ TagStack *lineStack;
+ int consecutiveNewlines;
+ SWBuf lastTransChange;
+ SWBuf w;
+ SWBuf fn;
+ SWBuf version;
+
+ MyUserData(const SWModule *module, const SWKey *key);
+ ~MyUserData();
+ void outputNewline(SWBuf &buf);
+ };
+public:
+ OSISLaTeX();
+ void setMorphFirst(bool val = true) { morphFirst = val; }
+ void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; }
+ virtual const char *getHeader() const;
+};
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/osisplain.h b/include/osisplain.h
index 5d728ca..485ff10 100644
--- a/include/osisplain.h
+++ b/include/osisplain.h
@@ -2,7 +2,7 @@
*
* osisplain.h - Implementation of OSISPlain
*
- * $Id: osisplain.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: osisplain.h 3524 2017-11-07 03:08:49Z scribe $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -35,6 +35,7 @@ public:
protected:
virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key);
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
+ virtual bool processStage(char stage, SWBuf &text, char *&from, BasicFilterUserData *userData);
public:
OSISPlain();
};
diff --git a/include/osisreferencelinks.h b/include/osisreferencelinks.h
index 4c75850..44d1ca8 100644
--- a/include/osisreferencelinks.h
+++ b/include/osisreferencelinks.h
@@ -3,7 +3,7 @@
* osisreferencelinks.h - SWFilter descendant to toggle OSIS reference
* links with specified type/subType
*
- * $Id: osisreferencelinks.h 2995 2013-12-28 06:32:26Z greg.hellings $
+ * $Id: osisreferencelinks.h 2989 2013-10-09 08:22:21Z chrislit $
*
* Copyright 2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/osiswebif.h b/include/osiswebif.h
index c58a379..db70777 100644
--- a/include/osiswebif.h
+++ b/include/osiswebif.h
@@ -2,7 +2,7 @@
*
* osiswebif.h - Implementation of OSISWEBIF
*
- * $Id: osiswebif.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: osiswebif.h 3257 2014-09-23 01:08:24Z scribe $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -35,6 +35,7 @@ class SWDLLEXPORT OSISWEBIF : public OSISXHTML {
bool javascript;
protected:
+ virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key);
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
public:
OSISWEBIF();
diff --git a/include/osisxhtml.h b/include/osisxhtml.h
index 4065dcc..8a71fa9 100644
--- a/include/osisxhtml.h
+++ b/include/osisxhtml.h
@@ -2,7 +2,7 @@
*
* osisxhtml.h - Render filter for classed XHTML of an OSIS module
*
- * $Id: osisxhtml.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: osisxhtml.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -36,19 +36,21 @@ private:
protected:
class TagStack;
- // used by derived classes so we have it in the header
virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key);
virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
+ // used by derived classes so we have it in the header
class MyUserData : public BasicFilterUserData {
public:
bool osisQToTick;
bool inXRefNote;
- bool BiblicalText;
+ bool isBiblicalText;
int suspendLevel;
SWBuf wordsOfChristStart;
SWBuf wordsOfChristEnd;
+ SWBuf interModuleLinkStart;
+ SWBuf interModuleLinkEnd;
TagStack *quoteStack;
TagStack *hiStack;
TagStack *titleStack;
diff --git a/include/rawstr.h b/include/rawstr.h
index 478035d..63af071 100644
--- a/include/rawstr.h
+++ b/include/rawstr.h
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr.h 3181 2014-04-17 04:27:57Z greg.hellings $
+ * $Id: rawstr.h 3134 2014-03-17 09:30:15Z chrislit $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/rawstr4.h b/include/rawstr4.h
index 71f50dc..e395ba8 100644
--- a/include/rawstr4.h
+++ b/include/rawstr4.h
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr4.h 3181 2014-04-17 04:27:57Z greg.hellings $
+ * $Id: rawstr4.h 3134 2014-03-17 09:30:15Z chrislit $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/rawverse.h b/include/rawverse.h
index 4c919cd..77c2fe3 100644
--- a/include/rawverse.h
+++ b/include/rawverse.h
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class VerseKey
*
- * $Id: rawverse.h 3181 2014-04-17 04:27:57Z greg.hellings $
+ * $Id: rawverse.h 3134 2014-03-17 09:30:15Z chrislit $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/rawverse4.h b/include/rawverse4.h
index 0b66dbe..95748db 100644
--- a/include/rawverse4.h
+++ b/include/rawverse4.h
@@ -5,7 +5,7 @@
* ??.vss and provides lookup and parsing functions based
* on class VerseKey
*
- * $Id: rawverse4.h 3181 2014-04-17 04:27:57Z greg.hellings $
+ * $Id: rawverse4.h 3134 2014-03-17 09:30:15Z chrislit $
*
* Copyright 2007-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/remotetrans.h b/include/remotetrans.h
index d20d96b..18ba672 100644
--- a/include/remotetrans.h
+++ b/include/remotetrans.h
@@ -2,7 +2,7 @@
*
* remotetrans.h - code for Remote Transport
*
- * $Id: remotetrans.h 2932 2013-07-31 14:07:01Z scribe $
+ * $Id: remotetrans.h 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 2004-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -53,6 +53,7 @@ protected:
StatusReporter *statusReporter;
bool passive;
bool term;
+ bool unverifiedPeerAllowed;
SWBuf host;
SWBuf u;
SWBuf p;
@@ -68,13 +69,23 @@ public:
*/
virtual char getURL(const char *destPath, const char *sourceURL, SWBuf *destBuf = 0);
+ /***********
+ * override this method in your real impl
+ *
+ * if sourceBuf then read from buffer instead of file
+ */
+ virtual char putURL(const char *destURL, const char *sourcePath, SWBuf *sourceBuf = 0);
+
int copyDirectory(const char *urlPrefix, const char *dir, const char *dest, const char *suffix);
virtual std::vector<struct DirEntry> getDirList(const char *dirURL);
void setPassive(bool passive) { this->passive = passive; }
+ bool isPassive() { return passive; }
void setUser(const char *user) { u = user; }
void setPasswd(const char *passwd) { p = passwd; }
+ void setUnverifiedPeerAllowed(bool val) { this->unverifiedPeerAllowed = val; }
+ bool isUnverifiedPeerAllowed() { return unverifiedPeerAllowed; }
void terminate() { term = true; }
};
diff --git a/include/rtranspgdrive.h b/include/rtranspgdrive.h
new file mode 100644
index 0000000..4a87789
--- /dev/null
+++ b/include/rtranspgdrive.h
@@ -0,0 +1,45 @@
+/******************************************************************************
+ *
+ * rtranspgdrive.h - code for Google Drive impl of Remote Transport
+ *
+ * $Id$
+ *
+ * Copyright 2004-2017 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 RTRANSPGDRIVE_H
+#define RTRANSPGDRIVE_H
+
+#include <defs.h>
+#include <remotetrans.h>
+
+SWORD_NAMESPACE_START
+
+
+class SWDLLEXPORT RTransportGDrive : public RemoteTransport {
+
+public:
+ RTransportGDrive(const char *host, StatusReporter *statusReporter = 0);
+ ~RTransportGDrive();
+
+ virtual char getURL(const char *destPath, const char *sourceURL, SWBuf *destBuf = 0);
+ virtual char putURL(const char *destURL, const char *sourcePath, SWBuf *sourceBuf = 0);
+};
+
+
+SWORD_NAMESPACE_END
+
+#endif
diff --git a/include/sapphire.h b/include/sapphire.h
index 96f3bf5..20aa53d 100644
--- a/include/sapphire.h
+++ b/include/sapphire.h
@@ -37,6 +37,9 @@
* results of assignments need to be reduced to 8 bits with
* & 0xFF or % 0x100, whichever is faster.
*/
+
+#ifndef SAPPHIRE_H
+#define SAPPHIRE_H
#ifndef NULL
#define NULL 0
@@ -80,3 +83,5 @@ unsigned *keypos); public:sapphire (unsigned char
SWORD_NAMESPACE_END
+
+#endif //SAPPHIRE_H
diff --git a/include/scsuutf8.h b/include/scsuutf8.h
index 7a36733..cf33887 100644
--- a/include/scsuutf8.h
+++ b/include/scsuutf8.h
@@ -2,7 +2,7 @@
*
* scsuutf8.h - SWFilter descendant to convert a SCSU character to UTF-8
*
- * $Id: scsuutf8.h 2846 2013-06-29 14:48:47Z chrislit $
+ * $Id: scsuutf8.h 3083 2014-03-06 08:13:10Z chrislit $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -25,16 +25,38 @@
#include <swfilter.h>
+#ifdef _ICU_
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/uchar.h>
+#endif
+
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);
+private:
+#ifdef _ICU_
+ UConverter* scsuConv;
+ UConverter* utf8Conv;
+ UErrorCode err;
+#else
+ // without ICU, we'll attempt to use Roman Czyborra's SCSU decoder code
+ unsigned char active;
+ bool mode;
+ unsigned long c, d;
+
+ static unsigned short start[8];
+ static unsigned short slide[8];
+ static unsigned short win[256];
+
+ int UTF8Output(unsigned long, SWBuf* utf8Buf);
+#endif
public:
SCSUUTF8();
+ ~SCSUUTF8();
virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
};
diff --git a/include/swbasicfilter.h b/include/swbasicfilter.h
index 29ea8a0..97b4638 100644
--- a/include/swbasicfilter.h
+++ b/include/swbasicfilter.h
@@ -5,7 +5,7 @@
* many filter will need and can use as a starting
* point
*
- * $Id: swbasicfilter.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: swbasicfilter.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -31,14 +31,16 @@
SWORD_NAMESPACE_START
+class VerseKey;
// not a protected inner class because MSVC++ sucks and can't handle it
class SWDLLEXPORT BasicFilterUserData {
public:
- BasicFilterUserData(const SWModule *module, const SWKey *key) { this->module = module; this->key = key; suspendTextPassThru = false; supressAdjacentWhitespace = false; }
+ BasicFilterUserData(const SWModule *module, const SWKey *key);
virtual ~BasicFilterUserData() {}
const SWModule *module;
const SWKey *key;
+ const VerseKey *vkey;
SWBuf lastTextNode;
SWBuf lastSuspendSegment;
bool suspendTextPassThru;
diff --git a/include/swbuf.h b/include/swbuf.h
index 0344299..254664b 100644
--- a/include/swbuf.h
+++ b/include/swbuf.h
@@ -2,7 +2,7 @@
*
* swbuf.h - code for SWBuf used as a transport and utility for data buffers
*
- * $Id: swbuf.h 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: swbuf.h 3541 2017-12-03 18:40:33Z scribe $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -90,27 +90,40 @@ public:
init(0);
}
- /**
- * SWBuf Constructor - Creates an SWBuf initialized
+ /******************************************************************************
+ * SWBuf Constructor - Creates an empty SWBuf object or an SWBuf initialized
* to a value from a const char *
- *
- */
- SWBuf(const char *initVal, unsigned long initSize = 0);
-// SWBuf(unsigned long initSize);
+ *
+ */
+ inline SWBuf(const char *initVal, unsigned long initSize = 0) {
+ init(initSize);
+ if (initVal)
+ set(initVal);
+ }
- /**
+ /******************************************************************************
* SWBuf Constructor - Creates an SWBuf initialized
- * to a value from a char
+ * to a value from another SWBuf
*
*/
- SWBuf(char initVal, unsigned long initSize = 0);
+ inline SWBuf(const SWBuf &other, unsigned long initSize = 0) {
+ init(initSize);
+ set(other);
+ }
- /**
+ /******************************************************************************
* SWBuf Constructor - Creates an SWBuf initialized
- * to a value from another SWBuf
+ * to a value from a char
*
*/
- SWBuf(const SWBuf &other, unsigned long initSize = 0);
+ inline SWBuf(char initVal, unsigned long initSize = 0) {
+ init(initSize+1);
+ *buf = initVal;
+ end = buf+1;
+ *end = 0;
+ }
+// SWBuf(unsigned long initSize);
+
/******************************************************************************
* SWBuf Destructor - Cleans up instance of SWBuf
@@ -220,7 +233,13 @@ public:
* SWBuf::setSize - Size this buffer to a specific length.
* @param len The new size of the buffer. One byte for the null will be added.
*/
- void setSize(unsigned long len);
+ inline void setSize(unsigned long len) {
+ assureSize(len+1);
+ if ((unsigned)(end - buf) < len)
+ memset(end, fillByte, len - (end-buf));
+ end = buf + len;
+ *end = 0;
+ }
/**
* SWBuf::resize - Resize this buffer to a specific length.
* @param len The new size of the buffer. One byte for the null will be added.
@@ -233,7 +252,17 @@ public:
* @param str Append this.
* @param max Append only max chars.
*/
- SWBuf &append(const char *str, long max = -1);
+ inline SWBuf &append(const char *str, long max = -1) {
+ // if (!str) //A null string was passed
+ // return;
+ if (max < 0)
+ max = strlen(str);
+ assureMore(max+1);
+ for (;((max)&&(*str));max--)
+ *end++ = *str++;
+ *end = 0;
+ return *this;
+ }
/**
* SWBuf::append - appends a value to the current value of this SWBuf
@@ -266,7 +295,7 @@ public:
* If the allocated memory is not enough, it will be resized accordingly.
* NOTE: This is dangerous, as wchar_t is currently different sizes on different
* platforms (stupid windoze; stupid c++ spec for not mandating 4byte).
- * @param ch Append this.
+ * @param wch Append this.
*/
inline SWBuf &append(wchar_t wch) {
assureMore(sizeof(wchar_t)*2);
@@ -402,7 +431,7 @@ public:
*
* @return prefix if separator character found; otherwise, null and leaves buffer unmodified
*/
- 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.
+ 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 = (int)(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 *
/**
@@ -445,7 +474,7 @@ public:
/**
* @return returns true if this buffer ends with the specified postfix
*/
- inline bool endsWith(const char *postfix) const { unsigned int psize = strlen(postfix); return (size() >= psize)?!strncmp(end-psize, postfix, psize):false; }
+ inline bool endsWith(const char *postfix) const { unsigned int psize = (unsigned int)strlen(postfix); return (size() >= psize)?!strncmp(end-psize, postfix, psize):false; }
// 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); }
diff --git a/include/swcomprs.h b/include/swcomprs.h
index 247ffcd..3cead50 100644
--- a/include/swcomprs.h
+++ b/include/swcomprs.h
@@ -3,7 +3,7 @@
* swcomprs.h - definition of Class SWCompress used for data
* compression
*
- * $Id: swcomprs.h 3175 2014-04-17 04:21:31Z greg.hellings $
+ * $Id: swcomprs.h 3122 2014-03-14 08:08:28Z chrislit $
*
* Copyright 1996-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -35,15 +35,18 @@ class SWDLLEXPORT SWCompress
protected:
char *buf, *zbuf, direct; // 0 - encode; 1 - decode
unsigned long zlen, zpos, pos, slen;
+ int level;
public:
- SWCompress ();
- virtual ~ SWCompress ();
+ SWCompress ();
+ virtual ~ SWCompress ();
virtual char *Buf (const char *buf = 0, unsigned long *len = 0);
virtual char *zBuf (unsigned long *len, char *buf = 0);
virtual unsigned long GetChars (char *buf, unsigned long len); // override for other than buffer compression
virtual unsigned long SendChars (char *buf, unsigned long len); // override for other than buffer compression
virtual void Encode (void); // override to provide compression algorythm
virtual void Decode (void); // override to provide compression algorythm
+ virtual void setLevel(int l) {level = l;};
+ virtual int getLevel() {return level;};
};
SWORD_NAMESPACE_END
diff --git a/include/swconfig.h b/include/swconfig.h
index 71fe735..794d24c 100644
--- a/include/swconfig.h
+++ b/include/swconfig.h
@@ -3,7 +3,7 @@
* swconfig.h - definition of Class SWConfig used for saving and
* retrieval of configuration information
*
- * $Id: swconfig.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: swconfig.h 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -39,51 +39,106 @@ typedef std::map < SWBuf, ConfigEntMap, std::less < SWBuf > >SectionMap;
*
*/
class SWDLLEXPORT SWConfig {
-private:
- char getline(int fd, SWBuf &line);
public:
- /** The filename used by this SWConfig object
- *
- */
- SWBuf filename;
/** Map of available sections
* The map of available sections.
*/
- SectionMap Sections;
/** Constructor of SWConfig
- * @param ifilename The file, which should be used for this config.
- */
- SWConfig(const char *ifilename);
+ * @param fileName The storage path for this config.
+ */
+ SWConfig(const char *fileName);
SWConfig();
virtual ~SWConfig();
- /** Load from disk
- * Load the content from disk.
- */
- virtual void Load();
+ /** Get the section map for the config
+ */
+ virtual SectionMap &getSections();
+ const SectionMap &getSections() const { return const_cast<SWConfig *>(this)->getSections(); }
- /** Save to disk
- * Save the content of this config object to disk.
- */
- virtual void Save();
+ /** Load the content from datastore
+ */
+ virtual void load();
- /** Merges the values of addFrom
- * @param addFrom The config which values should be merged to this config object. Already existing values will be overwritten.
- */
+ /** Save the content of this config object to the datastore
+ */
+ virtual void save() const;
+
+ /** Merges into this config the values from addFrom
+ * @param addFrom The config which values should be merged to this config object. Already existing values will be overwritten.
+ */
virtual void augment(SWConfig &addFrom);
- virtual SWConfig & operator +=(SWConfig &addFrom) { augment(addFrom); return *this; }
-
- /** Get a section
- * This is an easy way to get and store config values.
- * The following will work:\n
- *
- * @code
- * SWConfig config("/home/user/.setttings");
- * config["Colors"]["Background"] = "red";
- * @endcode
- */
- virtual ConfigEntMap & operator [](const char *section);
- };
+
+ /** Get a specified section from config, creating the section if needed
+ * There is no const version of this method because it returns a ConfigEntMap reference, creating the requested section if it doesn't exist.
+ * @param section section name to retrieve
+ */
+ ConfigEntMap &getSection(const char *section) { return getSections()[section]; }
+
+
+ /** This operator provides a conventient syntax to get and store config values
+ *
+ * config[section][key] = value;
+ * value = config[section][key];
+ *
+ * The following will work:\n
+ *
+ * @code
+ * SWConfig config("/home/user/.settings");
+ * config["Colors"]["Background"] = "red";
+ * @endcode
+ */
+ ConfigEntMap &operator [](const char *section) { return getSection(section); }
+
+ /** shorthand operator for augment
+ */
+ SWConfig &operator +=(SWConfig &addFrom) { augment(addFrom); return *this; }
+
+ /** get a value from a [section] key=value
+ * @param section the section name containing the key
+ * @param key the key to which the value is associated
+ * @return the value associated with the key in the provided section
+ */
+ SWBuf getValue(const char *section, const char *key) {
+ return (*this)[section][key];
+ }
+
+ /** set a value for a specified key in a [section]
+ * @param section the section name to contain the key
+ * @param key the key to which to associate the value
+ * @param value the value to associated with the key
+ */
+ void setValue(const char *section, const char *key, const char *value) {
+ (*this)[section][key] = value;
+ }
+
+ /** The storage path used by this SWConfig object
+ */
+ SWBuf getFileName() const;
+
+
+ // ****** Deprecated methods for removal in 2.0
+
+ /**
+ * @deprecated Use getSections() instead.
+ */
+ SWDEPRECATED SectionMap Sections;
+
+ /**
+ * @deprecated Use getFileName() instead.
+ */
+ SWDEPRECATED SWBuf filename;
+
+ /**
+ * @deprecated Use load() instead.
+ */
+ SWDEPRECATED void Load() { load(); }
+
+ /**
+ * @deprecated Use save() instead.
+ */
+ SWDEPRECATED void Save() { save(); }
+
+};
SWORD_NAMESPACE_END
#endif
diff --git a/include/swkey.h b/include/swkey.h
index 89786f0..6dd0f6d 100644
--- a/include/swkey.h
+++ b/include/swkey.h
@@ -4,7 +4,7 @@
* types of keys for indexing into modules (e.g. verse, word,
* place, etc.)
*
- * $Id: swkey.h 2926 2013-07-31 02:06:33Z scribe $
+ * $Id: swkey.h 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -159,6 +159,7 @@ public:
*/
SWDEPRECATED char Error() { return popError(); }
virtual char popError();
+ virtual char getError() { return error; }
virtual void setError(char err) { error = err; }
/** Sets this SWKey with a character string
diff --git a/include/swld.h b/include/swld.h
index 397a0bc..1d7e72c 100644
--- a/include/swld.h
+++ b/include/swld.h
@@ -3,7 +3,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 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: swld.h 3215 2014-05-01 05:13:22Z scribe $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/swmgr.h b/include/swmgr.h
index 1dad90a..9ddc4aa 100644
--- a/include/swmgr.h
+++ b/include/swmgr.h
@@ -3,7 +3,7 @@
* swmgr.h - definition of class SWMgr used to interact with an install
* base of sword modules.
*
- * $Id: swmgr.h 3156 2014-04-17 03:50:37Z greg.hellings $
+ * $Id: swmgr.h 3541 2017-12-03 18:40:33Z scribe $
*
* Copyright 1997-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -88,7 +88,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 3156 2014-04-17 03:50:37Z greg.hellings $
+ * @version $Id: swmgr.h 3541 2017-12-03 18:40:33Z scribe $
*/
class SWDLLEXPORT SWMgr {
private:
@@ -101,9 +101,11 @@ protected:
SWConfig *myconfig; //made protected because because BibleTime needs it
SWConfig *mysysconfig;
SWConfig *homeConfig;
- void CreateMods(bool multiMod = false);
- virtual SWModule *createModule(const char *name, const char *driver, ConfigEntMap &section);
- void DeleteMods();
+ /**
+ * Deprecated. Use createAllModules instead
+ */
+ SWDEPRECATED void CreateMods(bool multiMod = false) { createAllModules(multiMod); };
+ SWDEPRECATED void DeleteMods() { deleteAllModules(); }
char configType; // 0 = file; 1 = directory
OptionFilterMap optionFilters;
FilterMap cipherFilters;
@@ -115,49 +117,152 @@ protected:
FilterList cleanupFilters;
FilterMap extraFilters;
StringList options;
- virtual void init(); // use to initialize before loading modules
- virtual char AddModToConfig(FileDesc *conffd, const char *fname);
- virtual void loadConfigDir(const char *ipath);
- virtual void AddGlobalOptions(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end);
- virtual void AddLocalOptions(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end);
- StringList augPaths;
+ /**
+ * method to create all modules from configuration.
+ *
+ * Override to add any special processing before or after
+ * calling SWMgr::createAllModules
+ *
+ * e.g., augmenting a localConfig.conf to SWMgr::config
+ * that might store CipheyKey or Font preferences per module
+ * before actual construction of modules
+ *
+ */
+ virtual void createAllModules(bool multiMod = false);
+ /**
+ * called to delete all contructed modules. Undoes createAllModules
+ * override to clean anything up before or after all modules are
+ * deleted
+ */
+ virtual void deleteAllModules();
+
+ /**
+ * called to create exactly one module from a config entry
+ * override to do any extra work before or after each module
+ * is created
+ */
+ virtual SWModule *createModule(const char *name, const char *driver, ConfigEntMap &section);
+
+ /**
+ * call by every constructor to initialize SWMgr object
+ * override to include any addition common initialization
+ */
+ virtual void init();
+
+ /**
+ * Deprecated. Use addGlobalOptionFilters instead.
+ */
+ SWDEPRECATED virtual void AddGlobalOptions(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end) { addGlobalOptionFilters(module, section); }
+ /**
+ * Adds appropriate global option filters to a module. Override to add any special
+ * global option filters. Global option filters typically update SourceType markup
+ * to turn on and off specific features of a text when a user has optionally chosen
+ * to show or hide that feature, e.g. Strongs, Footnotes, Headings, etc.
+ * Global options can also have more than On and Off values, but these are the most
+ * common.
+ * A set of all global options included from an entire library of installed modules
+ * can be obtained from getGlobalOptions and presented to the user. Values to
+ * which each global option may be set can be obtain from getGlobalOptionValues,
+ * and similar. See that family of methods for more information.
+ * See the module.conf GlobalOptionFilter= entries.
+ * @param module module to which to add encoding filters
+ * @param section configuration information for module
+ */
+ virtual void addGlobalOptionFilters(SWModule *module, ConfigEntMap &section);
+
+ /**
+ * Deprecated. Use addLocalOptionFilters instead.
+ */
+ SWDEPRECATED virtual void AddLocalOptions(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end) { addLocalOptionFilters(module, section); }
+ /**
+ * Adds appropriate local option filters to a module. Override to add any special
+ * local option filters. Local options are similar to global options in that
+ * they may be toggled on or off or set to some value from a range of choices
+ * but local option
+ * See the module.conf LocalOptionFilter= entries.
+ * @param module module to which to add encoding filters
+ * @param section configuration information for module
+ */
+ virtual void addLocalOptionFilters(SWModule *module, ConfigEntMap &section);
+
+ /**
+ * Deprecated. Use addEncodingFilters instead
+ */
+ SWDEPRECATED virtual void AddEncodingFilters(SWModule *module, ConfigEntMap &section) { addEncodingFilters(module, section); }
/**
- * Called to add appropriate Encoding Filters to a module. Override to do special actions,
- * if desired. See the module.conf Encoding= entry.
- * @param module module to which to add Encoding Filters
- * @param section configuration information from module.conf
+ * Adds appropriate encoding filters to a module. Override to add any special
+ * encoding filters.
+ * See the module.conf Encoding= entry.
+ * @param module module to which to add encoding filters
+ * @param section configuration information for module
*/
- virtual void AddEncodingFilters(SWModule *module, ConfigEntMap &section);
+ virtual void addEncodingFilters(SWModule *module, ConfigEntMap &section);
/**
- * Called to add appropriate Render Filters to a module. Override to do special actions,
- * if desired. See the module.conf SourceType= entry.
- * @param module module to which to add Render Filters
- * @param section configuration information from module.conf
+ * Deprecated. Use addRenderFilters instead.
+ */
+ SWDEPRECATED virtual void AddRenderFilters(SWModule *module, ConfigEntMap &section) { addRenderFilters(module, section); }
+ /**
+ * Add appropriate render filters to a module. Override to add any special
+ * render filters. Render filters are used for preparing a text for
+ * display and typically convert markup from SourceType
+ * to desired display markup.
+ * See the module.conf SourceType= entry.
+ * @param module module to which to add render filters
+ * @param section configuration information for module
*/
- virtual void AddRenderFilters(SWModule *module, ConfigEntMap &section);
+ virtual void addRenderFilters(SWModule *module, ConfigEntMap &section);
/**
- * Called to add appropriate Strip Filters to a module. Override to do special actions,
- * if desired. See the module.conf SourceType= entry.
- * @param module module to which to add Strip Filters
- * @param section configuration information from module.conf
+ * Deprecated. Use addStripFilters instead.
*/
- virtual void AddStripFilters(SWModule *module, ConfigEntMap &section);
+ SWDEPRECATED virtual void AddStripFilters(SWModule *module, ConfigEntMap &section) { addStripFilters(module, section); }
+ /**
+ * Adds appropriate strip filters to a module. Override to add any special
+ * strip filters. Strip filters are used for preparing text for searching
+ * and typically strip out all markup and leave only searchable words
+ * See the module.conf SourceType= entry.
+ * @param module module to which to add strip filters
+ * @param section configuration information for module
+ */
+ virtual void addStripFilters(SWModule *module, ConfigEntMap &section);
- // ones manually specified in .conf file
- virtual void AddStripFilters(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end);
+ /**
+ * Deprecated. Use addLocalStripFilters instead.
+ */
+ SWDEPRECATED virtual void AddStripFilters(SWModule *module, ConfigEntMap &section, ConfigEntMap::iterator start, ConfigEntMap::iterator end) { addLocalStripFilters(module, section); }
+ /**
+ * Adds manually specified strip filters specified in module configuration
+ * as LocalStripFilters. These might take care of special cases of preparation
+ * for searching, e.g., removing ()[] and underdot symbols from manuscript modules
+ * @param module module to which to add local strip filters
+ * @param section configuration information for module
+ */
+ virtual void addLocalStripFilters(SWModule *module, ConfigEntMap &section);
/**
- * Called to add appropriate Raw Filters to a module. Override to do special actions,
- * if desired. See the module.conf CipherKey= entry.
- * @param module module to which to add Raw Filters
- * @param section configuration information from module.conf
+ * Deprecated. Use addRawFilters instead.
+ */
+ SWDEPRECATED virtual void AddRawFilters(SWModule *module, ConfigEntMap &section) { addRawFilters(module, section); }
+ /**
+ * Add appropriate raw filters to a module. Override to add any special
+ * raw filters. Raw filters are used to manipulate a buffer
+ * immediately after it has been read from storage. For example,
+ * any decryption that might need to be done.
+ * See the module.conf CipherKey= entry.
+ * @param module module to which to add raw filters
+ * @param section configuration information for module
*/
- virtual void AddRawFilters(SWModule *module, ConfigEntMap &section);
+ virtual void addRawFilters(SWModule *module, ConfigEntMap &section);
+ // still to be normalized below ...
+ //
+ StringList augPaths;
+ virtual char AddModToConfig(FileDesc *conffd, const char *fname);
+ virtual void loadConfigDir(const char *ipath);
+
public:
// constants which represent module types used in SWModule::getType
@@ -170,14 +275,32 @@ public:
static bool isICU;
static const char *globalConfPath;
- static SWBuf getHomeDir();
/**
- *
+ * Deprecated. Used FileMgr::getSystemFileMgr()->getHomeDir() instead.
+ */
+ SWDEPRECATED static SWBuf getHomeDir();
+
+ /**
+ * Perform all the logic to discover a SWORD configuration and libraries on a system
*/
static void findConfig(char *configType, char **prefixPath, char **configPath, StringList *augPaths = 0, SWConfig **providedSysConf = 0);
+ /**
+ * The configuration of a loaded library of SWORD modules
+ * e.g., from /usr/share/sword/mods.d/
+ * augmented with ~/.sword/mods.d/
+ *
+ * This represents all discovered modules and their configuration
+ * compiled into a single SWConfig object with each [section]
+ * representing each module. e.g. [KJV]
+ */
SWConfig *config;
+
+ /**
+ * The configuration file for SWORD
+ * e.g., /etc/sword.conf
+ */
SWConfig *sysConfig;
/** The path to main module set and locales
@@ -188,45 +311,52 @@ public:
*/
char *configPath;
+
+ /**
+ * Deprecated. Use getModules instead.
+ */
+ ModMap Modules;
/** The map of available modules.
* This map exposes the installed modules.
- * Here's an example how to iterate over the map and check the module type of each module.
*
- *@code
- * ModMap::iterator it;
- * SWModule *curMod = 0;
+ * Here's an example how to iterate over all
+ * the installed modules and check the module name
+ * and type of each module and do something special
+ * if the module type is a Bible.
*
- * for (it = Modules.begin(); it != Modules.end(); it++) {
- * curMod = (*it).second;
- * if (!strcmp(curMod->Type(), "Biblical Texts")) {
- * // do something with curMod
- * }
- * else if (!strcmp(curMod->Type(), "Commentaries")) {
- * // do something with curMod
- * }
- * else if (!strcmp(curMod->Type(), "Lexicons / Dictionaries")) {
- * // do something with curMod
- * }
+ * @code
+ *
+ * for (ModMap::iterator it = getModules().begin(); it != getModules().end(); ++it) {
+ *
+ * SWBuf modName = it->first;
+ * SWModule *mod = it->second;
+ *
+ * SWBuf modType = mod->getType();
+ *
+ * if (modType == SWMgr::MODTYPE_BIBLES) {
+ * // do something with mod
+ * }
* }
* @endcode
*/
- ModMap Modules;
+ ModMap &getModules();
+ const ModMap &getModules() const { return const_cast<SWMgr *>(this)->getModules(); }
/** Gets a specific module by name. e.g. SWModule *kjv = myManager.getModule("KJV");
* @param modName the name of the module to retrieve
* @return the module, if found, otherwise 0
*/
- SWModule *getModule(const char *modName) { ModMap::iterator it = Modules.find(modName); return ((it != Modules.end()) ? it->second : 0); }
- const SWModule *getModule(const char *modName) const { ModMap::const_iterator it = Modules.find(modName); return ((it != Modules.end()) ? it->second : 0); }
+ SWModule *getModule(const char *modName) { ModMap::iterator it = getModules().find(modName); return ((it != getModules().end()) ? it->second : 0); }
+ const SWModule *getModule(const char *modName) const { ModMap::const_iterator it = getModules().find(modName); return ((it != getModules().end()) ? it->second : 0); }
/** Constructs an instance of SWMgr
*
* @param iconfig manually supply a configuration. If not supplied, SWMgr will look on the system
* using a complex hierarchical search. See README for detailed specifics.
- * @param isysconfig
+ * @param isysconfig manually supply a an isysconfig (e.g. /etc/sword.conf)
* @param autoload whether or not to immediately load modules on construction of this SWMgr.
- * If you reimplemented SWMgr you can set this to false and call SWMgr::Load() after you have
+ * If you reimplemented SWMgr you can set this to false and call SWMgr::load() after you have
* completed the contruction and setup of your SWMgr subclass.
* @param filterMgr an SWFilterMgr subclass to use to manager filters on modules
* SWMgr TAKES OWNERSHIP FOR DELETING THIS OBJECT
@@ -271,12 +401,20 @@ public:
*/
virtual void InstallScan(const char *dir);
- /** Load all modules. Should only be manually called if SWMgr was constructed
+ /**
+ * Deprecated. Use load
+ */
+ SWDEPRECATED virtual signed char Load() { return load(); }
+ /** Loads installed library of SWORD modules.
+ * Should only be manually called if SWMgr was constructed
* without autoload; otherwise, this will be called on SWMgr construction
* Reimplement this function to supply special functionality when modules are
- * initially loaded.
+ * initially loaded. This includes
+ * discovery of config path with SWMgr::fileconfig,
+ * loading of composite SWMgr::config,
+ * and construction of all modules from config using SWMgr::createAllModules
*/
- virtual signed char Load();
+ virtual signed char load();
/** Change the values of global options (e.g. Footnotes, Strong's Number, etc.)
* @param option The name of the option, for which you want to change the
@@ -322,43 +460,53 @@ public:
/**
* Sets the cipher key for the given module. This function updates the key
* at runtime, but it does not write to the config file.
- * To write the new unlock key to the config file use code like this:
+ * This method is NOT the recommended means for applying a CipherKey
+ * to a module.
+ *
+ * Typically CipherKey entries and other per module user configuration
+ * settings are all saved in a separate localConfig.conf that is updated
+ * by a UI or other client of the library. e.g.,
+ *
+ *
+ * [KJV]
+ * Font=Arial
+ * LocalOptionFilter=SomeSpecialFilterMyUIAppliesToTheKJV
+ *
+ * [ISV]
+ * CipherKey=xyzzy
+ *
+ * [StrongsGreek]
+ * SomeUISetting=false
+ *
+ *
+ * Then these extra config settings in this separate file are applied
+ * just before module creation by overriding SWMgr::createAllModules and
+ * augmenting SWMgr::config with code like this:
*
* @code
- * SectionMap::iterator section;
- * ConfigEntMap::iterator entry;
- * DIR *dir = opendir(configPath);
- * struct dirent *ent;
- * char* modFile;
- * if (dir) { // find and update .conf file
- * rewinddir(dir);
- * while ((ent = readdir(dir)))
- * {
- * if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, "..")))
- * {
- * modFile = m_backend->configPath;
- * modFile += "/";
- * modFile += ent->d_name;
- * SWConfig *myConfig = new SWConfig( modFile );
- * section = myConfig->Sections.find( m_module->Name() );
- * if ( section != myConfig->Sections.end() )
- * {
- * entry = section->second.find("CipherKey");
- * if (entry != section->second.end())
- * {
- * entry->second = unlockKey;//set cipher key
- * myConfig->Save();//save config file
- * }
- * }
- * delete myConfig;
- * }
- * }
+ * void createAllModules(bool multiMod) {
+ *
+ * // after SWMgr::config is loaded
+ * // see if we have our own local settings
+ * SWBuf myExtraConf = "~/.myapp/localConf.conf";
+ * bool exists = FileMgr::existsFile(extraConf);
+ * if (exists) {
+ * SWConfig addConfig(extraConf);
+ * this->config->augment(addConfig);
+ * }
+ *
+ * // now that we've augmented SWMgr::config with our own custom
+ * // settings, proceed on with creating modules
+ *
+ * SWMgr::createAllModules(multiMod);
+ *
* }
- * closedir(dir);
* @endcode
*
+ * The above convention is preferred to using this setCipherKey method
+ *
* @param modName For this module we change the unlockKey
- * @param key This is the new unlck key we use for te module.
+ * @param key This is the new unlock key we use for the module.
*/
virtual signed char setCipherKey(const char *modName, const char *key);
};
diff --git a/include/swmodule.h b/include/swmodule.h
index 9c733dc..6926bc7 100644
--- a/include/swmodule.h
+++ b/include/swmodule.h
@@ -4,7 +4,7 @@
* all types of modules (e.g. texts, commentaries, maps,
* lexicons, etc.)
*
- * $Id: swmodule.h 2944 2013-08-03 09:43:40Z scribe $
+ * $Id: swmodule.h 3541 2017-12-03 18:40:33Z scribe $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -47,7 +47,6 @@ class SWFilter;
#define SEARCHFLAG_MATCHWHOLEENTRY 4096
#define SWMODULE_OPERATORS \
- SWDEPRECATED operator const char *() { static SWBuf unsafeTmp = renderText(); return unsafeTmp.c_str(); } \
operator SWBuf() { return renderText(); } \
operator SWKey &() { return *getKey(); } \
operator SWKey *() { return getKey(); } \
@@ -57,7 +56,8 @@ class SWFilter;
SWModule &operator +=(int steps) { increment(steps); return *this; } \
SWModule &operator ++(int) { return *this += 1; } \
SWModule &operator --(int) { return *this -= 1; } \
- SWModule &operator =(SW_POSITION p) { setPosition(p); return *this; }
+ SWModule &operator =(SW_POSITION p) { setPosition(p); return *this; } \
+ SWDEPRECATED operator const char *() { static SWBuf unsafeTmp = renderText(); return unsafeTmp.c_str(); }
typedef std::list < SWFilter * >FilterList;
@@ -194,6 +194,16 @@ public:
// are not comfortable with, or don't wish to use stl maps).
virtual void setConfig(ConfigEntMap *config);
virtual const ConfigEntMap &getConfig() const { return *config; }
+
+ /**
+ * Gets a configuration property about a module. These entries are primarily
+ * pulled from the module's .conf file, but also includes some virtual entries
+ * such as:
+ * PrefixPath - the absolute filesystem path to the sword module repository
+ * location where this module is located.
+ * AbsoluteDataPath - the full path to the root folder where the module
+ * data is stored.
+ */
virtual const char *getConfigEntry(const char *key) const;
/**
@@ -339,31 +349,27 @@ public:
/** Sets/gets module direction
*
- * @param newdir Value which to set direction; [-1]-only get
* @return new direction
*/
virtual char getDirection() const;
SWDEPRECATED char Direction(signed char newdir = -1) { char retVal = getDirection(); if (newdir != -1) return direction = newdir; return retVal; }
- /** Sets/gets module encoding
+ /** Gets module encoding
*
- * @param enc Value which to set encoding; [-1]-only get
* @return Encoding
*/
char getEncoding() const { return encoding; }
SWDEPRECATED char Encoding(signed char enc = -1) { char retVal = getEncoding(); if (enc != -1) encoding = enc; return retVal; }
- /** Sets/gets module markup
+ /** Gets module markup
*
- * @param markup Value which to set markup; [-1]-only get
* @return Markup
*/
char getMarkup() const { return markup; }
SWDEPRECATED char Markup(signed char imarkup = -1) { char retVal = getMarkup(); if (imarkup != -1) markup = imarkup; return retVal; }
- /** Sets/gets module language
+ /** Gets module language
*
- * @param imodlang Value which to set modlang; [0]-only get
* @return pointer to modlang
*/
const char *getLanguage() const { return modlang; }
@@ -376,23 +382,23 @@ public:
*
* @param istr string for which to search
* @param searchType type of search to perform
- * >=0 - regex
+ * >=0 - regex; (for backward compat, if > 0 then used as additional REGEX FLAGS)
* -1 - phrase
* -2 - multiword
- * -3 - entryAttrib (eg. Word//Strongs/G1234/)
+ * -3 - entryAttrib (eg. Word//Lemma./G1234/) (Lemma with dot means check components (Lemma.[1-9]) also)
* -4 - Lucene
+ * -5 - multilemma window; set 'flags' param to window size (NOT DONE)
* @param flags options flags for search
* @param scope Key containing the scope. VerseKey or ListKey are useful here.
- * @param justCheckIfSupported if set, don't search,
- * only tell if this function supports requested search.
+ * @param justCheckIfSupported If set, don't search but instead set this variable to true/false if the requested search is supported,
* @param percent Callback function to get the current search status in %.
- * @param percentUserData User data that is given to the callback function as parameter.
+ * @param percentUserData Anything that you might want to send to the precent callback function.
*
* @return ListKey set to verses that contain istr
*/
virtual ListKey &search(const char *istr, int searchType = 0, int flags = 0,
- SWKey * scope = 0,
- bool * justCheckIfSupported = 0,
+ SWKey *scope = 0,
+ bool *justCheckIfSupported = 0,
void (*percent) (char, void *) = &nullPercent,
void *percentUserData = 0);
@@ -477,7 +483,7 @@ public:
/** 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) {
@@ -495,7 +501,7 @@ public:
}
/** Removes a RenderFilter from this module's renderFilters queue
- * @param oldfilter the filter to remove
+ * @param oldFilter the filter to remove
* @return *this
*/
virtual SWModule &removeRenderFilter(SWFilter *oldFilter) {
@@ -505,8 +511,8 @@ public:
SWDEPRECATED SWModule &RemoveRenderFilter(SWFilter *oldFilter) { return removeRenderFilter(oldFilter); }
/** Replaces a RenderFilter in this module's renderfilters queue
- * @param oldfilter the filter to remove
- * @param newfilter the filter to add in its place
+ * @param oldFilter the filter to remove
+ * @param newFilter the filter to add in its place
* @return *this
*/
virtual SWModule &replaceRenderFilter(SWFilter *oldFilter, SWFilter *newFilter) {
@@ -531,7 +537,7 @@ public:
* Encoding Filters are called immediately when the module is read
* from data source, to assure we have desired internal data stream
* (e.g. UTF-8 for text modules)
- * @param newfilter the filter to add
+ * @param newFilter the filter to add
* @return *this
*/
virtual SWModule &addEncodingFilter(SWFilter *newFilter) {
@@ -541,7 +547,7 @@ public:
SWDEPRECATED SWModule &AddEncodingFilter(SWFilter *newFilter) { return addEncodingFilter(newFilter); }
/** Removes an EncodingFilter from this module's encodingFilters queue
- * @param oldfilter the filter to remove
+ * @param oldFilter the filter to remove
* @return *this
*/
virtual SWModule &removeEncodingFilter(SWFilter *oldFilter) {
@@ -551,8 +557,8 @@ public:
SWDEPRECATED SWModule &RemoveEncodingFilter(SWFilter *oldFilter) { return removeEncodingFilter(oldFilter); }
/** Replaces an EncodingFilter in this module's encodingfilters queue
- * @param oldfilter the filter to remove
- * @param newfilter the filter to add in its place
+ * @param oldFilter the filter to remove
+ * @param newFilter the filter to add in its place
* @return *this
*/
virtual SWModule &replaceEncodingFilter(SWFilter *oldFilter, SWFilter *newFilter) {
@@ -576,7 +582,7 @@ public:
/** Adds a StripFilter to this module's stripFilters queue.
* Strip filters are called when a module is asked to render
* an entry without any markup (like when searching).
- * @param newfilter the filter to add
+ * @param newFilter the filter to add
* @return *this
*/
virtual SWModule &addStripFilter(SWFilter *newFilter) {
@@ -589,8 +595,8 @@ public:
* @param newFilter the filter to add
* @return *this
*/
- virtual SWModule &addRawFilter(SWFilter *newfilter) {
- rawFilters->push_back(newfilter);
+ virtual SWModule &addRawFilter(SWFilter *newFilter) {
+ rawFilters->push_back(newFilter);
return *this;
}
SWDEPRECATED SWModule &AddRawFilter(SWFilter *newFilter) { return addRawFilter(newFilter); }
@@ -616,7 +622,7 @@ public:
* Option Filters are used to turn options in the text on
* or off, or so some other state (e.g. Strong's Number,
* Footnotes, Cross References, etc.)
- * @param newfilter the filter to add
+ * @param newFilter the filter to add
* @return *this
*/
virtual SWModule &addOptionFilter(SWOptionFilter *newFilter) {
@@ -652,7 +658,8 @@ public:
* @param render for internal use
* @return result buffer
*/
- SWBuf renderText(const char *buf = 0, int len = -1, bool render = true);
+ SWBuf renderText(const char *buf, int len = -1, bool render = true) const;
+ SWBuf renderText();
SWDEPRECATED const char *RenderText(const char *buf = 0, int len = -1, bool render = true) { return renderText(buf, len, render); }
/** Produces any header data which might be useful which is associated with the
diff --git a/include/swobject.h b/include/swobject.h
index 8866c37..0606ea0 100644
--- a/include/swobject.h
+++ b/include/swobject.h
@@ -3,7 +3,7 @@
* swobject.h - definition for SWObject used as lowest base class for
* many SWORD objects
*
- * $Id: swobject.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: swobject.h 3433 2016-08-17 13:25:41Z scribe $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/swoptfilter.h b/include/swoptfilter.h
index 0f2aed5..a525033 100644
--- a/include/swoptfilter.h
+++ b/include/swoptfilter.h
@@ -2,7 +2,7 @@
*
* swoptfilter.h - Implenetation of SWOptionFilter
*
- * $Id: swoptfilter.h 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: swoptfilter.h 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -80,7 +80,7 @@ public:
virtual const char *getOptionValue();
/** sets the value of the option of this filter,
- * e.g maybe a strong's filter mioght be set to "on" / "off" -
+ * e.g maybe a strong's filter might be set to "On" / "Off" -
* that would mean to show or not to show the strongs in the text,
* see also getOptionValues()
* @param ival the new option value
diff --git a/include/swversion.h b/include/swversion.h
index 5f71dab..ee588fc 100644
--- a/include/swversion.h
+++ b/include/swversion.h
@@ -3,7 +3,7 @@
* swversion.h - definition of class SWVersion used to compare version
* info
*
- * $Id: swversion.h 3156 2014-04-17 03:50:37Z greg.hellings $
+ * $Id: swversion.h 3524 2017-11-07 03:08:49Z scribe $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -24,11 +24,11 @@
#ifndef SWVERSION_H
#define SWVERSION_H
-#define SWORD_VERSION_NUM 107003000
-#define SWORD_VERSION_STR "1.7.3"
+#define SWORD_VERSION_NUM 107905000
+#define SWORD_VERSION_STR "1.7.905"
#define SWORD_VERSION_MAJOR 1
#define SWORD_VERSION_MINOR 7
-#define SWORD_VERSION_MICRO 3
+#define SWORD_VERSION_MICRO 905
#define SWORD_VERSION_NANO 0
#include <defs.h>
diff --git a/include/sysdata.h b/include/sysdata.h
index b95b836..ccb8150 100644
--- a/include/sysdata.h
+++ b/include/sysdata.h
@@ -2,7 +2,7 @@
*
* sysdata.h -
*
- * $Id: sysdata.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: sysdata.h 3455 2017-04-24 08:50:31Z scribe $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -40,9 +40,15 @@ typedef unsigned short __u16;
typedef signed int __s32;
typedef unsigned int __u32;
-#ifdef __GNUC__
+#ifdef OS_ANDROID
+#elif defined(__GNUC__)
+ #if !defined(__SANE_USERSPACE_TYPES__) && defined(__powerpc64__)
+ typedef __signed__ long __s64;
+ typedef unsigned long __u64;
+ #else
__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
+ #endif
#elif defined(__BORLANDC__)
typedef signed __int64 __s64;
typedef unsigned __int64 __u64;
diff --git a/include/teihtmlhref.h b/include/teihtmlhref.h
index 99b2755..d34cb7e 100644
--- a/include/teihtmlhref.h
+++ b/include/teihtmlhref.h
@@ -2,7 +2,7 @@
*
* teihtmlhref.h - Implementation of TEIHTMLHREF
*
- * $Id: teihtmlhref.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: teihtmlhref.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2008-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -36,7 +36,7 @@ private:
protected:
class MyUserData : public BasicFilterUserData {
public:
- bool BiblicalText;
+ bool isBiblicalText;
SWBuf lastHi;
SWBuf version;
diff --git a/include/teilatex.h b/include/teilatex.h
new file mode 100644
index 0000000..c36e302
--- /dev/null
+++ b/include/teilatex.h
@@ -0,0 +1,57 @@
+/******************************************************************************
+ *
+ * teilatex.h - Implementation of TEILaTeX
+ *
+ * $Id: teilatex.h 3548 2017-12-10 05:11:38Z scribe $
+ *
+ * Copyright 2012-2014 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 TEILATEX_H
+#define TEILATEX_H
+
+#include <swbasicfilter.h>
+
+SWORD_NAMESPACE_START
+
+/** this filter converts TEI text to LaTeX text
+ */
+class SWDLLEXPORT TEILaTeX : public SWBasicFilter {
+private:
+ bool renderNoteNumbers;
+
+protected:
+ class MyUserData : public BasicFilterUserData {
+ public:
+ bool isBiblicalText;
+ SWBuf lastHi;
+ bool firstCell; // for tables, indicates whether a cell is the first one in a row
+ int consecutiveNewlines;
+
+ SWBuf version;
+ MyUserData(const SWModule *module, const SWKey *key);
+ };
+ virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) {
+ return new MyUserData(module, key);
+ }
+ virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
+public:
+ TEILaTeX();
+ void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; }
+};
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/teirtf.h b/include/teirtf.h
index e9793d3..85eb0df 100644
--- a/include/teirtf.h
+++ b/include/teirtf.h
@@ -2,7 +2,7 @@
*
* teirtf.h - Implementation of TEIRTF
*
- * $Id: teirtf.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: teirtf.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -35,7 +35,7 @@ private:
protected:
class MyUserData : public BasicFilterUserData {
public:
- bool BiblicalText;
+ bool isBiblicalText;
bool inOsisRef;
SWBuf w;
SWBuf version;
diff --git a/include/teixhtml.h b/include/teixhtml.h
index c948608..7d72219 100644
--- a/include/teixhtml.h
+++ b/include/teixhtml.h
@@ -2,7 +2,7 @@
*
* teixhtml.h - Implementation of TEIXHTML
*
- * $Id: teixhtml.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: teixhtml.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2012-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -36,7 +36,7 @@ private:
protected:
class MyUserData : public BasicFilterUserData {
public:
- bool BiblicalText;
+ bool isBiblicalText;
SWBuf lastHi;
SWBuf version;
@@ -49,6 +49,7 @@ protected:
public:
TEIXHTML();
void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; }
+ virtual const char *getHeader() const;
};
SWORD_NAMESPACE_END
diff --git a/include/thmlhtml.h b/include/thmlhtml.h
index 2f32cc4..9c50f01 100644
--- a/include/thmlhtml.h
+++ b/include/thmlhtml.h
@@ -2,7 +2,7 @@
*
* thmlhtml.h - Implementation of ThMLHTML
*
- * $Id: thmlhtml.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: thmlhtml.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -33,8 +33,8 @@ class SWDLLEXPORT ThMLHTML : public SWBasicFilter {
protected:
class MyUserData : public BasicFilterUserData {
public:
- MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {}
- bool SecHead;
+ MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key), inSecHead(false) {}
+ bool inSecHead;
};
virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) {
return new MyUserData(module, key);
diff --git a/include/thmlhtmlhref.h b/include/thmlhtmlhref.h
index 8ce802e..5cacc99 100644
--- a/include/thmlhtmlhref.h
+++ b/include/thmlhtmlhref.h
@@ -2,7 +2,7 @@
*
* thmlhtmlhref.h - Implementation of ThMLHTMLHREF
*
- * $Id: thmlhtmlhref.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: thmlhtmlhref.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -38,8 +38,8 @@ protected:
public:
MyUserData(const SWModule *module, const SWKey *key);//: BasicFilterUserData(module, key) {}
bool inscriptRef;
- bool SecHead;
- bool BiblicalText;
+ bool inSecHead;
+ bool isBiblicalText;
SWBuf version;
XMLTag startTag;
};
diff --git a/include/thmllatex.h b/include/thmllatex.h
new file mode 100644
index 0000000..14ea064
--- /dev/null
+++ b/include/thmllatex.h
@@ -0,0 +1,60 @@
+/******************************************************************************
+ *
+ * thmllatex.h - Implementation of ThMLLaTeX
+ *
+ * $Id: thmllatex.h 3548 2017-12-10 05:11:38Z scribe $
+ *
+ * Copyright 2011-2014 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 THMLLATEX_H
+#define THMLLATEX_H
+
+#include <swbasicfilter.h>
+#include <utilxml.h>
+
+SWORD_NAMESPACE_START
+
+/** this filter converts ThML text to LaTeX
+ */
+class SWDLLEXPORT ThMLLaTeX : public SWBasicFilter {
+ SWBuf imgPrefix;
+ bool renderNoteNumbers;
+protected:
+ class MyUserData : public BasicFilterUserData {
+ public:
+ MyUserData(const SWModule *module, const SWKey *key);//: BasicFilterUserData(module, key) {}
+ bool inscriptRef;
+ bool inSecHead;
+ bool isBiblicalText;
+ SWBuf version;
+ XMLTag startTag;
+ };
+ virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) {
+ return new MyUserData(module, key);
+ }
+ virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
+public:
+ ThMLLaTeX();
+ virtual const char *getImagePrefix() { return imgPrefix.c_str(); }
+ virtual void setImagePrefix(const char *newImgPrefix) { imgPrefix = newImgPrefix; }
+ virtual const char *getHeader() const;
+ void setRenderNoteNumbers(bool val = true) { renderNoteNumbers = val; }
+};
+
+SWORD_NAMESPACE_END
+
+#endif
diff --git a/include/thmlrtf.h b/include/thmlrtf.h
index 9b7d3f2..cf8aef2 100644
--- a/include/thmlrtf.h
+++ b/include/thmlrtf.h
@@ -2,7 +2,7 @@
*
* thmlrtf.h - Implementation of ThMLRTF
*
- * $Id: thmlrtf.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: thmlrtf.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -35,9 +35,9 @@ protected:
class MyUserData : public BasicFilterUserData {
public:
MyUserData(const SWModule *module, const SWKey *key);
- bool SecHead;
+ bool inSecHead;
SWBuf version;
- bool BiblicalText;
+ bool isBiblicalText;
XMLTag startTag;
};
virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) {
diff --git a/include/thmlxhtml.h b/include/thmlxhtml.h
index c3406ad..9696cb8 100644
--- a/include/thmlxhtml.h
+++ b/include/thmlxhtml.h
@@ -2,7 +2,7 @@
*
* thmlxhtml.h - Implementation of ThMLXHTML
*
- * $Id: thmlxhtml.h 3196 2014-04-24 03:04:07Z greg.hellings $
+ * $Id: thmlxhtml.h 3548 2017-12-10 05:11:38Z scribe $
*
* Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -38,8 +38,8 @@ protected:
public:
MyUserData(const SWModule *module, const SWKey *key);//: BasicFilterUserData(module, key) {}
bool inscriptRef;
- char SecHead;
- bool BiblicalText;
+ char secHeadLevel;
+ bool isBiblicalText;
SWBuf version;
XMLTag startTag;
};
diff --git a/include/utf8nfc.h b/include/utf8nfc.h
index 1240cca..fc64564 100644
--- a/include/utf8nfc.h
+++ b/include/utf8nfc.h
@@ -2,7 +2,7 @@
*
* utf8nfc.h - Implementation of UTF8NFC
*
- * $Id: utf8nfc.h 3157 2014-04-17 03:56:12Z greg.hellings $
+ * $Id: utf8nfc.h 3081 2014-03-05 19:52:08Z chrislit $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/utf8scsu.h b/include/utf8scsu.h
new file mode 100644
index 0000000..6936434
--- /dev/null
+++ b/include/utf8scsu.h
@@ -0,0 +1,49 @@
+/******************************************************************************
+ *
+ * utf8scsu.h - Implementation of UTF8SCSU
+ *
+ * $Id: utf8scsu.h 3472 2017-05-22 04:19:02Z scribe $
+ *
+ * Copyright 2001-2014 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 UTF8SCSU_H
+#define UTF8SCSU_H
+
+#include <swfilter.h>
+
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/uchar.h>
+#include <unicode/unistr.h>
+
+SWORD_NAMESPACE_START
+
+/** This filter converts UTF-8 encoded text to SCSU
+ */
+class SWDLLEXPORT UTF8SCSU : public SWFilter {
+private:
+ UConverter* scsuConv;
+ UConverter* utf8Conv;
+ UErrorCode err;
+public:
+ UTF8SCSU();
+ ~UTF8SCSU();
+ virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
+};
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/utilstr.h b/include/utilstr.h
index 573b4a1..efb6768 100644
--- a/include/utilstr.h
+++ b/include/utilstr.h
@@ -2,7 +2,7 @@
*
* utilstr.h - prototypes for string utility functions
*
- * $Id: utilstr.h 2981 2013-09-15 00:05:26Z scribe $
+ * $Id: utilstr.h 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -29,9 +29,29 @@
SWORD_NAMESPACE_START
-/** stdstr - clone a string
-*/
-SWDLLEXPORT char *stdstr (char **iistr, const char *istr, unsigned int memPadFactor = 1);
+
+/******************************************************************************
+ * stdstr - clones a string
+ *
+ * ENT: ipstr - pointer to a string pointer to set if necessary
+ * istr - string to set to *ipstr
+ * 0 - only get
+ *
+ * RET: *ipstr
+ */
+
+inline char *stdstr(char **ipstr, const char *istr, unsigned int memPadFactor = 1) {
+ if (*ipstr)
+ delete [] *ipstr;
+ if (istr) {
+ int len = (int)strlen(istr) + 1;
+ *ipstr = new char [ len * memPadFactor ];
+ memcpy(*ipstr, istr, len);
+ }
+ else *ipstr = 0;
+ return *ipstr;
+}
+
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);
@@ -55,7 +75,80 @@ extern const unsigned char SW_toupper_array[256];
* unicode codepoint value (0 with buf incremented is invalid UTF8 byte
*/
-__u32 getUniCharFromUTF8(const unsigned char **buf);
+
+/******************************************************************************
+ * 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
+ */
+
+inline __u32 getUniCharFromUTF8(const unsigned char **buf, bool skipValidation = false) {
+ __u32 ch = 0;
+
+ //case: We're at the end
+ if (!(**buf)) {
+ return ch;
+ }
+
+ //case: ANSI
+ if (!(**buf & 128)) {
+ ch = **buf;
+ (*buf)++;
+ return ch;
+ }
+
+ //case: Invalid UTF-8 (illegal continuing byte in initial position)
+ if ((**buf >> 6) == 2) {
+ (*buf)++;
+ return ch;
+ }
+
+
+ //case: 2+ byte codepoint
+ int subsequent = 1;
+ if ((**buf & 32) == 0) { subsequent = 1; }
+ else if ((**buf & 16) == 0) { subsequent = 2; }
+ else if ((**buf & 8) == 0) { subsequent = 3; }
+ else if ((**buf & 4) == 0) { subsequent = 4; }
+ else if ((**buf & 2) == 0) { subsequent = 5; }
+ else if ((**buf & 1) == 0) { subsequent = 6; }
+ else subsequent = 7; // is this legal?
+
+ ch = **buf & (0xFF>>(subsequent + 1));
+
+ for (int i = 1; i <= subsequent; ++i) {
+ // subsequent byte did not begin with 10XXXXXX
+ // move our buffer to here and error out
+ // this also catches our null if we hit the string terminator
+ if (((*buf)[i] >> 6) != 2) {
+ *buf += i;
+ return 0;
+ }
+ ch <<= 6;
+ ch |= (*buf)[i] & 63;
+ }
+ *buf += (subsequent+1);
+
+ if (!skipValidation) {
+ // I THINK THIS IS STUPID BUT THE SPEC SAYS NO MORE THAN 4 BYTES
+ if (subsequent > 3) ch = 0;
+ // AGAIN stupid, but spec says UTF-8 can't use more than 21 bits
+ if (ch > 0x1FFFFF) ch = 0;
+ // This would be out of Unicode bounds
+ if (ch > 0x10FFFF) ch = 0;
+ // these would be values which could be represented in less bytes
+ if (ch < 0x80 && subsequent > 0) ch = 0;
+ if (ch < 0x800 && subsequent > 1) ch = 0;
+ if (ch < 0x10000 && subsequent > 2) ch = 0;
+ if (ch < 0x200000 && subsequent > 3) ch = 0;
+ }
+
+ return ch;
+}
/******************************************************************************
@@ -66,9 +159,93 @@ __u32 getUniCharFromUTF8(const unsigned char **buf);
*
* RET: buf - a UTF8 string which consists of the proper UTF8 sequence of
* bytes for the given Unicode codepoint
+ * NOTE: for speed and thread safety, this method now requires a buffer
+ * to work with
*/
-SWBuf getUTF8FromUniChar(__u32 uchar);
+inline SWBuf *getUTF8FromUniChar(__u32 uchar, SWBuf *appendTo) {
+ unsigned long base = appendTo->size();
+
+ // This would be out of Unicode bounds
+ if (uchar > 0x10FFFF) uchar = 0xFFFD;
+ char bytes = uchar < 0x80 ? 1 : uchar < 0x800 ? 2 : uchar < 0x10000 ? 3 : 4;
+ appendTo->setSize(base+bytes);
+ switch (bytes) {
+ case 1:
+ (*appendTo)[base ] = (unsigned char)uchar;
+ break;
+ case 2:
+ (*appendTo)[base+1] = (unsigned char)(0x80 | (uchar & 0x3f));
+ uchar >>= 6;
+ (*appendTo)[base ] = (unsigned char)(0xc0 | (uchar & 0x1f));
+ break;
+ case 3:
+ (*appendTo)[base+2] = (unsigned char)(0x80 | (uchar & 0x3f));
+ uchar >>= 6;
+ (*appendTo)[base+1] = (unsigned char)(0x80 | (uchar & 0x3f));
+ uchar >>= 6;
+ (*appendTo)[base ] = (unsigned char)(0xe0 | (uchar & 0x0f));
+ break;
+ case 4:
+ (*appendTo)[base+3] = (unsigned char)(0x80 | (uchar & 0x3f));
+ uchar >>= 6;
+ (*appendTo)[base+2] = (unsigned char)(0x80 | (uchar & 0x3f));
+ uchar >>= 6;
+ (*appendTo)[base+1] = (unsigned char)(0x80 | (uchar & 0x3f));
+ uchar >>= 6;
+ (*appendTo)[base ] = (unsigned char)(0xf0 | (uchar & 0x07));
+ break;
+ }
+/*
+ else if (uchar < 0x4000000) {
+ appendTo->setSize(base+5);
+ i = uchar & 0x3f;
+ (*appendTo)[base+4] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x3f;
+ (*appendTo)[base+3] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x3f;
+ (*appendTo)[base+2] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x3f;
+ (*appendTo)[base+1] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x03;
+ (*appendTo)[base] = (unsigned char)(0xf8 | i);
+ }
+ else if (uchar < 0x80000000) {
+ appendTo->setSize(base+6);
+ i = uchar & 0x3f;
+ (*appendTo)[base+5] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x3f;
+ (*appendTo)[base+4] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x3f;
+ (*appendTo)[base+3] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x3f;
+ (*appendTo)[base+2] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x3f;
+ (*appendTo)[base+1] = (unsigned char)(0x80 | i);
+ uchar >>= 6;
+
+ i = uchar & 0x01;
+ (*appendTo)[base] = (unsigned char)(0xfc | i);
+ }
+*/
+ return appendTo;
+}
/******************************************************************************
diff --git a/include/versekey.h b/include/versekey.h
index acddc9d..b32b0f9 100644
--- a/include/versekey.h
+++ b/include/versekey.h
@@ -3,7 +3,7 @@
* versekey.h - code for class 'VerseKey'- a standard Biblical verse
* key
*
- * $Id: versekey.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: versekey.h 3541 2017-12-03 18:40:33Z scribe $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -176,7 +176,6 @@ public:
/** sets the upper boundary for this VerseKey
* @param ub the new upper boundary for this VerseKey
- * @return the upper boundary the key was set to
*/
void setUpperBound(const VerseKey &ub);
SWDEPRECATED VerseKey &UpperBound(const VerseKey &ub) { setUpperBound(ub); return getUpperBound(); }
@@ -223,21 +222,18 @@ public:
/** 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 = 1);
/** Increments key a number of verses
*
* @param steps Number of verses to jump forward
- * @return *this
*/
virtual void increment(int steps = 1);
virtual bool isTraversable() const { return true; }
@@ -348,7 +344,6 @@ public:
* Matthew 29:47 = Mark 2:2). If last verse is
* exceeded, key is set to last Book CH:VS
*
- * @return *this
*/
virtual void normalize(bool autocheck = false);
SWDEPRECATED void Normalize(char autocheck = 0) { normalize(autocheck!=0); }
@@ -357,9 +352,6 @@ public:
* automatically normalize itself when modified
*
* @param iautonorm value which to set autonorm
- * [MAXPOS(char)] - only get
- * @return if unchanged -> value of autonorm,
- * if changed -> previous value of autonorm
*/
virtual void setAutoNormalize(bool iautonorm);
virtual bool isAutoNormalize() const;
@@ -402,7 +394,6 @@ public:
/** Sets index based upon current verse
*
* @param iindex value to set index to
- * @return offset
*/
virtual void setIndex(long iindex);
@@ -423,7 +414,7 @@ public:
/** Tries to parse a string and convert it into an OSIS reference
* @param inRef reference string to try to parse
- * @param defaultKey @see ParseVerseList(..., defaultKey, ...)
+ * @param defaultKey for details @see ParseVerseList(..., defaultKey, ...)
*/
static const char *convertToOSIS(const char *inRef, const SWKey *defaultKey);
diff --git a/include/versificationmgr.h b/include/versificationmgr.h
index 4ed8a62..a488d0e 100644
--- a/include/versificationmgr.h
+++ b/include/versificationmgr.h
@@ -3,7 +3,7 @@
* versification.h - definition of class VersificationMgr used for managing
* versification systems
*
- * $Id: versificationmgr.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: versificationmgr.h 3240 2014-07-12 16:27:35Z scribe $
*
* Copyright 2008-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -142,11 +142,12 @@ public:
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);
+ void loadFromSBook(const sbook *ot, const sbook *nt, int *chMax, const unsigned char *mappings=NULL);
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; }
+ void translateVerse(const System *dstSys, const char **book, int *chapter, int *verse, int *verse_end) const;
};
VersificationMgr() { init(); }
~VersificationMgr();
@@ -154,7 +155,7 @@ public:
static void setSystemVersificationMgr(VersificationMgr *newVersificationMgr);
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 sbook *ot, const sbook *nt, int *chMax, const unsigned char *mappings=NULL);
void registerVersificationSystem(const char *name, const TreeKey *);
};
diff --git a/include/xzcomprs.h b/include/xzcomprs.h
index 49b43bc..c9059be 100644
--- a/include/xzcomprs.h
+++ b/include/xzcomprs.h
@@ -3,7 +3,7 @@
* xzcomprs.h - XzCompress, a driver class that provides xz (LZMA2)
* compression
*
- * $Id: xzcomprs.h 3156 2014-04-17 03:50:37Z greg.hellings $
+ * $Id: xzcomprs.h 3249 2014-08-24 01:55:08Z scribe $
*
* Copyright 2000-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -27,6 +27,7 @@
#include <swcomprs.h>
#include <defs.h>
+#include <sysdata.h>
SWORD_NAMESPACE_START
@@ -39,6 +40,9 @@ public:
virtual void Encode(void);
virtual void Decode(void);
+ virtual void setLevel(int l);
+private:
+ __u64 memlimit; // memory usage limit during decompression
};
SWORD_NAMESPACE_END
diff --git a/include/zcom.h b/include/zcom.h
index 560b650..9a990d8 100644
--- a/include/zcom.h
+++ b/include/zcom.h
@@ -25,6 +25,7 @@
#define ZCOM_H
#include <swcom.h>
+#include <zverse.h>
#include <defs.h>
diff --git a/include/zcom4.h b/include/zcom4.h
new file mode 100644
index 0000000..aaf8541
--- /dev/null
+++ b/include/zcom4.h
@@ -0,0 +1,78 @@
+/******************************************************************************
+ *
+ * zcom4.h - code for class 'zCom4'- a module that reads compressed text
+ * files: ot and nt using indexs ??.vss
+ *
+ * $Id: zcom4.h 3141 2014-03-19 01:24:04Z chrislit $
+ *
+ * Copyright 1996-2014 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 ZCOM4_H
+#define ZCOM4_H
+
+#include <swcom.h>
+
+#include <defs.h>
+
+SWORD_NAMESPACE_START
+
+class SWDLLEXPORT zCom4 : public zVerse4, public SWCom {
+
+ VerseKey *lastWriteKey;
+ bool sameBlock(VerseKey * lastWriteKey, VerseKey * key);
+ int blockType;
+
+
+public:
+
+ zCom4(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ 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,
+ const char *versification = "KJV");
+ virtual ~zCom4();
+ virtual SWBuf &getRawEntryBuf() const;
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
+
+ // write interface ----------------------------
+ virtual bool isWritable() const;
+ static char createModule(const char *path, int blockBound, const char *v11n = "KJV") {
+ return zVerse4::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
+ virtual void deleteEntry(); // Delete current module entry
+ // end write interface ------------------------
+
+ virtual void rawZFilter(SWBuf &buf, char direction = 0) const { rawFilter(buf, (SWKey *)(long)direction); }// hack, use key as direction for enciphering
+
+ // swcacher interface ----------------------
+ 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
+
+};
+
+SWORD_NAMESPACE_END
+
+#endif
diff --git a/include/zconf.h b/include/zconf.h
new file mode 100644
index 0000000..cb3b162
--- /dev/null
+++ b/include/zconf.h
@@ -0,0 +1,279 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zconf.h 1688 2005-01-01 04:42:26Z scribe $ */
+
+#ifndef _ZCONF_H
+#define _ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+# define deflateInit_ z_deflateInit_
+# define deflate z_deflate
+# define deflateEnd z_deflateEnd
+# define inflateInit_ z_inflateInit_
+# define inflate z_inflate
+# define inflateEnd z_inflateEnd
+# define deflateInit2_ z_deflateInit2_
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateCopy z_deflateCopy
+# define deflateReset z_deflateReset
+# define deflateParams z_deflateParams
+# define inflateInit2_ z_inflateInit2_
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateReset z_inflateReset
+# define compress z_compress
+# define compress2 z_compress2
+# define uncompress z_uncompress
+# define adler32 z_adler32
+# define crc32 z_crc32
+# define get_crc_table z_get_crc_table
+
+# define Byte z_Byte
+# define uInt z_uInt
+# define uLong z_uLong
+# define Bytef z_Bytef
+# define charf z_charf
+# define intf z_intf
+# define uIntf z_uIntf
+# define uLongf z_uLongf
+# define voidpf z_voidpf
+# define voidp z_voidp
+#endif
+
+#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
+# define WIN32
+#endif
+#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
+# ifndef __32BIT__
+# define __32BIT__
+# endif
+#endif
+#if defined(__MSDOS__) && !defined(MSDOS)
+# define MSDOS
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#if defined(MSDOS) && !defined(__32BIT__)
+# define MAXSEG_64K
+#endif
+#ifdef MSDOS
+# define UNALIGNED_OK
+#endif
+
+#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
+# define STDC
+#endif
+#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+# ifndef STDC
+# define STDC
+# endif
+#endif
+
+#ifndef STDC
+# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+# define const
+# endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
+# define NO_DUMMY_DECL
+#endif
+
+/* Old Borland C incorrectly complains about missing returns: */
+#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
+# define NEED_DUMMY_RETURN
+#endif
+
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+# ifdef MAXSEG_64K
+# define MAX_MEM_LEVEL 8
+# else
+# define MAX_MEM_LEVEL 9
+# endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+# define MAX_WBITS 15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+ (1 << (windowBits+2)) + (1 << (memLevel+9))
+ that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+ make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+ The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+ /* Type declarations */
+
+#ifndef OF /* function prototypes */
+# ifdef STDC
+# define OF(args) args
+# else
+# define OF(args) ()
+# endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
+#endif
+#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
+# ifndef __32BIT__
+# define SMALL_MEDIUM
+# define FAR _far
+# endif
+#endif
+
+/* Compile with -DZLIB_DLL for Windows DLL support */
+#if defined(ZLIB_DLL)
+# if defined(_WINDOWS) || defined(WINDOWS)
+# ifdef FAR
+# undef FAR
+# endif
+# include <windows.h>
+# define ZEXPORT WINAPI
+# ifdef WIN32
+# define ZEXPORTVA WINAPIV
+# else
+# define ZEXPORTVA FAR _cdecl _export
+# endif
+# endif
+# if defined (__BORLANDC__)
+# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
+# include <windows.h>
+# define ZEXPORT __declspec(dllexport) WINAPI
+# define ZEXPORTRVA __declspec(dllexport) WINAPIV
+# else
+# if defined (_Windows) && defined (__DLL__)
+# define ZEXPORT _export
+# define ZEXPORTVA _export
+# endif
+# endif
+# endif
+#endif
+
+#if defined (__BEOS__)
+# if defined (ZLIB_DLL)
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+#endif
+
+#ifndef ZEXPORT
+# define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+# define ZEXPORTVA
+#endif
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
+
+#ifndef FAR
+# define FAR
+#endif
+
+#if !defined(MACOS) && !defined(TARGET_OS_MAC) && !defined(VCL)
+typedef unsigned char Byte; /* 8 bits */
+#endif
+typedef unsigned int uInt; /* 16 bits or more */
+typedef unsigned long uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+ /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+# define Bytef Byte FAR
+#else
+ typedef unsigned char FAR Bytef;
+#endif
+typedef char FAR charf;
+typedef int FAR intf;
+typedef uInt FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <sys/types.h> /* for off_t */
+# include <unistd.h> /* for SEEK_* and off_t */
+# define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+# define SEEK_SET 0 /* Seek from beginning of file. */
+# define SEEK_CUR 1 /* Seek from current position. */
+# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+# define z_off_t long
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+# pragma map(deflateInit_,"DEIN")
+# pragma map(deflateInit2_,"DEIN2")
+# pragma map(deflateEnd,"DEEND")
+# pragma map(inflateInit_,"ININ")
+# pragma map(inflateInit2_,"ININ2")
+# pragma map(inflateEnd,"INEND")
+# pragma map(inflateSync,"INSY")
+# pragma map(inflateSetDictionary,"INSEDI")
+# pragma map(inflate_blocks,"INBL")
+# pragma map(inflate_blocks_new,"INBLNE")
+# pragma map(inflate_blocks_free,"INBLFR")
+# pragma map(inflate_blocks_reset,"INBLRE")
+# pragma map(inflate_codes_free,"INCOFR")
+# pragma map(inflate_codes,"INCO")
+# pragma map(inflate_fast,"INFA")
+# pragma map(inflate_flush,"INFLU")
+# pragma map(inflate_mask,"INMA")
+# pragma map(inflate_set_dictionary,"INSEDI2")
+# pragma map(inflate_copyright,"INCOPY")
+# pragma map(inflate_trees_bits,"INTRBI")
+# pragma map(inflate_trees_dynamic,"INTRDY")
+# pragma map(inflate_trees_fixed,"INTRFI")
+# pragma map(inflate_trees_free,"INTRFR")
+#endif
+
+#endif /* _ZCONF_H */
diff --git a/include/ztext.h b/include/ztext.h
index 4bdcc8d..6222a7c 100644
--- a/include/ztext.h
+++ b/include/ztext.h
@@ -3,7 +3,7 @@
* ztext.h - code for class 'zText'- a module that reads compressed text
* files: ot and nt using indexs ??.vss
*
- * $Id: ztext.h 3176 2014-04-17 04:22:36Z greg.hellings $
+ * $Id: ztext.h 3126 2014-03-14 11:59:36Z chrislit $
*
* Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/include/ztext4.h b/include/ztext4.h
new file mode 100644
index 0000000..2582fc2
--- /dev/null
+++ b/include/ztext4.h
@@ -0,0 +1,90 @@
+/******************************************************************************
+ *
+ * ztext4.h - code for class 'zText4'- a module that reads compressed text
+ * files: ot and nt using indexs ??.vss
+ *
+ * $Id: ztext4.h 3141 2014-03-19 01:24:04Z chrislit $
+ *
+ * Copyright 1996-2014 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 ZTEXT4_H
+#define ZTEXT4_H
+
+#include <zverse4.h>
+#include <swtext.h>
+
+#include <defs.h>
+
+namespace lucene { namespace index {
+class IndexReader;
+}}
+
+namespace lucene { namespace search {
+class IndexSearcher;
+}}
+
+SWORD_NAMESPACE_START
+
+/*** SWModule implementation for compressed modules
+* This class handles compressed modules.
+* It should not be used in frontends, unless you are doing very special things.
+*/
+class SWDLLEXPORT zText4:public zVerse4, public SWText {
+
+ VerseKey *lastWriteKey;
+ bool sameBlock(VerseKey * lastWriteKey, VerseKey * key);
+ int blockType;
+
+public:
+ zText4(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ 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,
+ const char *versification = "KJV");
+
+ virtual ~zText4();
+ virtual SWBuf &getRawEntryBuf() const;
+
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
+
+ // write interface ----------------------------
+ virtual bool isWritable() const;
+ static char createModule(const char *path, int blockBound, const char *v11n = "KJV") {
+ return zVerse4::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
+ virtual void deleteEntry(); // Delete current module entry
+ // end write interface ------------------------
+
+ virtual void rawZFilter(SWBuf &buf, char direction = 0) const { rawFilter(buf, (SWKey *)(long)direction); }// hack, use key as direction for enciphering
+
+ // swcacher interface ----------------------
+ 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
+};
+
+SWORD_NAMESPACE_END
+#endif
diff --git a/include/zverse.h b/include/zverse.h
index 22bf913..5a1e197 100644
--- a/include/zverse.h
+++ b/include/zverse.h
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class VerseKey
*
- * $Id: zverse.h 3180 2014-04-17 04:26:37Z greg.hellings $
+ * $Id: zverse.h 3136 2014-03-17 09:38:48Z chrislit $
*
* Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -61,8 +61,6 @@ public:
#define BOOKBLOCKS 4
static const char uniqueIndexID[];
- char nl;
-
// fileMode default = RDONLY
zVerse(const char *ipath, int fileMode = -1, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0);
diff --git a/include/zverse4.h b/include/zverse4.h
new file mode 100644
index 0000000..f7fbdaa
--- /dev/null
+++ b/include/zverse4.h
@@ -0,0 +1,77 @@
+/******************************************************************************
+ *
+ * zverse4.h - code for class 'zVerse4'- a module that reads raw text
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ * and provides lookup and parsing functions based on
+ * class VerseKey
+ *
+ * $Id: zverse4.h 3141 2014-03-19 01:24:04Z chrislit $
+ *
+ * Copyright 2000-2014 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 ZVERSE4_H
+#define ZVERSE4_H
+
+#include <defs.h>
+
+SWORD_NAMESPACE_START
+
+class FileDesc;
+class SWCompress;
+class SWBuf;
+
+class SWDLLEXPORT zVerse4 {
+ SWCompress *compressor;
+
+protected:
+ static int instance; // number of instantiated zVerse4 objects or derivitives
+
+ FileDesc *idxfp[2];
+ FileDesc *textfp[2];
+ FileDesc *compfp[2];
+ char *path;
+ void doSetText(char testmt, long idxoff, const char *buf, long len = 0);
+ void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
+ void flushCache() const;
+ mutable char *cacheBuf;
+ mutable unsigned int cacheBufSize;
+ mutable char cacheTestament;
+ mutable long cacheBufIdx;
+ mutable bool dirtyCache;
+
+public:
+
+#define VERSEBLOCKS 2
+#define CHAPTERBLOCKS 3
+#define BOOKBLOCKS 4
+
+ static const char uniqueIndexID[];
+
+
+ // fileMode default = RDONLY
+ zVerse4(const char *ipath, int fileMode = -1, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0);
+ virtual ~zVerse4();
+
+ void findOffset(char testmt, long idxoff, long *start, unsigned long *size, unsigned long *buffnum) const;
+ void zReadText(char testmt, long start, unsigned long size, unsigned long buffnum, SWBuf &buf) const;
+ virtual void rawZFilter(SWBuf &buf, char direction = 0) const { (void) buf; (void) direction; }
+ static char createModule(const char *path, int blockBound, const char *v11n = "KJV");
+};
+
+SWORD_NAMESPACE_END
+#endif