aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordanglassey <danglassey>2002-08-14 09:57:17 +0000
committerdanglassey <danglassey>2002-08-14 09:57:17 +0000
commitc9458897ebbb739d8db83c80e06512d8a612f743 (patch)
treef8c5381045887e34388cc6b26cfccc254bf766dc /include
downloadsword-sf-cvs-c9458897ebbb739d8db83c80e06512d8a612f743.tar.gz
*** empty log message ***
Diffstat (limited to 'include')
-rw-r--r--include/Greek2Greek.h114
-rw-r--r--include/GreekChars.h149
-rw-r--r--include/Makefile5
-rw-r--r--include/Makefile.am137
-rw-r--r--include/Makefile.in0
-rw-r--r--include/SwordAPI.pas69
-rw-r--r--include/canon.h695
-rw-r--r--include/cipherfil.h38
-rw-r--r--include/defs.h76
-rw-r--r--include/echomod.h38
-rw-r--r--include/encfiltmgr.h85
-rw-r--r--include/entriesblk.h30
-rw-r--r--include/femain.h32
-rw-r--r--include/filemgr.h82
-rw-r--r--include/flatapi.h78
-rw-r--r--include/gbffootnotes.h58
-rw-r--r--include/gbfheadings.h58
-rw-r--r--include/gbfhtml.h38
-rw-r--r--include/gbfhtmlhref.h33
-rw-r--r--include/gbfmorph.h57
-rw-r--r--include/gbfosis.h35
-rw-r--r--include/gbfplain.h37
-rw-r--r--include/gbfrtf.h37
-rw-r--r--include/gbfstrongs.h58
-rw-r--r--include/gbfthml.h34
-rw-r--r--include/greeklexattribs.h36
-rw-r--r--include/hebrewmcim.h29
-rw-r--r--include/hrefcom.h50
-rw-r--r--include/latin1utf16.h35
-rw-r--r--include/latin1utf8.h35
-rw-r--r--include/listkey.h119
-rw-r--r--include/localemgr.h114
-rw-r--r--include/lzsscomprs.h79
-rw-r--r--include/markupfiltmgr.h75
-rw-r--r--include/multimapwdef.h31
-rw-r--r--include/nullim.h14
-rw-r--r--include/plainfootnotes.h62
-rw-r--r--include/plainhtml.h38
-rw-r--r--include/rawcom.h61
-rw-r--r--include/rawfiles.h86
-rw-r--r--include/rawgbf.h45
-rw-r--r--include/rawgenbook.h64
-rw-r--r--include/rawld.h65
-rw-r--r--include/rawld4.h67
-rw-r--r--include/rawstr.h54
-rw-r--r--include/rawstr4.h55
-rw-r--r--include/rawtext.h64
-rw-r--r--include/rawverse.h38
-rw-r--r--include/regex.h545
-rw-r--r--include/roman.h25
-rw-r--r--include/rtfhtml.h37
-rw-r--r--include/rwphtml.h38
-rw-r--r--include/rwprtf.h40
-rw-r--r--include/sapphire.h53
-rw-r--r--include/scsuutf8.h41
-rw-r--r--include/strkey.h54
-rw-r--r--include/swbasicfilter.h117
-rw-r--r--include/swcacher.h37
-rw-r--r--include/swcipher.h49
-rw-r--r--include/swcom.h58
-rw-r--r--include/swcomprs.h45
-rw-r--r--include/swconfig.h91
-rw-r--r--include/swdisp.h47
-rw-r--r--include/swdisprtf.h74
-rw-r--r--include/swdisprtfchap.h51
-rw-r--r--include/swfilter.h108
-rw-r--r--include/swfiltermgr.h82
-rw-r--r--include/swgenbook.h61
-rw-r--r--include/swinputmeth.h30
-rw-r--r--include/swinstallmgr.h0
-rw-r--r--include/swkey.h209
-rw-r--r--include/swld.h69
-rw-r--r--include/swlocale.h73
-rw-r--r--include/swlog.h46
-rw-r--r--include/swmacs.h30
-rw-r--r--include/swmgr.h294
-rw-r--r--include/swmodule.h556
-rw-r--r--include/swobject.h54
-rw-r--r--include/swremotemgr.h0
-rw-r--r--include/swtext.h61
-rw-r--r--include/swunicod.h38
-rw-r--r--include/swversion.h46
-rw-r--r--include/swwinlog.h42
-rw-r--r--include/sysdata.h76
-rw-r--r--include/tbdisp.h39
-rw-r--r--include/thmlfootnotes.h58
-rw-r--r--include/thmlgbf.h37
-rw-r--r--include/thmlheadings.h58
-rw-r--r--include/thmlhtml.h35
-rw-r--r--include/thmlhtmlhref.h33
-rw-r--r--include/thmllemma.h58
-rw-r--r--include/thmlmorph.h57
-rw-r--r--include/thmlolb.h37
-rw-r--r--include/thmlosis.h35
-rw-r--r--include/thmlplain.h37
-rw-r--r--include/thmlrtf.h38
-rw-r--r--include/thmlscripref.h58
-rw-r--r--include/thmlstrongs.h58
-rw-r--r--include/thmlvariants.h61
-rw-r--r--include/treekey.h89
-rw-r--r--include/treekeyidx.h121
-rw-r--r--include/unicodertf.h36
-rw-r--r--include/unixstr.h28
-rw-r--r--include/untgz.h9
-rw-r--r--include/utf16utf8.h35
-rw-r--r--include/utf8arshaping.h46
-rw-r--r--include/utf8bidireorder.h45
-rw-r--r--include/utf8cantillation.h57
-rw-r--r--include/utf8greekaccents.h57
-rw-r--r--include/utf8hebrewpoints.h57
-rw-r--r--include/utf8html.h35
-rw-r--r--include/utf8latin1.h36
-rw-r--r--include/utf8nfc.h43
-rw-r--r--include/utf8nfkd.h43
-rw-r--r--include/utf8transliterator.h92
-rw-r--r--include/utf8utf16.h35
-rw-r--r--include/utilconf.h8
-rw-r--r--include/utilfuns.h29
-rw-r--r--include/utilstr.h84
-rw-r--r--include/versekey.h407
-rw-r--r--include/zcom.h73
-rw-r--r--include/zconf.h279
-rw-r--r--include/zipcomprs.h39
-rw-r--r--include/zld.h72
-rw-r--r--include/zlib.h893
-rw-r--r--include/zstr.h72
-rw-r--r--include/ztext.h77
-rw-r--r--include/zverse.h55
128 files changed, 10317 insertions, 0 deletions
diff --git a/include/Greek2Greek.h b/include/Greek2Greek.h
new file mode 100644
index 0000000..9770ea2
--- /dev/null
+++ b/include/Greek2Greek.h
@@ -0,0 +1,114 @@
+//*****************************************************************************
+// Author : William Dicks ***
+// Date Created: 10 February 1998 ***
+// Purpose : Interface for Greek to b-Greek conversion and vice versa ***
+// File Name : Greek2Greek.h ***
+// ***
+// Author info : ---------------------------------------------------------- ***
+// Address : 23 Tieroogpark ***
+// : Hoewe Str ***
+// : Elarduspark X3 ***
+// : 0181 ***
+// : South Africa ***
+// Home Tel: +27 (0)12 345 3166 ***
+// Cell No : +27 (0)82 577 4424 ***
+// e-mail : wd@isis.co.za ***
+// Church WWW : http://www.hatfield.co.za ***
+//*****************************************************************************
+/*
+ *
+ * $Id: Greek2Greek.h,v 1.2 2001/02/09 15:38:51 jansorg Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef __GREEK2GREEK
+#define __GREEK2GREEK
+
+//*****************************************************************************
+// Used to convert a string created by using the Greek font supplied with the
+// Sword Project to a string that conforms to the b-Greek discussion list
+// method of transliteration.
+//*****************************************************************************
+unsigned char Greek2bGreek (unsigned char *sResult, unsigned char *sGreekText,
+ int nMaxResultBuflen);
+
+//*****************************************************************************
+// Used to convert a string created by using the b-Greek method of
+// transliteration to a string that can be converted to a Greek-font readable
+// string.
+//*****************************************************************************
+unsigned char bGreek2Greek (unsigned char *sResult,
+ unsigned char *sGreekText, int nMaxResultBuflen);
+
+//*****************************************************************************
+// Parse a Greek font created string and return the b-Greek equivalent
+//*****************************************************************************
+int ParseGreek (unsigned char *sResult,
+ unsigned char *sGreekText, int nMaxResultBuflen);
+
+//*****************************************************************************
+// Parse a b-Greek string and return the Greek font equivalent
+//*****************************************************************************
+int ParsebGreek (unsigned char *sResult,
+ unsigned char *sGreekText, int nMaxResultBuflen);
+
+//*****************************************************************************
+// Convert a unsigned character to a GREEK font unsigned character
+//*****************************************************************************
+unsigned char char2Font (unsigned char letter, // bGreek letter to convert to Font letter
+ bool finalSigma, // Is it a final SIGMA
+ bool iota, // TRUE = IOTA subscript; FALSE = No IOTA
+ bool breathing, // TRUE = add breathing; FALSE = no breathing
+ bool rough); // TRUE = rough breathing; False = smooth
+
+//*****************************************************************************
+// Convert a GREEK font unsigned character to a unsigned character
+//*****************************************************************************
+unsigned char Font2char (unsigned char letter, // bGreek letter to convert to Font letter
+ bool & iota, // TRUE = IOTA subscript; FALSE = No IOTA
+ bool & breathing, // TRUE = add breathing; FALSE = no breathing
+ bool & rough); // TRUE = rough breathing; False = smooth
+
+
+//*****************************************************************************
+// Identify and return a bGreek letter from a special font char
+//*****************************************************************************
+bool getSpecialChar (unsigned char Font, unsigned char &letter);
+
+//*****************************************************************************
+// true if the font character is a special character; false it isn't
+//*****************************************************************************
+bool SpecialGreek (unsigned char Font);
+
+//*****************************************************************************
+// Return Greek font puntuation from bGreek punstuation
+//*****************************************************************************
+unsigned char getGreekPunct (unsigned char bGreek);
+
+//*****************************************************************************
+// Return bGreek puntuation from Greek font punstuation
+//*****************************************************************************
+unsigned char getbGreekPunct (unsigned char Greek);
+
+//*****************************************************************************
+// Is the character punctuation or a space: true it is, false it isn't
+//*****************************************************************************
+bool isPunctSpace (unsigned char c);
+
+
+
+#endif // __GREEK2GREEK
diff --git a/include/GreekChars.h b/include/GreekChars.h
new file mode 100644
index 0000000..c4f94be
--- /dev/null
+++ b/include/GreekChars.h
@@ -0,0 +1,149 @@
+//*****************************************************************************
+// Author : William Dicks ***
+// Date Created: 10 February 1998 ***
+// Purpose : Enumeration for Greek to b-Greek conversion and vice ***
+// : versa. ***
+// File Name : GreekChars.h ***
+// ***
+// Author info : ---------------------------------------------------------- ***
+// Address : 23 Tieroogpark ***
+// : Hoewe Str ***
+// : Elarduspark X3 ***
+// : 0181 ***
+// : South Africa ***
+// Home Tel: +27 (0)12 345 3166 ***
+// Cell No : +27 (0)82 577 4424 ***
+// e-mail : wd@isis.co.za ***
+// Church WWW : http://www.hatfield.co.za ***
+//*****************************************************************************
+/*
+ *
+ * $Id: GreekChars.h,v 1.3 2001/03/18 21:04:25 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef __GREEKCHARS_H
+#define __GREEKCHARS_H
+
+// This enum represents the values of the characters used for the
+// transliteration as used on the b-greek discussion list.
+
+enum bGreekChars
+{
+ ALPHA = 65, // A
+ BETA, // B
+ CHI, // C
+ DELTA, // D
+ EPSILON, // E
+ PHI, // F
+ GAMMA, // G
+ ETA, // H
+ IOTA, // I
+ // No J
+ KAPPA = 75, // K
+ LAMBDA, // L
+ MU, // M
+ NU, // N
+ OMICRON, // O
+ PI, // P
+ THETA, // Q
+ RHO, // R
+ SIGMA, // S
+ TAU, // T
+ UPSILON, // U
+ // No V
+ OMEGA = 'W', // W
+ XI, // X
+ PSI, // Y
+ ZETA, // Z
+ ROUGH = 104, // h
+ IOTA_SUB // i
+};
+
+// This enum represents the values of the characters ib the Greek.ttf font,
+// and the comments on the right are the corresponding bGreek equivalents.
+
+enum GreekFontChars
+{
+ gALPHA = 'a', // A
+ gBETA, // B
+ gCHI, // C
+ gDELTA, // D
+ gEPSILON, // E
+ gPHI, // F
+ gGAMMA, // G
+ gETA, // H
+ gIOTA, // I
+ gSIGMA_END, // j
+ gKAPPA, // K
+ gLAMBDA, // L
+ gMU, // M
+ gNU, // N
+ gOMICRON, // O
+ gPI, // P
+ gTHETA, // Q
+ gRHO, // R
+ gSIGMA, // S
+ gTAU, // T
+ gUPSILON, // U
+ // No V
+ gOMEGA = 'w', // W
+ gXI, // X
+ gPSI, // Y
+ gZETA, // Z
+ gROUGH_ALPHA = 161, // hA
+ gROUGH_EPSILON = 152, // hE
+ gROUGH_ETA = 185, // hH
+ gROUGH_IOTA = 131, // hH
+ gROUGH_OMICRON = 208, // hH
+ gROUGH_RHO = 183, // hR
+ gROUGH_UPSILON = 216, // hU
+ gROUGH_OMEGA = 230, // hW
+ gIOTA_ALPHA = 'v', // Ai
+ gIOTA_ETA = 'V', // Ei
+ gIOTA_OMEGA = 'J', // Wi
+ gNON_ROUGH_ALPHA = 162, // hA
+ gNON_ROUGH_EPSILON = 153, // hE
+ gNON_ROUGH_ETA = 186, // hH
+ gNON_ROUGH_IOTA = 132, // hH
+ gNON_ROUGH_OMICRON = 209, // hH
+ gNON_ROUGH_RHO = 184, // hR
+ gNON_ROUGH_UPSILON = 217, // hU
+ gNON_ROUGH_OMEGA = 231 // hW
+};
+
+// English puntuation as used on bGreek
+
+enum bGreekPunct
+{
+ COMMA = ',',
+ STOP = '.',
+ SEMI_COLON = ';',
+ QUESTION = '?'
+};
+
+// English puntuation as used in the Greek font
+
+enum GreekPunct
+{
+ gCOMMA = ',',
+ gSTOP = '.',
+ gSEMI_COLON = ':',
+ gQUESTION = ';'
+};
+
+#endif // __GREEKCHARS_H
diff --git a/include/Makefile b/include/Makefile
new file mode 100644
index 0000000..fc04b62
--- /dev/null
+++ b/include/Makefile
@@ -0,0 +1,5 @@
+
+root := ..
+
+all:
+ make -C ${root}
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644
index 0000000..bd4edce
--- /dev/null
+++ b/include/Makefile.am
@@ -0,0 +1,137 @@
+swincludedir = $(top_srcdir)/include
+
+pkginclude_HEADERS = $(swincludedir)/Greek2Greek.h
+pkginclude_HEADERS += $(swincludedir)/GreekChars.h
+pkginclude_HEADERS += $(swincludedir)/canon.h
+pkginclude_HEADERS += $(swincludedir)/cipherfil.h
+pkginclude_HEADERS += $(swincludedir)/defs.h
+pkginclude_HEADERS += $(swincludedir)/echomod.h
+pkginclude_HEADERS += $(swincludedir)/encfiltmgr.h
+pkginclude_HEADERS += $(swincludedir)/entriesblk.h
+pkginclude_HEADERS += $(swincludedir)/femain.h
+pkginclude_HEADERS += $(swincludedir)/filemgr.h
+pkginclude_HEADERS += $(swincludedir)/flatapi.h
+pkginclude_HEADERS += $(swincludedir)/gbffootnotes.h
+pkginclude_HEADERS += $(swincludedir)/gbfheadings.h
+pkginclude_HEADERS += $(swincludedir)/gbfhtml.h
+pkginclude_HEADERS += $(swincludedir)/gbfhtmlhref.h
+pkginclude_HEADERS += $(swincludedir)/gbfmorph.h
+pkginclude_HEADERS += $(swincludedir)/gbfplain.h
+pkginclude_HEADERS += $(swincludedir)/gbfrtf.h
+pkginclude_HEADERS += $(swincludedir)/gbfstrongs.h
+pkginclude_HEADERS += $(swincludedir)/gbfthml.h
+pkginclude_HEADERS += $(swincludedir)/greeklexattribs.h
+pkginclude_HEADERS += $(swincludedir)/hebrewmcim.h
+pkginclude_HEADERS += $(swincludedir)/hrefcom.h
+pkginclude_HEADERS += $(swincludedir)/latin1utf16.h
+pkginclude_HEADERS += $(swincludedir)/latin1utf8.h
+pkginclude_HEADERS += $(swincludedir)/listkey.h
+pkginclude_HEADERS += $(swincludedir)/localemgr.h
+pkginclude_HEADERS += $(swincludedir)/lzsscomprs.h
+pkginclude_HEADERS += $(swincludedir)/markupfiltmgr.h
+pkginclude_HEADERS += $(swincludedir)/multimapwdef.h
+pkginclude_HEADERS += $(swincludedir)/nullim.h
+pkginclude_HEADERS += $(swincludedir)/plainfootnotes.h
+pkginclude_HEADERS += $(swincludedir)/plainhtml.h
+pkginclude_HEADERS += $(swincludedir)/rawcom.h
+pkginclude_HEADERS += $(swincludedir)/rawfiles.h
+pkginclude_HEADERS += $(swincludedir)/rawgbf.h
+pkginclude_HEADERS += $(swincludedir)/rawgenbook.h
+pkginclude_HEADERS += $(swincludedir)/rawld.h
+pkginclude_HEADERS += $(swincludedir)/rawld4.h
+pkginclude_HEADERS += $(swincludedir)/rawstr.h
+pkginclude_HEADERS += $(swincludedir)/rawstr4.h
+pkginclude_HEADERS += $(swincludedir)/rawtext.h
+pkginclude_HEADERS += $(swincludedir)/rawverse.h
+pkginclude_HEADERS += $(swincludedir)/regex.h
+pkginclude_HEADERS += $(swincludedir)/roman.h
+pkginclude_HEADERS += $(swincludedir)/rtfhtml.h
+pkginclude_HEADERS += $(swincludedir)/rwphtml.h
+pkginclude_HEADERS += $(swincludedir)/rwprtf.h
+pkginclude_HEADERS += $(swincludedir)/sapphire.h
+pkginclude_HEADERS += $(swincludedir)/scsuutf8.h
+pkginclude_HEADERS += $(swincludedir)/strkey.h
+pkginclude_HEADERS += $(swincludedir)/swbasicfilter.h
+pkginclude_HEADERS += $(swincludedir)/swcacher.h
+pkginclude_HEADERS += $(swincludedir)/swcipher.h
+pkginclude_HEADERS += $(swincludedir)/swcom.h
+pkginclude_HEADERS += $(swincludedir)/swcomprs.h
+pkginclude_HEADERS += $(swincludedir)/swconfig.h
+pkginclude_HEADERS += $(swincludedir)/swdisp.h
+pkginclude_HEADERS += $(swincludedir)/swdisprtf.h
+pkginclude_HEADERS += $(swincludedir)/swdisprtfchap.h
+pkginclude_HEADERS += $(swincludedir)/swfilter.h
+pkginclude_HEADERS += $(swincludedir)/swfiltermgr.h
+pkginclude_HEADERS += $(swincludedir)/swgenbook.h
+pkginclude_HEADERS += $(swincludedir)/swinputmeth.h
+pkginclude_HEADERS += $(swincludedir)/swkey.h
+pkginclude_HEADERS += $(swincludedir)/swld.h
+pkginclude_HEADERS += $(swincludedir)/swlocale.h
+pkginclude_HEADERS += $(swincludedir)/swlog.h
+pkginclude_HEADERS += $(swincludedir)/swmacs.h
+pkginclude_HEADERS += $(swincludedir)/swmgr.h
+pkginclude_HEADERS += $(swincludedir)/swmodule.h
+pkginclude_HEADERS += $(swincludedir)/swobject.h
+pkginclude_HEADERS += $(swincludedir)/swtext.h
+pkginclude_HEADERS += $(swincludedir)/swunicod.h
+pkginclude_HEADERS += $(swincludedir)/swversion.h
+pkginclude_HEADERS += $(swincludedir)/swwinlog.h
+pkginclude_HEADERS += $(swincludedir)/sysdata.h
+pkginclude_HEADERS += $(swincludedir)/tbdisp.h
+pkginclude_HEADERS += $(swincludedir)/thmlfootnotes.h
+pkginclude_HEADERS += $(swincludedir)/thmlgbf.h
+pkginclude_HEADERS += $(swincludedir)/thmlheadings.h
+pkginclude_HEADERS += $(swincludedir)/thmlhtml.h
+pkginclude_HEADERS += $(swincludedir)/thmlhtmlhref.h
+pkginclude_HEADERS += $(swincludedir)/thmllemma.h
+pkginclude_HEADERS += $(swincludedir)/thmlmorph.h
+pkginclude_HEADERS += $(swincludedir)/thmlolb.h
+pkginclude_HEADERS += $(swincludedir)/thmlplain.h
+pkginclude_HEADERS += $(swincludedir)/thmlrtf.h
+pkginclude_HEADERS += $(swincludedir)/thmlscripref.h
+pkginclude_HEADERS += $(swincludedir)/thmlstrongs.h
+pkginclude_HEADERS += $(swincludedir)/thmlvariants.h
+pkginclude_HEADERS += $(swincludedir)/treekey.h
+pkginclude_HEADERS += $(swincludedir)/treekeyidx.h
+pkginclude_HEADERS += $(swincludedir)/unicodertf.h
+pkginclude_HEADERS += $(swincludedir)/unixstr.h
+pkginclude_HEADERS += $(swincludedir)/untgz.h
+pkginclude_HEADERS += $(swincludedir)/utf16utf8.h
+pkginclude_HEADERS += $(swincludedir)/utf8cantillation.h
+pkginclude_HEADERS += $(swincludedir)/utf8greekaccents.h
+pkginclude_HEADERS += $(swincludedir)/utf8hebrewpoints.h
+pkginclude_HEADERS += $(swincludedir)/utf8html.h
+pkginclude_HEADERS += $(swincludedir)/utf8latin1.h
+pkginclude_HEADERS += $(swincludedir)/utf8utf16.h
+pkginclude_HEADERS += $(swincludedir)/utilconf.h
+pkginclude_HEADERS += $(swincludedir)/utilfuns.h
+pkginclude_HEADERS += $(swincludedir)/utilstr.h
+pkginclude_HEADERS += $(swincludedir)/versekey.h
+pkginclude_HEADERS += $(swincludedir)/zcom.h
+pkginclude_HEADERS += $(swincludedir)/zconf.h
+pkginclude_HEADERS += $(swincludedir)/zipcomprs.h
+pkginclude_HEADERS += $(swincludedir)/zld.h
+pkginclude_HEADERS += $(swincludedir)/zlib.h
+pkginclude_HEADERS += $(swincludedir)/ztext.h
+pkginclude_HEADERS += $(swincludedir)/zverse.h
+
+if ICU
+ICU_HEAD = $(swincludedir)/utf8arshaping.h
+ICU_HEAD += $(swincludedir)/utf8bidireorder.h
+ICU_HEAD += $(swincludedir)/utf8nfc.h
+ICU_HEAD += $(swincludedir)/utf8nfkd.h
+ICU_HEAD += $(swincludedir)/utf8transliterator.h
+else
+ICU_HEAD =
+endif
+
+if INSTALLMGR
+REMOTE_HEAD = $(swincludedir)/swremotemgr.h
+REMOTE_HEAD += $(swincludedir)/swinstallmgr.h
+else
+REMOTE_HEAD =
+endif
+
+
+pkginclude_HEADERS += $(ICU_HEAD)
+pkginclude_HEADERS += $(REMOTE_HEAD)
diff --git a/include/Makefile.in b/include/Makefile.in
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/include/Makefile.in
diff --git a/include/SwordAPI.pas b/include/SwordAPI.pas
new file mode 100644
index 0000000..a83d825
--- /dev/null
+++ b/include/SwordAPI.pas
@@ -0,0 +1,69 @@
+{*
+ *
+ * $Id: SwordAPI.pas,v 1.1.1.1 1999/05/04 22:03:36 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ *}
+unit SwordAPI;
+
+interface
+const
+ DLLNAME = 'sword32.dll';
+
+type
+ paramt = record
+ path, name, disc: pchar;
+ end;
+ pparamt = ^paramt;
+
+function NewModule(modtype: PChar; params: pparamt): integer; stdcall; external DLLNAME;
+procedure DeleteModule(hmod: integer); stdcall; external DLLNAME;
+function ModGetTextLen(hmod: integer): integer; stdcall; external DLLNAME;
+procedure ModGetText(hmod: integer; buf: PChar; size: integer); stdcall; external DLLNAME;
+procedure ModGetKeyText(hmod: integer; buf: PChar; size: integer); stdcall; external DLLNAME;
+function ModGetKey(hmod: integer):integer; stdcall; external DLLNAME;
+function ModSetKeyText(hmod: integer; keytext: PChar):char; stdcall; external DLLNAME;
+function ModSetKeyKey(hmod: integer; hkey: integer):char; stdcall; external DLLNAME;
+function ModSearch(hmod: integer; stext: PChar):integer; stdcall; external DLLNAME;
+procedure YoYo(x:integer; y:integer); stdcall; external DLLNAME;
+procedure ModInc(hmod: integer); stdcall; external DLLNAME;
+procedure ModDec(hmod: integer); stdcall; external DLLNAME;
+function ModError(hmod:integer): integer; stdcall; external DLLNAME;
+function NewKey(keytype:PChar):integer;stdcall; external DLLNAME;
+procedure DeleteKey(hkey: integer); stdcall; external DLLNAME;
+function KeyGetPersist(hkey: integer): integer; stdcall; external DLLNAME;
+procedure KeySetPersist(hkey: integer; value: integer); stdcall; external DLLNAME;
+function KeyError(hkey:integer): integer; stdcall; external DLLNAME;
+procedure KeyGetText(hkey: integer; buf: PChar; size: integer); stdcall; external DLLNAME;
+procedure KeySetText(hkey: integer; keytext: PChar); stdcall; external DLLNAME;
+procedure KeySetKey(hkey: integer; hkey: integer); stdcall; external DLLNAME;
+procedure KeyInc(hkey: integer); stdcall; external DLLNAME;
+procedure KeyDec(hkey: integer); stdcall; external DLLNAME;
+function VerseKeyGetTestament(hkey: integer): integer; stdcall; external DLLNAME;
+function VerseKeyGetBook(hkey: integer): integer; stdcall; external DLLNAME;
+function VerseKeyGetChapter(hkey: integer): integer; stdcall; external DLLNAME;
+function VerseKeyGetVerse(hkey: integer): integer; stdcall; external DLLNAME;
+procedure VerseKeySetTestament(hkey: integer; value: integer); stdcall; external DLLNAME;
+procedure VerseKeySetBook(hkey: integer; value: integer); stdcall; external DLLNAME;
+procedure VerseKeySetChapter(hkey: integer; value: integer); stdcall; external DLLNAME;
+procedure VerseKeySetVerse(hkey: integer; value: integer); stdcall; external DLLNAME;
+function VerseKeyGetAutoNormalize(hkey: integer): integer; stdcall; external DLLNAME;
+procedure VerseKeySetAutoNormalize(hkey: integer; value: integer); stdcall; external DLLNAME;
+procedure VerseKeyNormalize(hkey: integer); stdcall; external DLLNAME;
+
+implementation
+
+end.
diff --git a/include/canon.h b/include/canon.h
new file mode 100644
index 0000000..9af48af
--- /dev/null
+++ b/include/canon.h
@@ -0,0 +1,695 @@
+/******************************************************************************
+ * canon.h - Canonical text information to be included by VerseKey.cpp
+ *
+ * $Id: canon.h,v 1.13 2002/06/25 04:17:29 chrislit Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+/******************************************************************************
+ * [on]tbooks - initialize static instance for all canonical text names
+ * and chapmax
+ */
+
+struct sbook
+ VerseKey::otbooks[] = {
+ {"Genesis", "Gen", 50},
+ {"Exodus", "Exod", 40},
+ {"Leviticus", "Lev", 27},
+ {"Numbers", "Num", 36},
+ {"Deuteronomy", "Deut", 34},
+ {"Joshua", "Josh", 24},
+ {"Judges", "Judg", 21},
+ {"Ruth", "Ruth", 4},
+ {"I Samuel", "I Sam", 31},
+ {"II Samuel", "II Sam", 24},
+ {"I Kings", "I Kin", 22},
+ {"II Kings", "II Kin", 25},
+ {"I Chronicles", "I Chr", 29},
+ {"II Chronicles", "II Chr", 36},
+ {"Ezra", "Ezra", 10},
+ {"Nehemiah", "Neh", 13},
+ {"Esther", "Esth", 10},
+ {"Job", "Job", 42},
+ {"Psalms", "Psa", 150},
+ {"Proverbs", "Prov", 31},
+ {"Ecclesiastes", "Eccl", 12},
+ {"Song of Solomon", "Song", 8},
+ {"Isaiah", "Isa", 66},
+ {"Jeremiah", "Jer", 52},
+ {"Lamentations", "Lam", 5},
+ {"Ezekiel", "Ezek", 48},
+ {"Daniel", "Dan", 12},
+ {"Hosea", "Hos", 14},
+ {"Joel", "Joel", 3},
+ {"Amos", "Amos", 9},
+ {"Obadiah", "Obad", 1},
+ {"Jonah", "Jonah", 4},
+ {"Micah", "Mic", 7},
+ {"Nahum", "Nah", 3},
+ {"Habakkuk", "Hab", 3},
+ {"Zephaniah", "Zeph", 3},
+ {"Haggai", "Hag", 2},
+ {"Zechariah", "Zech", 14},
+ {"Malachi", "Mal", 4}
+};
+
+struct sbook
+ VerseKey::ntbooks[] = {
+ {"Matthew", "Mat", 28},
+ {"Mark", "Mark", 16},
+ {"Luke", "Luke", 24},
+ {"John", "John", 21},
+ {"Acts", "Acts", 28},
+ {"Romans", "Rom", 16},
+ {"I Corinthians", "I Cor", 16},
+ {"II Corinthians", "II Cor", 13},
+ {"Galatians", "Gal", 6},
+ {"Ephesians", "Eph", 6},
+ {"Philippians", "Philip", 4},
+ {"Colossians", "Col", 4},
+ {"I Thessalonians", "I Thes", 5},
+ {"II Thessalonians", "II Thes", 3},
+ {"I Timothy", "I Tim", 6},
+ {"II Timothy", "II Tim", 4},
+ {"Titus", "Titus", 3},
+ {"Philemon", "Philem", 1},
+ {"Hebrews", "Heb", 13},
+ {"James", "Jas", 5},
+ {"I Peter", "I Pet", 5},
+ {"II Peter", "II Pet", 3},
+ {"I John", "I Jo", 5},
+ {"II John", "II Jo", 1},
+ {"III John", "III Jo", 1},
+ {"Jude", "Jude", 1},
+ {"Revelation of John", "Rev", 22}
+};
+
+
+/******************************************************************************
+ * Abbreviations - MUST be in alphabetical order & by PRIORITY
+ * RULE: first match of entire key
+ * (e.g. key: "1CH"; match: "1CHRONICLES")
+ */
+
+const struct abbrev
+ VerseKey::builtin_abbrevs[] = {
+ {"1 C", 46}, // 1 Corinthians
+ {"1 CHRONICLES", 13}, // 1 Chronicles
+ {"1 CORINTHIANS", 46}, // 1 Corinthians
+ {"1 JN", 62}, // 1 John
+ {"1 JOHN", 62}, // 1 John
+ {"1 KGS", 11}, // 1 Kings
+ {"1 KINGS", 11}, // 1 Kings
+ {"1 PETER", 60}, // 1 Peter
+ {"1 PTR", 60}, // 1 Peter
+ {"1 SAMUEL", 9}, // 1 Samuel
+ {"1 THESSALONIANS", 52}, // 1 Thessalonians
+ {"1 TIMOTHY", 54}, // 1 Timothy
+ {"1C", 46}, // 1 Corinthians
+ {"1CHRONICLES", 13}, // 1 Chronicles
+ {"1CORINTHIANS", 46}, // 1 Corinthians
+ {"1JN", 62}, // 1 John
+ {"1JOHN", 62}, // 1 John
+ {"1KGS", 11}, // 1 Kings
+ {"1KINGS", 11}, // 1 Kings
+ {"1PETER", 60}, // 1 Peter
+ {"1PTR", 60}, // 1 Peter
+ {"1SAMUEL", 9}, // 1 Samuel
+ {"1THESSALONIANS", 52}, // 1 Thessalonians
+ {"1TIMOTHY", 54}, // 1 Timothy
+ {"2 C", 47}, // 2 Corinthians
+ {"2 CHRONICLES", 14}, // 2 Chronicles
+ {"2 CORINTHIANS", 47}, // 2 Corinthians
+ {"2 JN", 63}, // 2 John
+ {"2 JOHN", 63}, // 2 John
+ {"2 KGS", 12}, // 2 Kings
+ {"2 KINGS", 12}, // 2 Kings
+ {"2 PETER", 61}, // 2 Peter
+ {"2 PTR", 61}, // 2 Peter
+ {"2 SAMUEL", 10}, // 2 Samuel
+ {"2 THESSALONIANS", 53}, // 2 Thessalonians
+ {"2 TIMOTHY", 55}, // 2 Timothy
+ {"2C", 47}, // 2 Corinthians
+ {"2CHRONICLES", 14}, // 2 Chronicles
+ {"2CORINTHIANS", 47}, // 2 Corinthians
+ {"2JN", 63}, // 2 John
+ {"2JOHN", 63}, // 2 John
+ {"2KGS", 12}, // 2 Kings
+ {"2KINGS", 12}, // 2 Kings
+ {"2PETER", 61}, // 2 Peter
+ {"2PTR", 61}, // 2 Peter
+ {"2SAMUEL", 10}, // 2 Samuel
+ {"2THESSALONIANS", 53}, // 2 Thessalonians
+ {"2TIMOTHY", 55}, // 2 Timothy
+ {"3 JN", 64}, // 3 John
+ {"3 JOHN", 64}, // 3 John
+ {"3JN", 64}, // 3 John
+ {"3JOHN", 64}, // 3 John
+ {"ACTS", 44}, // Acts
+ {"AMOS", 30}, // Amos
+ {"APOCALYPSE OF ST. JOHN", 66}, // Apocalypse of St. John (Rev.)
+ {"C", 51}, // Colossians
+ {"CANTICLE OF CANTICLES", 22}, // Canticle of Canticles (Song of S.)
+ {"COLOSSIANS", 51}, // Colossians
+ {"D", 5}, // Deuteronomy
+ {"DANIEL", 27}, // Daniel
+ {"DEUTERONOMY", 5}, // Deuteronomy
+ {"E", 49}, // Ephesians
+ {"ECCLESIASTES", 21}, // Ecclesiastes
+ {"EPHESIANS", 49}, // Ephesians
+ {"ESTER", 17}, // Esther
+ {"ESTHER", 17}, // Esther
+ {"EXODUS", 2}, // Exodus
+ {"EZEKIEL", 26}, // Ezekiel
+ {"EZK", 26}, // Ezekiel
+ {"EZRA", 15}, // Ezra
+ {"G", 1}, // Genesis
+ {"GALATIANS", 48}, // Galatians
+ {"GENESIS", 1}, // Genesis
+ {"H", 58}, // Hebrews
+ {"HABAKKUK", 35}, // Habakkuk
+ {"HAGGAI", 37}, // Haggai
+ {"HEBREWS", 58}, // Hebrews
+ {"HOSEA", 28}, // Hosea
+ {"I C", 46}, // 1 Corinthians
+ {"I CHRONICLES", 13}, // 1 Chronicles
+ {"I CORINTHIANS", 46}, // 1 Corinthians
+ {"I JN", 62}, // 1 John
+ {"I JOHN", 62}, // 1 John
+ {"I KGS", 11}, // 1 Kings
+ {"I KINGS", 11}, // 1 Kings
+ {"I PETER", 60}, // 1 Peter
+ {"I PTR", 60}, // 1 Peter
+ {"I SAMUEL", 9}, // 1 Samuel
+ {"I THESSALONIANS", 52}, // 1 Thessalonians
+ {"I TIMOTHY", 54}, // 1 Timothy
+ {"IC", 46}, // 1 Corinthians
+ {"ICHRONICLES", 13}, // 1 Chronicles
+ {"ICORINTHIANS", 46}, // 1 Corinthians
+ {"II C", 47}, // 2 Corinthians
+ {"II CHRONICLES", 14}, // 2 Chronicles
+ {"II CORINTHIANS", 47}, // 2 Corinthians
+ {"II JN", 63}, // 2 John
+ {"II JOHN", 63}, // 2 John
+ {"II KGS", 12}, // 2 Kings
+ {"II KINGS", 12}, // 2 Kings
+ {"II PETER", 61}, // 2 Peter
+ {"II PTR", 61}, // 2 Peter
+ {"II SAMUEL", 10}, // 2 Samuel
+ {"II THESSALONIANS", 53}, // 2 Thessalonians
+ {"II TIMOTHY", 55}, // 2 Timothy
+ {"IIC", 47}, // 2 Corinthians
+ {"IICHRONICLES", 14}, // 2 Chronicles
+ {"IICORINTHIANS", 47}, // 2 Corinthians
+ {"III JN", 64}, // 3 John
+ {"III JOHN", 64}, // 3 John
+ {"IIIJN", 64}, // 3 John
+ {"IIIJOHN", 64}, // 3 John
+ {"IIJN", 63}, // 2 John
+ {"IIJOHN", 63}, // 2 John
+ {"IIKGS", 12}, // 2 Kings
+ {"IIKINGS", 12}, // 2 Kings
+ {"IIPETER", 61}, // 2 Peter
+ {"IIPTR", 61}, // 2 Peter
+ {"IISAMUEL", 10}, // 2 Samuel
+ {"IITHESSALONIANS", 53}, // 2 Thessalonians
+ {"IITIMOTHY", 55}, // 2 Timothy
+ {"IJN", 62}, // 1 John
+ {"IJOHN", 62}, // 1 John
+ {"IKGS", 11}, // 1 Kings
+ {"IKINGS", 11}, // 1 Kings
+ {"IPETER", 60}, // 1 Peter
+ {"IPTR", 60}, // 1 Peter
+ {"ISA", 23}, // Isaiah
+ {"ISAIAH", 23}, // Isaiah
+ {"ISAMUEL", 9}, // 1 Samuel
+ {"ITHESSALONIANS", 52}, // 1 Thessalonians
+ {"ITIMOTHY", 54}, // 1 Timothy
+ {"J", 43}, // John
+ {"JAMES", 59}, // James
+ {"JAS", 59}, // James
+ {"JDGS", 7}, // Judges
+ {"JEREMIAH", 24}, // Jeremiah
+ {"JHN", 43}, // John
+ {"JN", 43}, // John
+ {"JO", 43}, // John
+ {"JOB", 18}, // Job
+ {"JOEL", 29}, // Joel
+ {"JOHN", 43}, // John
+ {"JOL", 29}, // Joel
+ {"JONAH", 32}, // Jonah
+ {"JOSHUA", 6}, // Joshua
+ {"JUDE", 65}, // Jude
+ {"JUDGES", 7}, // Judges
+ {"L", 42}, // Luke
+ {"LAMENTATIONS", 25}, // Lamentations
+ {"LEVITICUS", 3}, // Leviticus
+ {"LK", 42}, // Luke
+ {"LUKE", 42}, // Luke
+ {"MA", 40}, // Matthew
+ {"MALACHI", 39}, // Malachi
+ {"MARK", 41}, // Mark
+ {"MATTHEW", 40}, // Matthew
+ {"MICAH", 33}, // Micah
+ {"MK", 41}, // Mark
+ {"MRK", 41}, // Mark
+ {"MT", 40}, // Matthew
+ {"N", 4}, // Numbers
+ {"NAHUM", 34}, // Nahum
+ {"NAM", 34}, // Nahum
+ {"NEHEMIAH", 16}, // Nehemiah
+ {"NUMBERS", 4}, // Numbers
+ {"OBADIAH", 31}, // Obadiah
+ {"P", 19}, // Psalms
+ {"PHIL", 50}, // Philippians
+ {"PHILEMON", 57}, // Philemon
+ {"PHILIPPIANS", 50}, // Philippians
+ {"PHM", 57}, // Philemon
+ {"PHP", 50}, // Philippians
+ {"PROVERBS", 20}, // Proverbs
+ {"PSALMS", 19}, // Psalms
+ {"PSM", 19}, // Psalms
+ {"PSS", 19}, // Psalms
+ {"QOHELETH", 21}, // Qohelot (Ecclesiastes)
+ {"REVELATION OF JOHN", 66}, // Revelation
+ {"ROMANS", 45}, // Romans
+ {"RUTH", 8}, // Ruth
+ {"SNG", 22}, // Song of Solomon
+ {"SOLOMON", 22}, // Song of Solomon
+ {"SONG OF SOLOMON", 22}, // Song of Solomon
+ {"SONG OF SONGS", 22}, // Song of Solomon
+ {"SOS", 22}, // Song of Solomon
+ {"TITUS", 56}, // Titus
+ {"ZECHARIAH", 38}, // Zechariah
+ {"ZEPHANIAH", 36}, // Zephaniah
+ {"", -1} // Zephaniah
+};
+
+
+/******************************************************************************
+ * Maximum verses per chapter
+ */
+
+int
+ VerseKey::vm[] = {
+ // Genesis
+ 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33, 38,
+ 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 55, 32, 20, 31, 29, 43, 36,
+ 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26,
+ // Exodus
+ 22, 25, 22, 31, 23, 30, 25, 32, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27, 25,
+ 26, 36, 31, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38, 29,
+ 31, 43, 38,
+ // Leviticus
+ 17, 16, 17, 35, 19, 30, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30, 37,
+ 27, 24, 33, 44, 23, 55, 46, 34,
+ // Numbers
+ 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 50, 13, 32, 22,
+ 29, 35, 41, 30, 25, 18, 65, 23, 31, 40, 16, 54, 42, 56, 29, 34, 13,
+ // Deuteronomy
+ 46, 37, 29, 49, 33, 25, 26, 20, 29, 22, 32, 32, 18, 29, 23, 22, 20, 22, 21,
+ 20, 23, 30, 25, 22, 19, 19, 26, 68, 29, 20, 30, 52, 29, 12,
+ // Joshua
+ 18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51,
+ 9, 45, 34, 16, 33,
+ // Judges
+ 36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30,
+ 48, 25,
+ // Ruth
+ 22, 23, 18, 22,
+ // I Samual
+ 28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24,
+ 42, 15, 23, 29, 22, 44, 25, 12, 25, 11, 31, 13,
+ // II Samuel
+ 27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 33, 43,
+ 26, 22, 51, 39, 25,
+ // I Kings
+ 53, 46, 28, 34, 18, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21,
+ 43, 29, 53,
+ // II Kings
+ 18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 21, 21, 25, 29, 38, 20, 41, 37, 37,
+ 21, 26, 20, 37, 20, 30,
+ // I Chronicles
+ 54, 55, 24, 43, 26, 81, 40, 40, 44, 14, 47, 40, 14, 17, 29, 43, 27, 17, 19,
+ 8, 30, 19, 32, 31, 31, 32, 34, 21, 30,
+ // II Chronicles
+ 17, 18, 17, 22, 14, 42, 22, 18, 31, 19, 23, 16, 22, 15, 19, 14, 19, 34, 11,
+ 37, 20, 12, 21, 27, 28, 23, 9, 27, 36, 27, 21, 33, 25, 33, 27, 23,
+ // Ezra
+ 11, 70, 13, 24, 17, 22, 28, 36, 15, 44,
+ // Nehemiah
+ 11, 20, 32, 23, 19, 19, 73, 18, 38, 39, 36, 47, 31,
+ // Esther
+ 22, 23, 15, 17, 14, 14, 10, 17, 32, 3,
+ // Job
+ 22, 13, 26, 21, 27, 30, 21, 22, 35, 22, 20, 25, 28, 22, 35, 22, 16, 21, 29,
+ 29, 34, 30, 17, 25, 6, 14, 23, 28, 25, 31, 40, 22, 33, 37, 16, 33, 24, 41,
+ 30, 24, 34, 17,
+ // Psalms
+ 6, 12, 8, 8, 12, 10, 17, 9, 20, 18, 7, 8, 6, 7, 5, 11, 15, 50, 14, 9, 13,
+ 31, 6, 10, 22, 12, 14, 9, 11, 12, 24, 11, 22, 22, 28, 12, 40, 22, 13, 17,
+ 13, 11, 5, 26, 17, 11, 9, 14, 20, 23, 19, 9, 6, 7, 23, 13, 11, 11, 17, 12,
+ 8, 12, 11, 10, 13, 20, 7, 35, 36, 5, 24, 20, 28, 23, 10, 12, 20, 72, 13,
+ 19, 16, 8, 18, 12, 13, 17, 7, 18, 52, 17, 16, 15, 5, 23, 11, 13, 12, 9, 9,
+ 5, 8, 28, 22, 35, 45, 48, 43, 13, 31, 7, 10, 10, 9, 8, 18, 19, 2, 29, 176,
+ 7, 8, 9, 4, 8, 5, 6, 5, 6, 8, 8, 3, 18, 3, 3, 21, 26, 9, 8, 24, 13, 10, 7,
+ 12, 15, 21, 10, 20, 14, 9, 6,
+ // Proverbs
+ 33, 22, 35, 27, 23, 35, 27, 36, 18, 32, 31, 28, 25, 35, 33, 33, 28, 24, 29,
+ 30, 31, 29, 35, 34, 28, 28, 27, 28, 27, 33, 31,
+ // Ecclesiastes
+ 18, 26, 22, 16, 20, 12, 29, 17, 18, 20, 10, 14,
+ // Song of Solomon
+ 17, 17, 11, 16, 16, 13, 13, 14,
+ // Isaiah
+ 31, 22, 26, 6, 30, 13, 25, 22, 21, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6,
+ 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8,
+ 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21,
+ 14, 21, 22, 11, 12, 19, 12, 25, 24,
+ // Jeremiah
+ 19, 37, 25, 31, 31, 30, 34, 22, 26, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15,
+ 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21,
+ 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34,
+ // Lamentations
+ 22, 22, 66, 22, 22,
+ // Ezekiel
+ 28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14,
+ 49, 32, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28,
+ 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35,
+ // Daniel
+ 21, 49, 30, 37, 31, 28, 28, 27, 27, 21, 45, 13,
+ // Hosea
+ 11, 23, 5, 19, 15, 11, 16, 14, 17, 15, 12, 14, 16, 9,
+ // Joel
+ 20, 32, 21,
+ // Amos
+ 15, 16, 15, 13, 27, 14, 17, 14, 15,
+ // Obadiah
+ 21,
+ // Jonah
+ 17, 10, 10, 11,
+ // Micah
+ 16, 13, 12, 13, 15, 16, 20,
+ // Nahum
+ 15, 13, 19,
+ // Habakkuk
+ 17, 20, 19,
+ // Zephaniah
+ 18, 15, 20,
+ // Haggai
+ 15, 23,
+ // Zechariah
+ 21, 13, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21,
+ // Malachi
+ 14, 17, 18, 6,
+ // -----------------------------------------------------------------
+ // Matthew
+ 25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30,
+ 34, 46, 46, 39, 51, 46, 75, 66, 20,
+ // Mark
+ 45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20,
+ // Luke
+ 80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48,
+ 47, 38, 71, 56, 53,
+ // John
+ 51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42,
+ 31, 25,
+ // Acts
+ 26, 47, 26, 37, 42, 15, 60, 40, 43, 48, 30, 25, 52, 28, 41, 40, 34, 28, 41,
+ 38, 40, 30, 35, 27, 27, 32, 44, 31,
+ // Romans
+ 32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27,
+ // I Corinthians
+ 31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24,
+ // II Corinthians
+ 24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 14,
+ // Galatians
+ 24, 21, 29, 31, 26, 18,
+ // Ephesians
+ 23, 22, 21, 32, 33, 24,
+ // Philippians
+ 30, 30, 21, 23,
+ // Colossians
+ 29, 23, 25, 18,
+ // I Thessalonians
+ 10, 20, 13, 18, 28,
+ // II Thessalonians
+ 12, 17, 18,
+ // I Timothy
+ 20, 15, 16, 16, 25, 21,
+ // II Timothy
+ 18, 26, 17, 22,
+ // Titus
+ 16, 15, 15,
+ // Philemon
+ 25,
+ // Hebrews
+ 14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25,
+ // James
+ 27, 26, 18, 17, 20,
+ // I Peter
+ 25, 25, 22, 19, 14,
+ // II Peter
+ 21, 22, 18,
+ // I John
+ 10, 29, 24, 21, 21,
+ // II John
+ 13,
+ // III John
+ 14,
+ // Jude
+ 25,
+ // Revelation of John
+ 20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 17, 18, 20, 8, 21, 18, 24, 21,
+ 15, 27, 21
+};
+
+
+long
+ VerseKey::otbks[] = {
+ 0, 1, 52, 93, 121, 158,
+ 193, 218, 240, 245, 277, 302, 325,
+ 351, 381, 418, 429, 443, 454, 497,
+ 648, 680, 693, 702, 769, 822, 828,
+ 877, 890, 905, 909, 919, 921, 926,
+ 934, 938, 942, 946, 949, 964
+};
+
+long
+ VerseKey::otcps[] = {
+ 0, 2, 3, 35, 61, 86,
+ 113, 146, 169, 194, 217, 247, 280,
+ 313, 334, 353, 378, 400, 417, 445,
+ 479, 518, 537, 572, 597, 618, 686,
+ 721, 757, 804, 827, 863, 907, 963,
+ 996, 1017, 1049, 1079, 1123, 1160, 1191,
+ 1215, 1239, 1297, 1336, 1371, 1406, 1435,
+ 1470, 1502, 1525, 1559, 1586, 1587, 1610,
+ 1636, 1659, 1691, 1715, 1746, 1772, 1805,
+ 1841, 1871, 1882, 1934, 1957, 1989, 2017,
+ 2054, 2071, 2099, 2125, 2152, 2189, 2221,
+ 2255, 2274, 2315, 2353, 2375, 2419, 2466,
+ 2505, 2524, 2560, 2584, 2620, 2656, 2695,
+ 2725, 2757, 2801, 2840, 2841, 2859, 2876,
+ 2894, 2930, 2950, 2981, 3020, 3057, 3082,
+ 3103, 3151, 3160, 3220, 3278, 3312, 3347,
+ 3364, 3395, 3433, 3461, 3486, 3520, 3565,
+ 3589, 3645, 3692, 3727, 3728, 3783, 3818,
+ 3870, 3920, 3952, 3980, 4070, 4097, 4121,
+ 4158, 4194, 4211, 4245, 4291, 4333, 4384,
+ 4398, 4431, 4454, 4484, 4520, 4562, 4593,
+ 4619, 4638, 4704, 4728, 4760, 4801, 4818,
+ 4873, 4916, 4973, 5003, 5038, 5052, 5053,
+ 5100, 5138, 5168, 5218, 5252, 5278, 5305,
+ 5326, 5356, 5379, 5412, 5445, 5464, 5494,
+ 5518, 5541, 5562, 5585, 5607, 5628, 5652,
+ 5683, 5709, 5732, 5752, 5772, 5799, 5868,
+ 5898, 5919, 5950, 6003, 6033, 6046, 6047,
+ 6066, 6091, 6109, 6134, 6150, 6178, 6205,
+ 6241, 6269, 6313, 6337, 6362, 6396, 6412,
+ 6476, 6487, 6506, 6535, 6587, 6597, 6643,
+ 6678, 6695, 6729, 6730, 6767, 6791, 6823,
+ 6848, 6880, 6921, 6947, 6983, 7041, 7060,
+ 7101, 7117, 7143, 7164, 7185, 7217, 7231,
+ 7263, 7294, 7343, 7369, 7370, 7393, 7417,
+ 7436, 7459, 7460, 7489, 7526, 7548, 7571,
+ 7584, 7606, 7624, 7647, 7675, 7703, 7719,
+ 7745, 7769, 7822, 7858, 7882, 7941, 7972,
+ 7997, 8040, 8056, 8080, 8110, 8133, 8178,
+ 8204, 8217, 8243, 8255, 8287, 8301, 8302,
+ 8330, 8363, 8403, 8416, 8442, 8466, 8496,
+ 8515, 8529, 8549, 8577, 8609, 8649, 8683,
+ 8721, 8745, 8775, 8809, 8853, 8880, 8903,
+ 8955, 8995, 9021, 9022, 9076, 9123, 9152,
+ 9187, 9206, 9245, 9297, 9364, 9393, 9423,
+ 9467, 9501, 9536, 9568, 9603, 9638, 9663,
+ 9710, 9732, 9776, 9806, 9860, 9861, 9880,
+ 9906, 9934, 9979, 10007, 10041, 10062, 10092,
+ 10130, 10167, 10189, 10211, 10237, 10267, 10306,
+ 10327, 10369, 10407, 10445, 10467, 10494, 10515,
+ 10553, 10574, 10605, 10606, 10661, 10717, 10742,
+ 10786, 10813, 10895, 10936, 10977, 11022, 11037,
+ 11085, 11126, 11141, 11159, 11189, 11233, 11261,
+ 11279, 11299, 11308, 11339, 11359, 11392, 11424,
+ 11456, 11489, 11524, 11546, 11577, 11578, 11596,
+ 11615, 11633, 11656, 11671, 11714, 11737, 11756,
+ 11788, 11808, 11832, 11849, 11872, 11888, 11908,
+ 11923, 11943, 11978, 11990, 12028, 12049, 12062,
+ 12084, 12112, 12141, 12165, 12175, 12203, 12240,
+ 12268, 12290, 12324, 12350, 12384, 12412, 12436,
+ 12437, 12449, 12520, 12534, 12559, 12577, 12600,
+ 12629, 12666, 12682, 12727, 12728, 12740, 12761,
+ 12794, 12818, 12838, 12858, 12932, 12951, 12990,
+ 13030, 13067, 13115, 13147, 13148, 13171, 13195,
+ 13211, 13229, 13244, 13259, 13270, 13288, 13321,
+ 13325, 13326, 13349, 13363, 13390, 13412, 13440,
+ 13471, 13493, 13516, 13552, 13575, 13596, 13622,
+ 13651, 13674, 13710, 13733, 13750, 13772, 13802,
+ 13832, 13867, 13898, 13916, 13942, 13949, 13964,
+ 13988, 14017, 14043, 14075, 14116, 14139, 14173,
+ 14211, 14228, 14262, 14287, 14329, 14360, 14385,
+ 14420, 14438, 14439, 14446, 14459, 14468, 14477,
+ 14490, 14501, 14519, 14529, 14550, 14569, 14577,
+ 14586, 14593, 14601, 14607, 14619, 14635, 14686,
+ 14701, 14711, 14725, 14757, 14764, 14775, 14798,
+ 14811, 14826, 14836, 14848, 14861, 14886, 14898,
+ 14921, 14944, 14973, 14986, 15027, 15050, 15064,
+ 15082, 15096, 15108, 15114, 15141, 15159, 15171,
+ 15181, 15196, 15217, 15241, 15261, 15271, 15278,
+ 15286, 15310, 15324, 15336, 15348, 15366, 15379,
+ 15388, 15401, 15413, 15424, 15438, 15459, 15467,
+ 15503, 15540, 15546, 15571, 15592, 15621, 15645,
+ 15656, 15669, 15690, 15763, 15777, 15797, 15814,
+ 15823, 15842, 15855, 15869, 15887, 15895, 15914,
+ 15967, 15985, 16002, 16018, 16024, 16048, 16060,
+ 16074, 16087, 16097, 16107, 16113, 16122, 16151,
+ 16174, 16210, 16256, 16305, 16349, 16363, 16395,
+ 16403, 16414, 16425, 16435, 16444, 16463, 16483,
+ 16486, 16516, 16693, 16701, 16710, 16720, 16725,
+ 16734, 16740, 16747, 16753, 16760, 16769, 16778,
+ 16782, 16801, 16805, 16809, 16831, 16858, 16868,
+ 16877, 16902, 16916, 16927, 16935, 16948, 16964,
+ 16986, 16997, 17018, 17033, 17043, 17050, 17051,
+ 17085, 17108, 17144, 17172, 17196, 17232, 17260,
+ 17297, 17316, 17349, 17381, 17410, 17436, 17472,
+ 17506, 17540, 17569, 17594, 17624, 17655, 17687,
+ 17717, 17753, 17788, 17817, 17846, 17874, 17903,
+ 17931, 17965, 17997, 17998, 18017, 18044, 18067,
+ 18084, 18105, 18118, 18148, 18166, 18185, 18206,
+ 18217, 18232, 18233, 18251, 18269, 18281, 18298,
+ 18315, 18329, 18343, 18358, 18359, 18391, 18414,
+ 18441, 18448, 18479, 18493, 18519, 18542, 18564,
+ 18599, 18616, 18623, 18646, 18679, 18689, 18704,
+ 18719, 18727, 18753, 18760, 18778, 18804, 18823,
+ 18847, 18860, 18882, 18896, 18926, 18951, 18985,
+ 18995, 19016, 19041, 19059, 19070, 19093, 19132,
+ 19155, 19164, 19196, 19226, 19252, 19281, 19310,
+ 19336, 19350, 19366, 19389, 19416, 19428, 19452,
+ 19468, 19481, 19499, 19513, 19526, 19548, 19563,
+ 19585, 19608, 19620, 19633, 19653, 19666, 19692,
+ 19717, 19718, 19738, 19776, 19802, 19834, 19866,
+ 19897, 19932, 19955, 19982, 20008, 20032, 20050,
+ 20078, 20101, 20123, 20145, 20173, 20197, 20213,
+ 20232, 20247, 20278, 20319, 20330, 20369, 20394,
+ 20417, 20435, 20468, 20493, 20534, 20579, 20606,
+ 20629, 20649, 20682, 20704, 20733, 20752, 20769,
+ 20788, 20811, 20825, 20856, 20862, 20891, 20899,
+ 20947, 20987, 21034, 21099, 21134, 21135, 21158,
+ 21181, 21248, 21271, 21294, 21295, 21324, 21335,
+ 21363, 21381, 21399, 21414, 21442, 21461, 21473,
+ 21496, 21522, 21551, 21575, 21599, 21608, 21672,
+ 21697, 21730, 21745, 21795, 21828, 21860, 21910,
+ 21938, 21956, 21978, 22015, 22042, 22064, 22091,
+ 22110, 22143, 22177, 22209, 22225, 22264, 22293,
+ 22317, 22347, 22397, 22424, 22445, 22473, 22505,
+ 22531, 22556, 22580, 22616, 22617, 22639, 22689,
+ 22720, 22758, 22790, 22819, 22848, 22876, 22904,
+ 22926, 22972, 22986, 22987, 22999, 23023, 23029,
+ 23049, 23065, 23077, 23094, 23109, 23127, 23143,
+ 23156, 23171, 23188, 23198, 23199, 23220, 23253,
+ 23275, 23276, 23292, 23309, 23325, 23339, 23367,
+ 23382, 23400, 23415, 23431, 23432, 23454, 23455,
+ 23473, 23484, 23495, 23507, 23508, 23525, 23539,
+ 23552, 23566, 23582, 23599, 23620, 23621, 23637,
+ 23651, 23671, 23672, 23690, 23711, 23731, 23732,
+ 23751, 23767, 23788, 23789, 23805, 23829, 23830,
+ 23852, 23866, 23877, 23892, 23904, 23920, 23935,
+ 23959, 23977, 23990, 24008, 24023, 24033, 24055,
+ 24056, 24071, 24089, 24108
+};
+
+long
+ VerseKey::ntbks[] = {
+ 0, 1, 30, 47, 72, 94,
+ 123, 140, 157, 171, 178, 185, 190,
+ 195, 201, 205, 212, 217, 221, 223,
+ 237, 243, 249, 253, 259, 261, 263,
+ 265
+};
+
+long
+ VerseKey::ntcps[] = {
+ 0, 2, 3, 29, 53, 71,
+ 97, 146, 181, 211, 246, 285, 328,
+ 359, 410, 469, 506, 546, 575, 603,
+ 639, 670, 705, 752, 799, 839, 891,
+ 938, 1014, 1081, 1102, 1103, 1149, 1178,
+ 1214, 1256, 1300, 1357, 1395, 1434, 1485,
+ 1538, 1572, 1617, 1655, 1728, 1776, 1797,
+ 1798, 1879, 1932, 1971, 2016, 2056, 2106,
+ 2157, 2214, 2277, 2320, 2375, 2435, 2471,
+ 2507, 2540, 2572, 2610, 2654, 2703, 2751,
+ 2790, 2862, 2919, 2973, 2974, 3026, 3052,
+ 3089, 3144, 3192, 3264, 3318, 3378, 3420,
+ 3463, 3521, 3572, 3611, 3643, 3671, 3705,
+ 3732, 3773, 3816, 3848, 3874, 3875, 3902,
+ 3950, 3977, 4015, 4058, 4074, 4135, 4176,
+ 4220, 4269, 4300, 4326, 4379, 4408, 4450,
+ 4491, 4526, 4555, 4597, 4636, 4677, 4708,
+ 4744, 4772, 4800, 4833, 4878, 4910, 4911,
+ 4944, 4974, 5006, 5032, 5054, 5078, 5104,
+ 5144, 5178, 5200, 5237, 5259, 5274, 5298,
+ 5332, 5360, 5361, 5393, 5410, 5434, 5456,
+ 5470, 5491, 5532, 5546, 5574, 5608, 5643,
+ 5675, 5689, 5730, 5789, 5814, 5815, 5840,
+ 5858, 5877, 5896, 5918, 5937, 5954, 5979,
+ 5995, 6014, 6048, 6070, 6085, 6086, 6111,
+ 6133, 6163, 6195, 6222, 6241, 6242, 6266,
+ 6289, 6311, 6344, 6378, 6403, 6404, 6435,
+ 6466, 6488, 6512, 6513, 6543, 6567, 6593,
+ 6612, 6613, 6624, 6645, 6659, 6678, 6707,
+ 6708, 6721, 6739, 6758, 6759, 6780, 6796,
+ 6813, 6830, 6856, 6878, 6879, 6898, 6925,
+ 6943, 6966, 6967, 6984, 7000, 7016, 7017,
+ 7043, 7044, 7059, 7078, 7098, 7115, 7130,
+ 7151, 7180, 7194, 7223, 7263, 7304, 7334,
+ 7360, 7361, 7389, 7416, 7435, 7453, 7474,
+ 7475, 7501, 7527, 7550, 7570, 7585, 7586,
+ 7608, 7631, 7650, 7651, 7662, 7692, 7717,
+ 7739, 7761, 7762, 7776, 7777, 7792, 7793,
+ 7819, 7820, 7841, 7871, 7894, 7906, 7921,
+ 7939, 7957, 7971, 7993, 8005, 8025, 8043,
+ 8062, 8083, 8092, 8114, 8133, 8158, 8180,
+ 8196, 8224
+};
+
+
+int
+ VerseKey::offsize[2][2] =
+ { {sizeof (VerseKey::otbks) / 4, sizeof (VerseKey::otcps) / 4}
+, {sizeof (VerseKey::ntbks) / 4, sizeof (VerseKey::ntcps) / 4}
+};
diff --git a/include/cipherfil.h b/include/cipherfil.h
new file mode 100644
index 0000000..76abd55
--- /dev/null
+++ b/include/cipherfil.h
@@ -0,0 +1,38 @@
+/*
+ *
+ * $Id: cipherfil.h,v 1.8 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef CIPHERFIL_H
+#define CIPHERFIL_H
+
+#include <swfilter.h>
+#include <swcipher.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT CipherFilter:public SWFilter {
+ SWCipher *cipher;
+public:
+ CipherFilter(const char *key);
+ virtual ~CipherFilter();
+ virtual char ProcessText(char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+ virtual SWCipher *getCipher();
+};
+
+#endif
diff --git a/include/defs.h b/include/defs.h
new file mode 100644
index 0000000..b22ed8a
--- /dev/null
+++ b/include/defs.h
@@ -0,0 +1,76 @@
+// ----------------------------------------------------------------------------
+// Making or using sword as a Windows DLL
+// ----------------------------------------------------------------------------
+
+#define FILTERPAD 80
+
+#if defined(__SWMSW__)
+
+// _declspec works in BC++ 5 and later, as well as VC++
+#if defined(_MSC_VER)
+
+# ifdef SWMAKINGDLL
+# define SWDLLEXPORT _declspec( dllexport )
+# define SWDLLEXPORT_DATA(type) _declspec( dllexport ) type
+# define SWDLLEXPORT_CTORFN
+# elif defined(SWUSINGDLL)
+# define SWDLLEXPORT _declspec( dllimport )
+# define SWDLLEXPORT_DATA(type) _declspec( dllimport ) type
+# define SWDLLEXPORT_CTORFN
+# else
+# define SWDLLEXPORT
+# define SWDLLEXPORT_DATA(type) type
+# define SWDLLEXPORT_CTORFN
+# endif
+
+#elif defined(__SWPM__)
+
+# ifdef SWMAKINGDLL
+# define SWDLLEXPORT _Export
+# define SWDLLEXPORT_DATA(type) _Export type
+# define SWDLLEXPORT_CTORFN
+# elif defined(SWUSINGDLL)
+# define SWDLLEXPORT _Export
+# define SWDLLEXPORT_DATA(type) _Export type
+# define SWDLLEXPORT_CTORFN
+# else
+# define SWDLLEXPORT
+# define SWDLLEXPORT_DATA(type) type
+# define SWDLLEXPORT_CTORFN
+# endif
+
+#elif defined(__GNUWIN32__) || defined(__BORLANDC__)
+
+# ifdef SWMAKINGDLL
+# define SWDLLEXPORT __declspec( dllexport )
+# define SWDLLEXPORT_DATA(type) __declspec( dllexport ) type
+# define SWDLLEXPORT_CTORFN
+# elif defined(SWUSINGDLL)
+# define SWDLLEXPORT __declspec( dllimport )
+# define SWDLLEXPORT_DATA(type) __declspec( dllimport ) type
+# define SWDLLEXPORT_CTORFN
+# else
+# define SWDLLEXPORT
+# define SWDLLEXPORT_DATA(type) type
+# define SWDLLEXPORT_CTORFN
+# endif
+
+
+#else
+# define SWDLLEXPORT
+# define SWDLLEXPORT_DATA(type) type
+# define SWDLLEXPORT_CTORFN
+#endif
+
+#else // !Windows
+# define SWDLLEXPORT
+# define SWDLLEXPORT_DATA(type) type
+# define SWDLLEXPORT_CTORFN
+#endif // Win/!Win
+
+// For ostream, istream ofstream
+#if defined(__BORLANDC__) && defined( _RTLDLL )
+# define SWDLLIMPORT __import
+#else
+# define SWDLLIMPORT
+#endif
diff --git a/include/echomod.h b/include/echomod.h
new file mode 100644
index 0000000..44bedab
--- /dev/null
+++ b/include/echomod.h
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * echomod.h - code for class 'EchoMod' - a test module that just echo back
+ * text of key.
+ *
+ * $Id: echomod.h,v 1.2 2001/02/09 15:38:51 jansorg Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef ECHOMOD_H
+#define ECHOMOD_H
+
+#include <swtext.h>
+#include <versekey.h>
+
+class EchoMod:public SWText
+{
+public:
+ EchoMod ();
+ virtual ~ EchoMod ();
+ virtual operator const char *();
+};
+
+
+#endif
diff --git a/include/encfiltmgr.h b/include/encfiltmgr.h
new file mode 100644
index 0000000..f082b98
--- /dev/null
+++ b/include/encfiltmgr.h
@@ -0,0 +1,85 @@
+/******************************************************************************
+ * swencodingmgr.h - definition of class SWEncodingMgr, subclass of
+ * used to transcode all module text to a requested
+ * markup.
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef ENCFILTERMGR_H
+#define ENCFILTERMGR_H
+
+#include <swfiltermgr.h>
+
+
+/** This class is like a normal @ref SWMgr,
+ * but you can additonally specify which encoding
+ * you want to use.
+ */
+
+class SWDLLEXPORT EncodingFilterMgr : public SWFilterMgr {
+
+protected:
+ SWFilter *latin1utf8;
+ SWFilter *scsuutf8;
+ SWFilter *targetenc;
+
+
+ /*
+ * current encoding value
+ */
+ char encoding;
+
+public:
+
+
+ /** Constructor of SWEncodingMgr.
+ *
+ * @param iconfig
+ * @param isysconfig
+ * @param autoload If this bool is true the constructor starts loading the installed modules. If you reimplemented SWMgr you can set autoload=false to load the modules with your own reimplemented function.
+ * @param encoding The desired encoding.
+ */
+ EncodingFilterMgr (char encoding = ENC_UTF8);
+
+ /**
+ * The destructor of SWEncodingMgr.
+ */
+ ~EncodingFilterMgr();
+
+ /** Markup sets/gets the encoding after initialization
+ *
+ * @param m 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);
+
+ /**
+ * 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);
+
+ /**
+ * 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);
+};
+
+#endif
diff --git a/include/entriesblk.h b/include/entriesblk.h
new file mode 100644
index 0000000..fe7ac1c
--- /dev/null
+++ b/include/entriesblk.h
@@ -0,0 +1,30 @@
+#ifndef ENTRIESBLK_H
+#define ENTRIESBLK_H
+
+#include <sysdata.h>
+
+class EntriesBlock {
+ static const int METAHEADERSIZE;
+ static const int METAENTRYSIZE;
+
+private:
+ char *block;
+ void setCount(int count);
+ void getMetaEntry(int index, unsigned long *offset, unsigned long *size);
+ void setMetaEntry(int index, unsigned long offset, unsigned long size);
+
+public:
+ EntriesBlock(const char *iBlock, unsigned long size);
+ EntriesBlock();
+ ~EntriesBlock();
+
+ int getCount();
+ int addEntry(const char *entry);
+ const char *getEntry(int entryIndex);
+ unsigned long getEntrySize(int entryIndex);
+ void removeEntry(int entryIndex);
+ const char *getRawData(unsigned long *size);
+};
+
+
+#endif
diff --git a/include/femain.h b/include/femain.h
new file mode 100644
index 0000000..aee607e
--- /dev/null
+++ b/include/femain.h
@@ -0,0 +1,32 @@
+/*
+ *
+ * $Id: femain.h,v 1.3 2001/02/21 05:53:00 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef FEMAIN_H
+#define FEMAIN_H
+
+class FEMain
+{
+public:
+ FEMain ();
+ virtual ~FEMain ();
+ list < SWDisplay * >displays; // so we can delete each display we create
+};
+
+#endif
diff --git a/include/filemgr.h b/include/filemgr.h
new file mode 100644
index 0000000..111f916
--- /dev/null
+++ b/include/filemgr.h
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * filemgr.h - definition of class FileMgr used for pooling file handles
+ *
+ * $Id: filemgr.h,v 1.14 2002/03/13 06:55:39 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef FILEMGR_H
+#define FILEMGR_H
+
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT FileMgr;
+
+class SWDLLEXPORT FileDesc
+{
+
+ friend class FileMgr;
+
+ long offset;
+ int fd; // -77 closed;
+ FileMgr *parent;
+ FileDesc *next;
+
+public:
+ FileDesc (FileMgr * parent, char *path, int mode, int perms, bool tryDowngrade);
+ virtual ~FileDesc ();
+ int getFd ();
+ char *path;
+ int mode;
+ int perms;
+ bool tryDowngrade;
+};
+
+
+class FileMgr
+{
+
+ friend class FileDesc;
+
+ FileDesc *files;
+ int sysOpen (FileDesc * file);
+public:
+
+ FileMgr (int maxFiles = 35);
+ ~FileMgr ();
+ FileDesc *open (char *path, int mode, bool tryDowngrade);
+ FileDesc *open (char *path, int mode, int perms = S_IREAD | S_IWRITE, bool tryDowngrade = false);
+ void close (FileDesc *);
+
+ static signed char existsFile (const char *ipath, const char *ifileName = 0);
+ static signed char existsDir (const char *ipath, const char *idirName = 0);
+ // to truncate a file at its current position
+ // leaving byte at current possition intact
+ // deleting everything afterward.
+ signed char trunc (FileDesc *);
+
+ int maxFiles;
+ static FileMgr systemFileMgr;
+};
+
+
+
+
+#endif
diff --git a/include/flatapi.h b/include/flatapi.h
new file mode 100644
index 0000000..029d851
--- /dev/null
+++ b/include/flatapi.h
@@ -0,0 +1,78 @@
+#ifndef SWORDAPI_H
+#define SWORDAPI_H
+
+#include <swmodule.h>
+#include <swkey.h>
+#include <versekey.h>
+#include <swmgr.h>
+
+#ifdef __cplusplus
+#endif
+
+extern "C" {
+
+#define SWHANDLE int
+
+typedef struct {
+ ModMap::iterator it;
+ ModMap::iterator end;
+} ModItType;
+
+//-----------------------------------------------------------------
+// stringlist_iterator methods
+
+void stringlist_iterator_next(SWHANDLE hsli);
+const char *stringlist_iterator_val(SWHANDLE hsli);
+
+
+//-----------------------------------------------------------------
+// modmap methods
+//
+void ModList_iterator_next(SWHANDLE hmmi);
+SWHANDLE ModList_iterator_val(SWHANDLE hmmi);
+
+
+//-----------------------------------------------------------------
+// SWMgr methods
+//
+SWHANDLE SWMgr_new();
+// SWConfig *, SWConfig *, bool, SWFilterMgr *
+SWHANDLE SWMgr_newEx(SWHANDLE hiconfig, SWHANDLE hisysconfig, char autoload, SWHANDLE hfilterMgr);
+void SWMgr_delete(SWHANDLE hmgr);
+SWHANDLE SWMgr_getConfig(SWHANDLE hmgr);
+SWHANDLE SWMgr_getModulesIterator(SWHANDLE hmgr);
+SWHANDLE SWMgr_getModuleByName(SWHANDLE hmgr, const char *name);
+const char * SWMgr_getPrefixPath(SWHANDLE hmgr);
+const char * SWMgr_getConfigPath(SWHANDLE hmgr);
+void SWMgr_setGlobalOption(SWHANDLE hmgr, const char *option, const char *value);
+const char * SWMgr_getGlobalOption(SWHANDLE hmgr, const char *option);
+const char * SWMgr_getGlobalOptionTip(SWHANDLE hmgr, const char *option);
+// ret: forward_iterator
+SWHANDLE SWMgr_getGlobalOptionsIterator(SWHANDLE hmgr);
+// ret: forward_iterator
+SWHANDLE SWMgr_getGlobalOptionValuesIterator(SWHANDLE hmgr, const char *option);
+void SWMgr_setCipherKey(SWHANDLE hmgr, const char *modName, const char *key);
+
+
+//-----------------------------------------------------------------
+// SWModule methods
+
+void SWModule_terminateSearch(SWHANDLE hmodule);
+char SWModule_error(SWHANDLE hmodule);
+int SWModule_getEntrySize(SWHANDLE hmodule);
+void SWModule_setKeyText(SWHANDLE hmodule, const char *key);
+const char *SWModule_getKeyText(SWHANDLE hmodule);
+const char *SWModule_getName(SWHANDLE hmodule);
+const char *SWModule_getDescription(SWHANDLE hmodule);
+const char *SWModule_getType(SWHANDLE hmodule);
+void SWModule_previous(SWHANDLE hmodule);
+void SWModule_next(SWHANDLE hmodule);
+void SWModule_begin(SWHANDLE hmodule);
+const char *SWModule_getStripText(SWHANDLE hmodule);
+const char *SWModule_getRenderText(SWHANDLE hmodule);
+
+}
+#ifdef __cplusplus
+#endif
+
+#endif
diff --git a/include/gbffootnotes.h b/include/gbffootnotes.h
new file mode 100644
index 0000000..4262538
--- /dev/null
+++ b/include/gbffootnotes.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id: gbffootnotes.h,v 1.9 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef GBFFOOTNOTES_H
+#define GBFFOOTNOTES_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+/** This Filter shows/hides footnotes in a GBF text
+ */
+class SWDLLEXPORT GBFFootnotes:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ GBFFootnotes ();
+ virtual ~ GBFFootnotes ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/gbfheadings.h b/include/gbfheadings.h
new file mode 100644
index 0000000..da86a33
--- /dev/null
+++ b/include/gbfheadings.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id: gbfheadings.h,v 1.2 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef GBFHEADINGS_H
+#define GBFHEADINGS_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides headings in a GBF text
+ */
+class SWDLLEXPORT GBFHeadings:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ GBFHeadings ();
+ virtual ~ GBFHeadings ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/gbfhtml.h b/include/gbfhtml.h
new file mode 100644
index 0000000..40805aa
--- /dev/null
+++ b/include/gbfhtml.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ gbfhtml.h - description
+ -------------------
+ begin : Tue Jun 15 15:34:26 CEST 1999
+
+ copyright : (C) 1999 by Torsten Uhlmann
+ email : TUhlmann@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/* $Header: /usr/local/cvsroot/sword/include/gbfhtml.h,v 1.8 2001/12/11 22:35:10 scribe Exp $ */
+/* $Revision: 1.8 $ */
+
+#ifndef GBFHTML_H
+#define GBFHTML_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+/** This filter converts GBF Text into HTML
+ */
+class SWDLLEXPORT GBFHTML:public SWFilter
+{
+public:
+ GBFHTML ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/gbfhtmlhref.h b/include/gbfhtmlhref.h
new file mode 100644
index 0000000..77952a4
--- /dev/null
+++ b/include/gbfhtmlhref.h
@@ -0,0 +1,33 @@
+/*-*************************************************************************
+ gbfhtmlhref.h - description
+ -------------------
+ begin : 2001-09-03
+ copyright : 2001 by CrossWire Bible Society
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef GBFHTMLHREF_H
+#define GBFHTMLHREF_H
+
+#include <swbasicfilter.h>
+
+#include <defs.h>
+
+/** this filter converts GBF text to HTML text with hrefs
+ */
+class SWDLLEXPORT GBFHTMLHREF : public SWBasicFilter {
+protected:
+ virtual bool handleToken(char **buf, const char *token, DualStringMap &userData);
+public:
+ GBFHTMLHREF ();
+};
+
+#endif
diff --git a/include/gbfmorph.h b/include/gbfmorph.h
new file mode 100644
index 0000000..f57b3cc
--- /dev/null
+++ b/include/gbfmorph.h
@@ -0,0 +1,57 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef GBFMORPH_H
+#define GBFMORPH_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides morph tags in a GBF text
+ */
+class SWDLLEXPORT GBFMorph:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ GBFMorph ();
+ virtual ~ GBFMorph ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/gbfosis.h b/include/gbfosis.h
new file mode 100644
index 0000000..f0eb311
--- /dev/null
+++ b/include/gbfosis.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ gbfosis.h - description
+ -------------------
+ begin : 2001-09-03
+ copyright : 2001 by CrossWire Bible Society
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef GBFOSIS_H
+#define GBFOSIS_H
+
+#include <defs.h>
+#include <swfilter.h>
+
+/** this filter converts GBF text to HTML text with hrefs
+ */
+class SWDLLEXPORT GBFOSIS : public SWFilter {
+protected:
+ virtual const char *convertToOSIS(const char *, const SWKey *key);
+ void pushString(char **buf, const char *format, ...);
+public:
+ GBFOSIS();
+ virtual ~GBFOSIS();
+ char ProcessText(char *text, int maxlen, const SWKey *, const SWModule * = 0);
+};
+
+#endif /* THMLOSIS_H */
diff --git a/include/gbfplain.h b/include/gbfplain.h
new file mode 100644
index 0000000..5e24957
--- /dev/null
+++ b/include/gbfplain.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * $Id: gbfplain.h,v 1.8 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef GBFPLAIN_H
+#define GBFPLAIN_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts GBF text into plain text
+ */
+class SWDLLEXPORT GBFPlain:public SWFilter
+{
+public:
+ GBFPlain ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/gbfrtf.h b/include/gbfrtf.h
new file mode 100644
index 0000000..f0bbbd6
--- /dev/null
+++ b/include/gbfrtf.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * $Id: gbfrtf.h,v 1.7 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef GBFRTF_H
+#define GBFRTF_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts GBF text into RTF text
+ */
+class SWDLLEXPORT GBFRTF:public SWFilter
+{
+public:
+ GBFRTF ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/gbfstrongs.h b/include/gbfstrongs.h
new file mode 100644
index 0000000..d23e267
--- /dev/null
+++ b/include/gbfstrongs.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id: gbfstrongs.h,v 1.8 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef GBFSTRONGS_H
+#define GBFSTRONGS_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides strong's numbers in a GBF text
+ */
+class SWDLLEXPORT GBFStrongs:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ GBFStrongs ();
+ virtual ~ GBFStrongs ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/gbfthml.h b/include/gbfthml.h
new file mode 100644
index 0000000..f09cf92
--- /dev/null
+++ b/include/gbfthml.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+ gbfthml.h - description
+ -------------------
+ begin : 1999-10-28
+ copyright : 1999 by Chris Little
+ email : chrislit@chiasma.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef GBFTHML_H
+#define GBFTHML_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts GBF text into ThML text
+ */
+class SWDLLEXPORT GBFThML:public SWFilter
+{
+public:
+ GBFThML ();
+ virtual char ProcessText (char *text, int maxlen = -1);
+};
+
+#endif
diff --git a/include/greeklexattribs.h b/include/greeklexattribs.h
new file mode 100644
index 0000000..759aa6d
--- /dev/null
+++ b/include/greeklexattribs.h
@@ -0,0 +1,36 @@
+/*
+ *
+ * thmlplain.h
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef GREEKLEXATTRIBS_H
+#define GREEKLEXATTRIBS_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts ThML text to plain text
+ */
+class SWDLLEXPORT GreekLexAttribs:public SWFilter {
+public:
+ GreekLexAttribs();
+ virtual char ProcessText(char *text, int maxlen, const SWKey *, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/hebrewmcim.h b/include/hebrewmcim.h
new file mode 100644
index 0000000..c601751
--- /dev/null
+++ b/include/hebrewmcim.h
@@ -0,0 +1,29 @@
+#ifndef HEBREWMCIM_H
+#define HEBREWMCIM_H
+
+/**
+ * Title: Keyboard mapping for Michigan-Claremont Hebrew input
+ * Description:
+ * Copyright: Copyright (c) 2001 CrossWire Bible Society under the terms of the GNU GPL
+ * Company:
+ * @author Troy A. Griffitts
+ * @version 1.0
+ */
+
+#include <swinputmeth.h>
+#include <map>
+using namespace std;
+
+class HebrewMCIM : public SWInputMethod {
+
+ void init();
+ int subst[255];
+ map<int, int> subst2[12];
+ map<int, int*> multiChars;
+
+public:
+ HebrewMCIM();
+ int *translate(char in);
+};
+
+#endif
diff --git a/include/hrefcom.h b/include/hrefcom.h
new file mode 100644
index 0000000..58b971b
--- /dev/null
+++ b/include/hrefcom.h
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * hrefcom.h - code for class 'HREFCom'- a module that produces HTML HREFs
+ * pointing to actual text desired. Uses standard
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ *
+ * $Id: hrefcom.h,v 1.6 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef HREFCOM_H
+#define HREFCOM_H
+
+#include <rawverse.h>
+#include <swcom.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT HREFCom:public RawVerse, public SWCom {
+ char *prefix;
+
+public:
+
+
+ HREFCom(const char *ipath, const char *prefix, const char *iname = 0,
+ const char *idesc = 0, SWDisplay * idisp = 0);
+ virtual ~HREFCom();
+ virtual char *getRawEntry();
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/latin1utf16.h b/include/latin1utf16.h
new file mode 100644
index 0000000..685adbc
--- /dev/null
+++ b/include/latin1utf16.h
@@ -0,0 +1,35 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef LATIN1UTF16_H
+#define LATIN1UTF16_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts Latin-1 encoded text to UTF-8
+ */
+class SWDLLEXPORT Latin1UTF16:public SWFilter {
+public:
+ Latin1UTF16();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/latin1utf8.h b/include/latin1utf8.h
new file mode 100644
index 0000000..9303d89
--- /dev/null
+++ b/include/latin1utf8.h
@@ -0,0 +1,35 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef LATIN1UTF8_H
+#define LATIN1UTF8_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts Latin-1 encoded text to UTF-8
+ */
+class SWDLLEXPORT Latin1UTF8:public SWFilter {
+public:
+ Latin1UTF8();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/listkey.h b/include/listkey.h
new file mode 100644
index 0000000..8f1c59c
--- /dev/null
+++ b/include/listkey.h
@@ -0,0 +1,119 @@
+/******************************************************************************
+ * listkey.h - code for base class 'listkey'. listkey is the basis for all
+ * types of keys for indexing into modules
+ * (e.g. verse, word,
+ * place, etc.)
+ *
+ * $Id: listkey.h,v 1.13 2001/08/09 10:39:51 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWLSTKEY_H
+#define SWLSTKEY_H
+
+#include <swkey.h>
+
+#include <defs.h>
+
+ /** ListKey is the basis for all
+ * types of keys that have lists of specified indexes
+ * (e.g. a list of verses, place, etc.)
+ */
+class SWDLLEXPORT ListKey : public SWKey {
+
+ static SWClass classdef;
+ void init ();
+protected:
+ int arraypos;
+ int arraymax;
+ int arraycnt;
+ SWKey **array;
+public:
+ /** initializes instance of ListKey
+ *
+ * @param ikey text key
+ */
+ ListKey (const char *ikey = 0);
+ ListKey (ListKey const &k);
+ /** cleans up instance of ListKey
+ */
+ virtual ~ ListKey ();
+
+ virtual SWKey *clone () const;
+ /** Clears out elements of list
+ */
+ virtual void ClearList ();
+ /** Returns number of elements in list
+ * @return number of elements in list
+ */
+ virtual int Count ();
+ /** Removes current element from list
+ */
+ virtual void Remove ();
+ /** Sets key to element number
+ *
+ * @param ielement element number to set to
+ * @return error status
+ */
+ virtual char SetToElement (int ielement, SW_POSITION = TOP);
+ /** Gets a key element number
+ *
+ * @param pos element number to get (or default current)
+ * @return Key or null on error
+ */
+ virtual SWKey *GetElement (int pos = -1);
+ /** Adds an element to the list
+ * @param ikey the element to add
+ */
+ ListKey & operator << (const SWKey &ikey) { add(ikey); return *this; }
+ virtual void add(const SWKey &ikey);
+
+ /** Equates this ListKey to another ListKey object
+ *
+ * @param ikey other ListKey object
+ */
+ virtual void copyFrom(const ListKey & ikey);
+ virtual void copyFrom(const SWKey & ikey) { SWKey::copyFrom(ikey); }
+
+ /** Positions this key
+ *
+ * @param p position
+ * @return *this
+ */
+ virtual void setPosition(SW_POSITION);
+ /** Decrements a number of elements
+ */
+ virtual void decrement(int step);
+ /** Increments a number of elements
+ */
+ virtual void increment(int step);
+
+ virtual char Traversable () { return 1; }
+ virtual long Index () const { return arraypos; }
+
+ /**
+ * Returns the index for the new one given as as parameter.
+ * The first parameter is the new index.
+ */
+ virtual long Index (long index) { SetToElement (index); return Index (); }
+
+ SWKEY_OPERATORS
+ ListKey & operator =(const ListKey &key) { copyFrom(key); return *this; }
+};
+
+
+#endif
diff --git a/include/localemgr.h b/include/localemgr.h
new file mode 100644
index 0000000..641f067
--- /dev/null
+++ b/include/localemgr.h
@@ -0,0 +1,114 @@
+/******************************************************************************
+ * localemgr.h - definition of class LocaleMgr used to interact with
+ * registered locales for a sword installation
+ *
+ * $Id: localemgr.h,v 1.9 2002/06/19 09:24:44 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef LOCALEMGR_H
+#define LOCALEMGR_H
+
+#include <string>
+#include <map>
+#include <list>
+#include <swconfig.h>
+#include <swlocale.h>
+
+#include <defs.h>
+
+using namespace std;
+
+typedef map < string, SWLocale *, less < string > >LocaleMap;
+
+/**
+* The LocaleMgr class handles all the different locales of Sword.
+* It provides functions to get a list of all available locales,
+* to get the default locale name and to get it.
+* The other functions are not interesting for frontend programmers.
+*
+* To get the default locale name use @see getDefaultLocaleName
+* To set the default locale name use @see setDefaultLocaleName
+* To get the locale for a language name use @see getLocale
+* To get a list of availble locales use @see getAvailableLocales
+*/
+class SWDLLEXPORT LocaleMgr
+{
+private:
+ void deleteLocales ();
+ char *defaultLocaleName;
+
+protected:
+ LocaleMap locales;
+
+public:
+ /** Default constructor of LocaleMgr
+ * You do normally not need this constructor, use LocaleMgr::systemLocaleMgr instead.
+ */
+ LocaleMgr (const char *iConfigPath = 0);
+
+ /**
+ * Default destructor of LocaleMgr
+ */
+ virtual ~ LocaleMgr ();
+
+ /** Get the locale connected with the name "name".
+ *
+ * @param name The name of the locale you want to have. For example use getLocale("de") to get the locale for the German language.
+ * @return Returns the locale object if the locale with the name given as parameter was found. If it wasn't found return NULL.
+ */
+ virtual SWLocale *getLocale (const char *name);
+
+ /** Get the list of available locales.
+ *
+ * @ret Returns a list of strings, which contains the names of the available locales.
+ */
+ virtual list < string > getAvailableLocales ();
+
+ /** Returns translated text.
+ * This function uses both parameters to return the translated version of the given text.
+ *
+ * @param The text to translate into the language given by the first parameter.
+ * @param localeName The name of the locale Sword should use
+ * @return Returns the translated text.
+ */
+ virtual const char *translate (const char *text, const char *localeName = 0);
+
+ /** Get the default locale name. To set it use @see setDefaultLocaleName
+ *
+ * @ret Returns the default locale name
+ */
+ virtual const char *getDefaultLocaleName ();
+
+ /** Set the new standard locale of Sword.
+ *
+ * @param name The name of the new default locale
+ */
+ virtual void setDefaultLocaleName (const char *name);
+
+ /** The LocaleMgr object used globally in the Sword world.
+ * Do not create your own LocaleMgr, use this static object instead.
+ */
+ static LocaleMgr systemLocaleMgr;
+
+
+ /** Augment this localmgr with all locale.conf files in a directory
+ */
+ virtual void loadConfigDir(const char *ipath);
+
+};
+#endif
diff --git a/include/lzsscomprs.h b/include/lzsscomprs.h
new file mode 100644
index 0000000..0f352e7
--- /dev/null
+++ b/include/lzsscomprs.h
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * lzsscomprs.h - definition of Class SWCompress used for data compression
+ *
+ * $Id: lzsscomprs.h,v 1.3 2001/02/09 15:38:51 jansorg Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef LZSSCOMPRS_H
+#define LZSSCOMPRS_H
+
+#include <swcomprs.h>
+
+#include <defs.h>
+
+// The following are constant sizes used by the compression algorithm.
+//
+// N - This is the size of the ring buffer. It is set
+// to 4K. It is important to note that a position
+// within the ring buffer requires 12 bits.
+//
+// F - This is the maximum length of a character sequence
+// that can be taken from the ring buffer. It is set
+// to 18. Note that a length must be 3 before it is
+// worthwhile to store a position/length pair, so the
+// length can be encoded in only 4 bits. Or, put yet
+// another way, it is not necessary to encode a length
+// of 0-18, it is necessary to encode a length of
+// 3-18, which requires 4 bits.
+//
+// THRESHOLD - It takes 2 bytes to store an offset and
+// a length. If a character sequence only
+// requires 1 or 2 characters to store
+// uncompressed, then it is better to store
+// it uncompressed than as an offset into
+// the ring buffer.
+//
+// Note that the 12 bits used to store the position and the 4 bits
+// used to store the length equal a total of 16 bits, or 2 bytes.
+
+#define N 4096
+#define F 18
+#define THRESHOLD 3
+#define NOT_USED N
+
+
+
+class SWDLLEXPORT LZSSCompress:public SWCompress
+{
+ static unsigned char m_ring_buffer[N + F - 1];
+ static short int m_match_position;
+ static short int m_match_length;
+ static short int m_lson[N + 1];
+ static short int m_rson[N + 257];
+ static short int m_dad[N + 1];
+ void InitTree ();
+ void InsertNode (short int Pos);
+ void DeleteNode (short int Node);
+public:
+ LZSSCompress ();
+ virtual ~ LZSSCompress ();
+ virtual void Encode (void);
+ virtual void Decode (void);
+};
+
+#endif
diff --git a/include/markupfiltmgr.h b/include/markupfiltmgr.h
new file mode 100644
index 0000000..7c9c3c5
--- /dev/null
+++ b/include/markupfiltmgr.h
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * swmarkupmgr.h - definition of class SWMarkupMgr, subclass of
+ * used to transcode all module text to a requested
+ * markup.
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef MARKUPFILTMGR_H
+#define MARKUPFILTMGR_H
+
+#include <encfiltmgr.h>
+
+/** This class is like a normal @ref SWEncodingMgr,
+ * but you can additonally specify which markup
+ * you want to use.
+ */
+class SWDLLEXPORT MarkupFilterMgr : public EncodingFilterMgr {
+protected:
+ SWFilter* fromthml;
+ SWFilter* fromgbf;
+ SWFilter* fromplain;
+ SWFilter* fromosis;
+
+ /*
+ * current markup value
+ */
+ char markup;
+
+ void CreateFilters(char markup);
+public:
+ /** Constructor of SWMarkupMgr.
+ *
+ * @param iconfig
+ * @param isysconfig
+ * @param autoload If this bool is true the constructor starts loading the installed modules. If you reimplemented SWMgr you can set autoload=false to load the modules with your own reimplemented function.
+ * @param encoding The desired encoding.
+ * @param markup The desired markup format.
+ */
+ MarkupFilterMgr(char markup = FMT_THML, char encoding = ENC_UTF8);
+
+ /**
+ * The destructor of SWMarkupMgr.
+ */
+ ~MarkupFilterMgr();
+
+ /** Markup sets/gets the markup after initialization
+ *
+ * @param m The new markup or FMT_UNKNOWN if you just want to get the current markup.
+ * @return The current (possibly changed) markup format.
+ */
+ char Markup(char m = FMT_UNKNOWN);
+
+ /**
+ * Adds the render filters which are defined in "section" to the SWModule object "module".
+ * @param module To this module the render filter(s) are added
+ * @param section We use this section to get a list of filters we should apply to the module
+ */
+ virtual void AddRenderFilters(SWModule *module, ConfigEntMap &section);
+};
+
+#endif
diff --git a/include/multimapwdef.h b/include/multimapwdef.h
new file mode 100644
index 0000000..fbab567
--- /dev/null
+++ b/include/multimapwdef.h
@@ -0,0 +1,31 @@
+#ifndef MULTIMAPWDEF
+#define MULTIMAPWDEF
+
+#include <map>
+
+using namespace std;
+
+// multmap that still lets you use [] to reference FIRST
+// entry of a key if multiples exist
+template <class Key, class T, class Compare>
+class multimapwithdefault : public multimap<Key, T, Compare> {
+public:
+ typedef pair<const Key, T> value_type;
+ T& operator[](const Key& k) {
+ if (find(k) == end()) {
+ insert(value_type(k, T()));
+ }
+ return (*(find(k))).second;
+ }
+ bool has(const Key& k, const T &val) const {
+ typename multimap<Key, T, Compare>::const_iterator start = lower_bound(k);
+ typename multimap<Key, T, Compare>::const_iterator end = upper_bound(k);
+ for (; start!=end; start++) {
+ if (start->second == val)
+ return true;
+ }
+ return false;
+ }
+};
+
+#endif
diff --git a/include/nullim.h b/include/nullim.h
new file mode 100644
index 0000000..ce72090
--- /dev/null
+++ b/include/nullim.h
@@ -0,0 +1,14 @@
+#ifndef NULLIM_H
+#define NULLIM_H
+
+#include <swinputmeth.h>
+
+
+class NullIM : public SWInputMethod {
+
+public:
+ NullIM();
+ int * translate(char ch);
+};
+
+#endif
diff --git a/include/plainfootnotes.h b/include/plainfootnotes.h
new file mode 100644
index 0000000..41ed3af
--- /dev/null
+++ b/include/plainfootnotes.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ plainfootnotes.h - description
+ -------------------
+ begin : Wed Oct 13 1999
+ copyright : (C) 1999 by The team of BibleTime
+ email : info@bibletime.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/* $Header: /usr/local/cvsroot/sword/include/plainfootnotes.h,v 1.4 2001/12/11 22:35:10 scribe Exp $ */
+/* $Revision: 1.4 $ */
+
+#ifndef PLAINFOOTNOTES_H
+#define PLAINFOOTNOTES_H
+
+#include <defs.h>
+
+class QObject;
+#include <swfilter.h>
+class SWKey;
+
+/**Shows or hides footnotes in plain text.
+ *@author The team of BibleTime
+ */
+class SWDLLEXPORT PLAINFootnotes:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+
+public:
+ PLAINFootnotes ();
+ virtual ~ PLAINFootnotes ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/plainhtml.h b/include/plainhtml.h
new file mode 100644
index 0000000..d0eb547
--- /dev/null
+++ b/include/plainhtml.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ rwphtml.h - description
+ -------------------
+ begin : Tue Jun 15 15:34:26 CEST 1999
+
+ copyright : (C) 1999 by Torsten Uhlmann
+ email : TUhlmann@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/* $Header: /usr/local/cvsroot/sword/include/plainhtml.h,v 1.7 2001/12/11 22:35:10 scribe Exp $ */
+/* $Revision: 1.7 $ */
+
+#ifndef PLAINHTML_H
+#define PLAINHTML_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts plain text to HTML text
+ */
+class SWDLLEXPORT PLAINHTML:public SWFilter
+{
+public:
+ PLAINHTML ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/rawcom.h b/include/rawcom.h
new file mode 100644
index 0000000..aff3a77
--- /dev/null
+++ b/include/rawcom.h
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * rawcom.h - code for class 'RawCom'- a module that reads raw commentary
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ *
+ * $Id: rawcom.h,v 1.15 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWCOM_H
+#define RAWCOM_H
+
+#include <rawverse.h>
+#include <swcom.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawCom:public RawVerse, public SWCom {
+
+public:
+
+
+ RawCom(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
+ const char* ilang = 0);
+ virtual ~RawCom();
+ virtual char *getRawEntry();
+
+ virtual void increment(int steps);
+ virtual void decrement(int steps) { increment(-steps); }
+
+ // write interface ----------------------------
+ virtual bool isWritable() {
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & O_RDWR) == O_RDWR));
+ }
+ static char createModule(const char *path) { return RawVerse::createModule(path); }
+ 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 ------------------------
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+#endif
diff --git a/include/rawfiles.h b/include/rawfiles.h
new file mode 100644
index 0000000..cd66b13
--- /dev/null
+++ b/include/rawfiles.h
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * rawfiles.h - code for class 'RawFiles'- a module that produces HTML HREFs
+ * pointing to actual text desired. Uses standard
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ *
+ * $Id: rawfiles.h,v 1.15 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWFILES_H
+#define RAWFILES_H
+
+#include <rawverse.h>
+#include <swcom.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawFiles : public RawVerse, public SWCom {
+
+ char *getnextfilename();
+
+public:
+
+
+ RawFiles(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
+ const char *ilang = 0);
+ virtual ~RawFiles();
+ virtual char *getRawEntry();
+
+ // write interface ----------------------------
+ /** Is the module writable? :)
+ * @return yes or no
+ */
+ virtual bool isWritable() {
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & O_RDWR) == O_RDWR));
+ }
+
+ /** Creates a new module
+ * @param path The first parameter is path of the new module
+ * @return error
+ */
+ static char createModule(const char *);
+
+ /** Modify the current module entry text
+ * - only if module @ref isWritable
+ * @return *this
+ */
+ virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
+
+ /** Link the current module entry to another module entry
+ * - only if module @ref isWritable
+ * @return *this
+ */
+ virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
+
+ /** Delete current module entry - only if module @ref isWritable
+ *
+ */
+ virtual void deleteEntry();
+ // end write interface ------------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/rawgbf.h b/include/rawgbf.h
new file mode 100644
index 0000000..8634831
--- /dev/null
+++ b/include/rawgbf.h
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * rawgbf.h - code for class 'RawGBF'- a module that reads raw text files:
+ * ot and nt using indexs ??.bks ??.cps ??.vss
+ *
+ * $Id: rawgbf.h,v 1.4 2002/02/19 01:20:35 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWGBF_H
+#define RAWGBF_H
+
+#include <rawverse.h>
+#include <swtext.h>
+#include <swfilter.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawGBF:public SWText, public RawVerse
+{
+
+public:
+
+
+ RawGBF (const char *ipath, const char *iname = 0, const char *idesc =
+ 0, SWDisplay * idisp = 0);
+ virtual ~ RawGBF ();
+ virtual operator char *();
+};
+
+
+#endif
diff --git a/include/rawgenbook.h b/include/rawgenbook.h
new file mode 100644
index 0000000..3fa8657
--- /dev/null
+++ b/include/rawgenbook.h
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * rawtext.h - code for class 'RawText'- a module that reads raw text files:
+ * ot and nt using indexs ??.bks ??.cps ??.vss
+ *
+ * $Id: rawgenbook.h,v 1.4 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWGENBOOK_H
+#define RAWGENBOOK_H
+
+#include <swgenbook.h>
+#include <filemgr.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawGenBook : public SWGenBook {
+ char *entryBuf;
+ char *path;
+ FileDesc *bdtfd;
+
+public:
+
+
+ RawGenBook(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~RawGenBook();
+ virtual char *getRawEntry();
+ // write interface ----------------------------
+ virtual bool isWritable() {
+ return ((bdtfd->getFd() > 0) && ((bdtfd->mode & O_RDWR) == O_RDWR));
+ }
+ static char createModule(const char *ipath);
+ virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
+ virtual void linkEntry(const SWKey * linkKey); // Link current module entry to other module entry
+ virtual void deleteEntry(); // Delete current module entry
+ virtual SWKey *CreateKey();
+ // end write interface ------------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/rawld.h b/include/rawld.h
new file mode 100644
index 0000000..b7b6a80
--- /dev/null
+++ b/include/rawld.h
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * rawld.cpp - code for class 'RawLD'- a module that reads raw lexicon and
+ * dictionary files: *.dat *.idx
+ *
+ * $Id: rawld.h,v 1.16 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWLD_H
+#define RAWLD_H
+
+#include <rawstr.h>
+#include <swld.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawLD : public RawStr, public SWLD {
+ void strongsPad(char *buf);
+ char getEntry(long away = 0);
+
+public:
+
+
+ RawLD(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+
+ virtual ~RawLD();
+ virtual char *getRawEntry();
+
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
+ // write interface ----------------------------
+ virtual bool isWritable() { return ((idxfd->getFd() > 0) && ((idxfd->mode & O_RDWR) == O_RDWR)); }
+ static char createModule(const char *path) { return RawStr::createModule (path); }
+
+ 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 ------------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/rawld4.h b/include/rawld4.h
new file mode 100644
index 0000000..88b52b5
--- /dev/null
+++ b/include/rawld4.h
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * rawld.cpp - code for class 'RawLD'- a module that reads raw lexicon and
+ * dictionary files: *.dat *.idx
+ *
+ * $Id: rawld4.h,v 1.10 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWLD4_H
+#define RAWLD4_H
+
+#include <rawstr4.h>
+#include <swld.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawLD4 : public RawStr4, public SWLD {
+ void strongsPad(char *buf);
+ char getEntry(long away = 0);
+
+public:
+
+
+ RawLD4(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char *ilang = 0);
+
+ virtual ~RawLD4();
+ virtual char *getRawEntry();
+
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
+ // write interface ----------------------------
+ virtual bool isWritable() {
+ return ((idxfd->getFd() > 0) && ((idxfd->mode & O_RDWR) == O_RDWR));
+ }
+ static char createModule(const char *path) { return RawStr4::createModule(path); }
+
+ 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 ------------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/rawstr.h b/include/rawstr.h
new file mode 100644
index 0000000..15f1328
--- /dev/null
+++ b/include/rawstr.h
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * rawstr.h - code for class 'RawStr'- a module that reads raw text
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ * and provides lookup and parsing functions based on
+ * class StrKey
+ *
+ * $Id: rawstr.h,v 1.14 2002/07/30 10:17:30 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWSTR_H
+#define RAWSTR_H
+
+#include <filemgr.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawStr {
+ static int instance; // number of instantiated RawStr objects or derivitives
+ char *path;
+ long lastoff;
+
+protected:
+ FileDesc *idxfd;
+ FileDesc *datfd;
+ void settext(const char *key, const char *buf, long len = -1);
+ void linkentry(const char *destkey, const char *srckey);
+public:
+ static void preptext(char *buf);
+ static char nl;
+ RawStr(const char *ipath, int fileMode = -1);
+ virtual ~RawStr();
+ void getidxbuf(long ioffset, char **buf);
+ void getidxbufdat(long ioffset, char **buf);
+ signed char findoffset(const char *key, long *start, unsigned short *size, long away = 0, long *idxoff = 0);
+ void readtext(long start, unsigned short *size, char **idxbuf, char **buf);
+ static signed char createModule(const char *path);
+};
+
+#endif
diff --git a/include/rawstr4.h b/include/rawstr4.h
new file mode 100644
index 0000000..129ca54
--- /dev/null
+++ b/include/rawstr4.h
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * rawstr.h - code for class 'RawStr'- a module that reads raw text
+ * files: ot and nt using indexs ??.bks ??.cps ??.vss
+ * and provides lookup and parsing functions based on
+ * class StrKey
+ *
+ * $Id: rawstr4.h,v 1.7 2002/07/30 10:17:30 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWSTR4_H
+#define RAWSTR4_H
+
+#include <filemgr.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawStr4 {
+ static int instance; // number of instantiated RawStr4 objects or derivitives
+ char *path;
+ long lastoff;
+
+protected:
+ FileDesc *idxfd;
+ FileDesc *datfd;
+ void preptext(char *buf);
+ void setText(const char *key, const char *buf, long len = -1);
+ void linkentry(const char *destkey, const char *srckey);
+public:
+ char nl;
+ RawStr4(const char *ipath, int fileMode = -1);
+ virtual ~RawStr4();
+ void getidxbuf(long ioffset, char **buf);
+ void getidxbufdat(long ioffset, char **buf);
+ signed char findoffset(const char *key, long *start, unsigned long *size,
+ long away = 0, long *idxoff = 0);
+ void readtext(long start, unsigned long *size, char **idxbuf, char **buf);
+ static signed char createModule(const char *path);
+};
+
+#endif
diff --git a/include/rawtext.h b/include/rawtext.h
new file mode 100644
index 0000000..01a0114
--- /dev/null
+++ b/include/rawtext.h
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * rawtext.h - code for class 'RawText'- a module that reads raw text files:
+ * ot and nt using indexs ??.bks ??.cps ??.vss
+ *
+ * $Id: rawtext.h,v 1.24 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RAWTEXT_H
+#define RAWTEXT_H
+
+#include <rawverse.h>
+#include <rawstr.h>
+#include <swtext.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawText:public SWText, public RawVerse {
+ RawStr *fastSearch[2];
+
+public:
+
+
+ RawText(const char *ipath, const char *iname = 0, const char *idesc = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
+ const char* ilang = 0);
+ virtual ~RawText();
+ virtual char *getRawEntry();
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
+ virtual signed char createSearchFramework();
+ virtual bool hasSearchFramework() { return true; }
+ virtual ListKey & Search(const char *istr, int searchType = 0, int flags = 0, SWKey * scope = 0, bool * justCheckIfSupported = 0, void (*percent)(char, void *) = &SWModule::nullPercent, void *percentUserData = 0);
+
+ // write interface ----------------------------
+ virtual bool isWritable() { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & O_RDWR) == O_RDWR)); }
+ static char createModule(const char *path) { return RawVerse::createModule(path); }
+ 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 ------------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/rawverse.h b/include/rawverse.h
new file mode 100644
index 0000000..3917fd7
--- /dev/null
+++ b/include/rawverse.h
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * rawverse.h - code for class 'RawVerse'- 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
+ */
+
+#ifndef RAWVERSE_H
+#define RAWVERSE_H
+
+#include <filemgr.h>
+#include <fcntl.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT RawVerse {
+ static int instance; // number of instantiated RawVerse objects or derivitives
+protected:
+ FileDesc *idxfp[2];
+ FileDesc *textfp[2];
+
+ char *path;
+ void preptext(char *buf);
+ void settext(char testmt, long idxoff, const char *buf, long len = -1);
+ void linkentry(char testmt, long destidxoff, long srcidxoff);
+
+public:
+ static const char *nl;
+ RawVerse(const char *ipath, int fileMode = -1);
+ virtual ~ RawVerse();
+ void findoffset(char testmt, long idxoff, long *start,
+ unsigned short *end);
+ void readtext(char testmt, long start, unsigned short size, char *buf);
+ static char createModule(const char *path);
+};
+
+
+#endif
diff --git a/include/regex.h b/include/regex.h
new file mode 100644
index 0000000..a81e07d
--- /dev/null
+++ b/include/regex.h
@@ -0,0 +1,545 @@
+/* Definitions for data structures and routines for the regular
+ expression library, version 0.12.
+ Copyright (C) 1985,89,90,91,92,93,95,96,97 Free Software Foundation, Inc.
+
+ the C library, however. The master source lives in /gd/gnu/lib.
+
+NOTE: The canonical source of this file is maintained with the
+GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _REGEX_H
+#define _REGEX_H 1
+
+/* Allow the use in C++ code. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
+
+#if !defined (_POSIX_C_SOURCE) && !defined (_POSIX_SOURCE) && defined (VMS)
+/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
+ should be there. */
+#include <stddef.h>
+#endif
+
+/* The following two types have to be signed and unsigned integer type
+ wide enough to hold a value of a pointer. For most ANSI compilers
+ ptrdiff_t and size_t should be likely OK. Still size of these two
+ types is 2 for Microsoft C. Ugh... */
+ typedef long int s_reg_t;
+ typedef unsigned long int active_reg_t;
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+ typedef unsigned long int reg_syntax_t;
+
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS ((unsigned long int) 1)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+#define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then `\{...\}' defines an interval. */
+#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* If this bit is set, succeed as soon as we match the whole pattern,
+ without further backtracking. */
+#define RE_NO_POSIX_BACKTRACKING (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
+
+/* If this bit is set, do not process the GNU regex operators.
+ If not set, then the GNU regex operators are recognized. */
+#define RE_NO_GNU_OPS (RE_NO_POSIX_BACKTRACKING << 1)
+
+/* If this bit is set, turn on internal regex debugging.
+ If not set, and debugging was on, turn it off.
+ This only works if regex.c is compiled -DDEBUG.
+ We define this bit always, so that all that's needed to turn on
+ debugging is to recompile regex.c; the calling code can always have
+ this bit set, and it won't affect anything in the normal case. */
+#define RE_DEBUG (RE_NO_GNU_OPS << 1)
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+ extern reg_syntax_t re_syntax_options;
+
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GNU_AWK \
+ ((RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DEBUG) \
+ & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS))
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS \
+ | RE_INTERVALS | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
+ replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. Some systems
+ (erroneously) define this in other header files, but we want our
+ value, so remove any previous define. */
+#ifdef RE_DUP_MAX
+#undef RE_DUP_MAX
+#endif
+/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */
+#define RE_DUP_MAX (0x7fff)
+
+
+/* POSIX `cflags' bits (i.e., information for `regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (REG_EXTENDED << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (REG_ICASE << 1)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (REG_NEWLINE << 1)
+
+
+/* POSIX `eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+
+/* If any error codes are removed, changed, or added, update the
+ `re_error_msg' table in regex.c. */
+ typedef enum
+ {
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Not implemented. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+ }
+ reg_errcode_t;
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields `buffer', `allocated', `fastmap',
+ `translate', and `no_sub' can be set. After the pattern has been
+ compiled, the `re_nsub' field is available. All other fields are
+ private to the regex routines. */
+
+#ifndef RE_TRANSLATE_TYPE
+#define RE_TRANSLATE_TYPE char *
+#endif
+
+ struct re_pattern_buffer
+ {
+/* [[[begin pattern_buffer]]] */
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are
+ sometimes used as array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long int allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long int used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses
+ the fastmap, if there is one, to skip over impossible
+ starting points for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation
+ is applied to a pattern when it is compiled and to a string
+ when it is matched. */
+ RE_TRANSLATE_TYPE translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see
+ whether or not we should use the fastmap, so we don't set
+ this absolutely perfectly; see `re_compile_fastmap' (the
+ `duplicate' case). */
+ unsigned can_be_null:1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated:2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate:1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub:1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the
+ beginning of the string. */
+ unsigned not_bol:1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol:1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor:1;
+
+/* [[[end pattern_buffer]]] */
+ };
+
+ typedef struct re_pattern_buffer regex_t;
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+ typedef int regoff_t;
+
+
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+ struct re_registers
+ {
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+ };
+
+
+/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ `re_match_2' returns information about at least this many registers
+ the first time a `regs' structure is passed. */
+#ifndef RE_NREGS
+#define RE_NREGS 30
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+ typedef struct
+ {
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+ }
+ regmatch_t;
+
+/* Declarations for routines. */
+
+/* To avoid duplicating every routine declaration -- once with a
+ prototype (if we are ANSI), and once without (if we aren't) -- we
+ use the following macro to declare argument types. This
+ unfortunately clutters up the declarations a bit, but I think it's
+ worth it. */
+#ifndef __STDC__
+#define __STDC__ 1
+#endif
+#if __STDC__
+
+#define _RE_ARGS(args) args
+
+#else /* not __STDC__ */
+
+#define _RE_ARGS(args) ()
+
+#endif /* not __STDC__ */
+
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the `re_syntax_options' variable. */
+ extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global `re_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not. */
+ extern const char *re_compile_pattern
+ _RE_ARGS ((const char *pattern, size_t length,
+ struct re_pattern_buffer * buffer));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+ extern int re_compile_fastmap
+ _RE_ARGS ((struct re_pattern_buffer * buffer));
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+ extern int re_search
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string,
+ int length, int start, int range, struct re_registers * regs));
+
+
+/* Like `re_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+ extern int re_search_2
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, int range, struct re_registers * regs, int stop));
+
+
+/* Like `re_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+ extern int re_match
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string,
+ int length, int start, struct re_registers * regs));
+
+
+/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
+ extern int re_match_2
+ _RE_ARGS ((struct re_pattern_buffer * buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, struct re_registers * regs, int stop));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least `NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+ extern void re_set_registers
+ _RE_ARGS ((struct re_pattern_buffer * buffer, struct re_registers * regs,
+ unsigned num_regs, regoff_t * starts, regoff_t * ends));
+
+#ifdef _REGEX_RE_COMP
+#ifndef _CRAY
+/* 4.2 bsd compatibility. */
+ extern char *re_comp _RE_ARGS ((const char *));
+ extern int re_exec _RE_ARGS ((const char *));
+#endif
+#endif
+
+/* POSIX compatibility. */
+ extern int regcomp
+ _RE_ARGS ((regex_t * preg, const char *pattern, int cflags));
+ extern int regexec
+ _RE_ARGS (
+ (const regex_t * preg, const char *string, size_t nmatch,
+ regmatch_t pmatch[], int eflags));
+ extern size_t regerror
+ _RE_ARGS (
+ (int errcode, const regex_t * preg, char *errbuf,
+ size_t errbuf_size));
+ extern void regfree _RE_ARGS ((regex_t * preg));
+
+
+#ifdef __cplusplus
+}
+#endif /* C++ */
+
+#endif /* regex.h */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/include/roman.h b/include/roman.h
new file mode 100644
index 0000000..92665fe
--- /dev/null
+++ b/include/roman.h
@@ -0,0 +1,25 @@
+/******************************************************************************
+ * roman.h - roman numeral functions
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+#ifndef ROMAN_H
+#define ROMAN_H
+char isroman(const char *);
+/* char* to_rom(int num, char *p); */
+int from_rom(const char *s);
+
+#endif
diff --git a/include/rtfhtml.h b/include/rtfhtml.h
new file mode 100644
index 0000000..54b8a9f
--- /dev/null
+++ b/include/rtfhtml.h
@@ -0,0 +1,37 @@
+/***************************************************************************
+ rtfhtml.h - description
+ -------------------
+ begin : Wed Oct 13 1999
+ copyright : (C) 1999 by The team of BibleTime
+ email : info@bibletime.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/* $Header: /usr/local/cvsroot/sword/include/rtfhtml.h,v 1.5 2001/12/11 22:35:10 scribe Exp $ */
+/* $Revision: 1.5 $ */
+
+#ifndef RTFHTML_H
+#define RTFHTML_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts RTF text into HTML text
+ */
+class SWDLLEXPORT RTFHTML:public SWFilter
+{
+public:
+ RTFHTML ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/rwphtml.h b/include/rwphtml.h
new file mode 100644
index 0000000..512fa38
--- /dev/null
+++ b/include/rwphtml.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ rwphtml.h - description
+ -------------------
+ begin : Tue Jun 15 15:34:26 CEST 1999
+
+ copyright : (C) 1999 by Torsten Uhlmann
+ email : TUhlmann@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+/* $Header: /usr/local/cvsroot/sword/include/rwphtml.h,v 1.7 2001/12/11 22:35:10 scribe Exp $ */
+/* $Revision: 1.7 $ */
+
+#ifndef RWPHTML_H
+#define RWPHTML_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts RWP text to HTML text
+ */
+class SWDLLEXPORT RWPHTML:public SWFilter
+{
+public:
+ RWPHTML ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/rwprtf.h b/include/rwprtf.h
new file mode 100644
index 0000000..5e2452d
--- /dev/null
+++ b/include/rwprtf.h
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * rwprtf.h - definition of Class RWPRTF, an SWFilter used to convert
+ * special tags in Robertsons Word Pictures commentary into
+ * Rich Text Format tags
+ *
+ * $Id: rwprtf.h,v 1.7 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef RWPRTF_H
+#define RWPRTF_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts RWP text to RTF text
+ */
+class SWDLLEXPORT RWPRTF:public SWFilter
+{
+public:
+ RWPRTF ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/sapphire.h b/include/sapphire.h
new file mode 100644
index 0000000..9e9f724
--- /dev/null
+++ b/include/sapphire.h
@@ -0,0 +1,53 @@
+/* sapphire.h -- Interface for the Saphire II stream cipher.
+
+ Dedicated to the Public Domain the author and inventor
+ (Michael Paul Johnson). This code comes with no warranty.
+ Use it at your own risk.
+ Ported from the Pascal implementation of the Sapphire Stream
+ Cipher 9 December 1994.
+ Added hash-specific functions 27 December 1994.
+ Made index variable initialization key-dependent,
+ made the output function more resistant to cryptanalysis,
+ and renamed to Sapphire II Stream Cipher 2 January 1995.
+
+ unsigned char is assumed to be 8 bits. If it is not, the
+ results of assignments need to be reduced to 8 bits with
+ & 0xFF or % 0x100, whichever is faster.
+*/
+
+#ifndef NULL
+#define NULL 0
+#endif /* */
+ class sapphire
+{
+
+ // These variables comprise the state of the state machine.
+ unsigned char cards[256]; // A permutation of 0-255.
+ unsigned char rotor, // Index that rotates smoothly
+ ratchet, // Index that moves erratically
+ avalanche, // Index heavily data dependent
+ last_plain, // Last plain text byte
+ last_cipher; // Last cipher text byte
+
+ // This function is used by initialize(), which is called by the
+ // constructor.
+ unsigned char keyrand (int limit, unsigned char *user_key,
+ unsigned char keysize, unsigned char *rsum,
+unsigned *keypos); public:sapphire (unsigned char
+ *key = NULL, // Calls initialize if a real
+ unsigned char keysize = 0); // key is provided. If none
+ // is provided, call initialize
+ // before encrypt or decrypt.
+ ~sapphire (); // Destroy cipher state information.
+ void initialize (unsigned char *key, // User key is used to set
+ unsigned char keysize); // up state information.
+ void hash_init (void); // Set up default hash.
+ unsigned char encrypt (unsigned char b = 0); // Encrypt byte
+ // or get a random byte.
+ unsigned char decrypt (unsigned char b); // Decrypt byte.
+ void hash_final (unsigned char *hash, // Copy hash value to hash
+ unsigned char hashlength = 20); // Hash length (16-32)
+ void burn (void); // Destroy cipher state information.
+};
+
+
diff --git a/include/scsuutf8.h b/include/scsuutf8.h
new file mode 100644
index 0000000..4ff28da
--- /dev/null
+++ b/include/scsuutf8.h
@@ -0,0 +1,41 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SCSUUTF8_H
+#define SCSUUTF8_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts SCSU compressed (encoded) text to UTF-8
+ */
+class SWDLLEXPORT SCSUUTF8:public SWFilter {
+ private:
+ unsigned char* UTF8Output(unsigned long, unsigned char* text);
+
+ unsigned long c, d;
+
+
+ public:
+ SCSUUTF8();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/strkey.h b/include/strkey.h
new file mode 100644
index 0000000..fc8fd58
--- /dev/null
+++ b/include/strkey.h
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * strkey.h - code for class 'strkey'- a standard Biblical verse key
+ *
+ * $Id: strkey.h,v 1.6 2001/08/08 09:17:00 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+
+#ifndef STRKEY_H
+#define STRKEY_H
+
+#include <swkey.h>
+#include <swmacs.h>
+
+#include <defs.h>
+
+ /** a standard string key class (used
+ * for modules that index on single strings (eg. cities,
+ * names, words, etc.)
+ */
+class SWDLLEXPORT StrKey:public SWKey
+{
+ static SWClass classdef;
+ void init ();
+public:
+ /** initializes instance of StrKey
+ *
+ * @param ikey text key (word, city, name, etc.)
+ */
+ StrKey (const char *ikey = 0);
+ /** cleans up instance of StrKey
+ */
+ virtual ~ StrKey ();
+
+ SWKEY_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/swbasicfilter.h b/include/swbasicfilter.h
new file mode 100644
index 0000000..339b7e7
--- /dev/null
+++ b/include/swbasicfilter.h
@@ -0,0 +1,117 @@
+/******************************************************************************
+ * swbasicfilter.h - definition of class SWBasicFilter. An SWFilter
+ * impl that provides some basic methods that
+ * many filter will need and can use as a starting
+ * point.
+ *
+ * $Id: swbasicfilter.h,v 1.9 2002/06/06 21:08:47 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWBASICFILTER_H
+#define SWBASICFILTER_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+#include <map>
+using namespace std;
+
+/** A filter providing commonly used functionality.
+* This filter has facilities for handling SGML/HTML/XML like tokens and
+* escape strings (like SGML entities). It has the facility for just
+* substituting the given tokens and escape strings to other strings and for
+* "manual" custom token handling.
+*
+* In this class the functions with arguments looking as <code>char
+* **buf</code> write a character sequnce at address specified by
+* <code>*buf</code> address and change <code>*buf</code> to point past
+* the last char of the written sequence.
+*/
+class SWDLLEXPORT SWBasicFilter : public SWFilter {
+
+ char *tokenStart;
+ char *tokenEnd;
+ char *escStart;
+ char *escEnd;
+ bool escStringCaseSensitive;
+ bool tokenCaseSensitive;
+ bool passThruUnknownToken;
+ bool passThruUnknownEsc;
+
+public:
+ SWBasicFilter();
+ virtual char ProcessText(char *text, int maxlen, const SWKey *, const SWModule * = 0);
+ virtual ~SWBasicFilter();
+
+protected:
+ const SWModule *module;
+ const SWKey *key;
+ char *resultBuffer;
+ typedef map<string, string> DualStringMap;
+ DualStringMap tokenSubMap;
+ DualStringMap escSubMap;
+
+ /** Sets the beginning of escape sequence (by default "&").*/
+ void setEscapeStart(const char *escStart);
+
+ /** Sets the end of escape sequence (by default ";").*/
+ void setEscapeEnd(const char *escEnd);
+
+ /** Sets the beginning of token start sequence (by default "<").*/
+ void setTokenStart(const char *tokenStart);
+
+ /** Sets the end of token start sequence (by default ">").*/
+ void setTokenEnd(const char *tokenEnd);
+
+ /** Sets whether pass thru unknown tokens unchanged or just ignore (remove) them.
+ * Default is false.*/
+ void setPassThruUnknownToken(bool val);
+
+ /** Sets whether pass thru unknown escape sequences unchanged or just ignore (remove) them.
+ * Default is false.*/
+ void setPassThruUnknownEscapeString(bool val);
+
+ void setTokenCaseSensitive(bool val);
+ void setEscapeStringCaseSensitive(bool val);
+
+ void addTokenSubstitute(const char *findString, const char *replaceString);
+ void addEscapeStringSubstitute(const char *findString, const char *replaceString);
+ bool substituteToken(char **buf, const char *token);
+ bool substituteEscapeString(char **buf, const char *escString);
+
+ /** Like sprintf*/
+ void pushString(char **buf, const char *format, ...);
+
+ /** This function is called for every token encountered in the input text.
+ * @param buf the output buffer (FIXME: what is its size?)
+ * @param token the token (e.g. <code>"p align='left'"</code>
+ * @param userData FIXME: document this
+ * @return <code>false</code> if was not handled and should be handled in
+ * the default way (by just substituting).*/
+ virtual bool handleToken(char **buf, const char *token, DualStringMap &userData);
+
+ /** This function is called for every escape sequence encountered in the input text.
+ * @param buf the output buffer (FIXME: what is its size?)
+ * @param escString the escape sequence (e.g. <code>"amp"</code> for &amp;amp;)
+ * @param userData FIXME: document this
+ * @return <code>false</code> if was not handled and should be handled in
+ * the default way (by just substituting).*/
+ virtual bool handleEscapeString(char **buf, const char *escString, DualStringMap &userData);
+};
+
+#endif
diff --git a/include/swcacher.h b/include/swcacher.h
new file mode 100644
index 0000000..f62adba
--- /dev/null
+++ b/include/swcacher.h
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * swcacher.h - definition of class SWCacher used to provide an interface for
+ * objects that cache and want a standard interface for cleaning up.
+ *
+ * $Id: swcacher.h,v 1.2 2002/03/16 04:10:33 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWCACHER_H
+#define SWCACHER_H
+
+#include <defs.h>
+
+class SWDLLEXPORT SWCacher {
+public:
+ SWCacher();
+ virtual ~SWCacher();
+ virtual void flush();
+ virtual long resourceConsumption();
+ virtual long lastAccess();
+};
+
+#endif
diff --git a/include/swcipher.h b/include/swcipher.h
new file mode 100644
index 0000000..4f1fe21
--- /dev/null
+++ b/include/swcipher.h
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * swcipher.h - definition of Class SWCipher used for data cipher/decipher
+ *
+ * $Id: swcipher.h,v 1.6 2001/11/05 07:59:10 chrislit Exp $
+ *
+ * Copyright 1999 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 SWCIPHER_H
+#define SWCIPHER_H
+
+#include "sapphire.h"
+
+#include <defs.h>
+
+class SWDLLEXPORT SWCipher
+{
+
+ sapphire master;
+ sapphire work;
+
+ char *buf;
+ bool cipher;
+ int len;
+protected:
+public:
+ SWCipher (unsigned char *key);
+ virtual void setCipherKey (const char *key);
+ virtual ~ SWCipher ();
+ virtual char *Buf (const char *buf = 0, unsigned int len = 0);
+ virtual char *cipherBuf (unsigned int *len, const char *buf = 0);
+ virtual void Encode (void);
+ virtual void Decode (void);
+};
+
+#endif
diff --git a/include/swcom.h b/include/swcom.h
new file mode 100644
index 0000000..ee95f99
--- /dev/null
+++ b/include/swcom.h
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * swcom.h - code for base class 'SWCom'. SWCom is the basis for all
+ * types of commentary modules
+ *
+ * $Id: swcom.h,v 1.10 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWCOM_H
+#define SWCOM_H
+
+#include <swmodule.h>
+#include <versekey.h>
+
+#include <defs.h>
+
+ /** The basis for all commentary modules
+ */
+class SWDLLEXPORT SWCom : public SWModule {
+public:
+
+ /** Initializes data for instance of SWCom
+ *
+ * @param imodname Internal name for module
+ * @param imoddesc Name to display to user for module
+ * @param idisp Display object to use for displaying
+ */
+ SWCom(const char *imodname = 0, const char *imoddesc = 0,
+ SWDisplay * idisp = 0, SWTextEncoding enc = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup mark = FMT_UNKNOWN, const char* ilang = 0);
+
+ virtual ~SWCom();
+ virtual SWKey *CreateKey() { return new VerseKey(); }
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/swcomprs.h b/include/swcomprs.h
new file mode 100644
index 0000000..034060e
--- /dev/null
+++ b/include/swcomprs.h
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * swcomprs.h - definition of Class SWCompress used for data compression
+ *
+ * $Id: swcomprs.h,v 1.7 2001/12/20 10:01:00 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWCOMPRS_H
+#define SWCOMPRS_H
+
+#include <defs.h>
+
+class SWDLLEXPORT SWCompress
+{
+ void Init ();
+ void cycleStream ();
+protected:
+ char *buf, *zbuf, direct; // 0 - encode; 1 - decode
+ unsigned long zlen, zpos, pos, slen;
+public:
+ 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
+};
+
+#endif
diff --git a/include/swconfig.h b/include/swconfig.h
new file mode 100644
index 0000000..a0a6b0d
--- /dev/null
+++ b/include/swconfig.h
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * swconfig.h - definition of Class SWConfig used for saving and retrieval
+ * of configuration information
+ *
+ * $Id: swconfig.h,v 1.17 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWCONFIG_H
+#define SWCONFIG_H
+
+#include <stdio.h>
+
+#include <string>
+#include <map>
+
+#include <defs.h>
+#include <multimapwdef.h>
+
+using namespace std;
+
+
+
+typedef multimapwithdefault < string, string, less < string > >ConfigEntMap;
+typedef map < string, ConfigEntMap, less < string > >SectionMap;
+
+/** The class to read and save settings using a file on disk.
+*
+*/
+class SWDLLEXPORT SWConfig {
+private:
+ char getline(FILE * fp, string & line);
+public:
+ /** The filename used by this SWConfig object
+ *
+ */
+ string 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);
+ virtual ~SWConfig();
+
+ /** Load from disk
+ * Load the contzent from disk.
+ */
+ virtual void Load();
+
+ /** Save to disk
+ * Save the content of this config object to disk.
+ */
+ virtual void Save();
+
+ /** Merges the values of addFrom
+ * @param 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);
+ };
+
+#endif
diff --git a/include/swdisp.h b/include/swdisp.h
new file mode 100644
index 0000000..9668470
--- /dev/null
+++ b/include/swdisp.h
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * swdisp.h - code for base class 'swdisp'. swdisp is the basis for all
+ * types of displays (e.g. raw textout, curses, xwindow, etc.)
+ *
+ * $Id: swdisp.h,v 1.7 2002/05/25 22:56:51 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWDISP_H
+#define SWDISP_H
+
+#include <swobject.h>
+#include <defs.h>
+
+class SWModule;
+
+/** swdisp is the basis for all types of displays
+* (e.g. raw textout, curses, xwindow, etc.)
+*/
+class SWDLLEXPORT SWDisplay : public SWObject {
+ static SWClass classdef;
+public:
+ SWDisplay () { myclass = &classdef; };
+ /** casts a module to a character pointer and displays it to
+ * raw output (overriden for different display types and
+ * module types if necessary)
+ *
+ * @param imodule module to display
+ * @return error status
+ */
+ virtual char Display (SWModule & imodule);
+};
+#endif
diff --git a/include/swdisprtf.h b/include/swdisprtf.h
new file mode 100644
index 0000000..f8b78e7
--- /dev/null
+++ b/include/swdisprtf.h
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * swdisprtf.h - definition of Class SWDispRTF-- an SWDisplay used to display
+ * a verse in Rich Text Format.
+ *
+ * $Id: swdisprtf.h,v 1.10 2002/07/30 11:33:17 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+//---------------------------------------------------------------------------
+#ifndef SWDispRTFH
+#define SWDispRTFH
+//---------------------------------------------------------------------------
+#include <vcl\SysUtils.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\Classes.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ComCtrls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <swtext.h>
+#include "RxRichEditX.h"
+//---------------------------------------------------------------------------
+
+#define defRTFHeader "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f2\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f3\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;} "
+#define defRTFHeadMargin "{\\fs8\\cf1\\par\\pard} "
+#define defRTFTrailer "{\\fs%d \\par }}" // 24
+
+#define defRTFChapterMarkPre "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b Chapter " // 30
+#define defRTFChapterMarkPost "\\par\\fs%d\\par}" // 10
+
+#define defRTFVerseMarkPre "{\\fs%d\\cf1\\super " //20
+#define defRTFVerseMarkPost "}"
+
+#define defRTFVersePre "{\\fs%d" // 24
+#define defRTFVersePost " }"
+
+class SWDispRTF : public TRxRichEditX {
+protected:
+
+ bool FExpandNewLine;
+ CHARRANGE FCharRange;
+ int fontSize;
+
+ int __fastcall GetMySelStart ();
+ void __fastcall SetMySelStart (int iselstart);
+ int __fastcall getFontSize ();
+ void __fastcall setFontSize (int iFontSize);
+protected:
+ TMemoryStream * RTFStream;
+
+ virtual void __fastcall Loaded (void);
+public:
+ __fastcall SWDispRTF (TWinControl *Owner);
+ __fastcall ~ SWDispRTF ();
+
+ virtual char Display (SWModule & imodule);
+ __property bool ExpandNewLine = { read = FExpandNewLine, write = FExpandNewLine };
+};
+
+//---------------------------------------------------------------------------
+#endif
diff --git a/include/swdisprtfchap.h b/include/swdisprtfchap.h
new file mode 100644
index 0000000..2a0b3d9
--- /dev/null
+++ b/include/swdisprtfchap.h
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * swdisprtfchap.h - definition of class SWDispRTFChap, an SWDisplay used to
+ * display an entire chapter in Rich Text Format
+ *
+ * $Id: swdisprtfchap.h,v 1.5 2002/07/30 11:33:17 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+//---------------------------------------------------------------------------
+#ifndef swdisprtfchapH
+#define swdisprtfchapH
+//---------------------------------------------------------------------------
+#include <vcl\SysUtils.hpp>
+#include <vcl\Controls.hpp>
+#include <vcl\Classes.hpp>
+#include <vcl\Forms.hpp>
+#include <vcl\ComCtrls.hpp>
+#include <vcl\StdCtrls.hpp>
+#include <swtext.h>
+#include <swdisprtf.h>
+//---------------------------------------------------------------------------
+class SWDispRTFChap_init;
+class SWDispRTFChap:public SWDispRTF {
+protected:
+ virtual void __fastcall Loaded (void);
+public:
+ static char platformID;
+ static SWDispRTFChap_init _init;
+
+ __fastcall SWDispRTFChap(TWinControl *Owner);
+ __fastcall ~ SWDispRTFChap();
+
+ virtual char Display(SWModule & imodule);
+};
+
+//---------------------------------------------------------------------------
+#endif
diff --git a/include/swfilter.h b/include/swfilter.h
new file mode 100644
index 0000000..68a67a4
--- /dev/null
+++ b/include/swfilter.h
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * swfilter.h - definition of class SWFilter used to filter text between
+ * different formats
+ *
+ * $Id: swfilter.h,v 1.13 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWFILTER_H
+#define SWFILTER_H
+#include <string>
+#include <list>
+#include <swkey.h>
+
+#include <defs.h>
+
+/**
+* The type definitoin for option types
+*/
+typedef std::list < std::string > OptionsList;
+
+
+/** Base class for all filters in sword.
+* Filters are used to filter/convert text between different formats
+* like GBF, HTML, RTF ...
+*/
+class SWModule;
+
+class SWDLLEXPORT SWFilter {
+public:
+ virtual ~SWFilter() {}
+ /** the type definition for option lists,
+ * see @ref getOptionValues
+ */
+// typedef std::list < std::string > OptionsList;
+ /** gets the name of the option of this filter
+ * @return option name
+ */
+ virtual const char * getOptionName ()
+ {
+ return 0;
+ }
+ /** gets a short explanation of the option of this filter;
+ * it could be presented to the user in frontend programs
+ * @return option tip/explanation
+ */
+ virtual const char * getOptionTip ()
+ {
+ return 0;
+ }
+ /** returns a list of the possible option values
+ * might be
+ * @return list of option values
+ */
+ virtual OptionsList getOptionValues ()
+ {
+ OptionsList options;
+ return options;
+ }
+ /** sets the value of the option of this filter,
+ * e.g maybe a strong's filter mioght be set to "on" / "off" -
+ * that would mean to show or not to show the strongs in the text,
+ * see also @ref getOptionValues
+ * @param ival the new option valus
+ */
+ virtual void setOptionValue (const char *)
+ {
+ }
+ virtual const char * getOptionValue ()
+ {
+ return 0;
+ }
+ /** This is the main filter function
+ * @param text the text to be filtered/converted
+ * @param maxlen maximal length of text to be processed
+ * @param key sorry I don't know
+ * @return 0
+ */
+ virtual char ProcessText(char *text, int maxlen, const SWKey *, const SWModule * = 0)
+ {
+ return ProcessText(text, maxlen);
+ }
+ /** This is the main filter function without the 3rd parameter
+ * @param text the text to be filtered/converted
+ * @param maxlen maximal length of text to be processed
+ * @return 0
+ */
+ virtual char ProcessText(char *text, int maxlen = -1)
+ {
+ return ProcessText(text, maxlen, 0);
+ }
+};
+
+#endif
diff --git a/include/swfiltermgr.h b/include/swfiltermgr.h
new file mode 100644
index 0000000..6de765b
--- /dev/null
+++ b/include/swfiltermgr.h
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * swfiltermgr.h - definition of class SWFilterMgr used as an interface to
+ * manage filters on a module
+ *
+ * $Id: swfiltermgr.h,v 1.1 2001/11/30 21:05:41 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWFILTERMGR_H
+#define SWFILTERMGR_H
+
+#include <sys/types.h>
+#include <swmodule.h>
+#include <swconfig.h>
+#include <swlog.h>
+
+#include <defs.h>
+
+class SWMgr;
+
+
+class SWDLLEXPORT SWFilterMgr {
+
+private:
+ SWMgr *parentMgr;
+
+public:
+ SWFilterMgr ();
+ virtual ~SWFilterMgr ();
+
+ virtual void setParentMgr(SWMgr *parentMgr);
+ virtual SWMgr *getParentMgr();
+
+ 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);
+
+ /**
+ * 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);
+ /**
+ * Adds the render filters which are defined in "section" to the SWModule object "module".
+ * @param module To this module the render filter(s) are added
+ * @param section We use this section to get a list of filters we should apply to the module
+ */
+ virtual void AddRenderFilters (SWModule * module, ConfigEntMap & section);
+ /**
+ * Adds the strip filters which are defined in "section" to the SWModule object "module".
+ * @param module To this module the strip filter(s) are added
+ * @param section We use this section to get a list of filters we should apply to the module
+ */
+ virtual void AddStripFilters (SWModule * module, ConfigEntMap & section);
+ /**
+ * 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);
+
+};
+
+#endif
diff --git a/include/swgenbook.h b/include/swgenbook.h
new file mode 100644
index 0000000..bb8c56b
--- /dev/null
+++ b/include/swgenbook.h
@@ -0,0 +1,61 @@
+/******************************************************************************
+* swld.h - code for base class 'SWLD'. SWLD is the basis for all
+* types of Lexicon and Dictionary modules (hence the 'LD').
+*
+* $Id: swgenbook.h,v 1.2 2002/07/28 01:48:38 scribe Exp $
+*
+* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+* CrossWire Bible Society
+* P. O. Box 2528
+* Tempe, AZ 85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+*/
+
+#ifndef SWGENBOOK_H
+#define SWGENBOOK_H
+
+#include <swmodule.h>
+#include <treekeyidx.h>
+
+#include <defs.h>
+
+/** the basis for all types of Lexicon and
+* Dictionary modules (hence the 'LD').
+*/
+class SWDLLEXPORT SWGenBook : public SWModule {
+
+protected:
+ char *entkeytxt;
+
+public:
+ /** Initializes data for instance of SWLD
+ *
+ * @param imodname Internal name for module
+ * @param imoddesc Name to display to user for module
+ * @param idisp Display object to use for displaying
+ */
+ SWGenBook(const char *imodname = 0, const char *imoddesc = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+
+ virtual ~SWGenBook();
+ virtual SWKey *CreateKey() = 0;
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+#endif
diff --git a/include/swinputmeth.h b/include/swinputmeth.h
new file mode 100644
index 0000000..05eed88
--- /dev/null
+++ b/include/swinputmeth.h
@@ -0,0 +1,30 @@
+/**
+ * Title:
+ * Description:
+ * Copyright: Copyright (c) 2001 CrossWire Bible Society under the terms of the GNU GPL
+ * Company:
+ * @author Troy A. Griffitts
+ * @version 1.0
+ */
+
+#ifndef SWINPUTMETHOD_H
+#define SWINPUTMETHOD_H
+
+class SWInputMethod {
+
+private:
+ int state;
+
+protected:
+ virtual void setState(int state);
+
+public:
+ SWInputMethod();
+ virtual ~SWInputMethod() {}
+
+ virtual int *translate(char in) = 0;
+ virtual int getState();
+ virtual void clearState();
+};
+
+#endif
diff --git a/include/swinstallmgr.h b/include/swinstallmgr.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/include/swinstallmgr.h
diff --git a/include/swkey.h b/include/swkey.h
new file mode 100644
index 0000000..ce088d4
--- /dev/null
+++ b/include/swkey.h
@@ -0,0 +1,209 @@
+/******************************************************************************
+ * swkey.h - code for base class 'swkey'. swkey is the basis for all
+ * types of keys for indexing into modules (e.g. verse, word,
+ * place, etc.)
+ *
+ * $Id: swkey.h,v 1.18 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWKEY_H
+#define SWKEY_H
+
+#include <swobject.h>
+
+#include <defs.h>
+
+#define KEYERR_OUTOFBOUNDS 1
+
+#define SWKEY_OPERATORS \
+ SWKey & operator =(const char *ikey) { setText(ikey); return *this; } \
+ SWKey & operator =(const SWKey &ikey) { copyFrom(ikey); return *this; } \
+ SWKey & operator =(SW_POSITION pos) { setPosition(pos); return *this; } \
+ operator const char *() const { return getText(); } \
+ bool operator ==(const SWKey & ikey) { return equals(ikey); } \
+ bool operator !=(const SWKey & ikey) { return !equals(ikey); } \
+ virtual bool operator >(const SWKey & ikey) { return (compare(ikey) > 0); } \
+ virtual bool operator <(const SWKey & ikey) { return (compare(ikey) < 0); } \
+ virtual bool operator >=(const SWKey & ikey) { return (compare(ikey) > -1); } \
+ virtual bool operator <=(const SWKey & ikey) { return (compare(ikey) < 1); } \
+ SWKey & operator -=(int steps) { decrement(steps); return *this; } \
+ SWKey & operator +=(int steps) { increment(steps); return *this; } \
+ SWKey & operator++(int) { return *this += 1; } \
+ SWKey & operator--(int) { return *this -= 1; }
+
+
+// For use with = operator to position key.
+
+class SW_POSITION {
+ char pos;
+public:
+ SW_POSITION(char ipos) { pos = ipos; }
+ operator char() { return pos; }
+};
+
+#define POS_TOP ((char)1)
+#define POS_BOTTOM ((char)2)
+
+#define TOP SW_POSITION(POS_TOP)
+#define BOTTOM SW_POSITION(POS_BOTTOM)
+
+/** SWKey is the basis for all
+* types of keys for indexing into modules (e.g. verse, word,
+* place, etc.)
+*/
+class SWDLLEXPORT SWKey : public SWObject {
+ long index;
+ static SWClass classdef;
+ void init();
+
+protected:
+ char *keytext;
+ char persist;
+ char error;
+
+public:
+
+ // misc pointer for whatever
+ void *userData;
+
+ /** initializes instance of SWKey
+ *
+ * @param ikey text key
+ */
+ SWKey(const char *ikey = 0);
+
+ /** Copy Constructor
+ * @param The SWKey object to copy.
+ */
+ SWKey(SWKey const &k);
+
+ /** Destructor, cleans up this instance of SWKey
+ */
+ virtual ~SWKey();
+
+ /** Returns a copy of this SWKey object.
+ * This is useful to get a 1:1 copy of an SWKey based object.
+ * @return SWKey
+ */
+ virtual SWKey *clone() const;
+
+ /** Gets whether this object itself persists within a
+ * module that it was used to SetKey or just a copy.
+ * (1 - persists in module; 0 - a copy is attempted
+ *
+ * @return value of persist
+ */
+ char Persist() const;
+
+ /** Set/gets whether this object itself persists within a
+ * module that it was used to SetKey or just a copy.
+ * (1 - persists in module; 0 - a copy is attempted
+ *
+ * @param ipersist value which to set persist;
+ * [-1] - only get
+ * @return value of persist
+ */
+ char Persist(signed char ikey);
+
+ /** Gets and clears error status
+ *
+ * @return error status
+ */
+ virtual char Error();
+
+ /** Equates this SWKey to a character string
+ *
+ * @param ikey string to set this key to
+ */
+ virtual void setText(const char *ikey);
+
+ /** Equates this SWKey to another SWKey object
+ *
+ * @param ikey other swkey object
+ */
+ virtual void copyFrom(const SWKey &ikey);
+
+ /** returns text key if (char *) cast is requested
+ */
+ virtual const char *getText() const;
+ virtual const char *getShortText() const { return getText(); }
+
+ /** Compares another VerseKey object
+ *
+ * @param ikey key to compare with this one
+ * @return >0 if this key is greater than compare key;
+ * <0 if this key is smaller than compare key;
+ * 0 if the keys are the same
+ */
+ virtual int compare(const SWKey & ikey);
+
+ /** Compares another VerseKey object
+ *
+ * @param ikey key to compare with this one
+ * @return true if the keys are the same
+ */
+ virtual bool equals(const SWKey &ikey) { return !compare(ikey); }
+
+ virtual void setPosition(SW_POSITION);
+
+ /** Decrements key a number of entries
+ *
+ * @param steps Number of entries to jump backward
+ * @return *this
+ */
+ virtual void decrement(int steps = 1);
+
+ /** Increments key a number of entries
+ *
+ * @param increment Number of entries to jump forward
+ * @return *this
+ */
+ virtual void increment(int steps = 1);
+
+ virtual char Traversable() { return 0; }
+
+ /** Use this function to get te current position withing a module.
+ * Here's a small example how to use this function and @ref Index(long).
+ * This function uses the GerLut module and chooses a random verse from the
+ * Bible and returns it.
+ * @code
+ * const char* randomVerse() {
+ * VerseKey vk;
+ * SWMgr mgr;
+ * LocaleMgr::systemLocaleMgr.setDefaultLocaleName("de");
+ *
+ * SWModule* module = mgr->Modules("GerLut");
+ * srand( time(0) );
+ * const double newIndex = (double(rand())/RAND_MAX)*(24108+8224);
+ * vk.Index(newIndex);
+ * module->SetKey(vk);
+ *
+ * char* text;
+ * sprintf(text, "%s: %s",(const char*)vk ,module->StripText(&vk));
+ * return text;
+ * @endcode
+ */
+ virtual long Index() const { return index; }
+ virtual long Index(long iindex) { index = iindex; return index; }
+
+ SWKEY_OPERATORS
+
+ };
+
+
+#endif
diff --git a/include/swld.h b/include/swld.h
new file mode 100644
index 0000000..07718f7
--- /dev/null
+++ b/include/swld.h
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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,v 1.12 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWLD_H
+#define SWLD_H
+
+#include <swmodule.h>
+#include <strkey.h>
+
+#include <defs.h>
+
+ /** the basis for all types of Lexicon and
+ * Dictionary modules (hence the 'LD').
+ */
+class SWDLLEXPORT SWLD : public SWModule {
+protected:
+ char *entkeytxt;
+public:
+ /** Initializes data for instance of SWLD
+ *
+ * @param imodname Internal name for module
+ * @param imoddesc Name to display to user for module
+ * @param idisp Display object to use for displaying
+ */
+ SWLD(const char *imodname = 0, const char *imoddesc = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+
+ virtual ~SWLD();
+ virtual SWKey *CreateKey() { return new StrKey(); }
+
+ /** Sets/gets module KeyText, getting from saved text if key is persistent
+ *
+ * @param ikeytext value which to set keytext;
+ * [0] - only get
+ * @return pointer to keytext
+ */
+ virtual const char *KeyText(const char *ikeytext = 0);
+ virtual void setPosition(SW_POSITION pos);
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/swlocale.h b/include/swlocale.h
new file mode 100644
index 0000000..a2645fc
--- /dev/null
+++ b/include/swlocale.h
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * swlocale.h - definition of Class SWLocale used for retrieval
+ * of locale lookups
+ *
+ * $Id: swlocale.h,v 1.7 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 2000 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 SWLOCALE_H
+#define SWLOCALE_H
+
+#include <string>
+#include <map>
+
+#include <swconfig.h>
+#include <versekey.h>
+
+#include <defs.h>
+
+using namespace std;
+
+typedef map < string, string, less < string > >LookupMap;
+
+/** SWLocale is used for the localisation of the booknames
+* The SWLocale is a class which holds the information of one language.
+* Every language supported by Sword has one SWLocale object,
+* get the name of the Language using @see getname of this class.
+* Another functions useful for frontend developers is @see getDescription.
+*/
+class SWDLLEXPORT SWLocale {
+ LookupMap lookupTable;
+ SWConfig *localeSource;
+ char *name;
+ char *description;
+ struct abbrev *bookAbbrevs;
+ char *BMAX;
+ struct sbook **books;
+
+public:
+ SWLocale(const char *ifilename);
+ virtual ~SWLocale();
+
+ /**
+ * This function is used to get the name of the languages which this object is handling.
+ * @return The name of the managed language. A possible example is "de".
+ */
+ virtual const char *getName();
+ /**
+ * @return The description. A possible example is "German".
+ */
+ virtual const char *getDescription();
+ virtual const char *translate(const char *text);
+ virtual void augment(SWLocale &addFrom);
+ virtual SWLocale & operator +=(SWLocale &addFrom) { augment(addFrom); return *this; }
+ virtual const struct abbrev *getBookAbbrevs();
+ virtual void getBooks(char **iBMAX, struct sbook ***ibooks);
+};
+
+#endif
diff --git a/include/swlog.h b/include/swlog.h
new file mode 100644
index 0000000..6e9ee57
--- /dev/null
+++ b/include/swlog.h
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * swlog.h - definition of class SWLog used for logging messages
+ *
+ * $Id: swlog.h,v 1.4 2002/07/19 23:00:43 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+//---------------------------------------------------------------------------
+#ifndef swlogH
+#define swlogH
+//---------------------------------------------------------------------------
+
+#include <defs.h>
+
+class SWDLLEXPORT SWLog {
+protected:
+ char logLevel;
+
+public:
+ static SWLog *systemlog;
+
+ SWLog () { logLevel = 1; /*default to show only errors*/}
+ virtual void setLogLevel(char level) { logLevel = level; }
+ virtual char getLogLevel() { return logLevel; }
+ virtual void LogWarning (char *fmt, ...);
+ virtual void LogError (char *fmt, ...);
+ virtual void LogTimedInformation (char *fmt, ...);
+ virtual void LogInformation (char *fmt, ...);
+};
+
+
+#endif
diff --git a/include/swmacs.h b/include/swmacs.h
new file mode 100644
index 0000000..ea9f8d3
--- /dev/null
+++ b/include/swmacs.h
@@ -0,0 +1,30 @@
+/******************************************************************************
+ * swmacs.h - generic macros
+ *
+ * $Id: swmacs.h,v 1.1.1.1 1999/05/04 22:03:36 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWMACS_H
+#define SWMACS_H
+
+
+// Maximum positive value of a signed numeric type
+#define MAXPOS(x) ((x)((unsigned x)(1L << (sizeof(x)*8-1)) - 1))
+
+
+#endif
diff --git a/include/swmgr.h b/include/swmgr.h
new file mode 100644
index 0000000..24ad7e6
--- /dev/null
+++ b/include/swmgr.h
@@ -0,0 +1,294 @@
+/******************************************************************************
+* swmgr.h - definition of class SWMgr used to interact with an install
+* base of sword modules.
+*
+* $Id: swmgr.h,v 1.45 2002/08/08 21:35:05 scribe Exp $
+*
+* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+* CrossWire Bible Society
+* P. O. Box 2528
+* Tempe, AZ 85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+*/
+
+/** @mainpage The Sword Project 1.5.3 - API documentation
+* This is the API documentation of the Sword project.
+* it describes the structure of the Sword library and documents the functions of the classes.
+* From time to time this documentation gives programming examples, too.
+*
+* Sword provides an interface to different modules (Bibles/Commentaries/Lexicons)
+* on disk. The object to work directly with the modules is SWModule.
+* Use the class SWMgr to manage the modules.
+*
+* If you want to write your own frontend for Sword please have a look at the already existing ones.
+* Well knwon frontends are:\n
+* -BibleCS for Windows (the sourcecode is availble in the CVS of crosswire.org)\n
+* -GnomeSword (http://gnomesword.sourceforge.net/)\n
+* -BibleTime (http://www.bibletime.de/)\n
+*/
+
+#ifndef SWMGR_H
+#define SWMGR_H
+
+#include <sys/types.h>
+#include <string>
+#include <map>
+#include <list>
+#include <swmodule.h>
+#include <swconfig.h>
+#include <swlog.h>
+#include <swfiltermgr.h>
+
+#include <defs.h>
+
+using namespace std;
+
+typedef map < string, SWModule *, less < string > >ModMap;
+typedef list < string > OptionsList;
+typedef map < string, SWFilter * >FilterMap;
+
+/** SWMgr is the main class of the Sword library.
+*
+* SWmgr manages the installed modules, the filters and global options like footnotes or strong numbers.
+* The class SWMgr is the most important class of Sword. It is used to manage the installed modules.
+* It also manages the filters (Render-, Strip- and Rawfilters).
+*
+* To get the SWModule objects of the instalelled modules use @ref Modules for this.
+* @see AddRawFilters(), AddRenderFilters(), AddStripFilters()
+* @version $Id: swmgr.h,v 1.45 2002/08/08 21:35:05 scribe Exp $
+*/
+class SWDLLEXPORT SWMgr {
+
+private:
+ void commonInit(SWConfig * iconfig, SWConfig * isysconfig, bool autoload, SWFilterMgr *filterMgr);
+
+protected:
+ SWFilterMgr *filterMgr; //made protected because because BibleTime needs it
+ SWConfig * myconfig; //made protected because because BibleTime needs it
+ SWConfig *mysysconfig;
+ SWConfig *homeConfig;
+ void CreateMods();
+ SWModule *CreateMod(string name, string driver, ConfigEntMap & section);
+ void DeleteMods();
+ char configType; // 0 = file; 1 = directory
+ FilterMap optionFilters;
+ FilterMap cipherFilters;
+ SWFilter *gbfplain;
+ SWFilter *thmlplain;
+ SWFilter *transliterator;
+ FilterList cleanupFilters;
+ OptionsList options;
+ virtual void init(); // use to initialize before loading modules
+ virtual char AddModToConfig(int 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);
+ list<string> augPaths;
+
+ /**
+ * 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);
+ /**
+ * Adds the render filters which are defined in "section" to the SWModule object "module".
+ * @param module To this module the render filter(s) are added
+ * @param section We use this section to get a list of filters we should apply to the module
+ */
+ virtual void AddRenderFilters(SWModule * module, ConfigEntMap & section);
+ /**
+ * Adds the strip filters which are defined in "section" to the SWModule object "module".
+ * @param module To this module the strip filter(s) are added
+ * @param section We use this section to get a list of filters we should apply to the module
+ */
+ virtual void AddStripFilters(SWModule * module, ConfigEntMap & section);
+ /**
+ * 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 augmentModules(const char *ipath);
+
+public:
+
+ /** Enable / Disable debug output on runtime
+ * Set this to true to get more verbose output of SWMgr at runtime. Set it to false to get no debug output.
+ * The default is "false".
+ */
+ static bool debug;
+ static bool isICU;
+ static const char *globalConfPath;
+ /**
+ *
+ */
+ static void findConfig(char *configType, char **prefixPath, char **configPath, list<string> *augPaths = 0);
+ /** The global config object.
+ * This is the global config object. It contains all items of all modules,
+ * so lookups of entries should use this config object.
+ * If you want to save a cipher key or other things to the module config file,
+ * DO NOT USE this object, because it would corrupt your config files after config->Save().
+ *
+ * If you want to write to the modules config file read the informtaion of @ref setCipherKey() for an example of this.
+ */
+ SWConfig *config;
+ /**
+ *
+ */
+ SWConfig *sysconfig;
+ /** The map of available modules.
+ * This map contains thew list of available modules in Sword.
+ * Here's an example how to got through the map and how toc ehck for the module type.
+ *
+ *@code
+ * ModMap::iterator it;
+ * SWModule* curMod = 0;
+ *
+ * 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
+ * }
+ * }
+ * @endcode
+ */
+ ModMap Modules;
+ /** The path to your Sword directory
+ *
+ */
+ char *prefixPath;
+ /**
+ *
+ */
+ char *configPath;
+
+ /** Constructor of SWMgr.
+ *
+ * @param iconfig
+ * @param isysconfig
+ * @param autoload If this bool is true the constructor starts loading the installed modules. If you reimplemented SWMgr you can set autoload=false to load the modules with your own reimplemented function.
+ * @param filterMgr an SWFilterMgr subclass to use to manager filters on modules THIS WILL BE DELETED BY SWMgr
+ */
+ SWMgr(SWConfig * iconfig = 0, SWConfig * isysconfig = 0, bool autoload = true, SWFilterMgr *filterMgr = 0);
+ /**
+ *
+ * @param filterMgr an SWFilterMgr subclass to use to manager filters on modules THIS WILL BE DELETED BY SWMgr
+ */
+ SWMgr(SWFilterMgr *filterMgr);
+ /**
+ *
+ * @param autoload If this bool is true the constructor starts loading the
+ * installed modules. If you reimplemented SWMgr you can set autoload=false
+ * to load the modules with your own reimplemented function.
+ * @param filterMgr an SWFilterMgr subclass to use to manager filters on
+ * modules THIS WILL BE DELETED BY SWMgr
+ *
+ */
+ SWMgr(const char *iConfigPath, bool autoload = true, SWFilterMgr *filterMgr = 0);
+ /** The destructor of SWMgr.
+ * This function cleans up the modules and deletes the created object.
+ * Destroy the SWMgr at last object in your application, because otherwise you may experience crashes
+ * because the SWModule objects become invalid.
+ */
+ virtual ~SWMgr();
+ /**Installs a scan for modules in the directory givan as parameter.
+ * @param dir The directory where new modules should be searched.
+ */
+ virtual void InstallScan(const char *dir);
+ /** Load the modules.
+ * Reimplement this function to use your own Load function,
+ * for example to use your own filters.
+ */
+ virtual signed char Load();
+ /** Set a global option
+ * Set a global option using the parameters. A global option could be for
+ * example footnotes.
+ * @param option The name of the option, for which you want to change the
+ * value. Well known and often used values are "Footnotes" or "Strongs"
+ * @param value The value. Common values are "On" and "Off"
+ */
+ virtual void setGlobalOption(const char *option, const char *value);
+ /** Gives the value of the given option
+ * @param The option, which should be used to return the value of it
+ * @return The value of the given option
+ */
+ virtual const char *getGlobalOption(const char *option);
+ /** Gives a description for the given option
+ * @param option The option, which should be used
+ * @return A description of the given option
+ * @see setGlobalOption, getGlobalOption, getGlobalOptions
+ */
+ virtual const char *getGlobalOptionTip(const char *option);
+ /** A list of all availble options with the currently set values
+ * @return This function returns a list of global options.
+ */
+ virtual OptionsList getGlobalOptions();
+ /**
+ *
+ */
+ virtual OptionsList getGlobalOptionValues(const char *option);
+ /**
+ * 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:
+ *
+ * @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;
+ * }
+ * }
+ * }
+ * closedir(dir);
+ * @endcode
+ *
+ * @param modName For this module we change the unlockKey
+ * @paran key This is the new unlck key we use for te module.
+ */
+ virtual signed char setCipherKey(const char *modName, const char *key);
+};
+#endif
diff --git a/include/swmodule.h b/include/swmodule.h
new file mode 100644
index 0000000..1dc1307
--- /dev/null
+++ b/include/swmodule.h
@@ -0,0 +1,556 @@
+/******************************************************************************
+* swmodule.h - code for base class 'module'. Module is the basis for all
+* types of modules (e.g. texts, commentaries, maps, lexicons,
+* etc.)
+*
+* $Id: swmodule.h,v 1.49 2002/07/30 10:17:30 scribe Exp $
+*
+* Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+* CrossWire Bible Society
+* P. O. Box 2528
+* Tempe, AZ 85280-2528
+*
+* This program is free software; you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation version 2.
+*
+* This program is distributed in the hope that it will be useful, but
+* WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* General Public License for more details.
+*
+*/
+
+#ifndef SWMODULE_H
+#define SWMODULE_H
+
+#include <swdisp.h>
+#include <swkey.h>
+#include <listkey.h>
+#include <swfilter.h>
+#include <swconfig.h>
+#include <swcacher.h>
+#include <list>
+
+#include <defs.h>
+#include <multimapwdef.h>
+
+using namespace std;
+
+
+#define SWMODULE_OPERATORS \
+ operator const char *() { return RenderText(); } \
+ operator SWKey &() { return *key; } \
+ operator SWKey *() { return key; } \
+ SWModule &operator <<(const char *inbuf) { setEntry(inbuf); return *this; } \
+ SWModule &operator <<(const SWKey *sourceKey) { linkEntry(sourceKey); return *this; } \
+ SWModule &operator -=(int steps) { decrement(steps); return *this; } \
+ 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; }
+
+
+typedef list < SWFilter * >FilterList;
+
+typedef map < string, string, less < string > > AttributeValue;
+typedef map < string, AttributeValue, less < string > > AttributeList;
+typedef map < string, AttributeList, less < string > > AttributeTypeList;
+
+#define SWTextDirection char
+#define SWTextEncoding char
+#define SWTextMarkup char
+
+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};
+enum {ENC_UNKNOWN = 0, ENC_LATIN1, ENC_UTF8, ENC_SCSU, ENC_UTF16, ENC_RTF, ENC_HTML};
+
+/**
+ * The class SWModule is the base class for all modules used in Sword.
+ * It provides functions to look up a text passage, to search in the module,
+ * to switch on/off the state of optional things like Strong's numbers or footnotes.
+ *
+ * SWModule has also functions to write to the data files.
+ */
+
+class SWDLLEXPORT SWModule : public SWCacher {
+
+protected:
+
+ ConfigEntMap ownConfig;
+ ConfigEntMap *config;
+ mutable AttributeTypeList entryAttributes;
+ mutable bool procEntAttr;
+
+ char error;
+ bool skipConsecutiveLinks;
+
+ /** the current key */
+ SWKey *key;
+
+ ListKey listkey;
+ char *modname;
+ char *moddesc;
+ char *modtype;
+ char *modlang;
+
+ char direction;
+ char markup;
+ char encoding;
+
+ /** this module's display object */
+ SWDisplay *disp;
+
+ static SWDisplay rawdisp;
+ char *entrybuf;
+ unsigned long entrybufallocsize;
+
+ /** executed to remove all markup (for searches) */
+ FilterList *stripFilters;
+
+ /** executed immediately upon fileread */
+ FilterList *rawFilters;
+
+ /** executed to format for display */
+ FilterList *renderFilters;
+
+ /** executed to change markup to user prefs */
+ FilterList *optionFilters;
+
+ /** executed to decode text for display */
+ FilterList *encodingFilters;
+
+ int entrySize;
+
+ public:
+ /**
+ * This is the default callback function for searching.
+ * This function is a placeholder and does nothing.
+ * You can define your own function for search progress
+ * evaluation, and pass it over to @ref Search.
+ */
+ static void nullPercent(char percent, void *userData);
+ /**
+ * Set this bool to false to terminate the search which is executed by this module (@ref #Search).
+ * This is useful for threaded applications to terminate the search in another thread.
+ */
+ bool terminateSearch;
+ /** Initializes data for instance of SWModule
+ *
+ * @param imodname Internal name for module; see also @ref Name
+ * @param imoddesc Name to display to user for module;
+ * see also @ref Description
+ * @param idisp Display object to use for displaying
+ * see also @ref Disp
+ * @param imodtype Type of Module
+ * (All modules will be displayed with
+ * others of same type under their modtype heading)
+ * see also @ref Type
+ */
+ SWModule(const char *imodname = 0, const char *imoddesc = 0, SWDisplay * idisp = 0, char *imodtype = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* modlang = 0);
+ /** Cleans up instance of SWModule
+ */
+ virtual ~SWModule();
+ /** Gets and clears error status
+ *
+ * @return error status
+ */
+ virtual char Error();
+ /**
+ * @return True if this module is encoded in Unicode, otherwise return false.
+ */
+ virtual const bool isUnicode() const { return (encoding == (char)ENC_UTF8 || encoding == (char)ENC_SCSU); }
+
+ // These methods are useful for modules that come from a standard SWORD install (most do).
+ // SWMgr will call setConfig. The user may use getConfig and getConfigEntry (if they
+ // are not comfortable with, or don't wish to use stl maps).
+ virtual const ConfigEntMap &getConfig() const { return *config; }
+ virtual void setConfig(ConfigEntMap *config);
+ virtual const char *getConfigEntry(const char *key) const;
+
+ /**
+ * @return The size of the current entry.
+ */
+ virtual const int getEntrySize() const { return entrySize; }
+ /**
+ * Sets a key to this module for position to a
+ * particular record or set of records
+ *
+ * @param ikey key with which to set this module
+ * @return error status
+ */
+ virtual char SetKey(const SWKey *ikey);
+ /**
+ * Sets the key of this module. Similair to @see SetKey(const SWKey*) .
+ * @param ikey The SWKey which should be used as new key.
+ * @return Error status
+ */
+ virtual char SetKey(const SWKey &ikey);
+ /** Gets the current module key
+ * @return the current key of this module
+ */
+ virtual SWKey & Key() const { return *key; }
+ /** Sets the current key of the module to ikey, and returns
+ * the keytext
+ *
+ * @param ikey new current key for the module
+ * @return the keytext of the current module key
+ */
+ virtual char Key(const SWKey & ikey) { return SetKey(ikey); }
+ /** Sets/gets module KeyText
+ *
+ * @param ikeytext value which to set keytext;
+ * [0] - only get
+ * @return pointer to keytext
+ */
+ virtual const char *KeyText(const char *imodtype = 0);
+ /** Calls this modules display object and passes itself
+ *
+ * @return error status
+ */
+ virtual char Display();
+ /** Sets/gets display driver
+ *
+ * @param idisp value which to set disp;
+ * [0] - only get
+ * @return pointer to disp
+ */
+ virtual SWDisplay *Disp(SWDisplay * idisp = 0);
+ /** Sets/gets module name
+ *
+ * @param imodname value which to set modname;
+ * [0] - only get
+ * @return pointer to modname
+ */
+ virtual char *Name(const char *imodname = 0);
+ /** Sets/gets module description
+ *
+ * @param imoddesc value which to set moddesc;
+ * [0] - only get
+ * @return pointer to moddesc
+ */
+ virtual char *Description(const char *imoddesc = 0);
+ /** Sets/gets module type
+ *
+ * @param imodtype value which to set modtype;
+ * [0] - only get
+ * @return pointer to modtype
+ */
+ virtual char *Type(const char *imodtype = 0);
+ /** Sets/gets module direction
+ *
+ * @param newdir value which to set direction;
+ * [-1] - only get
+ * @return char direction
+ */
+ virtual char Direction(signed char newdir = -1);
+ /** Sets/gets module encoding
+ *
+ * @param newdir value which to set encoding;
+ * [-1] - only get
+ * @return char encoding
+ */
+ virtual char Encoding(signed char enc = -1);
+ /** Sets/gets module markup
+ *
+ * @param newdir value which to set markup;
+ * [-1] - only get
+ * @return char markup
+ */
+ virtual char Markup(signed char enc = -1);
+ /** Sets/gets module language
+ *
+ * @param imodlang value which to set modlang;
+ * [0] - only get
+ * @return pointer to modlang
+ */
+ virtual char *Lang(const char *imodlang = 0);
+
+ // search methods
+
+ /** Searches a module for a string
+ *
+ * @param istr string for which to search
+ * @param searchType type of search to perform
+ * <=0 ->regex; 1->phrase; 2->multiword;
+ * @param flags options flags for search
+ * @param justCheckIfSupported if set, don't search,
+ * only tell if this function supports requested search.
+ *
+ * @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,
+ void (*percent) (char, void *) = &nullPercent,
+ void *percentUserData = 0);
+ /**
+ *
+ */
+ virtual signed char createSearchFramework() { return 0; } // special search framework
+ /**
+ *
+ */
+ virtual bool hasSearchFramework() { return false; } // special search framework
+ /** Check if the search is optimally supported (e.g. if index files are presnt and working)
+ * This function checks whether the search framework may work in the best way.
+ * @return True if the the search is optimally supported, false if it's not working in the best way.
+ */
+ virtual bool isSearchOptimallySupported(const char *istr, int searchType,
+ int flags, SWKey * scope) {
+ bool retVal = false;
+ Search(istr, searchType, flags, scope, &retVal);
+ return retVal;
+ }
+ /** Allocates a key of specific type for module
+ * The different reimplementatiosn of SWModule (e.g. SWText) support SWKey implementations, which support special.
+ * This functions returns a SWKey object which works with the current implementation of SWModule. For example for the SWText class it returns a VerseKey object.
+ * @see VerseKey, ListKey, SWText, SWLD, SWCom
+ * @return pointer to allocated key
+ */
+ virtual SWKey *CreateKey();
+ /** This function is reimplemented by the different kinds
+ * of module objects
+ * @return the raw module text of the current entry
+ */
+#ifndef SWIG
+ virtual char *getRawEntry() = 0;
+#else
+ virtual char *getRawEntry() {};
+#endif
+
+
+ // write interface ----------------------------
+ /** Is the module writable? :)
+ * @return yes or no
+ */
+ virtual bool isWritable() { return false; }
+ /** Creates a new module
+ * @param path The first parameter is path of the new module
+ * @return error
+ */
+ static signed char createModule(const char *) { return -1; }
+ /** Modify the current module entry text
+ * - only if module @ref isWritable
+ * @return *this
+ */
+ virtual void setEntry(const char *inbuf, long len = -1) { }
+ /** Link the current module entry to another module entry
+ * - only if module @ref isWritable
+ */
+ virtual void linkEntry(const SWKey *sourceKey) { }
+ /** Delete current module entry - only if module @ref isWritable
+ *
+ */
+ virtual void deleteEntry() {}
+
+ // end write interface ------------------------
+
+ /** Decrements module key a number of entries
+ *
+ * @param decrement Number of entries to jump backward
+ * @return *this
+ */
+ virtual void decrement(int steps = 1);
+ /** Increments module key a number of entries
+ *
+ * @param increment Number of entries to jump forward
+ * @return *this
+ */
+ virtual void increment(int steps = 1);
+ /** Positions this modules to an entry
+ *
+ * @param p position (e.g. TOP, BOTTOM)
+ * @return *this
+ */
+ virtual void setPosition(SW_POSITION p);
+ /** Adds a RenderFilter to this module's @see renderfilters queue
+ * @param newfilter the filter to add
+ * @return *this
+ */
+ virtual SWModule & AddRenderFilter(SWFilter * newfilter) {
+ renderFilters->push_back (newfilter);
+ return *this;
+ }
+ /** Removes a RenderFilter from this module's @see renderfilters queue
+ * @param oldfilter the filter to remove
+ * @return *this
+ */
+ virtual SWModule & RemoveRenderFilter(SWFilter * oldfilter) {
+ renderFilters->remove (oldfilter);
+ return *this;
+ }
+ /** Replaces a RenderFilter in this module's @see renderfilters queue
+ * @param oldfilter the filter to remove
+ * @param newfilter the filter to add in its place
+ * @return *this
+ */
+ virtual SWModule & ReplaceRenderFilter(SWFilter * oldfilter, SWFilter * newfilter) {
+ FilterList::iterator iter;
+ for (iter = renderFilters->begin(); iter != renderFilters->end(); iter++) {
+ if (*iter == oldfilter)
+ *iter = newfilter;
+ }
+ return *this;
+ }
+ /** RenderFilter a text buffer
+ * @param buf the buffer to filter
+ * @param size the allocated size of the buffer
+ * @param key key location from where this buffer was extracted
+ * @return *this
+ */
+ virtual void renderFilter(char *buf, long size, SWKey *key) {
+ filterBuffer(renderFilters, buf, size, key);
+ }
+ /** Adds an EncodingFilter to this module's @see encodingfilters queue
+ * @param newfilter the filter to add
+ * @return *this
+ */
+ virtual SWModule & AddEncodingFilter(SWFilter * newfilter) {
+ encodingFilters->push_back (newfilter);
+ return *this;
+ }
+ /** Removes an EncodingFilter from this module's @see encodingfilters queue
+ * @param oldfilter the filter to remove
+ * @return *this
+ */
+ virtual SWModule & RemoveEncodingFilter(SWFilter * oldfilter) {
+ encodingFilters->remove (oldfilter);
+ return *this;
+ }
+ /** Replaces an EncodingFilter in this module's @see encodingfilters queue
+ * @param oldfilter the filter to remove
+ * @param newfilter the filter to add in its place
+ * @return *this
+ */
+ virtual SWModule & ReplaceEncodingFilter(SWFilter * oldfilter, SWFilter * newfilter) {
+ FilterList::iterator iter;
+ for (iter = encodingFilters->begin(); iter != encodingFilters->end(); iter++) {
+ if (*iter == oldfilter)
+ *iter = newfilter;
+ }
+ return *this;
+ }
+ /** encodingFilter a text buffer
+ * @param buf the buffer to filter
+ * @param size the allocated size of the buffer
+ * @param key key location from where this buffer was extracted
+ * @return *this
+ */
+ virtual void encodingFilter(char *buf, long size, SWKey *key) {
+ filterBuffer(encodingFilters, buf, size, key);
+ }
+ /** Adds a StripFilter to this module's @ref stripfilters queue
+ * @param newfilter the filter to add
+ * @return *this
+ */
+ virtual SWModule & AddStripFilter(SWFilter * newfilter) {
+ stripFilters->push_back (newfilter);
+ return *this;
+ }
+ /** StripFilter a text buffer
+ * @param buf the buffer to filter
+ * @param size the allocated size of the buffer
+ * @param key key location from where this buffer was extracted
+ * @return *this
+ */
+ virtual void stripFilter(char *buf, long size, SWKey *key) {
+ filterBuffer(stripFilters, buf, size, key);
+ }
+ /** Adds a RawFilter to this module's @ref rawfilters queue
+ * @param newfilter the filter to add
+ * @return *this
+ */
+ virtual SWModule & AddRawFilter(SWFilter * newfilter) {
+ rawFilters->push_back (newfilter);
+ return *this;
+ }
+ /** FilterBuffer a text buffer
+ * @param filters the FilterList of filters to iterate
+ * @param buf the buffer to filter
+ * @param size the allocated size of the buffer
+ * @param key key location from where this buffer was extracted
+ * @return *this
+ */
+ virtual void filterBuffer(FilterList *filters, char *buf, long size, SWKey *key) {
+ FilterList::iterator it;
+ for (it = filters->begin(); it != filters->end(); it++) {
+ (*it)->ProcessText(buf, size, key, this);
+ }
+ }
+ /** RawFilter a text buffer
+ * @param buf the buffer to filter
+ * @param size the allocated size of the buffer
+ * @param key key location from where this buffer was extracted
+ * @return *this
+ */
+ virtual void rawFilter(char *buf, long size, SWKey *key) {
+ buf[size] = 0;
+ filterBuffer(rawFilters, buf, size, key);
+ }
+ /** Adds an OptionFilter to this module's @ref optionfilters queue
+ * @param newfilter the filter to add
+ * @return *this
+ */
+ virtual SWModule & AddOptionFilter(SWFilter * newfilter) {
+ optionFilters->push_back(newfilter);
+ return *this;
+ }
+ /** OptionFilter a text buffer
+ * @param buf the buffer to filter
+ * @param size the allocated size of the buffer
+ * @param key key location from where this buffer was extracted
+ * @return *this
+ */
+ virtual void optionFilter(char *buf, long size, SWKey *key) {
+ filterBuffer(optionFilters, buf, size, key);
+ }
+ /** calls all StripFilters on buffer or current text
+ *
+ * @param buf buf to massage instead of current module position;
+ * if buf is NULL, the current text will be used
+ * @param len max len of buf OR current text -- will be applied anyway
+ * @return this module's text at specified key location massaged by Strip filters
+ */
+ virtual const char *StripText(char *buf = 0, int len = -1);
+ /** calls all RenderFilters on buffer or current text
+ *
+ * @param buf buffer to Render instead of current module position;
+ * if buf is NULL, the current text will be used
+ * @param len max len of buf OR current text -- will be applied anyway
+ * @return this module's text at specified key location massaged by Render filters
+ */
+ virtual const char *RenderText(char *buf = 0, int len = -1, bool render = true);
+ /** calls all StripFilters on current text
+ *
+ * @param tmpKey key to use to grab text
+ * @return this module's text at specified key location massaged by Strip filters
+ */
+ virtual const char *StripText(SWKey * tmpKey);
+ /** calls all RenderFilters on current text
+ *
+ * @param tmpKey key to use to grab text
+ * @return this module's text at specified key location massaged by Render filters
+ */
+ virtual const char *RenderText(SWKey * tmpKey);
+
+ /**
+ *
+ * option to specify behaviour when iterating over consecutive entried linked
+ * to same text
+ * @param val = true means only include entry once in iteration
+ */
+ virtual void setSkipConsecutiveLinks(bool val) { skipConsecutiveLinks = val; }
+ virtual bool getSkipConsecutiveLinks() { return skipConsecutiveLinks; }
+ virtual AttributeTypeList &getEntryAttributes() const { return entryAttributes; }
+ virtual void processEntryAttributes(bool val) const { procEntAttr = val; }
+ virtual bool isProcessEntryAttributes() const { return procEntAttr; }
+
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+#endif
diff --git a/include/swobject.h b/include/swobject.h
new file mode 100644
index 0000000..567405b
--- /dev/null
+++ b/include/swobject.h
@@ -0,0 +1,54 @@
+#ifndef SWOBJECT_H
+#define SWOBJECT_H
+
+#include <utilfuns.h>
+#if !defined(__GNUC__) && !defined(_WIN32_WCE)
+#else
+#include <unixstr.h>
+#endif
+
+#include <defs.h>
+#include <string.h>
+
+#define SWDYNAMIC_CAST(className, object) (className *)((object)?((object->getClass()->isAssignableFrom(#className))?object:0):0)
+
+/**
+* Class used for SWDYNAMIC_CAST to save the inheritance order.
+*/
+class SWDLLEXPORT SWClass {
+private:
+ const char **descends;
+
+public:
+ SWClass(const char **descends) {
+ this->descends = descends;
+ }
+
+ bool isAssignableFrom(const char *className) const {
+ for (int i = 0; descends[i]; i++) {
+ if (!stricmp(descends[i], className))
+ return true;
+ }
+ return false;
+ }
+};
+
+/** Base class for major Sword classes.
+* SWObject is the base class for major Sword classes like SWKey.
+* It is used because dynamic_cast is not available on all plattforms supported
+* by Sword. Use SWDYNAMIC_CAST(classname, object) instead of dynamic_cast<classname>(object).
+*/
+class SWObject {
+protected:
+ SWClass * myclass;
+
+public:
+ /** Use this to get the class definition and inheritance order.
+ * @return The class definition of this object
+ */
+ const SWClass *getClass () const {
+ return myclass;
+ }
+};
+
+#endif
diff --git a/include/swremotemgr.h b/include/swremotemgr.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/include/swremotemgr.h
diff --git a/include/swtext.h b/include/swtext.h
new file mode 100644
index 0000000..ee2b92b
--- /dev/null
+++ b/include/swtext.h
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * swtext.h - code for base class 'SWText'. SWText is the basis for all
+ * types of text modules
+ *
+ * $Id: swtext.h,v 1.11 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWTEXT_H
+#define SWTEXT_H
+
+#include <swmodule.h>
+#include <versekey.h>
+#include <listkey.h>
+
+#include <defs.h>
+
+/** The basis for all text modules
+ */
+class SWDLLEXPORT SWText : public SWModule {
+public:
+ /** Initializes data for instance of SWText
+ *
+ * @param imodname Internal name for module
+ * @param imoddesc Name to display to user for module
+ * @param idisp Display object to use for displaying
+ */
+ SWText(const char *imodname = 0, const char *imoddesc = 0,
+ SWDisplay * idisp = 0,
+ SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+
+ virtual ~SWText();
+ /** Create the correct key (VerseKey) for use with SWText
+ */
+ virtual SWKey *CreateKey();
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/swunicod.h b/include/swunicod.h
new file mode 100644
index 0000000..af25630
--- /dev/null
+++ b/include/swunicod.h
@@ -0,0 +1,38 @@
+/*
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+
+#ifndef SWUNICOD_H
+#define SWUNICOD_H
+
+/** Converts a 32-bit unsigned integer UTF-32 value into a UTF-8 encoded 1-6 byte array
+ * @param utf32 the UTF-32 Unicode code point value
+ * @param utf8 pointer to an array of 6 unsigned chars to contain the UTF-8 value
+ * @return utf8
+ */
+unsigned char* UTF32to8 (unsigned long utf32, unsigned char * utf8);
+
+
+/** Converts a UTF-8 encoded 1-6 byte array into a 32-bit unsigned integer UTF-32 value
+ * @param utf8 pointer to an array of 6 unsigned chars containing the UTF-8 value, starting in the utf8[0]
+ * @param utf32 the UTF-32 Unicode code point value
+ * @return utf32
+ */
+unsigned long UTF8to32 (unsigned char * utf8, unsigned long utf32);
+
+#endif
diff --git a/include/swversion.h b/include/swversion.h
new file mode 100644
index 0000000..a34a9e6
--- /dev/null
+++ b/include/swversion.h
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * swversion.h - definition of class SWVersion used to compare version info
+ *
+ * $Id: swversion.h,v 1.4 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWORDVER
+#define SWORDVER "1.5.3"
+#endif
+
+#ifndef SWVERSION_H
+#define SWVERSION_H
+
+class SWVersion {
+ public:
+ int major, minor, minor2, minor3;
+
+ SWVersion(const char *version = "0.0");
+ int compare(const SWVersion &vi) const;
+ const char *getText() const;
+ operator const char *() const { return getText(); }
+ bool operator>(const SWVersion &vi) const {return (compare(vi) > 0);}
+ bool operator<(const SWVersion &vi) const {return (compare(vi) < 0);}
+ bool operator==(const SWVersion &vi) const {return (compare(vi) == 0);}
+
+ // current sword library version
+ static SWVersion currentVersion;
+};
+
+#endif
+
diff --git a/include/swwinlog.h b/include/swwinlog.h
new file mode 100644
index 0000000..579e37b
--- /dev/null
+++ b/include/swwinlog.h
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * swwinlog.h - definition of SWWinLog-- a derivitive of SWLog used to
+ * handle logging in the MSWindows environment
+ *
+ * $Id: swwinlog.h,v 1.2 2001/02/09 15:38:51 jansorg Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+//---------------------------------------------------------------------------
+#ifndef swwinlogH
+#define swwinlogH
+//---------------------------------------------------------------------------
+
+#include <swlog.h>
+
+class SWWinLog:public SWLog
+{
+ HWND parent;
+public:
+ SWWinLog (HWND iparent);
+ virtual void LogWarning (char *fmt, ...);
+ virtual void LogError (char *fmt, ...);
+ virtual void LogTimedInformation (char *fmt, ...);
+ virtual void LogInformation (char *fmt, ...);
+};
+
+
+#endif
diff --git a/include/sysdata.h b/include/sysdata.h
new file mode 100644
index 0000000..deb2e5c
--- /dev/null
+++ b/include/sysdata.h
@@ -0,0 +1,76 @@
+#ifndef SIZEDTYPES_H
+#define SIZEDTYPES_H
+/*
+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
+ * header files exported to user space
+ */
+#ifdef USE_AUTOTOOLS
+#include "config.h"
+#endif
+
+typedef signed char __s8;
+typedef unsigned char __u8;
+
+typedef signed short __s16;
+typedef unsigned short __u16;
+
+typedef signed int __s32;
+typedef unsigned int __u32;
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+//typedef __signed__ long long __s64;
+//typedef unsigned long long __u64;
+#endif
+
+
+#define __swap16(x) \
+ ((__u16)( \
+ (((__u16)(x) & (__u16)0x00ffU) << 8) | \
+ (((__u16)(x) & (__u16)0xff00U) >> 8) ))
+
+
+#define __swap32(x) \
+ ((__u32)( \
+ (((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
+ (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
+ (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
+ (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+
+
+#define __swap64(x) \
+ ((__u64)( \
+ (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | \
+ (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | \
+ (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | \
+ (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | \
+ (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | \
+ (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | \
+ (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | \
+ (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+
+
+
+
+#ifndef WORDS_BIGENDIAN
+
+#define swordtoarch16(x) (x)
+#define swordtoarch32(x) (x)
+#define swordtoarch64(x) (x)
+#define archtosword16(x) (x)
+#define archtosword32(x) (x)
+#define archtosword64(x) (x)
+
+#else
+
+#define swordtoarch16(x) __swap16(x)
+#define swordtoarch32(x) __swap32(x)
+#define swordtoarch64(x) __swap64(x)
+#define archtosword16(x) __swap16(x)
+#define archtosword32(x) __swap32(x)
+#define archtosword64(x) __swap64(x)
+
+
+#endif
+
+
+#endif
diff --git a/include/tbdisp.h b/include/tbdisp.h
new file mode 100644
index 0000000..8064da5
--- /dev/null
+++ b/include/tbdisp.h
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * tbdisp.cpp - code for class 'tbdisp'. tbdisp writes module output to a
+ * MSWindows TextBox (or any other control that takes a
+ * SetDialogItemText
+ *
+ * $Id: tbdisp.h,v 1.2 2001/02/09 15:38:51 jansorg Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef TBDISP_H
+#define TBDISP_H
+
+#include <windows.h>
+class SWModule;
+
+class TBDisp:public SWDisplay
+{
+protected:
+ HWND wnd;
+ int ctrlid;
+public:
+ TBDisp (HWND iwnd, int ictrlid);
+ virtual char Display (SWModule & imodule);
+};
+#endif
diff --git a/include/thmlfootnotes.h b/include/thmlfootnotes.h
new file mode 100644
index 0000000..871700f
--- /dev/null
+++ b/include/thmlfootnotes.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id:
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLFOOTNOTES_H
+#define THMLFOOTNOTES_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+/** This Filter shows/hides footnotes in a ThML text
+ */
+class SWDLLEXPORT ThMLFootnotes:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ ThMLFootnotes ();
+ virtual ~ ThMLFootnotes ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/thmlgbf.h b/include/thmlgbf.h
new file mode 100644
index 0000000..02ae82e
--- /dev/null
+++ b/include/thmlgbf.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * thmlgbf.h
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLGBF_H
+#define THMLGBF_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts ThML text to GBF text
+ */
+class SWDLLEXPORT ThMLGBF:public SWFilter
+{
+public:
+ ThMLGBF ();
+ virtual char ProcessText (char *text, int maxlen = -1);
+};
+
+#endif
diff --git a/include/thmlheadings.h b/include/thmlheadings.h
new file mode 100644
index 0000000..f159503
--- /dev/null
+++ b/include/thmlheadings.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id:
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLHEADINGS_H
+#define THMLHEADINGS_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides headings in a ThML text
+ */
+class SWDLLEXPORT ThMLHeadings:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ ThMLHeadings ();
+ virtual ~ ThMLHeadings ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/thmlhtml.h b/include/thmlhtml.h
new file mode 100644
index 0000000..f6c29ad
--- /dev/null
+++ b/include/thmlhtml.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ thmlhtml.h - description
+ -------------------
+ begin : 1999-10-28
+
+ copyright : 1999 by Chris Little
+ email : chrislit@chiasma.org
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef THMLHTML_H
+#define THMLHTML_H
+
+#include <swbasicfilter.h>
+
+#include <defs.h>
+
+/** this filter converts ThML text to HTML text
+ */
+class SWDLLEXPORT ThMLHTML : public SWBasicFilter {
+protected:
+ virtual bool handleToken(char **buf, const char *token, DualStringMap &userData);
+public:
+ ThMLHTML();
+};
+
+#endif
diff --git a/include/thmlhtmlhref.h b/include/thmlhtmlhref.h
new file mode 100644
index 0000000..dc1d192
--- /dev/null
+++ b/include/thmlhtmlhref.h
@@ -0,0 +1,33 @@
+/***************************************************************************
+ thmlhtmlhref.h - description
+ -------------------
+ begin : 2001-09-03
+ copyright : 2001 by CrossWire Bible Society
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef _THMLHTMLHREF_H
+#define _THMLHTMLHREF_H
+
+#include <swbasicfilter.h>
+
+#include <defs.h>
+
+/** this filter converts ThML text to HTML text with hrefs
+ */
+class SWDLLEXPORT ThMLHTMLHREF : public SWBasicFilter {
+protected:
+ virtual bool handleToken(char **buf, const char *token, DualStringMap &userData);
+public:
+ ThMLHTMLHREF();
+};
+
+#endif /* _THMLHTMLHREF_H */
diff --git a/include/thmllemma.h b/include/thmllemma.h
new file mode 100644
index 0000000..b2ab320
--- /dev/null
+++ b/include/thmllemma.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id:
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLLEMMA_H
+#define THMLLEMMA_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides lemmas in a ThML text
+ */
+class SWDLLEXPORT ThMLLemma:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ ThMLLemma ();
+ virtual ~ ThMLLemma ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/thmlmorph.h b/include/thmlmorph.h
new file mode 100644
index 0000000..c71a380
--- /dev/null
+++ b/include/thmlmorph.h
@@ -0,0 +1,57 @@
+/*
+ * $Id:
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLMORPH_H
+#define THMLMORPH_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides morph tags in a ThML text
+ */
+class SWDLLEXPORT ThMLMorph:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ ThMLMorph ();
+ virtual ~ ThMLMorph ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/thmlolb.h b/include/thmlolb.h
new file mode 100644
index 0000000..6f6c0f7
--- /dev/null
+++ b/include/thmlolb.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * thmlolb.h
+ *
+ * Copyright 2001 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 THMLOLB_H
+#define THMLOLB_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts ThML text to OLB text
+ */
+class SWDLLEXPORT ThMLOLB:public SWFilter
+{
+public:
+ ThMLOLB ();
+ virtual char ProcessText (char *text, int maxlen = -1);
+};
+
+#endif
diff --git a/include/thmlosis.h b/include/thmlosis.h
new file mode 100644
index 0000000..038d4b6
--- /dev/null
+++ b/include/thmlosis.h
@@ -0,0 +1,35 @@
+/***************************************************************************
+ thmlosis.h - description
+ -------------------
+ begin : 2001-09-03
+ copyright : 2001 by CrossWire Bible Society
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef THMLOSIS_H
+#define THMLOSIS_H
+
+#include <defs.h>
+#include <swfilter.h>
+
+/** this filter converts ThML text to HTML text with hrefs
+ */
+class SWDLLEXPORT ThMLOSIS : public SWFilter {
+protected:
+ virtual const char *convertToOSIS(const char *, const SWKey *key);
+ void pushString(char **buf, const char *format, ...);
+public:
+ ThMLOSIS();
+ virtual ~ThMLOSIS();
+ char ProcessText(char *text, int maxlen, const SWKey *, const SWModule * = 0);
+};
+
+#endif /* THMLOSIS_H */
diff --git a/include/thmlplain.h b/include/thmlplain.h
new file mode 100644
index 0000000..0a753fe
--- /dev/null
+++ b/include/thmlplain.h
@@ -0,0 +1,37 @@
+/*
+ *
+ * thmlplain.h
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLPLAIN_H
+#define THMLPLAIN_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts ThML text to plain text
+ */
+class SWDLLEXPORT ThMLPlain:public SWFilter
+{
+public:
+ ThMLPlain ();
+ virtual char ProcessText (char *text, int maxlen = -1);
+};
+
+#endif
diff --git a/include/thmlrtf.h b/include/thmlrtf.h
new file mode 100644
index 0000000..319cf4e
--- /dev/null
+++ b/include/thmlrtf.h
@@ -0,0 +1,38 @@
+/*
+ *
+ * thmlrtf.h
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLRTF_H
+#define THMLRTF_H
+
+#include <swbasicfilter.h>
+
+#include <defs.h>
+
+ /** this filter converts ThML text to RTF text
+ */
+class SWDLLEXPORT ThMLRTF:public SWBasicFilter
+{
+protected:
+ virtual bool handleToken(char **buf, const char *token, DualStringMap &userData);
+public:
+ ThMLRTF ();
+};
+
+#endif
diff --git a/include/thmlscripref.h b/include/thmlscripref.h
new file mode 100644
index 0000000..da96c42
--- /dev/null
+++ b/include/thmlscripref.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id:
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLSCRIPREF_H
+#define THMLSCRIPREF_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+/** This Filter shows/hides scripture references in a ThML text
+ */
+class SWDLLEXPORT ThMLScripref:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ ThMLScripref ();
+ virtual ~ ThMLScripref ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/thmlstrongs.h b/include/thmlstrongs.h
new file mode 100644
index 0000000..2b37d87
--- /dev/null
+++ b/include/thmlstrongs.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * $Id:
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef THMLSTRONGS_H
+#define THMLSTRONGS_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides strong's numbers in a ThML text
+ */
+class SWDLLEXPORT ThMLStrongs:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ ThMLStrongs ();
+ virtual ~ ThMLStrongs ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/thmlvariants.h b/include/thmlvariants.h
new file mode 100644
index 0000000..973b1e3
--- /dev/null
+++ b/include/thmlvariants.h
@@ -0,0 +1,61 @@
+/*
+ *
+ * Copyright 2001 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 THMLVARIANTS_H
+#define THMLVARIANTS_H
+
+#include <swfilter.h>
+#include <swmodule.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides textual variants
+ */
+class SWDLLEXPORT ThMLVariants : public SWFilter
+{
+ char option;
+
+ static const char primary[];
+ static const char secondary[];
+ static const char all[];
+
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+
+ public:
+ ThMLVariants ();
+ virtual ~ ThMLVariants ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/treekey.h b/include/treekey.h
new file mode 100644
index 0000000..8768ac5
--- /dev/null
+++ b/include/treekey.h
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * versekey.h - code for class 'versekey'- a standard Biblical verse key
+ *
+ * $Id: treekey.h,v 1.3 2002/04/15 21:26:44 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+
+#ifndef TREEKEY_H
+#define TREEKEY_H
+
+#include <swkey.h>
+#include <swmacs.h>
+
+#include <defs.h>
+
+
+/**
+ * Class VerseKey
+ * The SWKey implementation used for verse based modules like Bibles or commentaries.
+ */
+class SWDLLEXPORT TreeKey : public SWKey {
+ static SWClass classdef;
+ void init();
+
+public:
+// TreeKey (const char *ikey = 0);
+// TreeKey (const SWKey * ikey);
+// TreeKey (TreeKey const &k);
+ TreeKey () { init(); };
+ ~TreeKey () {};
+
+
+ virtual const char *getLocalName() = 0;
+ virtual const char *setLocalName(const char *) = 0;
+
+ virtual const char *getUserData(int *size = 0) = 0;
+ virtual void setUserData(const char *userData, int size = 0) = 0;
+
+ virtual const char *getFullName() const = 0;
+
+ virtual void root() = 0;
+ virtual bool parent() = 0;
+
+ virtual bool firstChild() = 0;
+ virtual bool nextSibling() = 0;
+ virtual bool previousSibling() = 0;
+
+ virtual bool hasChildren() = 0;
+
+ virtual void append() = 0;
+ virtual void appendChild() = 0;
+ virtual void insertBefore() = 0;
+
+ virtual void remove() = 0;
+
+ virtual void setOffset(unsigned long offset) = 0;
+ virtual unsigned long getOffset() const = 0;
+
+ virtual void setText(const char *ikey) = 0;
+ virtual void setPosition(SW_POSITION p) = 0;
+ virtual const char *getText() const = 0;
+ virtual int compare(const SWKey &ikey) = 0;
+ virtual void decrement(int steps = 1) = 0;
+ virtual void increment(int steps = 1) = 0;
+ virtual char Traversable () { return 1; }
+ virtual long Index () const { return getOffset(); }
+ virtual long Index (long iindex) { setOffset(iindex); return getOffset(); }
+
+ SWKEY_OPERATORS
+
+ };
+
+
+#endif
diff --git a/include/treekeyidx.h b/include/treekeyidx.h
new file mode 100644
index 0000000..bd28736
--- /dev/null
+++ b/include/treekeyidx.h
@@ -0,0 +1,121 @@
+/******************************************************************************
+ * versekey.h - code for class 'versekey'- a standard Biblical verse key
+ *
+ * $Id: treekeyidx.h,v 1.3 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+
+#ifndef TREEKEYIDX_H
+#define TREEKEYIDX_H
+
+#include <treekey.h>
+#include <sysdata.h>
+#include <filemgr.h>
+
+
+/**
+ * Class VerseKey
+ * The SWKey implementation used for verse based modules like Bibles or commentaries.
+ */
+class SWDLLEXPORT TreeKeyIdx : public TreeKey {
+
+ class TreeNode {
+ public:
+ TreeNode();
+ ~TreeNode();
+ void clear();
+ __u32 offset;
+ __s32 parent;
+ __s32 next;
+ __s32 firstChild;
+ char *name;
+ __u16 dsize;
+ char *userData;
+ } currentNode;
+
+ static SWClass classdef;
+
+ char *path;
+
+ FileDesc *idxfd;
+ FileDesc *datfd;
+
+ void getTreeNodeFromDatOffset(long ioffset, TreeNode *buf) const;
+ char getTreeNodeFromIdxOffset(long ioffset, TreeNode *node) const;
+ void saveTreeNode(TreeNode *node);
+ void saveTreeNodeOffsets(TreeNode *node);
+ void init();
+
+public:
+ TreeKeyIdx(const TreeKeyIdx &ikey);
+ TreeKeyIdx (const char *idxPath, int fileMode = -1);
+ ~TreeKeyIdx ();
+
+
+ virtual const char *getLocalName();
+ virtual const char *setLocalName(const char *);
+
+ virtual const char *getUserData(int *size = 0);
+ virtual void setUserData(const char *userData, int size = 0);
+
+ virtual const char *getFullName() const;
+
+ virtual void root();
+ virtual bool parent();
+
+ virtual bool firstChild();
+ virtual bool nextSibling();
+ virtual bool previousSibling();
+
+ virtual bool hasChildren();
+
+ virtual void append();
+ virtual void appendChild();
+ virtual void insertBefore();
+
+ virtual void remove();
+ virtual void save();
+
+ virtual void copyFrom(const TreeKeyIdx &ikey);
+ virtual void copyFrom(const SWKey & ikey);
+
+ void setOffset(unsigned long offset);
+ unsigned long getOffset() const;
+
+
+
+ // OPERATORS ------------------------------------------------------------
+
+
+ virtual SWKey &operator = (const TreeKeyIdx &ikey) { copyFrom(ikey); return *this; }
+ SWKEY_OPERATORS
+
+ virtual void setText(const char *ikey);
+ virtual void setPosition(SW_POSITION p);
+ virtual const char *getText() const;
+ virtual int _compare (const TreeKeyIdx & ikey);
+ virtual int compare(const SWKey &ikey);
+ virtual void decrement(int steps = 1);
+ virtual void increment(int steps = 1);
+ virtual char Traversable () { return 1; }
+
+ static signed char create(const char *path);
+};
+
+
+#endif
diff --git a/include/unicodertf.h b/include/unicodertf.h
new file mode 100644
index 0000000..be72707
--- /dev/null
+++ b/include/unicodertf.h
@@ -0,0 +1,36 @@
+/*
+ *
+ * $Id: unicodertf.h,v 1.3 2001/12/11 22:35:10 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UNICODERTF_H
+#define UNICODERTF_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts UTF-8 text into RTF Unicode tags
+ */
+class SWDLLEXPORT UnicodeRTF:public SWFilter {
+public:
+ UnicodeRTF();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/unixstr.h b/include/unixstr.h
new file mode 100644
index 0000000..87069b7
--- /dev/null
+++ b/include/unixstr.h
@@ -0,0 +1,28 @@
+// Include only if your UNIX compiler does not include stricmp but does include strcasecmp
+/*
+ *
+ * $Id: unixstr.h,v 1.2 2001/02/09 15:38:51 jansorg Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UNIXSTR_H
+#define UNIXSTR_H
+#include <string.h>
+
+int stricmp (const char *s1, const char *s2);
+
+#endif
diff --git a/include/untgz.h b/include/untgz.h
new file mode 100644
index 0000000..b91502b
--- /dev/null
+++ b/include/untgz.h
@@ -0,0 +1,9 @@
+#ifndef UNTGZ_H
+#define UNTGZ_H
+
+#include "zlib.h"
+
+int untargz(int fd, const char *dest);
+int untar(gzFile in, const char *dest);
+
+#endif \ No newline at end of file
diff --git a/include/utf16utf8.h b/include/utf16utf8.h
new file mode 100644
index 0000000..5481980
--- /dev/null
+++ b/include/utf16utf8.h
@@ -0,0 +1,35 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF16UTF8_H
+#define UTF16UTF8_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts UTF-16 encoded text to UTF-8
+ */
+class SWDLLEXPORT UTF16UTF8:public SWFilter {
+public:
+ UTF16UTF8();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/utf8arshaping.h b/include/utf8arshaping.h
new file mode 100644
index 0000000..411e1f5
--- /dev/null
+++ b/include/utf8arshaping.h
@@ -0,0 +1,46 @@
+/*
+ *
+ * Copyright 2001 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 UTF8ARSHAPING_H
+#define UTF8ARSHAPING_H
+
+#include <swfilter.h>
+
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/uchar.h>
+#include <unicode/ushape.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides reorders UTF-8 text according to Unicode BiDi
+ */
+class SWDLLEXPORT UTF8arShaping : public SWFilter
+{
+ private:
+ UConverter* conv;
+ UErrorCode err;
+ public:
+ UTF8arShaping();
+ ~UTF8arShaping();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
+
+
diff --git a/include/utf8bidireorder.h b/include/utf8bidireorder.h
new file mode 100644
index 0000000..61263e3
--- /dev/null
+++ b/include/utf8bidireorder.h
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright 2001 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 UTF8BIDIREORDER_H
+#define UTF8BIDIREORDER_H
+
+#include <swfilter.h>
+
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/uchar.h>
+#include <unicode/bidi.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides reorders UTF-8 text according to Unicode BiDi
+ */
+class SWDLLEXPORT UTF8BiDiReorder : public SWFilter
+{
+ private:
+ UConverter* conv;
+ UErrorCode err;
+ public:
+ UTF8BiDiReorder();
+ ~UTF8BiDiReorder();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
+
diff --git a/include/utf8cantillation.h b/include/utf8cantillation.h
new file mode 100644
index 0000000..c95e0ff
--- /dev/null
+++ b/include/utf8cantillation.h
@@ -0,0 +1,57 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF8CANTILLATION_H
+#define UTF8CANTILLATION_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides Hebrew cantillation marks in UTF8 text
+ */
+class SWDLLEXPORT UTF8Cantillation:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ UTF8Cantillation ();
+ virtual ~ UTF8Cantillation ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/utf8greekaccents.h b/include/utf8greekaccents.h
new file mode 100644
index 0000000..c579a18
--- /dev/null
+++ b/include/utf8greekaccents.h
@@ -0,0 +1,57 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF8GREEKACCENTS_H
+#define UTF8GREEKACCENTS_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides Greek Accents marks in UTF8 text
+ */
+class SWDLLEXPORT UTF8GreekAccents:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ UTF8GreekAccents ();
+ virtual ~ UTF8GreekAccents ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/utf8hebrewpoints.h b/include/utf8hebrewpoints.h
new file mode 100644
index 0000000..288500c
--- /dev/null
+++ b/include/utf8hebrewpoints.h
@@ -0,0 +1,57 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF8HEBREWPOINTS_H
+#define UTF8HEBREWPOINTS_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This Filter shows/hides Hebrew vowel points in UTF8 text
+ */
+class SWDLLEXPORT UTF8HebrewPoints:public SWFilter
+{
+ bool option;
+ static const char on[];
+ static const char off[];
+ static const char optName[];
+ static const char optTip[];
+ OptionsList options;
+public:
+ UTF8HebrewPoints ();
+ virtual ~ UTF8HebrewPoints ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/utf8html.h b/include/utf8html.h
new file mode 100644
index 0000000..f292efe
--- /dev/null
+++ b/include/utf8html.h
@@ -0,0 +1,35 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF8HTML_H
+#define UTF8HTML_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts UTF-8 text into HTML escape sequences
+ */
+class SWDLLEXPORT UTF8HTML:public SWFilter {
+public:
+ UTF8HTML();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/utf8latin1.h b/include/utf8latin1.h
new file mode 100644
index 0000000..0b9247b
--- /dev/null
+++ b/include/utf8latin1.h
@@ -0,0 +1,36 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF8Latin1_H
+#define UTF8Latin1_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts UTF-8 encoded text to Latin-1
+ */
+class SWDLLEXPORT UTF8Latin1:public SWFilter {
+ char replacementChar;
+public:
+ UTF8Latin1(char rchar = '?');
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/utf8nfc.h b/include/utf8nfc.h
new file mode 100644
index 0000000..15a0c3d
--- /dev/null
+++ b/include/utf8nfc.h
@@ -0,0 +1,43 @@
+/*
+ *
+ * Copyright 2001 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 UTF8NFC_H
+#define UTF8NFC_H
+
+#include <swfilter.h>
+
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/uchar.h>
+#include <unicode/unorm.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT UTF8NFC : public SWFilter
+{
+ private:
+ UConverter* conv;
+ UChar *source, *target;
+ UErrorCode err;
+ public:
+ UTF8NFC();
+ ~UTF8NFC();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/utf8nfkd.h b/include/utf8nfkd.h
new file mode 100644
index 0000000..9f4364e
--- /dev/null
+++ b/include/utf8nfkd.h
@@ -0,0 +1,43 @@
+/*
+ *
+ * Copyright 2001 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 UTF8NFKD_H
+#define UTF8NFKD_H
+
+#include <swfilter.h>
+
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/uchar.h>
+#include <unicode/unorm.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT UTF8NFKD : public SWFilter
+{
+ private:
+ UConverter* conv;
+ UChar *source, *target;
+ UErrorCode err;
+ public:
+ UTF8NFKD();
+ ~UTF8NFKD();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/utf8transliterator.h b/include/utf8transliterator.h
new file mode 100644
index 0000000..8e5175b
--- /dev/null
+++ b/include/utf8transliterator.h
@@ -0,0 +1,92 @@
+/*
+ *
+ * Copyright 2001 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 UTF8TRANSLITERATOR_H
+#define UTF8TRANSLITERATOR_H
+
+enum scriptEnum {SE_OFF, SE_LATIN, /*one-way (to) transliterators*/ SE_BASICLATIN, SE_BETA, SE_BGREEK, /*two-way transliterators*/ SE_GREEK, SE_HEBREW, SE_CYRILLIC, SE_ARABIC, SE_SYRIAC, SE_KATAKANA, SE_HIRAGANA, SE_JAMO, SE_HANGUL, SE_DEVANAGARI, SE_TAMIL, SE_BENGALI, SE_GURMUKHI, SE_GUJARATI, SE_ORIYA, SE_TELUGU, SE_KANNADA, SE_MALAYALAM, SE_THAI, SE_GEORGIAN, SE_ARMENIAN, SE_ETHIOPIC, SE_GOTHIC, SE_UGARITIC, SE_COPTIC, /*one-way (from) transliterators*/ SE_HAN, SE_KANJI};
+#define NUMSCRIPTS 32
+#define NUMTARGETSCRIPTS 5
+
+#include <swfilter.h>
+#include <swmodule.h>
+
+#include <unicode/utypes.h>
+#include <unicode/ucnv.h>
+#include <unicode/ustring.h>
+#include <unicode/uchar.h>
+
+#include <unicode/unistr.h>
+#include <unicode/translit.h>
+
+#include <defs.h>
+#include <map>
+
+struct SWTransData {
+ UnicodeString resource;
+ UTransDirection dir;
+};
+typedef map <const UnicodeString, SWTransData> SWTransMap;
+typedef pair<UnicodeString, SWTransData> SWTransPair;
+
+ /** This Filter uses ICU for transliteration
+ */
+class SWDLLEXPORT UTF8Transliterator : public SWFilter
+{
+private:
+
+ char option;
+
+ static const char optionstring[NUMTARGETSCRIPTS][16];
+
+ static const char optName[];
+ static const char optTip[];
+ static const char SW_RB_RULE_BASED_IDS[];
+ static const char SW_RB_RULE[];
+ static const char SW_RESDATA[];
+ OptionsList options;
+ static SWTransMap transMap;
+ UErrorCode utf8status;
+
+ void Load(UErrorCode &status);
+ void registerTrans(const UnicodeString& ID, const UnicodeString& resource,
+ UTransDirection dir, UErrorCode &status );
+ bool checkTrans(const UnicodeString& ID, UErrorCode &status );
+ Transliterator * createTrans(const UnicodeString& preID, const UnicodeString& ID,
+ const UnicodeString& postID, UTransDirection dir, UErrorCode &status );
+
+ public:
+ UTF8Transliterator ();
+ virtual char ProcessText (char *text, int maxlen, const SWKey * key, const SWModule * = 0);
+ virtual const char *getOptionName ()
+ {
+ return optName;
+ }
+ virtual const char *getOptionTip ()
+ {
+ return optTip;
+ }
+ virtual void setOptionValue (const char *ival);
+ virtual const char *getOptionValue ();
+ virtual OptionsList getOptionValues ()
+ {
+ return options;
+ }
+};
+
+#endif
diff --git a/include/utf8utf16.h b/include/utf8utf16.h
new file mode 100644
index 0000000..c4010a9
--- /dev/null
+++ b/include/utf8utf16.h
@@ -0,0 +1,35 @@
+/*
+ *
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTF8UTF16_H
+#define UTF8UTF16_H
+
+#include <swfilter.h>
+
+#include <defs.h>
+
+ /** This filter converts UTF-8 encoded text to UTF-16
+ */
+class SWDLLEXPORT UTF8UTF16:public SWFilter {
+public:
+ UTF8UTF16();
+ virtual char ProcessText (char *text, int maxlen, const SWKey *key, const SWModule * = 0);
+};
+
+#endif
diff --git a/include/utilconf.h b/include/utilconf.h
new file mode 100644
index 0000000..8be0173
--- /dev/null
+++ b/include/utilconf.h
@@ -0,0 +1,8 @@
+#ifndef UTILCONF_H
+#define UTILCONF_H
+
+
+char getconfent (char *filename, char *entryname, char *buf, int len);
+
+
+#endif
diff --git a/include/utilfuns.h b/include/utilfuns.h
new file mode 100644
index 0000000..77d913e
--- /dev/null
+++ b/include/utilfuns.h
@@ -0,0 +1,29 @@
+/******************************************************************************
+ * utilfuns.h - utility function prototypes
+ *
+ * $Id: utilfuns.h,v 1.1.1.1 1999/05/04 22:03:36 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+#ifndef UTILFUNS_H
+#define UTILFUNS_H
+
+
+#include <utilstr.h>
+#include <utilconf.h>
+
+
+#endif
diff --git a/include/utilstr.h b/include/utilstr.h
new file mode 100644
index 0000000..b3bcfb2
--- /dev/null
+++ b/include/utilstr.h
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * utilstr.h - prototypes for string utility functions
+ *
+ * $Id: utilstr.h,v 1.9 2002/07/28 06:44:01 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef UTILSTR_H
+#define UTILSTR_H
+
+/** Use stdstr to copy a const char* to a char*
+*/
+char *stdstr (char **iistr, const char *istr);
+char *strstrip (char *istr);
+const char *stristr (const char *s1, const char *s2);
+const char strnicmp(const char *s1, const char *s2, int len);
+unsigned int strlenw(const char *s1);
+char *toupperstr(char *buf);
+char *toupperstr_utf8(char *buf);
+
+/*
+extern "C" {
+int stricmp(const char *s1, const char *s2);
+}
+*/
+
+/******************************************************************************
+ * SW_toupper - array of uppercase values for any given Latin-1 value
+ *
+ * use this instead of toupper() for fast lookups on accented characters
+ */
+static const unsigned char SW_toupper_array[256] =
+ {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+ 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+ 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+ 0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+ 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+ 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+ 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+ 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+ 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xf7,
+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff
+ };
+
+#define SW_toupper(c) SW_toupper_array[(unsigned char)c]
+
+#endif
diff --git a/include/versekey.h b/include/versekey.h
new file mode 100644
index 0000000..d2a2fa0
--- /dev/null
+++ b/include/versekey.h
@@ -0,0 +1,407 @@
+/******************************************************************************
+ * versekey.h - code for class 'versekey'- a standard Biblical verse key
+ *
+ * $Id: versekey.h,v 1.26 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+
+#ifndef VERSEKEY_H
+#define VERSEKEY_H
+
+#include <swkey.h>
+#include <swmacs.h>
+#include <listkey.h>
+#include <ctype.h>
+
+#include <defs.h>
+
+#define POS_MAXVERSE ((char)3)
+#define POS_MAXCHAPTER ((char)4)
+#define POS_MAXBOOK ((char)5)
+
+#define MAXVERSE SW_POSITION(POS_MAXVERSE)
+#define MAXCHAPTER SW_POSITION(POS_MAXCHAPTER)
+#define MAXBOOK SW_POSITION(POS_MAXBOOK)
+
+struct sbook
+{
+ /**Name of book
+ */
+ const char *name;
+
+ /**Preferred Abbreviation
+ */
+ const char *prefAbbrev;
+
+ /**Maximum chapters in book
+ */
+ unsigned char chapmax;
+ /** Array[chapmax] of maximum verses in chapters
+ */
+ int *versemax;
+};
+
+struct abbrev
+{
+ const char *ab;
+ int book;
+};
+
+
+class SWLocale;
+
+/**
+ * Class VerseKey
+ * The SWKey implementation used for verse based modules like Bibles or commentaries.
+ */
+class SWDLLEXPORT VerseKey:public SWKey
+{
+ class LocaleCache
+ {
+ public:
+ char *name;
+ unsigned int abbrevsCnt;
+ SWLocale *locale;
+ LocaleCache()
+ {
+ name = 0;
+ abbrevsCnt = 0;
+ locale = 0;
+ }
+ virtual ~LocaleCache()
+ {
+ if (name)
+ delete[]name;
+ }
+ };
+
+ static SWClass classdef;
+
+ static long *offsets[2][2];
+ static int offsize[2][2];
+ /** number of instantiated VerseKey objects or derivitives
+ */
+ static int instance;
+ static struct sbook otbooks[];
+ static struct sbook ntbooks[];
+ static long otbks[];
+ static long otcps[];
+ static long ntbks[];
+ static long ntcps[];
+ static int vm[];
+ static LocaleCache localeCache;
+ ListKey internalListKey;
+
+ const struct abbrev *abbrevs;
+ char *locale;
+ int abbrevsCnt;
+ /** The Testament: 0 - Old; 1 - New
+ */
+ signed char testament;
+ mutable signed char book;
+ mutable signed int chapter;
+ mutable signed int verse;
+ /** flag for auto normalization
+ */
+ char autonorm;
+ /** flag for headings on/off
+ */
+ char headings;
+
+ int getBookAbbrev(const char *abbr);
+ void initBounds() const;
+ /** initialize and allocate books array
+ */
+ void initstatics();
+ /** initializes this VerseKey()
+ */
+ void init();
+ /** Refresh keytext based on testament|book|chapter|verse
+ * default auto normalization to true
+ * default display headings option is false
+ */
+ void freshtext() const;
+ /** Parse a character array into testament|book|chapter|verse
+ *
+ */
+ virtual char parse();
+ /** Binary search to find the index closest, but less
+ * than the given value.
+ *
+ * @param array long * to array to search
+ * @param size number of elements in the array
+ * @param value value to find
+ * @return the index into the array that is less than but closest to value
+ */
+ int findindex(long *array, int size, long value);
+ mutable VerseKey *lowerBound, *upperBound;
+
+public:
+ static const char builtin_BMAX[2];
+ static struct sbook *builtin_books[2];
+ static const struct abbrev builtin_abbrevs[];
+ const char *BMAX;
+ struct sbook **books;
+
+ /**
+ * VerseKey Constructor - initializes Instance of VerseKey
+ *
+ * @param ikey text key (will take various forms of 'BOOK CH:VS'.
+ * See @ref #parse for more detailed information)
+ */
+ VerseKey(const char *ikey = 0);
+
+ /**
+ * VerseKey Constructor - initializes instance of VerseKey
+ *
+ * @param ikey base key (will take various forms of 'BOOK CH:VS'.
+ * See @ref #parse for more detailed information)
+ */
+ VerseKey(const SWKey * ikey);
+
+ /** VerseKey Constructor - initializes instance of VerseKey
+ * with boundariess - see also @ref #LowerBound
+ * and @ref #UpperBound
+ * @param min the lower boundary of the new VerseKey
+ * @param max the upper boundary of the new VerseKey
+ */
+ VerseKey(const char *min, const char *max);
+
+ /** VerseKey Copy Constructor - will create a new VerseKey
+ * based on an existing one
+ *
+ * @param k the VerseKey to copy from
+ */
+ VerseKey(const VerseKey &k);
+
+ /** VerseKey Destructor
+ * Cleans up an instance of VerseKey
+ */
+ virtual ~ VerseKey();
+
+ /** sets the lower boundary for this VerseKey
+ * and returns the new boundary
+ *
+ * @param lb the new lower boundary for this VerseKey
+ * @return the lower boundary the key was set to
+ */
+ VerseKey & LowerBound(const char *lb);
+
+ /** sets the upper boundary for this VerseKey
+ * and returns the new boundary
+ * @param lb the new upper boundary for this VerseKey
+ * @return the upper boundary the key was set to
+ */
+ VerseKey & UpperBound(const char *ub);
+
+ /** gets the lower boundary of this VerseKey
+ * @return the lower boundary of this VerseKey
+ */
+ VerseKey & LowerBound() const;
+
+ /** gets the upper boundary of this VerseKey
+ * @return the upper boundary of this VerseKey
+ */
+ VerseKey & UpperBound() const;
+
+ /** clears the boundaries of this VerseKey
+ */
+ void ClearBounds();
+
+ /** Creates a new SWKey based on the current VerseKey
+ * see also the Copy Constructor
+ */
+ virtual SWKey *clone() const;
+
+ /** refreshes keytext before returning if cast to
+ * a (char *) is requested
+ */
+ virtual const char *getText() const;
+ virtual const char *getShortText() const;
+ virtual void setText(const char *ikey) { SWKey::setText(ikey); parse (); }
+ virtual void copyFrom(const SWKey & ikey);
+
+ /** Equates this VerseKey to another VerseKey
+ */
+ virtual void copyFrom(const VerseKey & ikey);
+
+ /** Positions this key
+ *
+ * @param p position
+ * @return *this
+ */
+ virtual void setPosition(SW_POSITION);
+
+ /** Decrements key a number of verses
+ *
+ * @param decrement Number of verses to jump backward
+ * @return *this
+ */
+ virtual void decrement(int step);
+
+ /** Increments key a number of verses
+ *
+ * @param increment Number of verses to jump forward
+ * @return *this
+ */
+ virtual void increment(int step);
+ virtual char Traversable() { return 1; }
+
+ virtual const char *getBookName() const;
+ virtual const char *getBookAbbrev() const;
+ /** Gets testament
+ *
+ * @return value of testament
+ */
+ virtual char Testament() const;
+
+ /** Gets book
+ *
+ * @return value of book
+ */
+ virtual char Book() const;
+
+ /** Gets chapter
+ *
+ * @return value of chapter
+ */
+ virtual int Chapter() const;
+
+ /** Gets verse
+ *
+ * @return value of verse
+ */
+ virtual int Verse() const;
+
+ /** Sets/gets testament
+ *
+ * @param itestament value which to set testament
+ * [MAXPOS(char)] - only get
+ * @return if unchanged -> value of testament,
+ * if changed -> previous value of testament
+ */
+ virtual char Testament(char itestament);
+
+ /** Sets/gets book
+ *
+ * @param ibook value which to set book
+ * [MAXPOS(char)] - only get
+ * @return if unchanged -> value of book,
+ * if changed -> previous value of book
+ */
+ virtual char Book(char ibook);
+
+ /** Sets/gets chapter
+ *
+ * @param ichapter value which to set chapter
+ * [MAXPOS(int)] - only get
+ * @return if unchanged -> value of chapter,
+ * if changed -> previous value of chapter
+ */
+ virtual int Chapter(int ichapter);
+
+ /** Sets/gets verse
+ *
+ * @param iverse value which to set verse
+ * [MAXPOS(int)] - only get
+ * @return if unchanged -> value of verse,
+ * if changed -> previous value of verse
+ */
+ virtual int Verse(int iverse);
+
+ /** checks limits and normalizes if necessary (e.g.
+ * Matthew 29:47 = Mark 2:2). If last verse is
+ * exceeded, key is set to last Book CH:VS
+ *
+ * @return *this
+ */
+ virtual void Normalize(char autocheck = 0);
+
+ /** Sets/gets flag that tells VerseKey to
+ * 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 char AutoNormalize(char iautonorm = MAXPOS (char));
+
+ /** Sets/gets flag that tells VerseKey to include
+ * chapter/book/testament/module headings
+ *
+ * @param iheadings value which to set headings
+ * [MAXPOS(char)] - only get
+ * @return if unchanged -> value of headings,
+ * if changed -> previous value of headings
+ */
+ virtual char Headings(char iheadings = MAXPOS (char));
+
+ virtual long NewIndex() const;
+
+ /** Gets index based upon current verse
+ *
+ * @return offset
+ */
+ virtual long Index() const;
+
+ /** Sets index based upon current verse
+ *
+ * @param iindex value to set index to
+ * @return offset
+ */
+ virtual long Index(long iindex);
+
+ virtual const char *getOSISRef() const;
+
+ virtual ListKey ParseVerseList(const char *buf, const char *defaultKey = "Genesis 1:1", bool expandRange = false);
+ /** Compares another SWKey object
+ *
+ * @param ikey key to compare with this one
+ * @return >0 if this VerseKey is greater than compare SWKey,
+ * <0 if this VerseKey is smaller than compare SWKey,
+ * 0 if the keys are the same
+ */
+ virtual int compare(const SWKey & ikey);
+
+ /** Compares another VerseKey object
+ *
+ * @param ikey key to compare with this one
+ * @return >0 if this VerseKey is greater than compare VerseKey,
+ * <0 if this VerseKey is smaller than compare VerseKey,
+ * 0 if the keys are the same
+ */
+ virtual int _compare(const VerseKey & ikey);
+
+ virtual void setBookAbbrevs(const struct abbrev *bookAbbrevs, unsigned int size = 0 /* default determine size */ );
+ virtual void setBooks(const char *iBMAX, struct sbook **ibooks);
+ virtual void setLocale(const char *name);
+ virtual const char *getLocale() const { return locale; }
+
+
+
+ // OPERATORS --------------------------------------------------------------------
+
+
+ SWKEY_OPERATORS
+
+ virtual SWKey & operator = (const VerseKey & ikey) { copyFrom(ikey); return *this; }
+};
+
+
+#endif
diff --git a/include/zcom.h b/include/zcom.h
new file mode 100644
index 0000000..96844fe
--- /dev/null
+++ b/include/zcom.h
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * zcom.h - code for class 'zCom'- a module that reads compressed text
+ * files: ot and nt using indexs ??.vss
+ *
+ * $Id: zcom.h,v 1.15 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef ZCOM_H
+#define ZCOM_H
+
+#include <rawverse.h>
+#include <swcom.h>
+#include <swcomprs.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT zCom:public zVerse, public SWCom {
+ VerseKey *lastWriteKey;
+ bool sameBlock(VerseKey * lastWriteKey, VerseKey * key);
+ int blockType;
+public:
+
+
+ zCom(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+ virtual ~zCom();
+ virtual char *getRawEntry();
+ virtual void increment(int steps);
+ virtual void decrement(int steps) { increment(-steps); }
+
+ // write interface ----------------------------
+ virtual bool isWritable() {
+ return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & O_RDWR) == O_RDWR));
+ }
+ static char createModule(const char *path, int blockBound) {
+ return zVerse::createModule(path, blockBound);
+ }
+ 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 ------------------------
+
+ // swcacher interface ----------------------
+ virtual void flush() { flushCache(); }
+ // end swcacher interface ----------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/zconf.h b/include/zconf.h
new file mode 100644
index 0000000..85fc50c
--- /dev/null
+++ b/include/zconf.h
@@ -0,0 +1,279 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-1998 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id: zconf.h,v 1.1 2001/03/23 09:00:15 scribe Exp $ */
+
+#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 Byte 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/zipcomprs.h b/include/zipcomprs.h
new file mode 100644
index 0000000..0e36396
--- /dev/null
+++ b/include/zipcomprs.h
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * swcomprs.h - definition of Class SWCompress used for data compression
+ *
+ * $Id: zipcomprs.h,v 1.3 2001/02/09 15:38:51 jansorg Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef ZIPCOMPRS_H
+#define ZIPCOMPRS_H
+
+#include <swcomprs.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT ZipCompress:public SWCompress
+{
+protected:
+public:
+ ZipCompress ();
+ virtual ~ ZipCompress ();
+ virtual void Encode (void);
+ virtual void Decode (void);
+};
+
+#endif
diff --git a/include/zld.h b/include/zld.h
new file mode 100644
index 0000000..f059597
--- /dev/null
+++ b/include/zld.h
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * zld.cpp - code for class 'zLD'- a module that reads compressed lexicon and
+ * dictionary files.
+ *
+ * $Id: zld.h,v 1.5 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef ZLD_H
+#define ZLD_H
+
+#include <zstr.h>
+#include <swld.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT zLD : public zStr, public SWLD {
+
+ void strongsPad(char *buf);
+ char getEntry(long away = 0);
+
+public:
+
+
+ zLD(const char *ipath, const char *iname = 0, const char *idesc = 0, long blockCount = 200, SWCompress *icomp = 0, SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN,
+ const char* ilang = 0);
+ virtual ~zLD();
+ virtual char *getRawEntry();
+
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
+
+ // write interface ----------------------------
+ virtual bool isWritable() {
+ return ((idxfd->getFd() > 0) && ((idxfd->mode & O_RDWR) == O_RDWR));
+ }
+ static char createModule(const char *path) {
+ return zStr::createModule(path);
+ }
+
+ 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 ------------------------
+
+ // swcacher interface ----------------------
+ virtual void flush() { flushCache(); }
+ // end swcacher interface ----------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+
+#endif
diff --git a/include/zlib.h b/include/zlib.h
new file mode 100644
index 0000000..49f56b4
--- /dev/null
+++ b/include/zlib.h
@@ -0,0 +1,893 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+ version 1.1.3, July 9th, 1998
+
+ Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ Jean-loup Gailly Mark Adler
+ jloup@gzip.org madler@alumni.caltech.edu
+
+
+ The data format used by the zlib library is described by RFCs (Request for
+ Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
+ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.1.3"
+
+/*
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed
+ data. This version of the library supports only one compression method
+ (deflation) but other algorithms will be added later and will have the same
+ stream interface.
+
+ Compression can be done in a single step if the buffers are large
+ enough (for example if an input file is mmap'ed), or can be done by
+ repeated calls of the compression function. In the latter case, the
+ application must provide more input and/or consume the output
+ (providing more output space) before each call.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never
+ crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void (*free_func) OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Bytef *next_in; /* next input byte */
+ uInt avail_in; /* number of bytes available at next_in */
+ uLong total_in; /* total nb of input bytes read so far */
+
+ Bytef *next_out; /* next output byte should be put there */
+ uInt avail_out; /* remaining free space at next_out */
+ uLong total_out; /* total nb of bytes output so far */
+
+ char *msg; /* last error message, NULL if no error */
+ struct internal_state FAR *state; /* not visible by applications */
+
+ alloc_func zalloc; /* used to allocate the internal state */
+ free_func zfree; /* used to free the internal state */
+ voidpf opaque; /* private data object passed to zalloc and zfree */
+
+ int data_type; /* best guess about the data type: ascii or binary */
+ uLong adler; /* adler32 value of the uncompressed data */
+ uLong reserved; /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+ The application must update next_in and avail_in when avail_in has
+ dropped to zero. It must update next_out and avail_out when avail_out
+ has dropped to zero. The application must initialize zalloc, zfree and
+ opaque before calling the init function. All other fields are set by the
+ compression library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
+ opaque value.
+
+ zalloc must return Z_NULL if there is not enough memory for the object.
+ If zlib is used in a multi-threaded application, zalloc and zfree must be
+ thread safe.
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this
+ if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+ pointers returned by zalloc for objects of exactly 65536 bytes *must*
+ have their offset normalized to zero. The default allocation function
+ provided by this library ensures this (see zutil.c). To reduce memory
+ requirements and avoid any allocation of 64K objects, at the expense of
+ compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or
+ progress reports. After compression, total_in holds the total size of
+ the uncompressed data and may be saved for use in the decompressor
+ (particularly if the decompressor wants to decompress everything in
+ a single step).
+*/
+
+ /* constants */
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH 2
+#define Z_FULL_FLUSH 3
+#define Z_FINISH 4
+/* Allowed flush values; see deflate() below for details */
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+/* compression levels */
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+/* Possible values of the data_type field */
+
+#define Z_DEFLATED 8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+ /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+ If the first character differs, the library code actually used is
+ not compatible with the zlib.h header file used by the application.
+ This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller.
+ If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+ use default allocation functions.
+
+ The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at
+ all (the input data is simply copied a block at a time).
+ Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+ compression (currently equivalent to level 6).
+
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+ with the version assumed by the caller (ZLIB_VERSION).
+ msg is set to null if there is no error message. deflateInit does not
+ perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+ deflate compresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may introduce some
+ output latency (reading input without producing any output) except when
+ forced to flush.
+
+ The detailed semantics are as follows. deflate performs one or both of the
+ following actions:
+
+ - Compress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in and avail_in are updated and
+ processing will resume at this point for the next call of deflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
+ Forcing flush frequently degrades the compression ratio, so this parameter
+ should be set only when necessary (in interactive applications).
+ Some output may be provided even if flush is not set.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating avail_in or avail_out accordingly; avail_out
+ should never be zero before the call. The application can consume the
+ compressed output when it wants, for example when the output buffer is full
+ (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+ and with zero avail_out, it must be called again after making room in the
+ output buffer because there might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+ flushed to the output buffer and the output is aligned on a byte boundary, so
+ that the decompressor can get all input data available so far. (In particular
+ avail_in is zero after the call if enough output space has been provided
+ before the call.) Flushing may degrade compression for some compression
+ algorithms and so it should be used only when necessary.
+
+ If flush is set to Z_FULL_FLUSH, all output is flushed as with
+ Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+ restart from this point if previous compressed data has been damaged or if
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ the compression.
+
+ If deflate returns with avail_out == 0, this function must be called again
+ with the same value of the flush parameter and more output space (updated
+ avail_out), until the flush is complete (deflate returns with non-zero
+ avail_out).
+
+ If the parameter flush is set to Z_FINISH, pending input is processed,
+ pending output is flushed and deflate returns with Z_STREAM_END if there
+ was enough output space; if deflate returns with Z_OK, this function must be
+ called again with Z_FINISH and more output space (updated avail_out) but no
+ more input data, until it returns with Z_STREAM_END or an error. After
+ deflate has returned Z_STREAM_END, the only possible operations on the
+ stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used immediately after deflateInit if all the compression
+ is to be done in a single step. In this case, avail_out must be at least
+ 0.1% larger than avail_in plus 12 bytes. If deflate does not return
+ Z_STREAM_END, then it must be called again as described above.
+
+ deflate() sets strm->adler to the adler32 checksum of all input read
+ so far (that is, total_in bytes).
+
+ deflate() may update data_type if it can make a good guess about
+ the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
+ binary. This field is only for information purposes and does not affect
+ the compression algorithm in any manner.
+
+ deflate() returns Z_OK if some progress has been made (more input
+ processed or more output produced), Z_STREAM_END if all input has been
+ consumed and all output has been produced (only when flush is set to
+ Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+ if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+ (for example avail_in or avail_out was zero).
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+ stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+ prematurely (some input or output was discarded). In the error case,
+ msg may be set but then points to a static string (which must not be
+ deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+ Initializes the internal stream state for decompression. The fields
+ next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+ the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+ value depends on the compression method), inflateInit determines the
+ compression method from the zlib header and allocates all data structures
+ accordingly; otherwise the allocation will be deferred to the first call of
+ inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+ use default allocation functions.
+
+ inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller. msg is set to null if there is no error
+ message. inflateInit does not perform any decompression apart from reading
+ the zlib header if present: this will be done by inflate(). (So next_in and
+ avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+ inflate decompresses as much data as possible, and stops when the input
+ buffer becomes empty or the output buffer becomes full. It may some
+ introduce some output latency (reading input without producing any output)
+ except when forced to flush.
+
+ The detailed semantics are as follows. inflate performs one or both of the
+ following actions:
+
+ - Decompress more input starting at next_in and update next_in and avail_in
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), next_in is updated and processing
+ will resume at this point for the next call of inflate().
+
+ - Provide more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there
+ is no more input data or no more space in the output buffer (see below
+ about the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming
+ more output, and updating the next_* and avail_* values accordingly.
+ The application can consume the uncompressed output when it wants, for
+ example when the output buffer is full (avail_out == 0), or after each
+ call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+ must be called again after making room in the output buffer because there
+ might be more output pending.
+
+ If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
+ output as possible to the output buffer. The flushing behavior of inflate is
+ not specified for values of the flush parameter other than Z_SYNC_FLUSH
+ and Z_FINISH, but the current implementation actually flushes as much output
+ as possible anyway.
+
+ inflate() should normally be called until it returns Z_STREAM_END or an
+ error. However if all decompression is to be performed in a single step
+ (a single call of inflate), the parameter flush should be set to
+ Z_FINISH. In this case all pending input is processed and all pending
+ output is flushed; avail_out must be large enough to hold all the
+ uncompressed data. (The size of the uncompressed data may have been saved
+ by the compressor for this purpose.) The next operation on this stream must
+ be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+ is never required, but can be used to inform inflate that a faster routine
+ may be used for the single inflate() call.
+
+ If a preset dictionary is needed at this point (see inflateSetDictionary
+ below), inflate sets strm-adler to the adler32 checksum of the
+ dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
+ it sets strm->adler to the adler32 checksum of all output produced
+ so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
+ an error code as described below. At the end of the stream, inflate()
+ checks that its computed adler32 checksum is equal to that saved by the
+ compressor and returns Z_STREAM_END only if the checksum is correct.
+
+ inflate() returns Z_OK if some progress has been made (more input processed
+ or more output produced), Z_STREAM_END if the end of the compressed data has
+ been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+ preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+ corrupted (input stream not conforming to the zlib format or incorrect
+ adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
+ (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if no progress is possible or if there was not
+ enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
+ case, the application may then call inflateSync to look for a good
+ compression block.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+ All dynamically allocated data structures for this stream are freed.
+ This function discards any unprocessed input and does not flush any
+ pending output.
+
+ inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+ was inconsistent. In the error case, msg may be set but then points to a
+ static string (which must not be deallocated).
+*/
+
+ /* Advanced functions */
+
+/*
+ The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+ int method,
+ int windowBits,
+ int memLevel,
+ int strategy));
+
+ This is another version of deflateInit with more compression options. The
+ fields next_in, zalloc, zfree and opaque must be initialized before by
+ the caller.
+
+ The method parameter is the compression method. It must be Z_DEFLATED in
+ this version of the library.
+
+ The windowBits parameter is the base two logarithm of the window size
+ (the size of the history buffer). It should be in the range 8..15 for this
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
+ deflateInit is used instead.
+
+ The memLevel parameter specifies how much memory should be allocated
+ for the internal compression state. memLevel=1 uses minimum memory but
+ is slow and reduces compression ratio; memLevel=9 uses maximum memory
+ for optimal speed. The default value is 8. See zconf.h for total memory
+ usage as a function of windowBits and memLevel.
+
+ The strategy parameter is used to tune the compression algorithm. Use the
+ value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+ filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match). Filtered data consists mostly of small values with a
+ somewhat random distribution. In this case, the compression algorithm is
+ tuned to compress them better. The effect of Z_FILTERED is to force more
+ Huffman coding and less string matching; it is somewhat intermediate
+ between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
+ the compression ratio but not the correctness of the compressed output even
+ if it is not set appropriately.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+ method). msg is set to null if there is no error message. deflateInit2 does
+ not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the compression dictionary from the given byte sequence
+ without producing any compressed output. This function must be called
+ immediately after deflateInit, deflateInit2 or deflateReset, before any
+ call of deflate. The compressor and decompressor must use exactly the same
+ dictionary (see inflateSetDictionary).
+
+ The dictionary should consist of strings (byte sequences) that are likely
+ to be encountered later in the data to be compressed, with the most commonly
+ used strings preferably put towards the end of the dictionary. Using a
+ dictionary is most useful when the data to be compressed is short and can be
+ predicted with good accuracy; the data can then be compressed better than
+ with the default empty dictionary.
+
+ Depending on the size of the compression data structures selected by
+ deflateInit or deflateInit2, a part of the dictionary may in effect be
+ discarded, for example if the dictionary is larger than the window size in
+ deflate or deflate2. Thus the strings most likely to be useful should be
+ put at the end of the dictionary, not at the front.
+
+ Upon return of this function, strm->adler is set to the Adler32 value
+ of the dictionary; the decompressor may later use this value to determine
+ which dictionary has been used by the compressor. (The Adler32 value
+ applies to the whole dictionary even if only a subset of the dictionary is
+ actually used by the compressor.)
+
+ deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent (for example if deflate has already been called for this stream
+ or if the compression method is bsort). deflateSetDictionary does not
+ perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
+
+ This function can be useful when several compression strategies will be
+ tried, for example when there are several ways of pre-processing the input
+ data with a filter. The streams that will be discarded should then be freed
+ by calling deflateEnd. Note that deflateCopy duplicates the internal
+ compression state which can be quite large, so this strategy is slow and
+ can consume lots of memory.
+
+ deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being NULL). msg is left unchanged in both source and
+ destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to deflateEnd followed by deflateInit,
+ but does not free and reallocate all the internal compression state.
+ The stream will keep the same compression level and any other attributes
+ that may have been set by deflateInit2.
+
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
+/*
+ Dynamically update the compression level and compression strategy. The
+ interpretation of level and strategy is as in deflateInit2. This can be
+ used to switch between compression and straight copy of the input data, or
+ to switch to a different kind of input data requiring a different
+ strategy. If the compression level is changed, the input available so far
+ is compressed with the old level (and may be flushed); the new level will
+ take effect only at the next call of deflate().
+
+ Before the call of deflateParams, the stream state must be set as for
+ a call of deflate(), since the currently available input may have to
+ be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+ deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+ stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+ if strm->avail_out was zero.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+ int windowBits));
+
+ This is another version of inflateInit with an extra parameter. The
+ fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+ before by the caller.
+
+ The windowBits parameter is the base two logarithm of the maximum window
+ size (the size of the history buffer). It should be in the range 8..15 for
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. If a compressed stream with a larger window size is given as
+ input, inflate() will return with the error code Z_DATA_ERROR instead of
+ trying to allocate a larger window.
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
+ memLevel). msg is set to null if there is no error message. inflateInit2
+ does not perform any decompression apart from reading the zlib header if
+ present: this will be done by inflate(). (So next_in and avail_in may be
+ modified, but next_out and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
+/*
+ Initializes the decompression dictionary from the given uncompressed byte
+ sequence. This function must be called immediately after a call of inflate
+ if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler32 value returned by this call of
+ inflate. The compressor and decompressor must use exactly the same
+ dictionary (see deflateSetDictionary).
+
+ inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+ parameter is invalid (such as NULL dictionary) or the stream state is
+ inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+ expected one (incorrect Adler32 value). inflateSetDictionary does not
+ perform any decompression: this will be done by subsequent calls of
+ inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+ Skips invalid compressed data until a full flush point (see above the
+ description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+ if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+ or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+ case, the application may save the current current value of total_in which
+ indicates where valid compressed data was found. In the error case, the
+ application may repeatedly call inflateSync, providing more input each time,
+ until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+ This function is equivalent to inflateEnd followed by inflateInit,
+ but does not free and reallocate all the internal decompression state.
+ The stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+
+ /* utility functions */
+
+/*
+ The following utility functions are implemented on top of the
+ basic stream-oriented functions. To simplify the interface, some
+ default options are assumed (compression level and memory usage,
+ standard memory allocation functions). The source code of these
+ utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Compresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be at least 0.1% larger than
+ sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
+ compressed buffer.
+ This function can be used to compress a whole file at once if the
+ input file is mmap'ed.
+ compress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
+/*
+ Compresses the source buffer into the destination buffer. The level
+ parameter has the same meaning as in deflateInit. sourceLen is the byte
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least 0.1% larger than sourceLen plus
+ 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+
+ compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+ Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
+/*
+ Decompresses the source buffer into the destination buffer. sourceLen is
+ the byte length of the source buffer. Upon entry, destLen is the total
+ size of the destination buffer, which must be large enough to hold the
+ entire uncompressed data. (The size of the uncompressed data must have
+ been saved previously by the compressor and transmitted to the decompressor
+ by some mechanism outside the scope of this compression library.)
+ Upon exit, destLen is the actual size of the compressed buffer.
+ This function can be used to decompress a whole file at once if the
+ input file is mmap'ed.
+
+ uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_BUF_ERROR if there was not enough room in the output
+ buffer, or Z_DATA_ERROR if the input data was corrupted.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+/*
+ Opens a gzip (.gz) file for reading or writing. The mode parameter
+ is as in fopen ("rb" or "wb") but can also include a compression level
+ ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+ Huffman only compression as in "wb1h". (See the description
+ of deflateInit2 for more information about the strategy parameter.)
+
+ gzopen can be used to read a file which is not in gzip format; in this
+ case gzread will directly read from the file without decompression.
+
+ gzopen returns NULL if the file could not be opened or if there was
+ insufficient memory to allocate the (de)compression state; errno
+ can be checked to distinguish the two cases (if errno is zero, the
+ zlib error is Z_MEM_ERROR). */
+
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ gzdopen() associates a gzFile with the file descriptor fd. File
+ descriptors are obtained from calls like open, dup, creat, pipe or
+ fileno (in the file has been previously opened with fopen).
+ The mode parameter is as in gzopen.
+ The next call of gzclose on the returned gzFile will also close the
+ file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+ descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+ gzdopen returns NULL if there was insufficient memory to allocate
+ the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+ Dynamically update the compression level or strategy. See the description
+ of deflateInit2 for the meaning of these parameters.
+ gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+ opened for writing.
+*/
+
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
+/*
+ Reads the given number of uncompressed bytes from the compressed file.
+ If the input file was not in gzip format, gzread copies the given number
+ of bytes into the buffer.
+ gzread returns the number of uncompressed bytes actually read (0 for
+ end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
+ const voidp buf, unsigned len));
+/*
+ Writes the given number of uncompressed bytes into the compressed file.
+ gzwrite returns the number of uncompressed bytes actually written
+ (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
+/*
+ Converts, formats, and writes the args to the compressed file under
+ control of the format string, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Writes the given null-terminated string to the compressed file, excluding
+ the terminating null character.
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Reads bytes from the compressed file until len-1 characters are read, or
+ a newline character is read and transferred to buf, or an end-of-file
+ condition is encountered. The string is then terminated with a null
+ character.
+ gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
+/*
+ Writes c, converted to an unsigned char, into the compressed file.
+ gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
+/*
+ Reads one byte from the compressed file. gzgetc returns this byte
+ or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
+/*
+ Flushes all pending output into the compressed file. The parameter
+ flush is as in the deflate() function. The return value is the zlib
+ error number (see function gzerror below). gzflush returns Z_OK if
+ the flush parameter is Z_FINISH and all output could be flushed.
+ gzflush should be called only when strictly necessary because it can
+ degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+/*
+ Sets the starting position for the next gzread or gzwrite on the
+ given compressed file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
+ the value SEEK_END is not supported.
+ If the file is opened for reading, this function is emulated but can be
+ extremely slow. If the file is opened for writing, only forward seeks are
+ supported; gzseek then compresses a sequence of zeroes up to the new
+ starting position.
+
+ gzseek returns the resulting offset location as measured in bytes from
+ the beginning of the uncompressed stream, or -1 in case of error, in
+ particular if the file is opened for writing and the new starting position
+ would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
+/*
+ Rewinds the given file. This function is supported only for reading.
+
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
+/*
+ Returns the starting position for the next gzread or gzwrite on the
+ given compressed file. This position represents a number of bytes in the
+ uncompressed data stream.
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Returns 1 when EOF has previously been detected reading the given
+ input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
+/*
+ Flushes all pending output if necessary, closes the compressed file
+ and deallocates all the (de)compression state. The return value is the zlib
+ error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+ Returns the error message for the last error which occurred on the
+ given compressed file. errnum is set to zlib error number. If an
+ error occurred in the file system and not in the compression library,
+ errnum is set to Z_ERRNO and the application may consult errno
+ to get the exact error code.
+*/
+
+ /* checksum functions */
+
+/*
+ These functions are not related to compression but are exported
+ anyway because they might be useful in applications using the
+ compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+
+/*
+ Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+ return the updated checksum. If buf is NULL, this function returns
+ the required initial value for the checksum.
+ An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+ much faster. Usage example:
+
+ uLong adler = adler32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ adler = adler32(adler, buffer, length);
+ }
+ if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+/*
+ Update a running crc with the bytes buf[0..len-1] and return the updated
+ crc. If buf is NULL, this function returns the required initial value
+ for the crc. Pre- and post-conditioning (one's complement) is performed
+ within this function so it shouldn't be done by the application.
+ Usage example:
+
+ uLong crc = crc32(0L, Z_NULL, 0);
+
+ while (read_buffer(buffer, length) != EOF) {
+ crc = crc32(crc, buffer, length);
+ }
+ if (crc != original_crc) error();
+*/
+
+
+ /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+#define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char * ZEXPORT zError OF((int err));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ZLIB_H */
diff --git a/include/zstr.h b/include/zstr.h
new file mode 100644
index 0000000..efcdf07
--- /dev/null
+++ b/include/zstr.h
@@ -0,0 +1,72 @@
+/*****************************************************************************
+ * zstr.h - code for class 'zStr'- a module that reads compressed text
+ * files.
+ * and provides lookup and parsing functions based on
+ * class StrKey
+ *
+ * $Id: zstr.h,v 1.4 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef ZSTR_H
+#define ZSTR_H
+
+#include <filemgr.h>
+
+#include <defs.h>
+
+class SWCompress;
+class EntriesBlock;
+
+class SWDLLEXPORT zStr {
+
+private:
+ static int instance; // number of instantiated zStr objects or derivitives
+ EntriesBlock *cacheBlock;
+ long cacheBlockIndex;
+ bool cacheDirty;
+ char *path;
+ long lastoff;
+ long blockCount;
+ SWCompress *compressor;
+
+protected:
+ FileDesc *idxfd;
+ FileDesc *datfd;
+ FileDesc *zdxfd;
+ FileDesc *zdtfd;
+ static const int IDXENTRYSIZE;
+ static const int ZDXENTRYSIZE;
+
+ void getCompressedText(long block, long entry, char **buf);
+ void flushCache();
+ void prepText(char *buf);
+ void getKeyFromDatOffset(long ioffset, char **buf);
+ void getKeyFromIdxOffset(long ioffset, char **buf);
+
+public:
+ char nl;
+ zStr(const char *ipath, int fileMode = -1, long blockCount = 100, SWCompress *icomp = 0);
+ virtual ~zStr();
+ signed char findKeyIndex(const char *ikey, long *idxoff, long away = 0);
+ void getText(long index, char **idxbuf, char **buf);
+ void setText(const char *ikey, const char *buf, long len = -1);
+ void linkEntry(const char *destkey, const char *srckey);
+ static signed char createModule (const char *path);
+};
+
+#endif
diff --git a/include/ztext.h b/include/ztext.h
new file mode 100644
index 0000000..917d0d3
--- /dev/null
+++ b/include/ztext.h
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * ztext.h - code for class 'zText'- a module that reads compressed text
+ * files: ot and nt using indexs ??.vss
+ *
+ * $Id: ztext.h,v 1.23 2002/07/28 01:48:38 scribe Exp $
+ *
+ * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#ifndef ZTEXT_H
+#define ZTEXT_H
+
+#include <zverse.h>
+#include <swtext.h>
+//#include <swcomprs.h>
+
+#include <defs.h>
+
+/*** 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 zText:public zVerse, public SWText {
+ VerseKey *lastWriteKey;
+ bool sameBlock(VerseKey * lastWriteKey, VerseKey * key);
+ int blockType;
+public:
+
+
+ zText(const char *ipath, const char *iname = 0, const char *idesc = 0,
+ int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0,
+ SWDisplay * idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
+ SWTextDirection dir = DIRECTION_LTR,
+ SWTextMarkup markup = FMT_UNKNOWN, const char* ilang = 0);
+
+ virtual ~zText();
+ virtual char *getRawEntry();
+
+ virtual void increment(int steps = 1);
+ virtual void decrement(int steps = 1) { increment(-steps); }
+
+ // write interface ----------------------------
+ virtual bool isWritable() { return ((idxfp[0]->getFd() > 0) && ((idxfp[0]->mode & O_RDWR) == O_RDWR)); }
+ static char createModule(const char *path, int blockBound) {
+ return zVerse::createModule(path, blockBound);
+ }
+
+ 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 ------------------------
+
+ // swcacher interface ----------------------
+ virtual void flush() { flushCache(); }
+ // end swcacher interface ----------------------
+
+
+ // OPERATORS -----------------------------------------------------------------
+
+ SWMODULE_OPERATORS
+
+};
+
+#endif
diff --git a/include/zverse.h b/include/zverse.h
new file mode 100644
index 0000000..02eec46
--- /dev/null
+++ b/include/zverse.h
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * rawverse.h - code for class 'zVerse'- 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
+ */
+
+#ifndef ZVERSE_H
+#define ZVERSE_H
+
+#include <filemgr.h>
+#include <fcntl.h>
+#include <rawverse.h>
+#include <swcomprs.h>
+
+#include <defs.h>
+
+class SWDLLEXPORT zVerse {
+ SWCompress *compressor;
+
+protected:
+ static int instance; // number of instantiated zVerse objects or derivitives
+
+ FileDesc *idxfp[2];
+ FileDesc *textfp[2];
+ FileDesc *compfp[2];
+ char *path;
+ void preptext(char *buf);
+ void settext(char testmt, long idxoff, const char *buf, long len = 0);
+ void linkentry(char testmt, long destidxoff, long srcidxoff);
+ void flushCache();
+ char *cacheBuf;
+ char cacheTestament;
+ long cacheBufIdx;
+ bool dirtyCache;
+
+public:
+
+#define VERSEBLOCKS 2
+#define CHAPTERBLOCKS 3
+#define BOOKBLOCKS 4
+
+ static const char uniqueIndexID[];
+ char nl;
+
+
+ zVerse(const char *ipath, int fileMode = O_RDONLY, int blockType = CHAPTERBLOCKS, SWCompress * icomp = 0);
+ virtual ~zVerse();
+ void findoffset(char testmt, long idxoff, long *start, unsigned short *end);
+ void zreadtext(char testmt, long start, unsigned short size, char *buf);
+ static char createModule(const char *path, int blockBound);
+};
+
+
+#endif