[sword-svn] r1688 - in trunk: bindings/bcppmake bindings/clx/test2 include lib/bcppmake scripts src/keys src/mgr src/modules/filters src/modules/texts/ztext src/utilfuns src/utilfuns/zlib tests/bcppmake utilities/bcppmake utilities/diatheke/pqa

scribe at crosswire.org scribe at crosswire.org
Fri Dec 31 21:42:27 MST 2004


Author: scribe
Date: 2004-12-31 21:42:26 -0700 (Fri, 31 Dec 2004)
New Revision: 1688

Added:
   trunk/include/curlftpt.h
   trunk/include/ftplibftpt.h
   trunk/include/ftptrans.h
   trunk/src/mgr/curlftpt.cpp
   trunk/src/mgr/ftplibftpt.cpp
   trunk/src/mgr/ftptrans.cpp
   trunk/utilities/bcppmake/installmgr.bpf
   trunk/utilities/bcppmake/installmgr.bpr
Modified:
   trunk/bindings/bcppmake/sword.bpf
   trunk/bindings/clx/test2/MainFrm.pas
   trunk/include/Greek2Greek.h
   trunk/include/GreekChars.h
   trunk/include/SwordAPI.pas
   trunk/include/apocrypha.h
   trunk/include/canon.h
   trunk/include/cdsourcemgr.h
   trunk/include/cipherfil.h
   trunk/include/echomod.h
   trunk/include/femain.h
   trunk/include/filemgr.h
   trunk/include/gbffootnotes.h
   trunk/include/gbfheadings.h
   trunk/include/gbfhtml.h
   trunk/include/gbfhtmlhref.h
   trunk/include/gbfmorph.h
   trunk/include/gbfosis.h
   trunk/include/gbfplain.h
   trunk/include/gbfredletterwords.h
   trunk/include/gbfrtf.h
   trunk/include/gbfstrongs.h
   trunk/include/gbfthml.h
   trunk/include/gbfwebif.h
   trunk/include/greeklexattribs.h
   trunk/include/hrefcom.h
   trunk/include/installmgr.h
   trunk/include/kjvref.h
   trunk/include/latin1utf16.h
   trunk/include/latin1utf8.h
   trunk/include/listkey.h
   trunk/include/localemgr.h
   trunk/include/lzsscomprs.h
   trunk/include/osisbook.h
   trunk/include/osisfootnotes.h
   trunk/include/osisheadings.h
   trunk/include/osishtmlhref.h
   trunk/include/osislemma.h
   trunk/include/osismorph.h
   trunk/include/osisosis.h
   trunk/include/osisplain.h
   trunk/include/osisredletterwords.h
   trunk/include/osisrtf.h
   trunk/include/osisscripref.h
   trunk/include/osisstrongs.h
   trunk/include/osiswebif.h
   trunk/include/plainfootnotes.h
   trunk/include/plainhtml.h
   trunk/include/rawcom.h
   trunk/include/rawfiles.h
   trunk/include/rawgbf.h
   trunk/include/rawgenbook.h
   trunk/include/rawld.h
   trunk/include/rawld4.h
   trunk/include/rawstr.h
   trunk/include/rawstr4.h
   trunk/include/rawtext.h
   trunk/include/refsys.h
   trunk/include/refsysmgr.h
   trunk/include/remotesourcemgr.h
   trunk/include/rtfhtml.h
   trunk/include/scsuutf8.h
   trunk/include/stringmgr.h
   trunk/include/strkey.h
   trunk/include/swbasicfilter.h
   trunk/include/swbuf.h
   trunk/include/swcacher.h
   trunk/include/swcipher.h
   trunk/include/swcom.h
   trunk/include/swcomprs.h
   trunk/include/swconfig.h
   trunk/include/swdisp.h
   trunk/include/swdisprtf.h
   trunk/include/swdisprtfchap.h
   trunk/include/swfilter.h
   trunk/include/swfiltermgr.h
   trunk/include/swgenbook.h
   trunk/include/swkey.h
   trunk/include/swld.h
   trunk/include/swlocale.h
   trunk/include/swlog.h
   trunk/include/swmacs.h
   trunk/include/swmgr.h
   trunk/include/swoptfilter.h
   trunk/include/swsearchable.h
   trunk/include/swsourcemgr.h
   trunk/include/swtext.h
   trunk/include/swversion.h
   trunk/include/tbdisp.h
   trunk/include/thmlfootnotes.h
   trunk/include/thmlgbf.h
   trunk/include/thmlheadings.h
   trunk/include/thmlhtml.h
   trunk/include/thmlhtmlhref.h
   trunk/include/thmllemma.h
   trunk/include/thmlmorph.h
   trunk/include/thmlosis.h
   trunk/include/thmlplain.h
   trunk/include/thmlrtf.h
   trunk/include/thmlscripref.h
   trunk/include/thmlstrongs.h
   trunk/include/thmlvariants.h
   trunk/include/thmlwebif.h
   trunk/include/treekey.h
   trunk/include/treekeyidx.h
   trunk/include/unicodertf.h
   trunk/include/unixstr.h
   trunk/include/url.h
   trunk/include/utf16utf8.h
   trunk/include/utf8arshaping.h
   trunk/include/utf8bidireorder.h
   trunk/include/utf8cantillation.h
   trunk/include/utf8greekaccents.h
   trunk/include/utf8hebrewpoints.h
   trunk/include/utf8html.h
   trunk/include/utf8latin1.h
   trunk/include/utf8nfc.h
   trunk/include/utf8nfkd.h
   trunk/include/utf8transliterator.h
   trunk/include/utf8utf16.h
   trunk/include/utilfuns.h
   trunk/include/utilstr.h
   trunk/include/utilweb.h
   trunk/include/utilxml.h
   trunk/include/versekey.h
   trunk/include/versekey2.h
   trunk/include/zcom.h
   trunk/include/zconf.h
   trunk/include/zipcomprs.h
   trunk/include/zld.h
   trunk/include/zstr.h
   trunk/include/ztext.h
   trunk/include/ztext2.h
   trunk/lib/bcppmake/libsword.bpr
   trunk/scripts/sapphire.cpp
   trunk/src/keys/refsys.cpp
   trunk/src/keys/treekey.cpp
   trunk/src/keys/treekeyidx.cpp
   trunk/src/mgr/filemgr.cpp
   trunk/src/mgr/installmgr.cpp
   trunk/src/mgr/localemgr.cpp
   trunk/src/mgr/refsysmgr.cpp
   trunk/src/mgr/swcacher.cpp
   trunk/src/mgr/swconfig.cpp
   trunk/src/mgr/swfiltermgr.cpp
   trunk/src/mgr/swlocale.cpp
   trunk/src/mgr/swmgr.cpp
   trunk/src/mgr/swsearchable.cpp
   trunk/src/mgr/swsourcemgr.cpp
   trunk/src/modules/filters/osisheadings.cpp
   trunk/src/modules/filters/swbasicfilter.cpp
   trunk/src/modules/texts/ztext/gbfidx.cpp
   trunk/src/modules/texts/ztext/rawtxt2z.cpp
   trunk/src/utilfuns/swbuf.cpp
   trunk/src/utilfuns/utilxml.cpp
   trunk/src/utilfuns/zlib/adler32.c
   trunk/src/utilfuns/zlib/compress.c
   trunk/src/utilfuns/zlib/crc32.c
   trunk/src/utilfuns/zlib/deflate.c
   trunk/src/utilfuns/zlib/deflate.h
   trunk/src/utilfuns/zlib/gzio.c
   trunk/src/utilfuns/zlib/trees.c
   trunk/src/utilfuns/zlib/uncompr.c
   trunk/src/utilfuns/zlib/zutil.c
   trunk/src/utilfuns/zlib/zutil.h
   trunk/tests/bcppmake/filtertest.bpf
   trunk/tests/bcppmake/mgrtest.bpf
   trunk/tests/bcppmake/parsekey.bpf
   trunk/utilities/bcppmake/cipherraw.bpf
   trunk/utilities/bcppmake/diatheke.bpf
   trunk/utilities/bcppmake/diatheke.bpr
   trunk/utilities/bcppmake/imp2gbs.bpf
   trunk/utilities/bcppmake/imp2ld.bpf
   trunk/utilities/bcppmake/imp2vs.bpf
   trunk/utilities/bcppmake/mkfastmod.bpf
   trunk/utilities/bcppmake/mod2imp.bpf
   trunk/utilities/bcppmake/mod2osis.bpf
   trunk/utilities/bcppmake/mod2vpl.bpf
   trunk/utilities/bcppmake/mod2zmod.bpf
   trunk/utilities/bcppmake/osis2mod.bpf
   trunk/utilities/bcppmake/step2vpl.bpf
   trunk/utilities/bcppmake/stepdump.bpf
   trunk/utilities/bcppmake/utilities.bpg
   trunk/utilities/bcppmake/vpl2mod.bpf
   trunk/utilities/bcppmake/vs2osisref.bpf
   trunk/utilities/bcppmake/xml2gbs.bpf
   trunk/utilities/diatheke/pqa/Diatheke.pqa
Log:
Added directory recursion support for InstallMgr functionality
Added new FileMgr methods: removeDirectory, copyDirectory
Separated FTP implementations out into their own classes to allow easy addition of new impls


Modified: trunk/bindings/bcppmake/sword.bpf
===================================================================
--- trunk/bindings/bcppmake/sword.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/bindings/bcppmake/sword.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -7,4 +7,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
DllEntryPoint
\ No newline at end of file
+
+DllEntryPoint
\ No newline at end of file

Modified: trunk/bindings/clx/test2/MainFrm.pas
===================================================================
--- trunk/bindings/clx/test2/MainFrm.pas	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/bindings/clx/test2/MainFrm.pas	2005-01-01 04:42:26 UTC (rev 1688)
@@ -375,16 +375,16 @@
         count := (ListView.Height div (ListView.Font.Height + 8));
         ListView.Items.Clear;
         for i := 0 to (count div 2) do
-        	module.modNext;	//-- get equal number of keys before and after our starting key(saveKey)
-        for i := 0 to count - 1 do
-        	module.modPrevious;
-        for i := 0 to count do
-        begin
-                ListItem := ListView.Items.Add;
-                ListItem.Caption := module.getKeyText;
-                module.modNext;
-        end;
-        module.setKeyText(key);
+        	module.modNext;	//-- get equal number of keys before and after our starting key(saveKey)
+        for i := 0 to count - 1 do
+        	module.modPrevious;
+        for i := 0 to count do
+        begin
+                ListItem := ListView.Items.Add;
+                ListItem.Caption := module.getKeyText;
+                module.modNext;
+        end;
+        module.setKeyText(key);
 end;
 
 procedure TForm1.ListViewItemClick(Sender: TObject; Button: TMouseButton;

Modified: trunk/include/Greek2Greek.h
===================================================================
--- trunk/include/Greek2Greek.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/Greek2Greek.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -17,7 +17,7 @@
 //*****************************************************************************
 /*
  *
- * $Id: Greek2Greek.h,v 1.3 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/GreekChars.h
===================================================================
--- trunk/include/GreekChars.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/GreekChars.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -18,7 +18,7 @@
 //*****************************************************************************
 /*
  *
- * $Id: GreekChars.h,v 1.4 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/SwordAPI.pas
===================================================================
--- trunk/include/SwordAPI.pas	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/SwordAPI.pas	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 {*
  *
- * $Id: SwordAPI.pas,v 1.1 1999/05/04 22:03:36 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/apocrypha.h
===================================================================
--- trunk/include/apocrypha.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/apocrypha.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  * apocrypha.h - Apocryphal text information to be included by VerseKey.cpp
  *
- * $Id: apocrypha.h,v 1.3 2003/05/10 00:55:43 chrislit Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/canon.h
===================================================================
--- trunk/include/canon.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/canon.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  * canon.h - Canonical text information to be included by VerseKey.cpp
  *
- * $Id: canon.h,v 1.20 2004/07/15 10:57:35 joachim Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/cdsourcemgr.h
===================================================================
--- trunk/include/cdsourcemgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/cdsourcemgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  cdsourcemgr.h	- definition of class SWCacheMgr used to provide an interface for
  *  	caching information of module sources
  *
- * $Id: cdsourcemgr.h,v 1.1 2002/10/23 23:13:35 dglassey Exp $
+ * $Id$
  *
  * Copyright 2002 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/cipherfil.h
===================================================================
--- trunk/include/cipherfil.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/cipherfil.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: cipherfil.h,v 1.10 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Added: trunk/include/curlftpt.h
===================================================================
--- trunk/include/curlftpt.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/curlftpt.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,32 @@
+#ifndef CURLFTPT_H
+#define CURLFTPT_H
+
+#include <defs.h>
+#include <ftptrans.h>
+
+SWORD_NAMESPACE_START
+
+class CURL;
+
+// initialize/cleanup SYSTEMWIDE library with life of this static.
+class CURLFTPTransport_init {
+public:
+	CURLFTPTransport_init();
+	~CURLFTPTransport_init();
+};
+
+
+class CURLFTPTransport : public FTPTransport {
+	CURL *session;
+
+public:
+	CURLFTPTransport(const char *host, StatusReporter *statusReporter = 0);
+	~CURLFTPTransport();
+	
+	virtual char getURL(const char *destPath, const char *sourceURL);
+};
+
+
+SWORD_NAMESPACE_END
+
+#endif

Modified: trunk/include/echomod.h
===================================================================
--- trunk/include/echomod.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/echomod.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  echomod.h  - code for class 'EchoMod' - a test module that just echo back
  *		 text of key.
  *
- * $Id: echomod.h,v 1.3 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/femain.h
===================================================================
--- trunk/include/femain.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/femain.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /*
  *
- * $Id: femain.h,v 1.3 2001/02/21 05:53:00 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/filemgr.h
===================================================================
--- trunk/include/filemgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/filemgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
 *  filemgr.h   - definition of class FileMgr used for pooling file handles
 *
-* $Id: filemgr.h,v 1.21 2004/02/06 21:01:00 scribe Exp $
+* $Id$
 *
 * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society
@@ -147,9 +147,12 @@
 	*/
 	signed char trunc(FileDesc *file);
 
+	static char isDirectory(const char *path);
 	static int createParent(const char *pName);
 	static int createPathAndFile(const char *fName);
-	static int copyFile(const char *sourceFile, const char *targetFile);
+	static int copyFile(const char *srcFile, const char *destFile);
+	static int copyDir(const char *srcDir, const char *destDir);
+	static int removeDir(const char *targetDir);
 	static int removeFile(const char *fName);
 	static char getLine(FileDesc *fDesc, SWBuf &line);
 

Added: trunk/include/ftplibftpt.h
===================================================================
--- trunk/include/ftplibftpt.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/ftplibftpt.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,29 @@
+#ifndef FTPLIBFTPT_H
+#define FTPLIBFTPT_H
+
+#include <defs.h>
+#include <ftptrans.h>
+
+SWORD_NAMESPACE_START
+
+// initialize/cleanup SYSTEMWIDE library with life of this static.
+class FTPLibFTPTransport_init {
+public:
+	FTPLibFTPTransport_init();
+	~FTPLibFTPTransport_init();
+};
+
+
+class FTPLibFTPTransport : public FTPTransport {
+	void *nControl;
+
+public:
+	FTPLibFTPTransport(const char *host, StatusReporter *statusReporter = 0);
+	~FTPLibFTPTransport();
+	char getURL(const char *destPath, const char *sourceURL);
+};
+
+
+SWORD_NAMESPACE_END
+
+#endif

Added: trunk/include/ftptrans.h
===================================================================
--- trunk/include/ftptrans.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/ftptrans.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,52 @@
+#ifndef FTPTRANS_H
+#define FTPTRANS_H
+
+#include <vector>
+#include <defs.h>
+
+SWORD_NAMESPACE_START
+
+
+// move this include to cpp once struct ftpparse isn't exposed anymore
+extern "C" {
+#include <ftpparse.h>
+}
+
+//class for reporting status
+class StatusReporter {
+public:
+	// Messages before stages of a batch download
+	virtual void preStatus(long totalBytes, long completedBytes, const char *message);
+	
+	// frequently called throughout a download, to report status
+	virtual void statusUpdate(double dtTotal, double dlNow);
+};
+
+
+class FTPTransport {
+
+protected:
+	StatusReporter *statusReporter;
+	bool passive;
+	bool term;
+	
+public:
+	FTPTransport(const char *host, StatusReporter *statusReporter = 0);
+	~FTPTransport();
+	virtual char getURL(const char *destPath, const char *sourceURL);
+
+	int copyDirectory(const char *urlPrefix, const char *dir, const char *dest, const char *suffix);
+
+	// probably change to not expose struct ftpparse.  We probably need our
+	// own FTPFile class or something that contains things like file name,
+	// size, type (dir, file, special).  Then change to vector of this class
+	// instead of ftpparse
+	std::vector<struct ftpparse> getDirList(const char *dirURL);
+	void setPassive(bool passive) { this->passive = passive; }
+	void terminate() { term = true; }
+};
+
+
+SWORD_NAMESPACE_END
+
+#endif

Modified: trunk/include/gbffootnotes.h
===================================================================
--- trunk/include/gbffootnotes.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbffootnotes.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbffootnotes.h,v 1.13 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfheadings.h
===================================================================
--- trunk/include/gbfheadings.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfheadings.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfheadings.h,v 1.6 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfhtml.h
===================================================================
--- trunk/include/gbfhtml.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfhtml.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: gbfhtml.h,v 1.14 2003/08/12 05:36:30 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfhtmlhref.h
===================================================================
--- trunk/include/gbfhtmlhref.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfhtmlhref.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: gbfhtmlhref.h,v 1.10 2004/07/21 16:49:34 tbiggs Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfmorph.h
===================================================================
--- trunk/include/gbfmorph.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfmorph.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfmorph.h,v 1.6 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfosis.h
===================================================================
--- trunk/include/gbfosis.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfosis.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfosis.h,v 1.10 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfplain.h
===================================================================
--- trunk/include/gbfplain.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfplain.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfplain.h,v 1.12 2003/02/28 13:31:37 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfredletterwords.h
===================================================================
--- trunk/include/gbfredletterwords.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfredletterwords.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfredletterwords.h,v 1.5 2004/03/27 09:24:35 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfrtf.h
===================================================================
--- trunk/include/gbfrtf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfrtf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfrtf.h,v 1.10 2003/02/28 13:31:37 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfstrongs.h
===================================================================
--- trunk/include/gbfstrongs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfstrongs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfstrongs.h,v 1.12 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfthml.h
===================================================================
--- trunk/include/gbfthml.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfthml.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: gbfthml.h,v 1.6 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/gbfwebif.h
===================================================================
--- trunk/include/gbfwebif.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/gbfwebif.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: gbfwebif.h,v 1.5 2003/08/12 05:36:30 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/greeklexattribs.h
===================================================================
--- trunk/include/greeklexattribs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/greeklexattribs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: greeklexattribs.h,v 1.3 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/hrefcom.h
===================================================================
--- trunk/include/hrefcom.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/hrefcom.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  *			pointing to actual text desired.  Uses standard
  *			files:	ot and nt using indexs ??.bks ??.cps ??.vss
  *
- * $Id: hrefcom.h,v 1.8 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/installmgr.h
===================================================================
--- trunk/include/installmgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/installmgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,37 +1,17 @@
 #ifndef INSTALLMGR_H
 #define INSTALLMGR_H
 
-#include <stdio.h>
-#include <vector>
 #include <defs.h>
 #include <swbuf.h>
-#include <swconfig.h>
 #include <map>
+#include <ftptrans.h>
 
 SWORD_NAMESPACE_START
 
 class SWMgr;
+class SWConfig;
 
-// move this include to cpp once struct ftpparse isn't exposed anymore
-extern "C" {
-#include <ftpparse.h>
-}
 
-
-// initialize/cleanup SYSTEMWIDE library with life of this static.
-class InstallMgr_init {
-public:
-	InstallMgr_init();
-	~InstallMgr_init();
-};
-
-
-struct FtpFile {
-  const char *filename;
-  FILE *stream;
-};
-
-
 class InstallSource {
 	SWMgr *mgr;
 public:
@@ -54,39 +34,33 @@
 
 class InstallMgr {
 
-	void *nControl;
-	int FTPCopyDirectoryRecurse(void *session, const char *urlPrefix, const char *dir, const char *dest, const char *suffix);
 protected:
 	char *privatePath;
-	// probably change to group these ftp functions into some kind of FTPSession
-	// class, and open/close functions become c_tor/d_tor.
+	StatusReporter *statusReporter;
+	bool passive;
+	
+	// override this method and provide your own custom FTPTransport subclass
+	virtual FTPTransport *createFTPTransport(const char *host, StatusReporter *statusReporter);
+
+	// we have a transport member to set as current running transport so we
+	// can ask it to terminate below, if user requests
+	FTPTransport *transport;	
+	
 public:
 	SWConfig *installConf;
 	InstallSourceMap sources;
-	void *FTPOpenSession(const char *host);
-	void FTPCloseSession(void *session);
-	char FTPURLGetFile(void *session, const char *dest, const char *sourceurl);
+	bool term;
 
-	// probably change to not expose struct ftpparse.  We probably need our
-	// own FTPFile class or something that contains things like file name,
-	// size, type (dir, file, special).  Then change to vector of this class
-	// instead of ftpparse
-	std::vector<struct ftpparse> FTPURLGetDir(void *session, const char *dirurl);
-
-
-public:
-	InstallMgr(const char *privatePath = "./");
+	InstallMgr(const char *privatePath = "./", StatusReporter *statusReporter = 0);
 	virtual ~InstallMgr();
-	bool passive;
-	bool terminate;
+
 	virtual int removeModule(SWMgr *manager, const char *modName);
-	virtual int FTPCopy(InstallSource *is, const char *src, const char *dest, bool dirTransfer = false, const char *suffix = "");
+	virtual int ftpCopy(InstallSource *is, const char *src, const char *dest, bool dirTransfer = false, const char *suffix = "");
 	virtual int installModule(SWMgr *destMgr, const char *fromLocation, const char *modName, InstallSource *is = 0);
-	virtual int copyFileToSWORDInstall(SWMgr *manager, const char *sourceDir, const char *fName);
 	virtual void refreshRemoteSource(InstallSource *is);
-	virtual void statusUpdate(double dltotal, double dlnow);
-	virtual void preDownloadStatus(long totalBytes, long completedBytes, const char *message);
 	virtual bool getCipherCode(const char *modName, SWConfig *config);
+	void setFTPPassive(bool passive) { this->passive = passive; }
+	void terminate() { if (transport) transport->terminate(); }
 };
 
 

Modified: trunk/include/kjvref.h
===================================================================
--- trunk/include/kjvref.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/kjvref.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  * kjvref.h - KJV versification used as default by Sword
  *
- * $Id: kjvref.h,v 1.1 2004/05/07 17:02:32 dglassey Exp $
+ * $Id$
  *
  * Copyright 2004 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/latin1utf16.h
===================================================================
--- trunk/include/latin1utf16.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/latin1utf16.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: latin1utf16.h,v 1.5 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/latin1utf8.h
===================================================================
--- trunk/include/latin1utf8.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/latin1utf8.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: latin1utf8.h,v 1.4 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/listkey.h
===================================================================
--- trunk/include/listkey.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/listkey.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -4,7 +4,7 @@
  *				(e.g. verse, word,
  *				place, etc.)
  *
- * $Id: listkey.h,v 1.20 2004/05/08 21:04:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/localemgr.h
===================================================================
--- trunk/include/localemgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/localemgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  localemgr.h   - definition of class LocaleMgr used to interact with
  *				registered locales for a sword installation
  *
- * $Id: localemgr.h,v 1.18 2004/02/06 21:01:00 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/lzsscomprs.h
===================================================================
--- trunk/include/lzsscomprs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/lzsscomprs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  lzsscomprs.h   - definition of Class SWCompress used for data compression
  *
- * $Id: lzsscomprs.h,v 1.4 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisbook.h
===================================================================
--- trunk/include/osisbook.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisbook.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  * osisbook.h - Canonical text information to be included by VerseKey2.cpp
  *
- * $Id: osisbook.h,v 1.6 2004/05/07 17:02:32 dglassey Exp $
+ * $Id$
  *
  * Copyright 2004 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisfootnotes.h
===================================================================
--- trunk/include/osisfootnotes.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisfootnotes.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osisfootnotes.h,v 1.2 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisheadings.h
===================================================================
--- trunk/include/osisheadings.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisheadings.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osisheadings.h,v 1.2 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osishtmlhref.h
===================================================================
--- trunk/include/osishtmlhref.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osishtmlhref.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osishtmlhref.h,v 1.11 2004/07/21 16:47:26 tbiggs Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osislemma.h
===================================================================
--- trunk/include/osislemma.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osislemma.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osislemma.h,v 1.2 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osismorph.h
===================================================================
--- trunk/include/osismorph.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osismorph.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: osismorph.h,v 1.3 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisosis.h
===================================================================
--- trunk/include/osisosis.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisosis.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osisosis.h,v 1.2 2004/03/31 20:47:26 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisplain.h
===================================================================
--- trunk/include/osisplain.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisplain.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osisplain.h,v 1.11 2004/04/09 12:31:18 joachim Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisredletterwords.h
===================================================================
--- trunk/include/osisredletterwords.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisredletterwords.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osisredletterwords.h,v 1.2 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisrtf.h
===================================================================
--- trunk/include/osisrtf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisrtf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osisrtf.h,v 1.11 2003/12/24 20:51:36 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisscripref.h
===================================================================
--- trunk/include/osisscripref.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisscripref.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osisscripref.h,v 1.2 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osisstrongs.h
===================================================================
--- trunk/include/osisstrongs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osisstrongs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: osisstrongs.h,v 1.3 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/osiswebif.h
===================================================================
--- trunk/include/osiswebif.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/osiswebif.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: osiswebif.h,v 1.1 2003/10/24 02:43:46 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/plainfootnotes.h
===================================================================
--- trunk/include/plainfootnotes.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/plainfootnotes.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: plainfootnotes.h,v 1.7 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/plainhtml.h
===================================================================
--- trunk/include/plainhtml.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/plainhtml.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: plainhtml.h,v 1.9 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawcom.h
===================================================================
--- trunk/include/rawcom.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawcom.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  rawcom.h   - code for class 'RawCom'- a module that reads raw commentary
  *			files:	ot and nt using indexs ??.bks ??.cps ??.vss
  *
- * $Id: rawcom.h,v 1.18 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawfiles.h
===================================================================
--- trunk/include/rawfiles.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawfiles.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  *			pointing to actual text desired.  Uses standard
  *			files:	ot and nt using indexs ??.bks ??.cps ??.vss
  *
- * $Id: rawfiles.h,v 1.18 2003/02/25 04:12:47 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawgbf.h
===================================================================
--- trunk/include/rawgbf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawgbf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  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.5 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawgenbook.h
===================================================================
--- trunk/include/rawgenbook.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawgenbook.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  rawtext.h   - code for class 'RawText'- a module that reads raw text files:
  *		  ot and nt using indexs ??.bks ??.cps ??.vss
  *
- * $Id: rawgenbook.h,v 1.7 2003/02/26 04:49:12 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawld.h
===================================================================
--- trunk/include/rawld.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawld.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  rawld.cpp - code for class 'RawLD'- a module that reads raw lexicon and
  *				dictionary files: *.dat *.idx
  *
- * $Id: rawld.h,v 1.18 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawld4.h
===================================================================
--- trunk/include/rawld4.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawld4.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  rawld.cpp - code for class 'RawLD'- a module that reads raw lexicon and
  *				dictionary files: *.dat *.idx
  *
- * $Id: rawld4.h,v 1.12 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawstr.h
===================================================================
--- trunk/include/rawstr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawstr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -4,7 +4,7 @@
  *			and provides lookup and parsing functions based on
  *			class StrKey
  *
- * $Id: rawstr.h,v 1.16 2003/02/26 03:23:44 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawstr4.h
===================================================================
--- trunk/include/rawstr4.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawstr4.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -4,7 +4,7 @@
  *			and provides lookup and parsing functions based on
  *			class StrKey
  *
- * $Id: rawstr4.h,v 1.9 2003/02/27 07:39:37 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rawtext.h
===================================================================
--- trunk/include/rawtext.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rawtext.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  rawtext.h   - code for class 'RawText'- a module that reads raw text files:
  *		  ot and nt using indexs ??.bks ??.cps ??.vss
  *
- * $Id: rawtext.h,v 1.29 2003/08/29 19:02:44 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/refsys.h
===================================================================
--- trunk/include/refsys.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/refsys.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *	refsys.h - code for class 'refsys'- Biblical reference system
  *
- * $Id: refsys.h,v 1.1 2004/05/07 17:02:32 dglassey Exp $
+ * $Id$
  *
  * Copyright 2004 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/refsysmgr.h
===================================================================
--- trunk/include/refsysmgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/refsysmgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  refsysmgr.h   - definition of class RefSysMgr used to interact with
  *				registered biblical reference systems for a sword installation
  *
- * $Id: refsysmgr.h,v 1.1 2004/05/07 17:02:32 dglassey Exp $
+ * $Id$
  *
  * Copyright 2004 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/remotesourcemgr.h
===================================================================
--- trunk/include/remotesourcemgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/remotesourcemgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  remotesourcemgr.h	- definition of class SWCacheMgr used to provide an interface for
  *  	caching information of module sources
  *
- * $Id: remotesourcemgr.h,v 1.1 2002/10/23 23:13:35 dglassey Exp $
+ * $Id$
  *
  * Copyright 2002 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/rtfhtml.h
===================================================================
--- trunk/include/rtfhtml.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/rtfhtml.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: rtfhtml.h,v 1.7 2003/02/20 07:25:19 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/scsuutf8.h
===================================================================
--- trunk/include/scsuutf8.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/scsuutf8.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: scsuutf8.h,v 1.4 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/stringmgr.h
===================================================================
--- trunk/include/stringmgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/stringmgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *	stringmgr.h - A class which provides string andling functions which can 
  *			reimplemented by frontends
  *
- * $Id: stringmgr.h,v 1.3 2004/07/20 12:53:36 joachim Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/strkey.h
===================================================================
--- trunk/include/strkey.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/strkey.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  strkey.h - code for class 'strkey'- a standard Biblical verse key
  *
- * $Id: strkey.h,v 1.7 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swbasicfilter.h
===================================================================
--- trunk/include/swbasicfilter.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swbasicfilter.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -4,7 +4,7 @@
  *  				many filter will need and can use as a starting
  *  				point. 
  *
- * $Id: swbasicfilter.h,v 1.22 2003/08/12 05:36:30 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swbuf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
 *  swbuf.h  - code for SWBuf used as a transport and utility for data buffers
 *
-* $Id: swbuf.h,v 1.39 2004/07/15 13:11:52 joachim Exp $
+* $Id$
 *
 * Copyright 2003 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society

Modified: trunk/include/swcacher.h
===================================================================
--- trunk/include/swcacher.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swcacher.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  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.5 2003/08/29 06:00:16 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swcipher.h
===================================================================
--- trunk/include/swcipher.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swcipher.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  swcipher.h   - definition of Class SWCipher used for data cipher/decipher
  *
- * $Id: swcipher.h,v 1.8 2003/08/12 10:37:06 scribe Exp $
+ * $Id$
  *
  * Copyright 1999 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swcom.h
===================================================================
--- trunk/include/swcom.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swcom.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swcom.h   - code for base class 'SWCom'.  SWCom is the basis for all
  *		 types of commentary modules
  *
- * $Id: swcom.h,v 1.13 2003/02/28 13:12:43 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swcomprs.h
===================================================================
--- trunk/include/swcomprs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swcomprs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  swcomprs.h   - definition of Class SWCompress used for data compression
  *
- * $Id: swcomprs.h,v 1.8 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swconfig.h
===================================================================
--- trunk/include/swconfig.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swconfig.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swconfig.h   - definition of Class SWConfig used for saving and retrieval
  *				of configuration information
  *
- * $Id: swconfig.h,v 1.23 2004/01/17 04:33:25 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swdisp.h
===================================================================
--- trunk/include/swdisp.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swdisp.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  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.8 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swdisprtf.h
===================================================================
--- trunk/include/swdisprtf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swdisprtf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  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 $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swdisprtfchap.h
===================================================================
--- trunk/include/swdisprtfchap.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swdisprtfchap.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  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 $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swfilter.h
===================================================================
--- trunk/include/swfilter.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swfilter.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swfilter.h	- definition of class SWFilter used to filter text between
  *				different formats
  *
- * $Id: swfilter.h,v 1.17 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swfiltermgr.h
===================================================================
--- trunk/include/swfiltermgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swfiltermgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swfiltermgr.h   - definition of class SWFilterMgr used as an interface to
  *				manage filters on a module
  *
- * $Id: swfiltermgr.h,v 1.3 2003/03/04 11:35:52 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swgenbook.h
===================================================================
--- trunk/include/swgenbook.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swgenbook.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
 *  swgenbook.h
 *
-* $Id: swgenbook.h,v 1.5 2003/03/04 22:32:55 mgruner Exp $
+* $Id$
 *
 * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society

Modified: trunk/include/swkey.h
===================================================================
--- trunk/include/swkey.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swkey.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  *				types of keys for indexing into modules (e.g. verse, word,
  *				place, etc.)
  *
- * $Id: swkey.h,v 1.27 2004/05/08 21:04:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swld.h
===================================================================
--- trunk/include/swld.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swld.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swld.h   - code for base class 'SWLD'.  SWLD is the basis for all
  *				types of Lexicon and Dictionary modules (hence the 'LD').
  *
- * $Id: swld.h,v 1.14 2003/02/28 13:12:43 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swlocale.h
===================================================================
--- trunk/include/swlocale.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swlocale.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swlocale.h   - definition of Class SWLocale used for retrieval
  *				of locale lookups
  *
- * $Id: swlocale.h,v 1.15 2004/05/07 18:03:36 dglassey Exp $
+ * $Id$
  *
  * Copyright 2000 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swlog.h
===================================================================
--- trunk/include/swlog.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swlog.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  swlog.h	- definition of class SWLog used for logging messages
  *
- * $Id: swlog.h,v 1.6 2004/02/06 21:01:00 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swmacs.h
===================================================================
--- trunk/include/swmacs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swmacs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  swmacs.h	- generic macros
  *
- * $Id: swmacs.h,v 1.2 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swmgr.h
===================================================================
--- trunk/include/swmgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swmgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
 *  swmgr.h   - definition of class SWMgr used to interact with an install
 *				base of sword modules.
 *
-* $Id: swmgr.h,v 1.57 2004/04/07 12:33:53 dglassey Exp $
+* $Id$
 *
 * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society
@@ -63,7 +63,7 @@
 *
 * To get the SWModule objects of the instalelled modules use @ref Modules for this.
 * @see AddRawFilters(), AddRenderFilters(), AddStripFilters()
-* @version $Id: swmgr.h,v 1.57 2004/04/07 12:33:53 dglassey Exp $
+* @version $Id$
 */
 class SWDLLEXPORT SWMgr {
 
@@ -126,6 +126,7 @@
 
 public:
 	virtual void augmentModules(const char *ipath);
+	void deleteModule(const char *);
 
 	/** 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.

Modified: trunk/include/swoptfilter.h
===================================================================
--- trunk/include/swoptfilter.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swoptfilter.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /***************************************************************************
  *
- * $Id: swoptfilter.h,v 1.2 2003/07/05 08:53:05 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swsearchable.h
===================================================================
--- trunk/include/swsearchable.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swsearchable.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swsearchable.h	- definition of class SWSearchable used to provide an
  *	interface for objects that be searched.
  *
- * $Id: swsearchable.h,v 1.1 2003/08/29 06:00:16 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swsourcemgr.h
===================================================================
--- trunk/include/swsourcemgr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swsourcemgr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swsourcemgr.h	- definition of class SWSourceMgr used to provide an interface for
  *  	caching information of module sources
  *
- * $Id: swsourcemgr.h,v 1.1 2002/10/23 23:13:35 dglassey Exp $
+ * $Id$
  *
  * Copyright 2002 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swtext.h
===================================================================
--- trunk/include/swtext.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swtext.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swtext.h   - code for base class 'SWText'.  SWText is the basis for all
  *		 types of text modules
  *
- * $Id: swtext.h,v 1.14 2003/02/28 13:12:43 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/swversion.h
===================================================================
--- trunk/include/swversion.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/swversion.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  swversion.h   - definition of class SWVersion used to compare version info
  *
- * $Id: swversion.h,v 1.17 2004/02/10 18:15:54 joachim Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/tbdisp.h
===================================================================
--- trunk/include/tbdisp.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/tbdisp.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  *			MSWindows TextBox (or any other control that takes a
  *			SetDialogItemText
  *
- * $Id: tbdisp.h,v 1.3 2002/10/03 04:26:46 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlfootnotes.h
===================================================================
--- trunk/include/thmlfootnotes.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlfootnotes.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlfootnotes.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlgbf.h
===================================================================
--- trunk/include/thmlgbf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlgbf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlgbf.h,v 1.7 2003/07/26 23:10:55 chrislit Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlheadings.h
===================================================================
--- trunk/include/thmlheadings.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlheadings.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlheadings.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlhtml.h
===================================================================
--- trunk/include/thmlhtml.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlhtml.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlhtml.h,v 1.12 2003/08/12 05:36:30 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlhtmlhref.h
===================================================================
--- trunk/include/thmlhtmlhref.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlhtmlhref.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlhtmlhref.h,v 1.10 2003/12/22 04:28:09 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmllemma.h
===================================================================
--- trunk/include/thmllemma.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmllemma.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmllemma.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlmorph.h
===================================================================
--- trunk/include/thmlmorph.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlmorph.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlmorph.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlosis.h
===================================================================
--- trunk/include/thmlosis.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlosis.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlosis.h,v 1.6 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 2003 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlplain.h
===================================================================
--- trunk/include/thmlplain.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlplain.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlplain.h,v 1.7 2003/07/26 23:10:55 chrislit Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlrtf.h
===================================================================
--- trunk/include/thmlrtf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlrtf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlrtf.h,v 1.13 2003/12/22 06:30:44 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlscripref.h
===================================================================
--- trunk/include/thmlscripref.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlscripref.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlscripref.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlstrongs.h
===================================================================
--- trunk/include/thmlstrongs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlstrongs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlstrongs.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlvariants.h
===================================================================
--- trunk/include/thmlvariants.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlvariants.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlvariants.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/thmlwebif.h
===================================================================
--- trunk/include/thmlwebif.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/thmlwebif.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: thmlwebif.h,v 1.5 2003/08/12 05:36:30 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/treekey.h
===================================================================
--- trunk/include/treekey.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/treekey.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  versekey.h - code for class 'versekey'- a standard Biblical verse key
  *
- * $Id: treekey.h,v 1.5 2004/05/08 21:04:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/treekeyidx.h
===================================================================
--- trunk/include/treekeyidx.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/treekeyidx.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  versekey.h - code for class 'versekey'- a standard Biblical verse key
  *
- * $Id: treekeyidx.h,v 1.6 2004/05/08 21:04:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/unicodertf.h
===================================================================
--- trunk/include/unicodertf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/unicodertf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: unicodertf.h,v 1.5 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/unixstr.h
===================================================================
--- trunk/include/unixstr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/unixstr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 // Include only if your UNIX compiler does not include stricmp but does include strcasecmp
 /*
  *
- * $Id: unixstr.h,v 1.4 2003/06/27 01:41:07 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/url.h
===================================================================
--- trunk/include/url.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/url.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
 *  url.h  - code for an URL parser utility class
 *
-* $Id: url.h,v 1.8 2004/07/20 22:48:33 scribe Exp $
+* $Id$
 *
 * Copyright 2003 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society

Modified: trunk/include/utf16utf8.h
===================================================================
--- trunk/include/utf16utf8.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf16utf8.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf16utf8.h,v 1.5 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8arshaping.h
===================================================================
--- trunk/include/utf8arshaping.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8arshaping.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8arshaping.h,v 1.6 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8bidireorder.h
===================================================================
--- trunk/include/utf8bidireorder.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8bidireorder.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8bidireorder.h,v 1.7 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8cantillation.h
===================================================================
--- trunk/include/utf8cantillation.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8cantillation.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8cantillation.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8greekaccents.h
===================================================================
--- trunk/include/utf8greekaccents.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8greekaccents.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8greekaccents.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8hebrewpoints.h
===================================================================
--- trunk/include/utf8hebrewpoints.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8hebrewpoints.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8hebrewpoints.h,v 1.5 2003/07/05 04:58:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8html.h
===================================================================
--- trunk/include/utf8html.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8html.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8html.h,v 1.4 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8latin1.h
===================================================================
--- trunk/include/utf8latin1.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8latin1.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8latin1.h,v 1.4 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8nfc.h
===================================================================
--- trunk/include/utf8nfc.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8nfc.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8nfc.h,v 1.6 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8nfkd.h
===================================================================
--- trunk/include/utf8nfkd.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8nfkd.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8nfkd.h,v 1.6 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8transliterator.h
===================================================================
--- trunk/include/utf8transliterator.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8transliterator.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8transliterator.h,v 1.22 2003/10/05 19:07:35 mgruner Exp $
+ * $Id$
  *
  * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utf8utf16.h
===================================================================
--- trunk/include/utf8utf16.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utf8utf16.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * $Id: utf8utf16.h,v 1.5 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utilfuns.h
===================================================================
--- trunk/include/utilfuns.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utilfuns.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  utilfuns.h	- utility function prototypes
  *
- * $Id: utilfuns.h,v 1.2 2003/06/01 14:32:09 joachim Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utilstr.h
===================================================================
--- trunk/include/utilstr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utilstr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  utilstr.h	- prototypes for string utility functions
  *
- * $Id: utilstr.h,v 1.13 2004/05/07 17:55:39 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utilweb.h
===================================================================
--- trunk/include/utilweb.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utilweb.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  utilxml.h   - definition of class that deal with xml constructs 
  *
- * $Id: utilweb.h,v 1.2 2003/06/27 01:41:07 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/utilxml.h
===================================================================
--- trunk/include/utilxml.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/utilxml.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  utilxml.h   - definition of class that deal with xml constructs 
  *
- * $Id: utilxml.h,v 1.8 2004/01/24 18:47:41 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/versekey.h
===================================================================
--- trunk/include/versekey.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/versekey.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *	versekey.h - code for class 'versekey'- a standard Biblical verse key
  *
- * $Id: versekey.h,v 1.33 2004/05/08 21:04:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/versekey2.h
===================================================================
--- trunk/include/versekey2.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/versekey2.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *	versekey2.h - code for class 'versekey'- a standard Biblical verse key
  *
- * $Id: versekey2.h,v 1.7 2004/05/08 21:04:42 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/zcom.h
===================================================================
--- trunk/include/zcom.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/zcom.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  zcom.h   - code for class 'zCom'- a module that reads compressed text
  *				files: ot and nt using indexs ??.vss
  *
- * $Id: zcom.h,v 1.19 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/zconf.h
===================================================================
--- trunk/include/zconf.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/zconf.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h 
  */
 
-/* @(#) $Id: zconf.h,v 1.4 2003/07/07 02:50:05 scribe Exp $ */
+/* @(#) $Id$ */
 
 #ifndef _ZCONF_H
 #define _ZCONF_H

Modified: trunk/include/zipcomprs.h
===================================================================
--- trunk/include/zipcomprs.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/zipcomprs.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  swcomprs.h   - definition of Class SWCompress used for data compression
  *
- * $Id: zipcomprs.h,v 1.4 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/zld.h
===================================================================
--- trunk/include/zld.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/zld.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  zld.cpp - code for class 'zLD'- a module that reads compressed lexicon and
  *				dictionary files.
  *
- * $Id: zld.h,v 1.8 2003/02/20 07:25:20 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/zstr.h
===================================================================
--- trunk/include/zstr.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/zstr.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -4,7 +4,7 @@
  *			and provides lookup and parsing functions based on
  *			class StrKey
  *
- * $Id: zstr.h,v 1.8 2003/08/12 05:36:30 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/ztext.h
===================================================================
--- trunk/include/ztext.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/ztext.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  ztext.h   - code for class 'zText'- a module that reads compressed text
  *				files: ot and nt using indexs ??.vss
  *
- * $Id: ztext.h,v 1.29 2003/08/29 06:00:16 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/include/ztext2.h
===================================================================
--- trunk/include/ztext2.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/include/ztext2.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  ztext.h   - code for class 'zText2'- a module that reads compressed text
  *				files: ot and nt using indexs ??.vss
  *
- * $Id: ztext2.h,v 1.2 2004/05/07 17:02:32 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/lib/bcppmake/libsword.bpr
===================================================================
--- trunk/lib/bcppmake/libsword.bpr	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/lib/bcppmake/libsword.bpr	2005-01-01 04:42:26 UTC (rev 1688)
@@ -115,7 +115,7 @@
     <PATHRC value=".;"/>
     <PATHASM value=".;"/>
     <LINKER value="TLib"/>
-    <USERDEFINES value="_ICU_;_ICUSWORD_;USBINARY;U_HAVE_PLACEMENT_NEW=0"/>
+    <USERDEFINES value="_ICU_;_ICUSWORD_;USBINARY;U_HAVE_PLACEMENT_NEW=0;_DEBUG"/>
     <SYSDEFINES value="NO_STRICT"/>
     <MAINSOURCE value="libsword.bpf"/>
     <INCLUDEPATH value="..\..\src\utilfuns\zlib;..\..\src\modules\lexdict\zld;..\..\src\modules\lexdict\rawld4;..\..\src\modules\comments\zcom;..\..\src\modules\genbook\rawgenbook;..\..\src\modules\genbook;..\..\src\modules\texts\ztext;..\..\src\modules\texts\rawtext;..\..\src\modules\texts;..\..\src\modules\lexdict\rawld;..\..\src\modules\lexdict;..\..\src\modules\filters;..\..\src\modules\common;..\..\src\modules\comments\rawfiles;..\..\src\modules\comments\rawcom;..\..\src\modules\comments\hrefcom;..\..\src\modules\comments;..\..\src\modules;..\..\src\frontend;..\..\src\utilfuns;..\..\src\mgr;..\..\src\keys;..\..\..\icu-sword\source\common;..\..\apps\windoze\CBuilder5\InstallMgr\curl\include;..\..\include;$(BCB)\include;$(BCB)\include\vcl;..\..\..\icu-sword\source\i18n"/>
@@ -139,9 +139,9 @@
       -I$(BCB)\include -I$(BCB)\include\vcl -I..\..\..\icu-sword\source\i18n 
       -src_suffix cpp -D_ICU_ -D_ICUSWORD_ -DUSBINARY -D_DEBUG 
       -DU_HAVE_PLACEMENT_NEW=0 -boa"/>
-    <CFLAG1 value="-O2 -Vx -X- -a8 -b- -k- -vi -c -tW -tWM"/>
-    <PFLAGS value="-$Y- -$L- -$D- -v -JPHNE -M"/>
-    <AFLAGS value="/mx /w2 /zn"/>
+    <CFLAG1 value="-Od -Vx -X- -r- -a8 -b- -k -y -v -vi- -c -tW -tWM"/>
+    <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/>
+    <AFLAGS value="/mx /w2 /zi"/>
     <LFLAGS value="/P512"/>
   </OPTIONS>
   <LINKER>
@@ -210,8 +210,8 @@
 
 [HistoryLists\hlConditionals]
 Count=11
-Item0=_ICU_;_ICUSWORD_;USBINARY;U_HAVE_PLACEMENT_NEW=0
-Item1=_ICU_;_ICUSWORD_;USBINARY;U_HAVE_PLACEMENT_NEW=0;_DEBUG
+Item0=_ICU_;_ICUSWORD_;USBINARY;U_HAVE_PLACEMENT_NEW=0;_DEBUG
+Item1=_ICU_;_ICUSWORD_;USBINARY;U_HAVE_PLACEMENT_NEW=0
 Item2=_ICU_;_ICUSWORD_;USBINARY;_DEBUG;U_HAVE_PLACEMENT_NEW=0
 Item3=_ICU_;_ICUSWORD_;USBINARY;_DEBUG
 Item4=_ICU_;_ICUSWORD_;USBINARY

Modified: trunk/scripts/sapphire.cpp
===================================================================
--- trunk/scripts/sapphire.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/scripts/sapphire.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,73 +1,73 @@
-/******************************************************************************
- *
- * Placeholder for the REAL SAPPHIRE II Stream Cipher Files
- *
- * The SAPPHIRE II package may be obtained from within the United States or
- * Canada from:
- *
- *   http://cryptography.org/cgi-bin/crypto.cgi/libraries/sapphire.zip
- *
- *
- * These files must be placed accordingly:
- *
- *   .../sword/include/sapphire.h
- *   .../sword/src/modules/common/sapphire.cpp
- *
- * If you are outside of these countries, you will have to obtain this package
- * elsewhere.
- *
- */
-
-
-#ifdef UNIX
-#include <memory.h>
-#include <unistd.h>
-#else
-#include <mem.h>
-#endif
-#include "sapphire.h"
-
-unsigned char sapphire::keyrand(int limit,
-                                unsigned char *user_key,
-                                unsigned char keysize,
-                                unsigned char *rsum,
-                                unsigned *keypos)
-    {
-    return keysize;
-    }
-
-void sapphire::initialize(unsigned char *key, unsigned char keysize)
-    {
-    }
-
-void sapphire::hash_init(void)
-    {
-    }
-
-sapphire::sapphire(unsigned char *key, unsigned char keysize)
-    {
-    }
-
-void sapphire::burn(void)
-    {
-    }
-
-sapphire::~sapphire()
-    {
-    }
-
-unsigned char sapphire::encrypt(unsigned char b)
-    {
-    return b;
-    }
-
-unsigned char sapphire::decrypt(unsigned char b)
-    {
-    return b;
-    }
-
-void sapphire::hash_final(unsigned char *hash,      // Destination
-                          unsigned char hashlength) // Size of hash.
-    {
-    }
-
+/******************************************************************************
+ *
+ * Placeholder for the REAL SAPPHIRE II Stream Cipher Files
+ *
+ * The SAPPHIRE II package may be obtained from within the United States or
+ * Canada from:
+ *
+ *   http://cryptography.org/cgi-bin/crypto.cgi/libraries/sapphire.zip
+ *
+ *
+ * These files must be placed accordingly:
+ *
+ *   .../sword/include/sapphire.h
+ *   .../sword/src/modules/common/sapphire.cpp
+ *
+ * If you are outside of these countries, you will have to obtain this package
+ * elsewhere.
+ *
+ */
+
+
+#ifdef UNIX
+#include <memory.h>
+#include <unistd.h>
+#else
+#include <mem.h>
+#endif
+#include "sapphire.h"
+
+unsigned char sapphire::keyrand(int limit,
+                                unsigned char *user_key,
+                                unsigned char keysize,
+                                unsigned char *rsum,
+                                unsigned *keypos)
+    {
+    return keysize;
+    }
+
+void sapphire::initialize(unsigned char *key, unsigned char keysize)
+    {
+    }
+
+void sapphire::hash_init(void)
+    {
+    }
+
+sapphire::sapphire(unsigned char *key, unsigned char keysize)
+    {
+    }
+
+void sapphire::burn(void)
+    {
+    }
+
+sapphire::~sapphire()
+    {
+    }
+
+unsigned char sapphire::encrypt(unsigned char b)
+    {
+    return b;
+    }
+
+unsigned char sapphire::decrypt(unsigned char b)
+    {
+    return b;
+    }
+
+void sapphire::hash_final(unsigned char *hash,      // Destination
+                          unsigned char hashlength) // Size of hash.
+    {
+    }
+

Modified: trunk/src/keys/refsys.cpp
===================================================================
--- trunk/src/keys/refsys.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/keys/refsys.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *	refsys.cpp - code for class 'refsys'- Biblical reference system
  *
- * $Id: refsys.cpp,v 1.2 2004/05/07 17:54:10 dglassey Exp $
+ * $Id$
  *
  * Copyright 2004 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/keys/treekey.cpp
===================================================================
--- trunk/src/keys/treekey.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/keys/treekey.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  versekey.h - code for class 'versekey'- a standard Biblical verse key
  *
- * $Id: treekey.cpp,v 1.3 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/keys/treekeyidx.cpp
===================================================================
--- trunk/src/keys/treekeyidx.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/keys/treekeyidx.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  versekey.h - code for class 'versekey'- a standard Biblical verse key
  *
- * $Id: treekeyidx.cpp,v 1.18 2004/05/16 20:59:04 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Added: trunk/src/mgr/curlftpt.cpp
===================================================================
--- trunk/src/mgr/curlftpt.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/curlftpt.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,113 @@
+ /*****************************************************************************
+ * CURLFTPTransport functions
+ *
+ */
+ 
+
+#include <curlftpt.h>
+
+#include <fcntl.h>
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+#include <curl/curl.h>
+#include <curl/types.h>
+#include <curl/easy.h>
+
+SWORD_NAMESPACE_START
+
+
+struct FtpFile {
+  const char *filename;
+  FILE *stream;
+};
+
+
+int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream);
+int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
+
+static CURLFTPTransport_init _CURLFTPTransport_init;
+
+CURLFTPTransport_init::CURLFTPTransport_init() {
+	//curl_global_init(CURL_GLOBAL_DEFAULT);  // curl_easy_init automatically calls it if needed
+}
+
+CURLFTPTransport_init::~CURLFTPTransport_init() {
+	curl_global_cleanup();
+}
+
+int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
+	struct FtpFile *out=(struct FtpFile *)stream;
+	if (out && !out->stream) {
+		/* open file for writing */
+		out->stream=fopen(out->filename, "wb");
+		if (!out->stream)
+			return -1; /* failure, can't open file to write */
+	}
+	return fwrite(buffer, size, nmemb, out->stream);
+}
+
+
+int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) {
+	if (clientp) {
+		((StatusReporter *)clientp)->statusUpdate(dltotal, dlnow);
+	}
+	return 0;
+}
+
+
+CURLFTPTransport::CURLFTPTransport(const char *host, StatusReporter *sr) : FTPTransport(host, sr) {
+	session = (CURL *)curl_easy_init();
+}
+
+
+CURLFTPTransport::~CURLFTPTransport() {
+	curl_easy_cleanup(session);
+}
+
+
+char CURLFTPTransport::getURL(const char *destPath, const char *sourceURL) {
+	char retVal = 0;
+	struct FtpFile ftpfile = {destPath, NULL};
+
+	CURLcode res;
+	
+	if (session) {
+		curl_easy_setopt(session, CURLOPT_URL, sourceURL);
+	
+		curl_easy_setopt(session, CURLOPT_USERPWD, "ftp:installmgr at user.com");
+		curl_easy_setopt(session, CURLOPT_WRITEFUNCTION, my_fwrite);
+		if (!passive)
+			curl_easy_setopt(session, CURLOPT_FTPPORT, "-");
+		curl_easy_setopt(session, CURLOPT_NOPROGRESS, 0);
+		curl_easy_setopt(session, CURLOPT_PROGRESSDATA, statusReporter);
+		curl_easy_setopt(session, CURLOPT_PROGRESSFUNCTION, my_fprogress);
+		/* Set a pointer to our struct to pass to the callback */
+		curl_easy_setopt(session, CURLOPT_FILE, &ftpfile);
+
+		/* Switch on full protocol/debug output */
+		curl_easy_setopt(session, CURLOPT_VERBOSE, true);
+
+		res = curl_easy_perform(session);
+
+		if(CURLE_OK != res) {
+			retVal = -1;
+		}
+	}
+
+	if (ftpfile.stream)
+		fclose(ftpfile.stream); /* close the local file */
+
+	return retVal;
+}
+
+
+SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/filemgr.cpp
===================================================================
--- trunk/src/mgr/filemgr.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/filemgr.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -161,6 +161,51 @@
 }
 
 
+int FileMgr::sysOpen(FileDesc *file) {
+	FileDesc **loop;
+	int openCount = 1;		// because we are presently opening 1 file, and we need to be sure to close files to accomodate, if necessary
+	
+	for (loop = &files; *loop; loop = &((*loop)->next)) {
+
+		if ((*loop)->fd > 0) {
+			if (++openCount > maxFiles) {
+				(*loop)->offset = lseek((*loop)->fd, 0, SEEK_CUR);
+				::close((*loop)->fd);
+				(*loop)->fd = -77;
+			}
+		}
+
+		if (*loop == file) {
+			if (*loop != files) {
+				*loop = (*loop)->next;
+				file->next = files;
+				files = file;
+			}
+			if ((!access(file->path, 04)) || ((file->mode & O_CREAT) == O_CREAT)) {	// check for at least file exists / read access before we try to open
+				char tries = (((file->mode & O_RDWR) == O_RDWR) && (file->tryDowngrade)) ? 2 : 1;  // try read/write if possible
+				for (int i = 0; i < tries; i++) {
+					if (i > 0) {
+						file->mode = (file->mode & ~O_RDWR);	// remove write access
+						file->mode = (file->mode | O_RDONLY);// add read access
+					}
+					file->fd = ::open(file->path, file->mode, file->perms);
+
+					if (file->fd >= 0)
+						break;
+				}
+
+				if (file->fd >= 0)
+					lseek(file->fd, file->offset, SEEK_SET);
+			}
+			else file->fd = -1;
+			if (!*loop)
+				break;
+		}
+	}
+	return file->fd;
+}
+
+
 // to truncate a file at its current position
 // leaving byte at current possition intact
 // deleting everything afterward.
@@ -221,51 +266,6 @@
 }
 
 
-int FileMgr::sysOpen(FileDesc *file) {
-	FileDesc **loop;
-	int openCount = 1;		// because we are presently opening 1 file, and we need to be sure to close files to accomodate, if necessary
-	
-	for (loop = &files; *loop; loop = &((*loop)->next)) {
-
-		if ((*loop)->fd > 0) {
-			if (++openCount > maxFiles) {
-				(*loop)->offset = lseek((*loop)->fd, 0, SEEK_CUR);
-				::close((*loop)->fd);
-				(*loop)->fd = -77;
-			}
-		}
-
-		if (*loop == file) {
-			if (*loop != files) {
-				*loop = (*loop)->next;
-				file->next = files;
-				files = file;
-			}
-			if ((!access(file->path, 04)) || ((file->mode & O_CREAT) == O_CREAT)) {	// check for at least file exists / read access before we try to open
-				char tries = (((file->mode & O_RDWR) == O_RDWR) && (file->tryDowngrade)) ? 2 : 1;  // try read/write if possible
-				for (int i = 0; i < tries; i++) {
-					if (i > 0) {
-						file->mode = (file->mode & ~O_RDWR);	// remove write access
-						file->mode = (file->mode | O_RDONLY);// add read access
-					}
-					file->fd = ::open(file->path, file->mode, file->perms);
-
-					if (file->fd >= 0)
-						break;
-				}
-
-				if (file->fd >= 0)
-					lseek(file->fd, file->offset, SEEK_SET);
-			}
-			else file->fd = -1;
-			if (!*loop)
-				break;
-		}
-	}
-	return file->fd;
-}
-
-
 signed char FileMgr::existsFile(const char *ipath, const char *ifileName)
 {
 	int len = strlen(ipath) + ((ifileName)?strlen(ifileName):0) + 3;
@@ -438,4 +438,58 @@
 }
 
 
+char FileMgr::isDirectory(const char *path) {
+	struct stat stats;
+	if (stat(path, &stats))
+		return 0;
+	return ((stats.st_mode & S_IFDIR) == S_IFDIR);
+}
+
+
+int FileMgr::copyDir(const char *srcDir, const char *destDir) {
+	DIR *dir;
+	struct dirent *ent;
+	if (dir = opendir(srcDir)) {
+		rewinddir(dir);
+		while ((ent = readdir(dir))) {
+			if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+				SWBuf srcPath  = (SWBuf)srcDir  + (SWBuf)"/" + ent->d_name;
+				SWBuf destPath = (SWBuf)destDir + (SWBuf)"/" + ent->d_name;
+				if (!isDirectory(srcPath.c_str())) {
+					copyFile(srcPath.c_str(), destPath.c_str());
+				}
+				else {
+					copyDir(srcPath.c_str(), destPath.c_str());
+				}
+			}
+		}
+		closedir(dir);
+	}
+	return 0;
+}
+
+
+int FileMgr::removeDir(const char *targetDir) {
+	DIR *dir = opendir(targetDir);
+	struct dirent *ent;
+	if (dir) {
+		rewinddir(dir);
+		while ((ent = readdir(dir))) {
+			if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
+				SWBuf targetPath = (SWBuf)targetDir + (SWBuf)"/" + ent->d_name;
+				if (!isDirectory(targetPath.c_str())) {
+					FileMgr::removeFile(targetPath.c_str());
+				}
+				else {
+					removeDir(targetPath.c_str());
+				}
+			}
+		}
+		closedir(dir);
+		removeFile(targetDir);
+	}
+	return 0;
+}
+
+
 SWORD_NAMESPACE_END

Added: trunk/src/mgr/ftplibftpt.cpp
===================================================================
--- trunk/src/mgr/ftplibftpt.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/ftplibftpt.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,78 @@
+ /*****************************************************************************
+ * FTPLibFTPTransport functions
+ *
+ */
+ 
+#include <stdio.h>
+#include <ftplibftpt.h>
+
+#include <fcntl.h>
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+#include <ftplib.h>
+
+
+SWORD_NAMESPACE_START
+
+
+static FTPLibFTPTransport_init _FTPLibFTPTransport_init;
+
+FTPLibFTPTransport_init::FTPLibFTPTransport_init() {
+	FtpInit();
+}
+
+FTPLibFTPTransport_init::~FTPLibFTPTransport_init() {
+}
+
+
+FTPLibFTPTransport::FTPLibFTPTransport(const char *host, StatusReporter *sr) : FTPTransport(host, sr) {
+	void *retVal = 0;
+
+	fprintf(stderr, "connecting to host %s\n", host);
+	if (FtpConnect(host, (netbuf **)&nControl))
+		retVal = nControl;
+	else
+		fprintf(stderr, "Failed to connect to %s\n", host);
+	if (!FtpLogin("anonymous", "installmgr at user.com", (netbuf *)nControl))
+		fprintf(stderr, "Failed to login to %s\n", host);
+}
+
+
+FTPLibFTPTransport::~FTPLibFTPTransport() {
+	FtpQuit((netbuf *) nControl);
+}
+
+
+char FTPLibFTPTransport::getURL(const char *destPath, const char *sourceURL) {
+	char retVal = 0;
+	fprintf(stderr, "getting file %s to %s\n", sourceURL, destPath);
+	if (passive)
+		FtpOptions(FTPLIB_CONNMODE, FTPLIB_PASSIVE, (netbuf *)nControl);
+	else
+		FtpOptions(FTPLIB_CONNMODE, FTPLIB_PORT, (netbuf *)nControl);
+	// !!!WDG also want to set callback options
+	if (!strcmp(destPath, "dirlist")) {
+		fprintf(stderr, "getting test directory %s\n", sourceURL);
+		FtpDir(NULL, sourceURL, (netbuf *)nControl);
+		fprintf(stderr, "getting real directory %s\n", sourceURL);
+		retVal = FtpDir(destPath, sourceURL, (netbuf *)nControl) - 1;
+	}
+	else {
+		fprintf(stderr, "getting file %s\n", sourceURL);
+		retVal = FtpGet(destPath, sourceURL, FTPLIB_IMAGE, (netbuf *)nControl) - 1;
+	}
+
+	return retVal;
+}
+
+
+SWORD_NAMESPACE_END
+

Added: trunk/src/mgr/ftptrans.cpp
===================================================================
--- trunk/src/mgr/ftptrans.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/ftptrans.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,153 @@
+ /*****************************************************************************
+ * FTPTransport functions
+ *
+ */
+ 
+
+#include <ftptrans.h>
+#include <filemgr.h>
+
+#include <fcntl.h>
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+#include <dirent.h>
+
+using namespace std;
+
+SWORD_NAMESPACE_START
+
+
+void StatusReporter::preStatus(long totalBytes, long completedBytes, const char *message) {
+}
+
+void StatusReporter::statusUpdate(double dtTotal, double dlNow) {
+}
+
+
+FTPTransport::FTPTransport(const char *host, StatusReporter *sr) {
+	statusReporter = sr;
+	term = false;
+}
+
+
+FTPTransport::~FTPTransport() {
+}
+
+
+// override this method in your real transport class
+char FTPTransport::getURL(const char *destPath, const char *sourceURL) {
+	char retVal = 0;
+	return retVal;
+}
+
+
+vector<struct ftpparse> FTPTransport::getDirList(const char *dirURL) {
+
+	vector<struct ftpparse> dirList;
+	
+	fprintf(stderr, "FTPURLGetDir: getting dir %s\n", dirURL);
+
+	if (!getURL("dirlist", dirURL)) {
+		int fd = open("dirlist", O_RDONLY|O_BINARY);
+		long size = lseek(fd, 0, SEEK_END);
+		lseek(fd, 0, SEEK_SET);
+		char *buf = new char [ size + 1 ];
+		read(fd, buf, size);
+		close(fd);
+		char *start = buf;
+		char *end = start;
+		while (start < (buf+size)) {
+			struct ftpparse item;
+			bool looking = true;
+			for (end = start; *end; end++) {
+				if (looking) {
+					if ((*end == 10) || (*end == 13)) {
+						*end = 0;
+						looking = false;
+					}
+				}
+				else if ((*end != 10) && (*end != 13))
+					break;
+			}
+			fprintf(stderr, "FTPURLGetDir: parsing item %s(%d)\n", start, end-start);
+			int status = ftpparse(&item, start, end - start);
+			fprintf(stderr, "FTPURLGetDir: got item %s\n", item.name);
+			if (status)
+				dirList.push_back(item);
+			start = end;
+		}
+	}
+	else
+	{
+		fprintf(stderr, "FTPURLGetDir: failed to get dir %s\n", dirURL);
+	}
+	return dirList;
+}
+
+
+int FTPTransport::copyDirectory(const char *urlPrefix, const char *dir, const char *dest, const char *suffix) {
+	int i;
+
+	term = false;
+	SWBuf url = (SWBuf)urlPrefix + (SWBuf)dir + "/"; //dont forget the final slash
+	fprintf(stderr, "FTPCopy: getting dir %s\n", url.c_str());
+	vector<struct ftpparse> dirList = getDirList(url.c_str());
+
+	if (!dirList.size()) {
+		fprintf(stderr, "FTPCopy: failed to read dir %s\n", url.c_str());
+		return -1;
+	}
+				
+	long totalBytes = 0;
+	for (i = 0; i < dirList.size(); i++)
+		totalBytes += dirList[i].size;
+	long completedBytes = 0;
+	for (i = 0; i < dirList.size(); i++) {
+		struct ftpparse &dirEntry = dirList[i];
+			SWBuf buffer = (SWBuf)dest + "/" + (dirEntry.name);
+			if (!strcmp(&buffer.c_str()[buffer.length()-strlen(suffix)], suffix)) {
+				SWBuf buffer2 = "Downloading (";
+				buffer2.appendFormatted("%d", i+1);
+				buffer2 += " of ";
+				buffer2.appendFormatted("%d", dirList.size());
+				buffer2 += "): ";
+				buffer2 += (dirEntry.name);
+				if (statusReporter)
+					statusReporter->preStatus(totalBytes, completedBytes, buffer2.c_str());
+				FileMgr::createParent(buffer.c_str());	// make sure parent directory exists
+				SWTRY {
+					SWBuf url = (SWBuf)urlPrefix + (SWBuf)dir + "/" + dirEntry.name; //dont forget the final slash
+					if (dirEntry.flagtrycwd != 1) {
+						if (getURL(buffer.c_str(), url.c_str())) {
+							fprintf(stderr, "FTPCopy: failed to get file %s\n", url.c_str());
+							return -2;
+						}
+						completedBytes += dirEntry.size;
+					}
+					else {
+						SWBuf subdir = (SWBuf)dir + "/" + dirEntry.name;
+						if (copyDirectory(urlPrefix, subdir, buffer.c_str(), suffix)) {
+							fprintf(stderr, "FTPCopy: failed to get file %s\n", subdir.c_str());
+							return -2;
+						}
+					}
+				}
+				SWCATCH (...) {}
+				if (term)
+					break;
+			}
+	}
+	return 0;
+}
+
+
+SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/installmgr.cpp
===================================================================
--- trunk/src/mgr/installmgr.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/installmgr.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -11,7 +11,6 @@
 }
 #endif
 
-#include <time.h>
 #include <installmgr.h>
 #include <filemgr.h>
 
@@ -26,70 +25,37 @@
 #define O_BINARY 0
 #endif
 
+#include <swmgr.h>
+#include <dirent.h>
+
 #ifdef CURLAVAILABLE
-#include <curl/curl.h>
-#include <curl/types.h>
-#include <curl/easy.h>
+#include <curlftpt.h>
 #else
-#include <ftplib.h>
+#include <ftplibftpt.h>
 #endif
 
-#include <defs.h>
-#include <vector>
-#include <swmgr.h>
-#include <dirent.h>
 
-using namespace std;
-
 SWORD_NAMESPACE_START
 
-#ifdef CURLAVAILABLE
-int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream);
-int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
-#endif
 
-static InstallMgr_init _InstallMgr_init;
-
-InstallMgr_init::InstallMgr_init() {
+// override this method and provide your own custom FTPTransport subclass
+// here we try a couple defaults if sword was compiled with support for them.
+// see these classes for examples of how to make your own
+FTPTransport *InstallMgr::createFTPTransport(const char *host, StatusReporter *statusReporter) {
 #ifdef CURLAVAILABLE
-	//curl_global_init(CURL_GLOBAL_DEFAULT);  // curl_easy_init automatically calls it if needed
+	return new CURLFTPTransport(host, statusReporter);
 #else
-	FtpInit();
-//	fprintf(stderr, "libCURL is needed for remote installation functions\n");
+	return new FTPLibFTPTransport(host, statusReporter);
 #endif
 }
 
-InstallMgr_init::~InstallMgr_init() {
-#ifdef CURLAVAILABLE
-	curl_global_cleanup();
-#else
-//	fprintf(stderr, "libCURL is needed for remote installation functions\n");
-#endif
-}
 
-#ifdef CURLAVAILABLE
-int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
-	struct FtpFile *out=(struct FtpFile *)stream;
-	if (out && !out->stream) {
-		/* open file for writing */
-		out->stream=fopen(out->filename, "wb");
-		if (!out->stream)
-			return -1; /* failure, can't open file to write */
-	}
-	return fwrite(buffer, size, nmemb, out->stream);
-}
 
 
-int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) {
-	if (clientp) {
-		((InstallMgr *)clientp)->statusUpdate(dltotal, dlnow);
-	}
-	return 0;
-}
-#endif
-
-InstallMgr::InstallMgr(const char *privatePath) {
+InstallMgr::InstallMgr(const char *privatePath, StatusReporter *sr) {
+	statusReporter = sr;
 	this->privatePath = 0;
+	this->transport = 0;
 	stdstr(&(this->privatePath), privatePath);
 	SWBuf confPath = (SWBuf)privatePath + "/InstallMgr.conf";
 	FileMgr::createParent(confPath.c_str());
@@ -103,7 +69,7 @@
 	sources.clear();
 	
 	sourcesSection = installConf->Sections.find("Sources");
-	passive = (!stricmp((*installConf)["General"]["PassiveFTP"].c_str(), "true"));
+	setFTPPassive(!stricmp((*installConf)["General"]["PassiveFTP"].c_str(), "true"));
 
 	if (sourcesSection != installConf->Sections.end()) {
 		sourceBegin = sourcesSection->second.lower_bound("FTPSource");
@@ -127,152 +93,20 @@
 }
 
 
-void InstallMgr::statusUpdate(double dltotal, double dlnow) {
-}
-
-void InstallMgr::preDownloadStatus(long totalBytes, long completedBytes, const char *message) {
-}
-
-char InstallMgr::FTPURLGetFile(void *session, const char *dest, const char *sourceurl) {
-	char retVal = 0;
-#ifdef CURLAVAILABLE
-	struct FtpFile ftpfile = {dest, NULL};
-
-	CURL *curl = (CURL *)session;
-	CURLcode res;
-	
-	if (curl) {
-		curl_easy_setopt(curl, CURLOPT_URL, sourceurl);
-	
-		curl_easy_setopt(curl, CURLOPT_USERPWD, "ftp:installmgr at user.com");
-		curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
-		if (!passive)
-			curl_easy_setopt(curl, CURLOPT_FTPPORT, "-");
-		curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
-		curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this);
-		curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_fprogress);
-		/* Set a pointer to our struct to pass to the callback */
-		curl_easy_setopt(curl, CURLOPT_FILE, &ftpfile);
-
-		/* Switch on full protocol/debug output */
-		curl_easy_setopt(curl, CURLOPT_VERBOSE, true);
-
-		res = curl_easy_perform(curl);
-
-		if(CURLE_OK != res) {
-			retVal = -1;
-		}
-	}
-
-	if (ftpfile.stream)
-		fclose(ftpfile.stream); /* close the local file */
-#else
-	fprintf(stderr, "getting file %s to %s\n", sourceurl, dest);
-	if (passive)
-		FtpOptions(FTPLIB_CONNMODE, FTPLIB_PASSIVE, (netbuf *)nControl);
-	else
-		FtpOptions(FTPLIB_CONNMODE, FTPLIB_PORT, (netbuf *)nControl);
-	// !!!WDG also want to set callback options
-	if (!strcmp(dest, "dirlist")) {
-		fprintf(stderr, "getting test directory %s\n", sourceurl);
-		FtpDir(NULL, sourceurl, (netbuf *)nControl);
-		fprintf(stderr, "getting real directory %s\n", sourceurl);
-		retVal = FtpDir(dest, sourceurl, (netbuf *)nControl) - 1;
-	}
-	else {
-		fprintf(stderr, "getting file %s\n", sourceurl);
-		retVal = FtpGet(dest, sourceurl, FTPLIB_IMAGE, (netbuf *)nControl) - 1;
-	}
-	//fprintf(stderr, "libCURL is needed for remote installation functions\n");
-#endif
-	return retVal;
-}
-
-
-
-vector<struct ftpparse> InstallMgr::FTPURLGetDir(void *session, const char *dirurl) {
-
-	vector<struct ftpparse> dirList;
-	
-	fprintf(stderr, "FTPURLGetDir: getting dir %s\n", dirurl);
-
-	if (!FTPURLGetFile(session, "dirlist", dirurl)) {
-		int fd = open("dirlist", O_RDONLY|O_BINARY);
-		long size = lseek(fd, 0, SEEK_END);
-		lseek(fd, 0, SEEK_SET);
-		char *buf = new char [ size + 1 ];
-		read(fd, buf, size);
-		close(fd);
-		char *start = buf;
-		char *end = start;
-		while (start < (buf+size)) {
-			struct ftpparse item;
-			bool looking = true;
-			for (end = start; *end; end++) {
-				if (looking) {
-					if ((*end == 10) || (*end == 13)) {
-						*end = 0;
-						looking = false;
-					}
-				}
-				else if ((*end != 10) && (*end != 13))
-					break;
-			}
-			fprintf(stderr, "FTPURLGetDir: parsing item %s(%d)\n", start, end-start);
-			int status = ftpparse(&item, start, end - start);
-			fprintf(stderr, "FTPURLGetDir: got item %s\n", item.name);
-			if (status)
-				dirList.push_back(item);
-			start = end;
-		}
-	}
-	else
-	{
-		fprintf(stderr, "FTPURLGetDir: failed to get dir %s\n", dirurl);
-	}
-	return dirList;
-}
-
-
-void *InstallMgr::FTPOpenSession(const char *host) {
-	void *retVal = 0;
-#ifdef CURLAVAILABLE
-	CURL *curl;
-
-	retVal = curl_easy_init();
-#else
-	fprintf(stderr, "connecting to host %s\n", host);
-	if (FtpConnect(host, (netbuf **)&nControl))
-		retVal = nControl;
-	else
-	fprintf(stderr, "Failed to connect to %s\n", host);
-	if (!FtpLogin("anonymous", "installmgr at user.com", (netbuf *)nControl))
-		fprintf(stderr, "Failed to login to %s\n", host);
-	//fprintf(stderr, "libCURL is needed for remote installation functions\n");
-#endif
-	return retVal;
-}
-
-
-void InstallMgr::FTPCloseSession(void *session) {
-#ifdef CURLAVAILABLE
-	CURL *curl = (CURL *)session;
-	curl_easy_cleanup(curl);
-#else
-	FtpQuit((netbuf *) nControl);
-	//fprintf(stderr, "libCURL is needed for remote installation functions\n");
-#endif
-}
-
-
-int InstallMgr::removeModule(SWMgr *manager, const char *modName) {
+int InstallMgr::removeModule(SWMgr *manager, const char *moduleName) {
 	SectionMap::iterator module;
 	ConfigEntMap::iterator fileBegin;
 	ConfigEntMap::iterator fileEnd, entry;
 
+	// save our own copy, cuz when we remove the module from the SWMgr
+	// it's likely we'll free the memory passed to us in moduleName
+	SWBuf modName = moduleName;
 	module = manager->config->Sections.find(modName);
 
 	if (module != manager->config->Sections.end()) {
+		// to be sure all files are closed
+		// this does not remove the .conf information from SWMgr
+		manager->deleteModule(modName);
 			
 		fileBegin = module->second.lower_bound("File");
 		fileEnd = module->second.upper_bound("File");
@@ -297,19 +131,8 @@
 			struct dirent *ent;
 			ConfigEntMap::iterator entry;
 
+			FileMgr::removeDir(modDir.c_str());
 
-			if (dir = opendir(modDir.c_str())) {
-				rewinddir(dir);
-				while ((ent = readdir(dir))) {
-					if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
-						modFile = modDir;
-						modFile += "/";
-						modFile += ent->d_name;
-						FileMgr::removeFile(modFile.c_str());
-					}
-				}
-				closedir(dir);
-			}
 			if (dir = opendir(manager->configPath)) {	// find and remove .conf file
 				rewinddir(dir);
 				while ((ent = readdir(dir))) {
@@ -372,90 +195,46 @@
 }
 
 
-
-int InstallMgr::FTPCopyDirectoryRecurse(void *session, const char *urlPrefix, const char *dir, const char *dest, const char *suffix) {
-	int i;
-
-	SWBuf url = (SWBuf)urlPrefix + (SWBuf)dir + "/"; //dont forget the final slash
-	fprintf(stderr, "FTPCopy: getting dir %s\n", url.c_str());
-	vector<struct ftpparse> dirList = FTPURLGetDir(session, url.c_str());
-
-	if (!dirList.size()) {
-		fprintf(stderr, "FTPCopy: failed to read dir %s\n", url.c_str());
-		return -1;
-	}
-				
-	long totalBytes = 0;
-	for (i = 0; i < dirList.size(); i++)
-		totalBytes += dirList[i].size;
-	long completedBytes = 0;
-	for (i = 0; i < dirList.size(); i++) {
-		struct ftpparse &dirEntry = dirList[i];
-		if (dirEntry.flagtrycwd != 1) {
-			SWBuf buffer = (SWBuf)dest + "/" + (dirEntry.name);
-			if (!strcmp(&buffer.c_str()[buffer.length()-strlen(suffix)], suffix)) {
-				SWBuf buffer2 = "Downloading (";
-				buffer2.appendFormatted("%d", i+1);
-				buffer2 += " of ";
-				buffer2.appendFormatted("%d", dirList.size());
-				buffer2 += "): ";
-				buffer2 += (dirEntry.name);
-				preDownloadStatus(totalBytes, completedBytes, buffer2.c_str());
-				FileMgr::createParent(buffer.c_str());	// make sure parent directory exists
-				SWTRY {
-					SWBuf url = (SWBuf)urlPrefix + (SWBuf)dir + "/" + dirEntry.name; //dont forget the final slash
-					if (FTPURLGetFile(session, buffer.c_str(), url.c_str())) {
-						fprintf(stderr, "FTPCopy: failed to get file %s\n", url.c_str());
-						return -2;
-					}
-					completedBytes += dirEntry.size;
-				}
-				SWCATCH (...) {}
-				if (terminate)
-					break;
-			}
-		}
-	}
-}
-
-
-int InstallMgr::FTPCopy(InstallSource *is, const char *src, const char *dest, bool dirTransfer, const char *suffix) {
+int InstallMgr::ftpCopy(InstallSource *is, const char *src, const char *dest, bool dirTransfer, const char *suffix) {
 	int retVal = 0;
-	terminate = false;
+	term = false;
 	long i;
-	void *session = FTPOpenSession(is->source);
-#ifdef CURLAVAILABLE
+	FTPTransport *transport = createFTPTransport(is->source, statusReporter);
 	SWBuf urlPrefix = (SWBuf)"ftp://" + is->source;
-#else
-	SWBuf urlPrefix = "";
-#endif
-	SWBuf url = urlPrefix + is->directory.c_str() + "/"; //dont forget the final slash
-	if (FTPURLGetFile(session, "dirlist", url.c_str())) {
-		fprintf(stderr, "FTPCopy: failed to get dir %s\n", url.c_str());
-		return -1;
-	}
+
+	// let's be sure we can connect.  This seems to be necessary but sucks
+//	SWBuf url = urlPrefix + is->directory.c_str() + "/"; //dont forget the final slash
+//	if (transport->getURL("dirlist", url.c_str())) {
+//		 fprintf(stderr, "FTPCopy: failed to get dir %s\n", url.c_str());
+//		 return -1;
+//	}
+
+	   
 	if (dirTransfer) {
 		SWBuf dir = (SWBuf)is->directory.c_str() + "/" + src; //dont forget the final slash
 
-		retVal = FTPCopyDirectoryRecurse(session, urlPrefix, dir, dest, suffix);
+		retVal = transport->copyDirectory(urlPrefix, dir, dest, suffix);
 
 
 	}
 	else {
-//		Synchronize((TThreadMethod)&PreDownload2);
 		SWTRY {
 			SWBuf url = urlPrefix + is->directory.c_str() + "/" + src; //dont forget the final slash
-			if (FTPURLGetFile(session, dest, url.c_str())) {
+			if (transport->getURL(dest, url.c_str())) {
 				fprintf(stderr, "FTPCopy: failed to get file %s", url.c_str());
 				return -1;
 			}
 		}
 		SWCATCH (...) {
-			terminate = true;
+			term = true;
 		}
 	}
 	SWTRY {
-		FTPCloseSession(session);
+		FTPTransport *deleteMe = transport;
+		// do this order for threadsafeness
+		// (see terminate())
+		transport = 0;
+		delete deleteMe;
 	}
 	SWCATCH (...) {}
 	return retVal;
@@ -493,6 +272,10 @@
 		if (entry != module->second.end())
 			cipher = true;
 		
+		//
+		// This first check is a method to allow a module to specify each
+		// file that needs to be copied
+		//
 		fileEnd = module->second.upper_bound("File");
 		fileBegin = module->second.lower_bound("File");
 
@@ -500,7 +283,7 @@
 			if (is) {
 				while (fileBegin != fileEnd) {	// ftp each file first
 					buffer = sourceDir + "/" + fileBegin->second.c_str();
-					if (FTPCopy(is, fileBegin->second.c_str(), buffer.c_str())) {
+					if (ftpCopy(is, fileBegin->second.c_str(), buffer.c_str())) {
 						aborted = true;
 						break;	// user aborted
 					}
@@ -512,7 +295,14 @@
 			if (!aborted) {
 				// DO THE INSTALL
 				while (fileBegin != fileEnd) {
-					copyFileToSWORDInstall(destMgr, sourceDir.c_str(), fileBegin->second.c_str());
+					SWBuf sourcePath = sourceDir;
+					sourcePath += fileBegin->second.c_str();
+					SWBuf dest = destMgr->prefixPath;
+					if ((destMgr->prefixPath[strlen(destMgr->prefixPath)-1] != '\\') && (destMgr->prefixPath[strlen(destMgr->prefixPath)-1] != '/'))
+						dest += "/";
+					dest += fileBegin->second.c_str();
+					FileMgr::copyFile(sourcePath.c_str(), dest.c_str());
+
 					fileBegin++;
 				}
 			}
@@ -527,77 +317,43 @@
 				}
 			}
 		}
-		else {	//copy all files in DataPath directory
+
+		// This is the REAL install code, the above code I don't think has
+		// ever been used
+		//
+		// Copy all files in DataPath directory
+		// 
+		else {
 			ConfigEntMap::iterator entry;
-			SWBuf sourceOrig = sourceDir;
 
-			entry = module->second.find("DataPath");
+			entry = module->second.find("AbsoluteDataPath");
 			if (entry != module->second.end()) {
-				SWBuf modDir = entry->second.c_str();
-				entry = module->second.find("ModDrv");
-				if (entry != module->second.end()) {
-					if (!strcmp(entry->second.c_str(), "RawLD") || !strcmp(entry->second.c_str(), "RawLD4") || !strcmp(entry->second.c_str(), "zLD") || !strcmp(entry->second.c_str(), "RawGenBook") || !strcmp(entry->second.c_str(), "zGenBook")) {
-						int end = modDir.length() - 1;
-						while (end >= 0) { //while(end) wouldn't work for length() == 0
-							if (modDir[end] == '/')
-								break;
+				SWBuf absolutePath = entry->second.c_str();
+				SWBuf relativePath = absolutePath;
+				relativePath << strlen(mgr.prefixPath);
 
-							modDir--; //remove last char
-							end--;
-						}
-					}
-
-					//make sure there's no trailing slash in modDir, required for Bibles and Commentaries
-					if ( modDir.length() && (modDir[modDir.length()-1] == '/')) //last char is a slash
-						modDir--; //remove the slash
-				}
-
 				if (is) {
-					buffer = sourceDir + "/" + modDir;
-					if (FTPCopy(is, modDir.c_str(), buffer.c_str(), true)) {
+					if (ftpCopy(is, relativePath.c_str(), absolutePath.c_str(), true)) {
 						aborted = true;	// user aborted
 					}
 				}
-				sourceDir += "/";
-				sourceDir += modDir;
 				if (!aborted) {
-					if (dir = opendir(sourceDir.c_str())) {
-						rewinddir(dir);
-						while ((ent = readdir(dir))) {
-							if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
-								modFile = modDir;
-								modFile += "/";
-								modFile += ent->d_name;
-								copyFileToSWORDInstall(destMgr, sourceOrig.c_str(), modFile.c_str());
-							}
-						}
-						closedir(dir);
-					}
+					SWBuf destPath = (SWBuf)destMgr->prefixPath + relativePath;
+					FileMgr::copyDir(absolutePath.c_str(), destPath.c_str());
 				}
 				if (is) {		// delete tmp ftp files
-					if (dir = opendir(sourceDir.c_str())) {
-						rewinddir(dir);
-						while ((ent = readdir(dir))) {
-							if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
-								modFile = sourceOrig + "/" + modDir;
-								modFile += "/";
-								modFile += ent->d_name;
-								FileMgr::removeFile(modFile.c_str());
-							}
-						}
-						closedir(dir);
-					}
+//					mgr->deleteModule(modName);
+					FileMgr::removeDir(absolutePath.c_str());
 				}
-				sourceDir = sourceOrig;
-				sourceDir += "/mods.d/";
 			}
 		}
 		if (!aborted) {
-			if (dir = opendir(sourceDir.c_str())) {	// find and copy .conf file
+			SWBuf confDir = sourceDir + "/mods.d/";
+			if (dir = opendir(confDir.c_str())) {	// find and copy .conf file
 				rewinddir(dir);
 				while ((ent = readdir(dir))) {
 					if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
-						modFile = sourceDir;
+						modFile = confDir;
 						modFile += ent->d_name;
 						SWConfig *config = new SWConfig(modFile.c_str());
 						if (config->Sections.find(modName) != config->Sections.end()) {
@@ -629,62 +385,65 @@
 }
 
 
-// return aborted
+// override this and provide an input mechanism to allow your users
+// to enter the decipher code for a module.
+// return true you added the cipher code to the config.
+// default to return 'aborted'
 bool InstallMgr::getCipherCode(const char *modName, SWConfig *config) {
 	return false;
-}
 
-int InstallMgr::copyFileToSWORDInstall(SWMgr *manager, const char *sourceDir, const char *fName) {
-	SWBuf sourcePath = sourceDir;
-	sourcePath += fName;
+/* a sample implementation, roughly taken from the windows installmgr
 
-	SWBuf dest;
-	dest = manager->prefixPath;
-	if ((manager->prefixPath[strlen(manager->prefixPath)-1] != '\\') && ( manager->prefixPath[strlen(manager->prefixPath)-1] != '/'))
-	   dest += "/";
-	  dest += fName;
+	SectionMap::iterator section;
+	ConfigEntMap::iterator entry;
+	SWBuf tmpBuf;
+	section = config->Sections.find(modName);
+	if (section != config->Sections.end()) {
+		entry = section->second.find("CipherKey");
+		if (entry != section->second.end()) {
+			entry->second = GET_USER_INPUT();
+			config->Save();
 
-	return FileMgr::copyFile(sourcePath.c_str(), dest.c_str());
+			// LET'S SHOW THE USER SOME SAMPLE TEXT FROM THE MODULE
+			SWMgr *mgr = new SWMgr();
+			SWModule *mod = mgr->Modules[modName];
+			mod->setKey("Ipet 2:12");
+			tmpBuf = mod->StripText();
+			mod->setKey("gen 1:10");
+			tmpBuf += "\n\n";
+			tmpBuf += mod->StripText();
+			SOME_DIALOG_CONTROL->SETTEXT(tmpBuf.c_str());
+			delete mgr;
+
+			// if USER CLICKS OK means we should return true
+			return true;
+		}
+	}
+	return false;
+*/
+
 }
 
 
 void InstallMgr::refreshRemoteSource(InstallSource *is) {
-	DIR *dir;
-	struct dirent *ent;
-	ConfigEntMap::iterator entry;
-	SWBuf modDir;
-	SWBuf modFile;
-	SWBuf root = privatePath;
-	root += (SWBuf)"/" + is->source.c_str();
+	SWBuf root = (SWBuf)privatePath + (SWBuf)"/" + is->source.c_str();
 	SWBuf target = root + "/mods.d";
 
-	if (dir = opendir(target.c_str())) {
-		rewinddir(dir);
-		while ((ent = readdir(dir))) {
-			if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) {
-				modFile = target;
-				modFile += "/";
-				modFile += ent->d_name;
-				FileMgr::removeFile(modFile.c_str());
-			}
-		}
-		closedir(dir);
-	}
+	FileMgr::removeDir(target.c_str());
+
 	if (!FileMgr::existsDir(target))
 		FileMgr::createPathAndFile(target+"/globals.conf");
 
-
-
 #ifndef EXCLUDEZLIB
 	SWBuf archive = root + "/mods.d.tar.gz";
-	if (!FTPCopy(is, "mods.d.tar.gz", archive.c_str(), false)) {
+	if (!ftpCopy(is, "mods.d.tar.gz", archive.c_str(), false)) {
 		int fd = open(archive.c_str(), O_RDONLY|O_BINARY);
 		untargz(fd, root.c_str());
 		close(fd);
 	}
 	else
 #endif
-	FTPCopy(is, "mods.d", target.c_str(), true, ".conf");
+	ftpCopy(is, "mods.d", target.c_str(), true, ".conf");
 	is->flush();
 }
 

Modified: trunk/src/mgr/localemgr.cpp
===================================================================
--- trunk/src/mgr/localemgr.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/localemgr.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  localemgr.cpp - implementation of class LocaleMgr used to interact with
  *				registered locales for a sword installation
  *
- * $Id: localemgr.cpp,v 1.24 2004/07/22 18:47:44 joachim Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/mgr/refsysmgr.cpp
===================================================================
--- trunk/src/mgr/refsysmgr.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/refsysmgr.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  refsysmgr.cpp   - definition of class RefSysMgr used to interact with
  *				registered biblical reference systems for a sword installation
  *
- * $Id: refsysmgr.cpp,v 1.1 2004/05/07 17:10:46 dglassey Exp $
+ * $Id$
  *
  * Copyright 2004 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/mgr/swcacher.cpp
===================================================================
--- trunk/src/mgr/swcacher.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/swcacher.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  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.cpp,v 1.2 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/mgr/swconfig.cpp
===================================================================
--- trunk/src/mgr/swconfig.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/swconfig.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swconfig.cpp   - implementation of Class SWConfig used for saving and
  *			retrieval of configuration information
  *
- * $Id: swconfig.cpp,v 1.15 2004/02/06 21:01:01 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/mgr/swfiltermgr.cpp
===================================================================
--- trunk/src/mgr/swfiltermgr.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/swfiltermgr.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swfiltermgr.cpp   - definition of class SWFilterMgr used as an interface to
  *				manage filters on a module
  *
- * $Id: swfiltermgr.cpp,v 1.3 2002/10/01 19:52:40 dglassey Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/mgr/swlocale.cpp
===================================================================
--- trunk/src/mgr/swlocale.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/swlocale.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swlocale.cpp   - implementation of Class SWLocale used for retrieval
  *				of locale lookups
  *
- * $Id: swlocale.cpp,v 1.12 2004/05/08 16:52:24 dglassey Exp $
+ * $Id$
  *
  * Copyright 2000 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/swmgr.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swmgr.cpp   - implementaion of class SWMgr used to interact with an install
  *				base of sword modules.
  *
- * $Id: swmgr.cpp,v 1.106 2004/06/07 19:37:59 mgruner Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
@@ -980,6 +980,15 @@
 }
 
 
+void SWMgr::deleteModule(const char *modName) {
+	ModMap::iterator it = Modules.find(modName);
+	if (it != Modules.end()) {
+		delete (*it).second;
+		Modules.erase(it);
+	}
+}
+
+
 void SWMgr::InstallScan(const char *dirname)
 {
    DIR *dir;
@@ -1012,7 +1021,7 @@
                                    if (conffd > 0)
                                         lseek(conffd, 0L, SEEK_END);
                               }
-                         }
+					}
                          AddModToConfig(conffd, newmodfile.c_str());
                          FileMgr::removeFile(newmodfile.c_str());
                     }

Modified: trunk/src/mgr/swsearchable.cpp
===================================================================
--- trunk/src/mgr/swsearchable.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/swsearchable.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swsearchable.h	- definition of class SWSearchable used to provide an
  *	interface for objects that be searched.
  *
- * $Id: swsearchable.cpp,v 1.1 2003/08/29 06:00:16 scribe Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/mgr/swsourcemgr.cpp
===================================================================
--- trunk/src/mgr/swsourcemgr.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/mgr/swsourcemgr.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -2,7 +2,7 @@
  *  swsourcemgr.cpp   - implementaion of class SWMgr used to interact with an install
  *				base of sword modules.
  *
- * $Id: swsourcemgr.cpp,v 1.2 2003/06/27 01:41:07 scribe Exp $
+ * $Id$
  *
  * Copyright 2002 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/modules/filters/osisheadings.cpp
===================================================================
--- trunk/src/modules/filters/osisheadings.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/modules/filters/osisheadings.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -60,6 +60,12 @@
 			if (!strncmp(token.c_str(), "title", 5) || !strncmp(token.c_str(), "/title", 6)) {
 				tag = token;
 				
+				if (!tag.isEndTag()) { //start tag
+					if (!tag.isEmpty()) {
+						startTag = tag;
+					}
+				}
+				
 				if (tag.getAttribute("subtype") && !stricmp(tag.getAttribute("subtype"), "x-preverse")) {
 					hide = true;
 					preverse = true;
@@ -67,9 +73,6 @@
 					continue;
 				}
 				if (!tag.isEndTag()) { //start tag
-					if (!tag.isEmpty()) {
-						startTag = tag;
-					}
 					hide = true;
 					header = "";
 					if (option) {	// we want the tag in the text

Modified: trunk/src/modules/filters/swbasicfilter.cpp
===================================================================
--- trunk/src/modules/filters/swbasicfilter.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/modules/filters/swbasicfilter.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -4,7 +4,7 @@
  *  				many filters will need and can use as a starting
  *  				point. 
  *
- * $Id: swbasicfilter.cpp,v 1.34 2004/06/02 14:44:03 joachim Exp $
+ * $Id$
  *
  * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/modules/texts/ztext/gbfidx.cpp
===================================================================
--- trunk/src/modules/texts/ztext/gbfidx.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/modules/texts/ztext/gbfidx.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,661 +1,661 @@
-/*****************************************************************************
- *
- *	This code reeks but works (sometimes).  Good luck!
- * Modified for zText purposes
- */
-
-//#include <stdio.h>
-#include <iostream>
-#include <fstream>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <assert.h>
-
-//#ifndef __GNUC__
-#include <io.h>
-//#else
-//#include <unistd.h>
-//#endif
-
-#include <fcntl.h>
-#include <versekey.h>
-
-
-void writeidx(VerseKey &key1, VerseKey &key2, VerseKey &key3, long offset, short size);
-char findbreak(int fp, long *offset, int *num1, int *num2, int *rangemax, unsigned short *size);
-void openfiles(char *fname);
-void checkparams(int argc, char **argv);
-
-
-VerseKey key1, key2, key3;
-int fp=0, vfp=0, cfp=0, bfp=0;
-long chapoffset=0;
-unsigned short chapsize=0;
-long bookoffset=0;
-unsigned short booksize=0;
-long testoffset=0;
-unsigned short testsize=0;
-long verseoffset=0;
-unsigned short versesize=0;
-long nextoffset=0;
-char testmnt=0;
-int deadcount = 0;
-int chapmark=-4, bookmark=-1;
-ofstream cfile;
-
-
-int main(int argc, char **argv)
-{
-	long pos, offset;
-	int num1, num2, rangemax;//, curbook = 0, curchap = 0, curverse = 0;
-	//char buf[127],
-	char startflag = 0;
-	unsigned short size;//, tmp;
-
-	checkparams(argc, argv);
-
-	openfiles(argv[1]);
-	//key1 = "Matthew 1:1";
-	//key2 = "Matthew 1:1";
-	//key3 = "Matthew 1:1";
-
-	testmnt = key1.Testament();
-	cfile << "testament" << (int) testmnt << "\n";
-	num1 = key1.Chapter();
-	num2 = key1.Verse();
-	pos  = 0;
-	write(bfp, &pos, 4);  /* Book    offset for testament intros */
-	pos = 4;
-	write(cfp, &pos, 4);  /* Chapter offset for testament intro */
-
-
-/*	Right now just zero out intros until parsing correctly */
-	/*pos = 0;
-	size = 0;
-	write(vfp, &pos, 4);  // Module intro
-	write(vfp, &size, 2);
-	cfile << "modintro pos{" << pos << "} size{" << size << "}\n";
-	write(vfp, &pos, 4);  // Testament intro
-	write(vfp, &size, 2);
-	cfile << "test intro pos{" << pos << "} size{" << size << "}\n";
-	*/
-	cout << "GBFIDX Running\n";
-	cout.flush();
-	while(!findbreak(fp, &offset, &num1, &num2, &rangemax, &size)) {
-		if (!startflag) {
-			startflag = 1;
-		}
-		else {
-			if (num2 < key2.Verse()) {            // new chapter
-				if (num1 <= key2.Chapter()) { // new book
-					key2.Verse(1);
-					key2.Chapter(1);
-					key2.Book(key2.Book()+1);
-				}
-				cfile << "Found Chapter Break: " << num1 << " ('" << (const char *)key2 << "')\n";
-				//chapoffset = offset;
-				//chapsize = chapsize - size;
-//				continue;
-			}
-		}
-		key2.Verse(1);
-		key2.Chapter(num1);
-		key2.Verse(num2);
-
-		key3 = key2;
-//		key3 += (rangemax - key3.Verse());
-
-		writeidx(key1, key2, key3, offset, size);
-	}
-	close(vfp);
-	close(cfp);
-	close(bfp);
-	close(fp);
-
-	return 1;
-}
-
-
-/**************************************************************************
- * writeidx:	key1	- current location of index
- * 	key2	- minimum keyval for which this offset is valid
- * 	key3	- maximum keyval for which this offset is valid
- */
-
-void writeidx(VerseKey &key1, VerseKey &key2, VerseKey &key3, long offset, short size)
-{
-	long pos;
-	unsigned short tmp;
-
-	for (; ((key1 <= key3) && (key1.Error() != KEYERR_OUTOFBOUNDS) && (key1.Testament() == testmnt)); key1+=1) {
-		if (chapmark>=2)
-		{
-			if (bookmark==2)
-			{
-				//booksize = booksize - chapsize + 7;
-				cfile << "versesize " << versesize << " booksize " << booksize << " chapsize " << chapsize << " size " << size << "\n";
-				//cfile.flush();
-				//assert(chapsize < size);
-				//if (chapsize > size)           // At start of Psalms gets chapsize rather than chapsize+size ???
-				//{
-				//	versesize = versesize - (booksize - (chapsize - size) + 7);
-				//}
-				//else
-				//{
-				versesize = versesize - (booksize - (chapsize) + 7);
-				//}
-					cfile << "Last verse in book\n";
-			}
-			//chapsize = chapsize - size;
-			cfile << "versesize " << versesize << " chapsize " << chapsize << " size " << size<< "\n";
-			cfile.flush();
-			//assert(chapsize > size);
-			//if (chapsize > size)           // At start of Psalms gets chapsize rather than chapsize+size ???
-			//{
-			//	versesize = versesize - (chapsize - size);
-			//}
-			//else
-			//{
-			versesize = versesize - (chapsize);
-			//}
-			cfile << "Last verse in chapter\n";
-		}
-		if (chapmark>=2 && bookmark!=1)
-		{
-			cfile << "prev verse pos{" << verseoffset << "} size{" << versesize << "} nextoffset{" << nextoffset << "}\n";
-			cfile.flush();
-			assert(verseoffset==nextoffset);
-			write(vfp, &verseoffset, 4);
-			write(vfp, &versesize, 2);
-			nextoffset = verseoffset+versesize;
-			bookmark = 0;
-			chapmark = 0;
-		}
-		if (key1.Verse() == 1) {	// new chapter
-			cfile << "size??? " << size << "\n";
-			cfile.flush();
-			//assert(chapsize > size || key1.Chapter()==1);
-			//assert(chapsize > size);
-			//if (chapsize > size)           // At start of books gets chapsize rather than chapsize+size
-			//{
-			//	chapsize = chapsize - size;
-			//}
-			if (key1.Chapter() == 1) {	// new book
-				booksize = booksize - chapsize + 7;
-				if (key1.Book() == 1)
-				{
-					pos = 0;
-					//tmp = testoffset;
-					tmp = 0;            	// better just remember that it goes up to the testament intro to avoid 64k limit
-												// AV exceeds that anyway!
-					write(vfp, &pos, 4);  /* Module intro */
-					write(vfp, &tmp, 2);
-					assert(nextoffset==0);
-					cfile << "modintro pos{" << pos << "} size{" << tmp << "}\n";
-					testsize = testsize - booksize - chapsize + 7;
-					if (testsize > 10000)
-					{
-						cerr << "Error: testament too big " << testsize << "\n";
-						exit(-1);
-					}
-					//assert(testoffset==nextoffset);
-					write(vfp, &testoffset, 4);  /* Testament intro (vss)  */
-					write(vfp, &testsize, 2);
-					nextoffset = testoffset+testsize;
-					cfile << "test intro pos{" << testoffset << "} size{" << testsize << "}\n";
-				}
-				pos = lseek(cfp, 0, SEEK_CUR);
-				write(bfp, &pos, 4);
-				pos = lseek(vfp, 0, SEEK_CUR); /* Book intro (cps) */
-				write(cfp, &pos, 4);
-				if (booksize > 10000)
-				{
-					cerr << "Error: book too big " << booksize << "\n";
-					exit(-1);
-				}
-				assert(bookoffset==nextoffset);
-				write(vfp, &bookoffset, 4);  /* Book intro (vss)  */
-				write(vfp, &booksize, 2);
-				nextoffset = bookoffset+booksize;
-				cfile << "book intro pos{" << bookoffset << "} size{" << booksize << "}\n";
-				//offset += booksize;
-				//bookmark = false;
-			}
-			pos = lseek(vfp, 0, SEEK_CUR);
-			write(cfp, &pos, 4);
-			assert(chapsize < 10000);
-			write(vfp, &chapoffset, 4);  /* Chapter intro */
-			write(vfp, &chapsize, 2);
-			nextoffset = chapoffset+chapsize;
-			cfile << "chapter intro pos{" << chapoffset << "} size{" << chapsize << "}\n";
-			//offset += chapsize;
-			//size -= chapsize;
-			//chapmark = false;
-		}
-		if (key1 >= key2) {
-			if (size > 10000)
-			{
-				cerr << "Error: verse too big " << size << "\n";
-				exit(-1);
-			}
-			if (!chapmark && !bookmark)
-			{
-				write(vfp, &offset, 4);
-				write(vfp, &size, 2);
-				cfile << "verse pos{" << offset << "} size{" << size << "}\n";
-				cfile.flush();
-				assert(offset==nextoffset);
-				nextoffset = offset+size;
-				//cfile << "bookmark " << bookmark << " chapmark " << chapmark << "\n";
-			}
-			else
-			{
-				verseoffset = offset;
-				versesize = size;
-				cfile << "saving verse pos{" << offset << "} size{" << size << "}\n";
-				cfile << "bookmark " << bookmark << " chapmark " << chapmark << "\n";
-			}
-		}
-		else	{
-			pos = 0;
-			tmp = 0;
-			write(vfp, &pos, 4);
-			write(vfp, &tmp, 2);
-			cfile << "blank pos{" << pos << "} size{" << tmp << "}\n";
-		}
-	}
-}
-
-char startmod(char *buf)
-{
-	//char loop;
-
-	if (buf[0] != '<')
-		return 0;
-	if (buf[1] != 'H')
-		return 0;
-	if (buf[2] != '0')
-		return 0;
-/*
-	if (!isdigit(buf[2]))
-		return 0;
-	for (loop = 3; loop < 7; loop++) {
-		if (buf[loop] == ' ')
-			break;
-		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
-			return 0;
-	}
-*/
-	return 1;
-}
-
-
-char starttest(char *buf)
-{
-	//char loop;
-
-	if (buf[0] != '<')
-		return 0;
-	if (buf[1] != 'B')
-		return 0;
-	if (testmnt==2)
-	{
-		if (buf[2] != 'N')
-			return 0;
-	}
-	else
-	{
-		if (buf[2] != 'O')
-			return 0;
-	}
-	//if (buf[3] != '>')
-	//	return 0;
-/*
-	if (!isdigit(buf[2]))
-		return 0;
-	for (loop = 3; loop < 7; loop++) {
-		if (buf[loop] == ' ')
-			break;
-		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
-			return 0;
-	}
-*/
-	return 1;
-}
-
-
-char startbook(char *buf)
-{
-	//char loop;
-
-	if (buf[0] != '<')
-		return 0;
-	if (buf[1] != 'S')
-		return 0;
-	if (buf[2] != 'B')
-		return 0;
-/*
-	if (!isdigit(buf[2]))
-		return 0;
-	for (loop = 3; loop < 7; loop++) {
-		if (buf[loop] == ' ')
-			break;
-		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
-			return 0;
-	}
-*/
-	return 1;
-}
-
-
-char startchap(char *buf)
-{
-	//char loop;
-
-	if (buf[0] != '<')
-		return 0;
-	if (buf[1] != 'S')
-		return 0;
-	if (buf[2] != 'C')
-		return 0;
-/*
-	if (!isdigit(buf[2]))
-		return 0;
-	for (loop = 3; loop < 7; loop++) {
-		if (buf[loop] == ' ')
-			break;
-		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
-			return 0;
-	}
-*/
-	return 1;
-}
-
-
-char startentry(char *buf)
-{
-	//char loop;
-	//cfile << "{SV}";
-
-	if (buf[0] != '<')
-	{
-		//cfile << "{no<}";
-		return 0;
-	}
-	if (buf[1] != 'S')
-	{
-		//cfile << "\n{noS}\n";
-		return 0;
-	}
-	if (buf[2] != 'V')
-	{
-		//cfile << "\n{noV}\n";
-		return 0;
-	}
-/*
-	if (!isdigit(buf[2]))
-		return 0;
-	for (loop = 3; loop < 7; loop++) {
-		if (buf[loop] == ' ')
-			break;
-		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
-			return 0;
-	}
-*/
-	return 1;
-}
-
-
-char findbreak(int fp, long *offset, int *num1, int *num2, int *rangemax, unsigned short *size)
-{
-	char buf[8];
-	//char buf2[20];
-	//char ch;
-	char loop=0;
-	long offset2;
-	int ch2, vs2, rm2;
-	bool flag;
-	long versestart = 0;
-	long chapstart = 0;
-	long bookstart = 0;
-	long teststart = 0;
-
-	memset(buf, ' ', 8);
-
-	while (1) {
-		//cfile << "#" << buf << "#";
-		//if (lseek(fp, 0, SEEK_CUR) > 2000000)
-		//{
-		//	cfile << lseek(fp, 0, SEEK_CUR) << "\n";
-		//}
-		if (starttest(buf)) {
-			cfile << "\n{start of testament}\n";
-			//chapstart = lseek(fp, 0, SEEK_CUR) - 7;
-			teststart = lseek(fp, 0, SEEK_CUR) - 7;
-			testoffset = teststart;
-			memset(buf, ' ', 3);
-			flag = false;
-			for (loop = 3; loop < 6; loop++) {
-				if (buf[loop]!='>')
-					flag = true;
-				else {
-					buf[loop] = 0;
-					break;
-				}
-			}
-			ch2 = *num1;
-			vs2 = 1;
-			if (size) {
-				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
-					testsize = (unsigned short) (lseek(fp, 0, SEEK_END) - teststart-7);
-				}
-				else {
-					if (vs2) {
-						testsize = (offset2 - teststart - 7);
-					}
-				}
-				lseek(fp, teststart+7, SEEK_SET);
-				cfile << "\nGot testsize " << testsize << "\n";
-			}
-		}
-
-
-		if (startbook(buf)) {
-			cfile << "\n{start of book}\n";
-			bookmark++;
-			//chapstart = lseek(fp, 0, SEEK_CUR) - 7;
-			bookstart = lseek(fp, 0, SEEK_CUR) - 7;
-			bookoffset = bookstart;
-			memset(buf, ' ', 3);
-			flag = false;
-			for (loop = 3; loop < 6; loop++) {
-				if (buf[loop]!='>')
-					flag = true;
-				else {
-					buf[loop] = 0;
-					break;
-				}
-			}
-			if (size) {
-				ch2 = *num1;
-				vs2 = 1;
-				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
-					booksize = (unsigned short) (lseek(fp, 0, SEEK_END) - bookstart - 7);
-				}
-				else {
-					if (vs2) {
-						booksize = (offset2 - bookstart - 7);
-					}
-				}
-				lseek(fp, bookstart+7, SEEK_SET);
-				cfile << "\nGot booksize " << booksize << "\n";
-			}
-		}
-
-		if (startchap(buf)) {
-			cfile << "{start of chapter}";
-			chapmark++;
-			//chapstart = lseek(fp, 0, SEEK_CUR) - 7;
-			chapstart = lseek(fp, 0, SEEK_CUR) - 7;
-			chapoffset = chapstart;
-			memset(buf, ' ', 3);
-			flag = false;
-			for (loop = 3; loop < 6; loop++) {
-				if (isdigit(buf[loop]))
-					flag = true;
-				else {
-					buf[loop] = 0;
-					break;
-				}
-			}
-			if (flag)
-				*num1 = atoi(buf);
-			else	(*num1)++;
-
-			if (size) {
-				ch2 = *num1;
-				vs2 = 1;
-				lseek(fp, chapstart, SEEK_SET);
-				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
-					chapsize = (unsigned short) (lseek(fp, 0, SEEK_END) - chapstart);
-					cfile << "getting chapsizeend{" << chapsize << "} = " << lseek(fp, 0, SEEK_END) << " - " << chapstart << "\n";
-				}
-				else {
-					if (vs2) {
-						chapsize = (offset2 - chapstart);
-						cfile << "getting chapsize{" << chapsize << "} = " << offset2 << " - " << chapstart << "\n";
-					}
-				}
-				lseek(fp, chapstart + 7, SEEK_SET);
-				cfile << "\nGot chapsize " << chapsize << " loop{" << (int) loop << "}\n";
-			}
-			//return 0;
-
-		}
-		if (startentry(buf)) {
-			//cfile << "{start of verse}";
-			memset(buf, ' ', 3);
-			flag = false;
-			for (loop = 3; loop < 6; loop++) {
-				if (isdigit(buf[loop]))
-					flag = true;
-				else {
-					buf[loop] = 0;
-					break;
-				}
-			if (flag)
-				*num2 = atoi(buf);
-			else	(*num2)++;
-			}
-			loop++;
-			/*
-			if (size)
-			{
-				// *offset = lseek(fp, 0, SEEK_CUR) - (7 - loop);
-				 *offset = lseek(fp, 0, SEEK_CUR) - 7;
-			}
-			//else	*offset = (chapstart) ? chapstart : lseek(fp, 0, SEEK_CUR) - 7;
-			else	*offset = (chapstart) ? chapstart : lseek(fp, 0, SEEK_CUR) - 7;
-			*/
-			/*if (chapstart)
-			{
-				chapsize = *offset-chapstart;
-			}
-			else
-			{
-				chapsize = 0;
-			}*/
-			*offset = lseek(fp, 0, SEEK_CUR) - 7;
-			versestart = *offset;
-			if (size) {
-				ch2 = *num1;
-				vs2 = *num2;
-				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
-					*size = (unsigned short) (lseek(fp, 0, SEEK_END) - versestart);
-					cfile << "getting sizeend{" << *size << "} = " << lseek(fp, 0, SEEK_END) << " - " << versestart << "\n";
-				}
-				else {
-					if (vs2) {
-						*size = (offset2 - versestart);
-						cfile << "getting size{" << *size << "} = " << offset2 << " - " << versestart << "\n";
-					}
-				}
-				lseek(fp, *offset+1, SEEK_SET);
-			}
-			else
-			{
-				cfile << "got offset{" << *offset << "}\n";
-			}
-			return 0;
-		}
-		//cfile << "{ng}";
-		//deadcount++;
-		//if (deadcount==1000) exit(-1);
-		//if (!size)
-		//{
-		//	cfile << "not bound offset{" << *offset << "}\n";
-		//}
-		memmove(buf, &buf[1], 6);
-		if (read(fp, &buf[6], 1) != 1)
-			return 1;
-	}
-}
-
-
-void openfiles(char *fname)
-{
-#ifndef O_BINARY		// O_BINARY is needed in Borland C++ 4.53
-#define O_BINARY 0		// If it hasn't been defined than we probably
-#endif				// don't need it.
-	char buf[255];
-
-	if ((fp = open(fname, O_RDONLY|O_BINARY)) == -1) {
-		fprintf(stderr, "Couldn't open file: %s\n", fname);
-		exit(1);
-	}
-
-	sprintf(buf, "%s.vss", fname);
-	if ((vfp = open(buf, O_CREAT|O_WRONLY|O_BINARY|O_TRUNC)) == -1) {
-		fprintf(stderr, "Couldn't open file: %s\n", buf);
-		exit(1);
-	}
-
-	sprintf(buf, "%s.cps", fname);
-	if ((cfp = open(buf, O_CREAT|O_WRONLY|O_BINARY|O_TRUNC)) == -1) {
-		fprintf(stderr, "Couldn't open file: %s\n", buf);
-		exit(1);
-	}
-
-	sprintf(buf, "%s.bks", fname);
-	if ((bfp = open(buf, O_CREAT|O_WRONLY|O_BINARY|O_TRUNC)) == -1) {
-		fprintf(stderr, "Couldn't open file: %s\n", buf);
-		exit(1);
-	}
-	cfile.open("gbfidx.log", ios::out);
-	if (!cfile.is_open())
-	{
-		cerr << "Failed to open log file\n";
-		exit(-1);
-	}
-}
-
-
-void checkparams(int argc, char **argv)
-{
-	if (argc < 2) {
-		fprintf(stderr, "usage: %s <file to process> [nt - for new testmt file]\n", argv[0]);
-		exit(1);
-	}
-	if (!strcmp(argv[1], "nt"))
-		key1 = key2 = key3 = "Matthew 1:1";
-	else if (!strcmp(argv[1], "ot"))
-	{
-			key1 = key2 = key3 = "Genesis 1:1";
-	}
-	else
-	{
-		cerr << "File must be ot or nt\n";
-		exit(-1);
-	}
-}
+/*****************************************************************************
+ *
+ *	This code reeks but works (sometimes).  Good luck!
+ * Modified for zText purposes
+ */
+
+//#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <assert.h>
+
+//#ifndef __GNUC__
+#include <io.h>
+//#else
+//#include <unistd.h>
+//#endif
+
+#include <fcntl.h>
+#include <versekey.h>
+
+
+void writeidx(VerseKey &key1, VerseKey &key2, VerseKey &key3, long offset, short size);
+char findbreak(int fp, long *offset, int *num1, int *num2, int *rangemax, unsigned short *size);
+void openfiles(char *fname);
+void checkparams(int argc, char **argv);
+
+
+VerseKey key1, key2, key3;
+int fp=0, vfp=0, cfp=0, bfp=0;
+long chapoffset=0;
+unsigned short chapsize=0;
+long bookoffset=0;
+unsigned short booksize=0;
+long testoffset=0;
+unsigned short testsize=0;
+long verseoffset=0;
+unsigned short versesize=0;
+long nextoffset=0;
+char testmnt=0;
+int deadcount = 0;
+int chapmark=-4, bookmark=-1;
+ofstream cfile;
+
+
+int main(int argc, char **argv)
+{
+	long pos, offset;
+	int num1, num2, rangemax;//, curbook = 0, curchap = 0, curverse = 0;
+	//char buf[127],
+	char startflag = 0;
+	unsigned short size;//, tmp;
+
+	checkparams(argc, argv);
+
+	openfiles(argv[1]);
+	//key1 = "Matthew 1:1";
+	//key2 = "Matthew 1:1";
+	//key3 = "Matthew 1:1";
+
+	testmnt = key1.Testament();
+	cfile << "testament" << (int) testmnt << "\n";
+	num1 = key1.Chapter();
+	num2 = key1.Verse();
+	pos  = 0;
+	write(bfp, &pos, 4);  /* Book    offset for testament intros */
+	pos = 4;
+	write(cfp, &pos, 4);  /* Chapter offset for testament intro */
+
+
+/*	Right now just zero out intros until parsing correctly */
+	/*pos = 0;
+	size = 0;
+	write(vfp, &pos, 4);  // Module intro
+	write(vfp, &size, 2);
+	cfile << "modintro pos{" << pos << "} size{" << size << "}\n";
+	write(vfp, &pos, 4);  // Testament intro
+	write(vfp, &size, 2);
+	cfile << "test intro pos{" << pos << "} size{" << size << "}\n";
+	*/
+	cout << "GBFIDX Running\n";
+	cout.flush();
+	while(!findbreak(fp, &offset, &num1, &num2, &rangemax, &size)) {
+		if (!startflag) {
+			startflag = 1;
+		}
+		else {
+			if (num2 < key2.Verse()) {            // new chapter
+				if (num1 <= key2.Chapter()) { // new book
+					key2.Verse(1);
+					key2.Chapter(1);
+					key2.Book(key2.Book()+1);
+				}
+				cfile << "Found Chapter Break: " << num1 << " ('" << (const char *)key2 << "')\n";
+				//chapoffset = offset;
+				//chapsize = chapsize - size;
+//				continue;
+			}
+		}
+		key2.Verse(1);
+		key2.Chapter(num1);
+		key2.Verse(num2);
+
+		key3 = key2;
+//		key3 += (rangemax - key3.Verse());
+
+		writeidx(key1, key2, key3, offset, size);
+	}
+	close(vfp);
+	close(cfp);
+	close(bfp);
+	close(fp);
+
+	return 1;
+}
+
+
+/**************************************************************************
+ * writeidx:	key1	- current location of index
+ * 	key2	- minimum keyval for which this offset is valid
+ * 	key3	- maximum keyval for which this offset is valid
+ */
+
+void writeidx(VerseKey &key1, VerseKey &key2, VerseKey &key3, long offset, short size)
+{
+	long pos;
+	unsigned short tmp;
+
+	for (; ((key1 <= key3) && (key1.Error() != KEYERR_OUTOFBOUNDS) && (key1.Testament() == testmnt)); key1+=1) {
+		if (chapmark>=2)
+		{
+			if (bookmark==2)
+			{
+				//booksize = booksize - chapsize + 7;
+				cfile << "versesize " << versesize << " booksize " << booksize << " chapsize " << chapsize << " size " << size << "\n";
+				//cfile.flush();
+				//assert(chapsize < size);
+				//if (chapsize > size)           // At start of Psalms gets chapsize rather than chapsize+size ???
+				//{
+				//	versesize = versesize - (booksize - (chapsize - size) + 7);
+				//}
+				//else
+				//{
+				versesize = versesize - (booksize - (chapsize) + 7);
+				//}
+					cfile << "Last verse in book\n";
+			}
+			//chapsize = chapsize - size;
+			cfile << "versesize " << versesize << " chapsize " << chapsize << " size " << size<< "\n";
+			cfile.flush();
+			//assert(chapsize > size);
+			//if (chapsize > size)           // At start of Psalms gets chapsize rather than chapsize+size ???
+			//{
+			//	versesize = versesize - (chapsize - size);
+			//}
+			//else
+			//{
+			versesize = versesize - (chapsize);
+			//}
+			cfile << "Last verse in chapter\n";
+		}
+		if (chapmark>=2 && bookmark!=1)
+		{
+			cfile << "prev verse pos{" << verseoffset << "} size{" << versesize << "} nextoffset{" << nextoffset << "}\n";
+			cfile.flush();
+			assert(verseoffset==nextoffset);
+			write(vfp, &verseoffset, 4);
+			write(vfp, &versesize, 2);
+			nextoffset = verseoffset+versesize;
+			bookmark = 0;
+			chapmark = 0;
+		}
+		if (key1.Verse() == 1) {	// new chapter
+			cfile << "size??? " << size << "\n";
+			cfile.flush();
+			//assert(chapsize > size || key1.Chapter()==1);
+			//assert(chapsize > size);
+			//if (chapsize > size)           // At start of books gets chapsize rather than chapsize+size
+			//{
+			//	chapsize = chapsize - size;
+			//}
+			if (key1.Chapter() == 1) {	// new book
+				booksize = booksize - chapsize + 7;
+				if (key1.Book() == 1)
+				{
+					pos = 0;
+					//tmp = testoffset;
+					tmp = 0;            	// better just remember that it goes up to the testament intro to avoid 64k limit
+												// AV exceeds that anyway!
+					write(vfp, &pos, 4);  /* Module intro */
+					write(vfp, &tmp, 2);
+					assert(nextoffset==0);
+					cfile << "modintro pos{" << pos << "} size{" << tmp << "}\n";
+					testsize = testsize - booksize - chapsize + 7;
+					if (testsize > 10000)
+					{
+						cerr << "Error: testament too big " << testsize << "\n";
+						exit(-1);
+					}
+					//assert(testoffset==nextoffset);
+					write(vfp, &testoffset, 4);  /* Testament intro (vss)  */
+					write(vfp, &testsize, 2);
+					nextoffset = testoffset+testsize;
+					cfile << "test intro pos{" << testoffset << "} size{" << testsize << "}\n";
+				}
+				pos = lseek(cfp, 0, SEEK_CUR);
+				write(bfp, &pos, 4);
+				pos = lseek(vfp, 0, SEEK_CUR); /* Book intro (cps) */
+				write(cfp, &pos, 4);
+				if (booksize > 10000)
+				{
+					cerr << "Error: book too big " << booksize << "\n";
+					exit(-1);
+				}
+				assert(bookoffset==nextoffset);
+				write(vfp, &bookoffset, 4);  /* Book intro (vss)  */
+				write(vfp, &booksize, 2);
+				nextoffset = bookoffset+booksize;
+				cfile << "book intro pos{" << bookoffset << "} size{" << booksize << "}\n";
+				//offset += booksize;
+				//bookmark = false;
+			}
+			pos = lseek(vfp, 0, SEEK_CUR);
+			write(cfp, &pos, 4);
+			assert(chapsize < 10000);
+			write(vfp, &chapoffset, 4);  /* Chapter intro */
+			write(vfp, &chapsize, 2);
+			nextoffset = chapoffset+chapsize;
+			cfile << "chapter intro pos{" << chapoffset << "} size{" << chapsize << "}\n";
+			//offset += chapsize;
+			//size -= chapsize;
+			//chapmark = false;
+		}
+		if (key1 >= key2) {
+			if (size > 10000)
+			{
+				cerr << "Error: verse too big " << size << "\n";
+				exit(-1);
+			}
+			if (!chapmark && !bookmark)
+			{
+				write(vfp, &offset, 4);
+				write(vfp, &size, 2);
+				cfile << "verse pos{" << offset << "} size{" << size << "}\n";
+				cfile.flush();
+				assert(offset==nextoffset);
+				nextoffset = offset+size;
+				//cfile << "bookmark " << bookmark << " chapmark " << chapmark << "\n";
+			}
+			else
+			{
+				verseoffset = offset;
+				versesize = size;
+				cfile << "saving verse pos{" << offset << "} size{" << size << "}\n";
+				cfile << "bookmark " << bookmark << " chapmark " << chapmark << "\n";
+			}
+		}
+		else	{
+			pos = 0;
+			tmp = 0;
+			write(vfp, &pos, 4);
+			write(vfp, &tmp, 2);
+			cfile << "blank pos{" << pos << "} size{" << tmp << "}\n";
+		}
+	}
+}
+
+char startmod(char *buf)
+{
+	//char loop;
+
+	if (buf[0] != '<')
+		return 0;
+	if (buf[1] != 'H')
+		return 0;
+	if (buf[2] != '0')
+		return 0;
+/*
+	if (!isdigit(buf[2]))
+		return 0;
+	for (loop = 3; loop < 7; loop++) {
+		if (buf[loop] == ' ')
+			break;
+		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
+			return 0;
+	}
+*/
+	return 1;
+}
+
+
+char starttest(char *buf)
+{
+	//char loop;
+
+	if (buf[0] != '<')
+		return 0;
+	if (buf[1] != 'B')
+		return 0;
+	if (testmnt==2)
+	{
+		if (buf[2] != 'N')
+			return 0;
+	}
+	else
+	{
+		if (buf[2] != 'O')
+			return 0;
+	}
+	//if (buf[3] != '>')
+	//	return 0;
+/*
+	if (!isdigit(buf[2]))
+		return 0;
+	for (loop = 3; loop < 7; loop++) {
+		if (buf[loop] == ' ')
+			break;
+		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
+			return 0;
+	}
+*/
+	return 1;
+}
+
+
+char startbook(char *buf)
+{
+	//char loop;
+
+	if (buf[0] != '<')
+		return 0;
+	if (buf[1] != 'S')
+		return 0;
+	if (buf[2] != 'B')
+		return 0;
+/*
+	if (!isdigit(buf[2]))
+		return 0;
+	for (loop = 3; loop < 7; loop++) {
+		if (buf[loop] == ' ')
+			break;
+		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
+			return 0;
+	}
+*/
+	return 1;
+}
+
+
+char startchap(char *buf)
+{
+	//char loop;
+
+	if (buf[0] != '<')
+		return 0;
+	if (buf[1] != 'S')
+		return 0;
+	if (buf[2] != 'C')
+		return 0;
+/*
+	if (!isdigit(buf[2]))
+		return 0;
+	for (loop = 3; loop < 7; loop++) {
+		if (buf[loop] == ' ')
+			break;
+		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
+			return 0;
+	}
+*/
+	return 1;
+}
+
+
+char startentry(char *buf)
+{
+	//char loop;
+	//cfile << "{SV}";
+
+	if (buf[0] != '<')
+	{
+		//cfile << "{no<}";
+		return 0;
+	}
+	if (buf[1] != 'S')
+	{
+		//cfile << "\n{noS}\n";
+		return 0;
+	}
+	if (buf[2] != 'V')
+	{
+		//cfile << "\n{noV}\n";
+		return 0;
+	}
+/*
+	if (!isdigit(buf[2]))
+		return 0;
+	for (loop = 3; loop < 7; loop++) {
+		if (buf[loop] == ' ')
+			break;
+		if ((!isdigit(buf[loop])) && (buf[loop] != ',') && (buf[loop] != '-'))
+			return 0;
+	}
+*/
+	return 1;
+}
+
+
+char findbreak(int fp, long *offset, int *num1, int *num2, int *rangemax, unsigned short *size)
+{
+	char buf[8];
+	//char buf2[20];
+	//char ch;
+	char loop=0;
+	long offset2;
+	int ch2, vs2, rm2;
+	bool flag;
+	long versestart = 0;
+	long chapstart = 0;
+	long bookstart = 0;
+	long teststart = 0;
+
+	memset(buf, ' ', 8);
+
+	while (1) {
+		//cfile << "#" << buf << "#";
+		//if (lseek(fp, 0, SEEK_CUR) > 2000000)
+		//{
+		//	cfile << lseek(fp, 0, SEEK_CUR) << "\n";
+		//}
+		if (starttest(buf)) {
+			cfile << "\n{start of testament}\n";
+			//chapstart = lseek(fp, 0, SEEK_CUR) - 7;
+			teststart = lseek(fp, 0, SEEK_CUR) - 7;
+			testoffset = teststart;
+			memset(buf, ' ', 3);
+			flag = false;
+			for (loop = 3; loop < 6; loop++) {
+				if (buf[loop]!='>')
+					flag = true;
+				else {
+					buf[loop] = 0;
+					break;
+				}
+			}
+			ch2 = *num1;
+			vs2 = 1;
+			if (size) {
+				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
+					testsize = (unsigned short) (lseek(fp, 0, SEEK_END) - teststart-7);
+				}
+				else {
+					if (vs2) {
+						testsize = (offset2 - teststart - 7);
+					}
+				}
+				lseek(fp, teststart+7, SEEK_SET);
+				cfile << "\nGot testsize " << testsize << "\n";
+			}
+		}
+
+
+		if (startbook(buf)) {
+			cfile << "\n{start of book}\n";
+			bookmark++;
+			//chapstart = lseek(fp, 0, SEEK_CUR) - 7;
+			bookstart = lseek(fp, 0, SEEK_CUR) - 7;
+			bookoffset = bookstart;
+			memset(buf, ' ', 3);
+			flag = false;
+			for (loop = 3; loop < 6; loop++) {
+				if (buf[loop]!='>')
+					flag = true;
+				else {
+					buf[loop] = 0;
+					break;
+				}
+			}
+			if (size) {
+				ch2 = *num1;
+				vs2 = 1;
+				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
+					booksize = (unsigned short) (lseek(fp, 0, SEEK_END) - bookstart - 7);
+				}
+				else {
+					if (vs2) {
+						booksize = (offset2 - bookstart - 7);
+					}
+				}
+				lseek(fp, bookstart+7, SEEK_SET);
+				cfile << "\nGot booksize " << booksize << "\n";
+			}
+		}
+
+		if (startchap(buf)) {
+			cfile << "{start of chapter}";
+			chapmark++;
+			//chapstart = lseek(fp, 0, SEEK_CUR) - 7;
+			chapstart = lseek(fp, 0, SEEK_CUR) - 7;
+			chapoffset = chapstart;
+			memset(buf, ' ', 3);
+			flag = false;
+			for (loop = 3; loop < 6; loop++) {
+				if (isdigit(buf[loop]))
+					flag = true;
+				else {
+					buf[loop] = 0;
+					break;
+				}
+			}
+			if (flag)
+				*num1 = atoi(buf);
+			else	(*num1)++;
+
+			if (size) {
+				ch2 = *num1;
+				vs2 = 1;
+				lseek(fp, chapstart, SEEK_SET);
+				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
+					chapsize = (unsigned short) (lseek(fp, 0, SEEK_END) - chapstart);
+					cfile << "getting chapsizeend{" << chapsize << "} = " << lseek(fp, 0, SEEK_END) << " - " << chapstart << "\n";
+				}
+				else {
+					if (vs2) {
+						chapsize = (offset2 - chapstart);
+						cfile << "getting chapsize{" << chapsize << "} = " << offset2 << " - " << chapstart << "\n";
+					}
+				}
+				lseek(fp, chapstart + 7, SEEK_SET);
+				cfile << "\nGot chapsize " << chapsize << " loop{" << (int) loop << "}\n";
+			}
+			//return 0;
+
+		}
+		if (startentry(buf)) {
+			//cfile << "{start of verse}";
+			memset(buf, ' ', 3);
+			flag = false;
+			for (loop = 3; loop < 6; loop++) {
+				if (isdigit(buf[loop]))
+					flag = true;
+				else {
+					buf[loop] = 0;
+					break;
+				}
+			if (flag)
+				*num2 = atoi(buf);
+			else	(*num2)++;
+			}
+			loop++;
+			/*
+			if (size)
+			{
+				// *offset = lseek(fp, 0, SEEK_CUR) - (7 - loop);
+				 *offset = lseek(fp, 0, SEEK_CUR) - 7;
+			}
+			//else	*offset = (chapstart) ? chapstart : lseek(fp, 0, SEEK_CUR) - 7;
+			else	*offset = (chapstart) ? chapstart : lseek(fp, 0, SEEK_CUR) - 7;
+			*/
+			/*if (chapstart)
+			{
+				chapsize = *offset-chapstart;
+			}
+			else
+			{
+				chapsize = 0;
+			}*/
+			*offset = lseek(fp, 0, SEEK_CUR) - 7;
+			versestart = *offset;
+			if (size) {
+				ch2 = *num1;
+				vs2 = *num2;
+				if (findbreak(fp, &offset2, &ch2, &vs2, &rm2, 0)) {
+					*size = (unsigned short) (lseek(fp, 0, SEEK_END) - versestart);
+					cfile << "getting sizeend{" << *size << "} = " << lseek(fp, 0, SEEK_END) << " - " << versestart << "\n";
+				}
+				else {
+					if (vs2) {
+						*size = (offset2 - versestart);
+						cfile << "getting size{" << *size << "} = " << offset2 << " - " << versestart << "\n";
+					}
+				}
+				lseek(fp, *offset+1, SEEK_SET);
+			}
+			else
+			{
+				cfile << "got offset{" << *offset << "}\n";
+			}
+			return 0;
+		}
+		//cfile << "{ng}";
+		//deadcount++;
+		//if (deadcount==1000) exit(-1);
+		//if (!size)
+		//{
+		//	cfile << "not bound offset{" << *offset << "}\n";
+		//}
+		memmove(buf, &buf[1], 6);
+		if (read(fp, &buf[6], 1) != 1)
+			return 1;
+	}
+}
+
+
+void openfiles(char *fname)
+{
+#ifndef O_BINARY		// O_BINARY is needed in Borland C++ 4.53
+#define O_BINARY 0		// If it hasn't been defined than we probably
+#endif				// don't need it.
+	char buf[255];
+
+	if ((fp = open(fname, O_RDONLY|O_BINARY)) == -1) {
+		fprintf(stderr, "Couldn't open file: %s\n", fname);
+		exit(1);
+	}
+
+	sprintf(buf, "%s.vss", fname);
+	if ((vfp = open(buf, O_CREAT|O_WRONLY|O_BINARY|O_TRUNC)) == -1) {
+		fprintf(stderr, "Couldn't open file: %s\n", buf);
+		exit(1);
+	}
+
+	sprintf(buf, "%s.cps", fname);
+	if ((cfp = open(buf, O_CREAT|O_WRONLY|O_BINARY|O_TRUNC)) == -1) {
+		fprintf(stderr, "Couldn't open file: %s\n", buf);
+		exit(1);
+	}
+
+	sprintf(buf, "%s.bks", fname);
+	if ((bfp = open(buf, O_CREAT|O_WRONLY|O_BINARY|O_TRUNC)) == -1) {
+		fprintf(stderr, "Couldn't open file: %s\n", buf);
+		exit(1);
+	}
+	cfile.open("gbfidx.log", ios::out);
+	if (!cfile.is_open())
+	{
+		cerr << "Failed to open log file\n";
+		exit(-1);
+	}
+}
+
+
+void checkparams(int argc, char **argv)
+{
+	if (argc < 2) {
+		fprintf(stderr, "usage: %s <file to process> [nt - for new testmt file]\n", argv[0]);
+		exit(1);
+	}
+	if (!strcmp(argv[1], "nt"))
+		key1 = key2 = key3 = "Matthew 1:1";
+	else if (!strcmp(argv[1], "ot"))
+	{
+			key1 = key2 = key3 = "Genesis 1:1";
+	}
+	else
+	{
+		cerr << "File must be ot or nt\n";
+		exit(-1);
+	}
+}

Modified: trunk/src/modules/texts/ztext/rawtxt2z.cpp
===================================================================
--- trunk/src/modules/texts/ztext/rawtxt2z.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/modules/texts/ztext/rawtxt2z.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,457 +1,457 @@
-// Compression on variable granularity
-
-#include <fcntl.h>
-#include <iostream>
-#include <fstream>
-#include <string>
-
-#ifndef __GNUC__
-#include <io.h>
-#else
-#include <unistd.h>
-#endif
-
-#include <zlib.h>
-#include <versekey.h>
-
-int iBufSize, ulBuffNum;
-ofstream cfile;
-ofstream cfile2;
-
-int ofd[2], oxfd[2], ovxfd[2];
-int ifd[2], ixfd[2];
-int itestfd[2], itestxfd[2];
-unsigned long ulIOff=0, ulCOff=0, ulFOff=0, ulNone=0;
-string currbuff="";
-
-
-int openreadfile(char *buffer, char *path, const char *filename)
-{
-	int filenum;
-	sprintf(buffer, "%s/%s", path, filename);
-	cfile << buffer << "\n";
-	filenum =  open(buffer, O_RDONLY|O_BINARY);
-	if (filenum > 0)
-	{
-		return filenum;
-	}
-	else
-	{
-		cerr << "failed to open file to read\n";
-		exit(-1);
-	}
-}
-
-int openwritefile(char *buffer, char *path, const char *filename)
-{
-	int filenum;
-	sprintf(buffer, "%s/%s", path, filename);
-	cfile << buffer << "\n";
-	filenum =  open(buffer, O_WRONLY|O_BINARY|O_CREAT|O_TRUNC);
-	if (filenum > 0)
-	{
-		return filenum;
-	}
-	else
-	{
-		cerr << "failed to open file to read\n";
-		exit(-1);
-	}
-}
-
-int bytebound(unsigned long offset, VerseKey &thekey)
-{
-	unsigned long bufferoff;
-	cfile << "byteboundtest " << thekey << "\n";
-	bufferoff = iBufSize * (ulBuffNum+1);
-	if (offset > bufferoff)
-	{
-		return 1;
-	}
-	else
-	{
-		return 0;
-	}
-}
-
-int versebound(unsigned long offset, VerseKey &thekey)
-{
-	cfile << "verseboundtest " << thekey << "\n";
-	return 1;
-}
-
-int chapterbound(unsigned long offset, VerseKey &thekey)
-{
-	VerseKey testkey;
-	testkey = thekey;
-	testkey++;
-	//cfile << "chapterboundtest " << testkey;
-	if (testkey.Verse()==1 || (!thekey.compare("Revelation of John 22:21")))
-	{
-		//cfile << " 1\n";
-		return 1;
-	}
-	else
-	{
-		//cfile << " 0\n";
-		return 0;
-	}
-}
-
-int bookbound(unsigned long offset, VerseKey &thekey)
-{
-	VerseKey testkey;
-	testkey = thekey;
-	cfile << "bookboundtest " << testkey << "\n";
-	testkey++;
-	if (testkey.Chapter()==1 || (!thekey.compare("Revelation of John 22:21")))
-	{
-		return 1;
-	}
-	else
-	{
-		return 0;
-	}
-}
-
-
-typedef int (*boundfunc)(unsigned long offset, VerseKey &thekey);
-
-int writeblock(int i)
-{
-	char *destbuff=NULL;
-	unsigned long compsize = 0, buffsize=0;
-
-	cfile << "compressing block\n";
-	// compress current buffer
-	buffsize = currbuff.length();
-	write(itestfd[i], currbuff.c_str(), buffsize);
-	compsize = (unsigned long) (buffsize*1.01)+20;  // at least 1% bigger than buffer + 12 bytes
-	//cfile << "{" << compsize << "}";
-	//destbuff = (char *) calloc(compsize + 1, 1);
-	destbuff = new char[compsize];
-	if (compress((Bytef*)destbuff, &compsize, (const Bytef*)currbuff.c_str(), buffsize)!=Z_OK)
-	{
-		cerr << "Could not compress buffer: exiting\n";
-		delete[] destbuff;
-		exit(-1);
-	}
-	//cout << "Compressed buffer{" << compsize << "}\n" << destbuff << "\n";
-	//cout.flush();
-	// write to compressed file index
-	ulCOff = lseek(ofd[i], 0, SEEK_END);
-	write(oxfd[i], &ulCOff, 4);    // offset in compressed file
-	write(oxfd[i], &compsize, 4);	 // compressed size
-	write(oxfd[i], &buffsize, 4);	 // uncompressed size
-	cfile << buffsize << " -> " << compsize << "\n";
-	cfile2 << "Compressed{" << compsize << "}\n" << destbuff << "\n";
-	cfile2.flush();
-
-	//write compressed buffer to file
-	write(ofd[i], destbuff, compsize);
-
-	//free(destbuff);
-	delete[] destbuff;
-
-	currbuff = "";
-	ulBuffNum++;
-	ulIOff = 0;
-	return 1;
-}
-
-
-
-int main(int argc, char **argv)
-{
-	VerseKey key1, key2, key3;
-	int i;
-	char xbuff[64];
-	unsigned long offset;
-	unsigned short size=0;
-	unsigned long ulsize=0;
-	char *tmpbuf=NULL;
-	int iType;
-	boundfunc blockbound[4] = {bytebound, versebound, chapterbound, bookbound};
-	bool newbook=true, newchapter=true, newtestament = true, newmodule = true, lasttodo=true;
-
-	if ((argc < 2) || (argc > 4)) {
-		cerr << "usage: " << argv[0] << " datapath [compression type [buffer size]]\n";
-		exit(1);
-	}
-
-	if (argc>2)
-	{
-		iType = atoi(argv[2]);
-		if (argc==4)
-		{
-			iBufSize = atoi(argv[3]);
-		}
-		else
-		{
-			iBufSize = 1;
-		}
-	}
-	else
-	{
-		iType = 2;
-		iBufSize = 1;
-	}
-
-	cfile.open("raw2z.log", ios::out);
-	if (!cfile.is_open())
-	{
-		cerr << "Failed to open log file\n";
-		exit(-1);
-	}
-	cfile2.open("raw2z.lg2", ios::out);
-	if (!cfile2.is_open())
-	{
-		cerr << "Failed to open log file\n";
-		exit(-1);
-	}
-	cfile << iType << " " << iBufSize << "\n";
-
-	if ((iType<=0) || (iType > 4) || !iBufSize || !strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || !strcmp(argv[1], "/?") || !strcmp(argv[1], "-help"))
-	{
-		cfile << argv[0] << " - a tool to create compressed Sword modules\n";
-		cfile << "version 0.1\n\n";
-		cfile << "usage: "<< argv[0] << " datapath [compression type [buffer size]]\n\n";
-		cfile << "datapath: the directory in which to find the raw module\n";
-		cfile << "compression type: (default 2)\n" << "   1 - bytes\n" << "   2 - verses\n" << "   3 - chapters\n" << "   4 - books\n";
-		cfile << "buffer size (default 1): the number of the compression type in each block\n";
-		exit(1);
-	}
-
-	//zobj = new SWCompress();
-	//rawdrv = new RawVerse(argv[1]);
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-	cfile << "opening files\n";
-
-	tmpbuf = new char [ strlen(argv[1]) + 11 ];
-
-	//original files
-	ifd[0] = openreadfile(tmpbuf, argv[1], "ot");
-	ixfd[0] = openreadfile(tmpbuf, argv[1], "ot.vss");
-	ifd[1] = openreadfile(tmpbuf, argv[1], "nt");
-	ixfd[1] = openreadfile(tmpbuf, argv[1], "nt.vss");
-
-switch ( iType) {
-	case 1 :
-		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.rzz");
-		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.rzs");
-		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.rzv");
-		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.rzz");
-		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.rzs");
-		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.rzv");
-		//boundfunc = bytebound;
-		break;
-	case 2 :
-		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.vzz");
-		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.vzs");
-		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.vzv");
-		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.vzz");
-		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.vzs");
-		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.vzv");
-		break;
-	case 3 :
-		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.czz");
-		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.czs");
-		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.czv");
-		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.czz");
-		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.czs");
-		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.czv");
-		break;
-	case 4 :
-		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.bzz");
-		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.bzs");
-		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.bzv");
-		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.bzz");
-		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.bzs");
-		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.bzv");
-		break;
-	default:
-		cerr << "Unknown compression type\n";
-		exit(-1);
-}
-	itestfd[0] = openwritefile(tmpbuf, argv[1], "ot.tst");
-	itestfd[1] = openwritefile(tmpbuf, argv[1], "nt.tst");
-	itestxfd[0] = openwritefile(tmpbuf, argv[1], "ot.tdx");
-	itestxfd[1] = openwritefile(tmpbuf, argv[1], "nt.tdx");
-
-
-	delete [] tmpbuf;
-
-	//cfile << "about to start\n";
-
-for ( i=0; i<2; i++)
-{
-	ulIOff=0, ulBuffNum=0;
-	currbuff = "";
-	key1 = (i == 1) ? "Matthew 1:1" : "Genesis 1:1";
-	key2 = key3 = key1;
-	newtestament = true;
-
-	cfile << "key: " << key1 << " Testament {" << key1.Testament()-1 << "}\n";
-	//cfile << "Chapter {" << key.Chapter() << "}\n";
-	//cfile << "Verse {" << key.Verse() << "}\n";
-	//cfile << key.compare("Revelation of John 22:21") << "\n";
-	//cfile << key.compare("Genesis 1:1") << "\n";
-	do
-	{
-		//cfile << "ok";
-		// read current verse offset
-		if (read(ixfd[i], &offset, 4) != 4)
-		{
-			cfile << "Failed to read input verse offsets?\n";
-			break;
-		}
-		if (read(ixfd[i], &size, 2) != 2)
-		{
-			cfile << "Failed to read input verse sizes?\n";
-			break;
-		}
-		cfile << "key:" << key1 << " offset:" << offset << " size:" << size << "\n";
-		sprintf(xbuff, "key{%s} offset{%ld} size{%d}\n", (const char *)key1, offset, size);
-		write(itestxfd[i], &xbuff, strlen(xbuff));
-		ulsize = size;
-		if (!offset && !size)
-		{
-			//Check for module header
-			if (read(ixfd[i], &ulIOff, 4) != 4)
-			{
-				cfile << "Failed to read input verse offsets?\n";
-				break;
-			}
-			ulsize = ulIOff;
-			ulIOff = 0;
-			lseek(ixfd[i], 6, SEEK_SET);
-		}
-
-		if (ulsize)
-		{
-			// read current verse and add to current buffer
-			tmpbuf = (char *) calloc(ulsize + 1, 1);
-			lseek(ifd[i], offset, SEEK_SET);
-			read(ifd[i], tmpbuf, ulsize);
-			currbuff += tmpbuf;
-			//cfile << currbuff << "\n";
-
-			// write to verse index into compressed
-			write(ovxfd[i], &ulBuffNum, 4);    // current buffer number
-			write(ovxfd[i], &ulIOff, 4);    // offset within the buffer
-			write(ovxfd[i], &size, 2);    // verse size
-
-			ulFOff = lseek(ofd[i], 0, SEEK_CUR) + size;
-			if (key1.compare("Revelation of John 22:21")!=-1)
-			{
-				lasttodo = false;
-			}
-			if (blockbound[iType-1](ulFOff, key1)/*at block boudary*/)
-			{
-				writeblock(i);
-				/*
-				cfile << "compressing block\n";
-				// compress current buffer
-				buffsize = currbuff.length();
-				write(itestfd[i], currbuff.c_str(), buffsize);
-				compsize = (unsigned long) (buffsize*1.01)+20;  // at least 1% bigger than buffer + 12 bytes
-				//cfile << "{" << compsize << "}";
-				//destbuff = (char *) calloc(compsize + 1, 1);
-				destbuff = new char[compsize];
-				if (compress((Bytef*)destbuff, &compsize, (const Bytef*)currbuff.c_str(), buffsize)!=Z_OK)
-				{
-					cerr << "Could not compress buffer: exiting\n";
-					delete[] destbuff;
-					exit(-1);
-				}
-				//cout << "Compressed buffer{" << compsize << "}\n" << destbuff << "\n";
-				//cout.flush();
-				// write to compressed file index
-				ulCOff = lseek(ofd[i], 0, SEEK_END);
-				write(oxfd[i], &ulCOff, 4);    // offset in compressed file
-				write(oxfd[i], &compsize, 4);	 // compressed size
-				write(oxfd[i], &buffsize, 4);	 // uncompressed size
-				cfile << buffsize << " -> " << compsize << "\n";
-				cfile2 << "Compressed{" << compsize << "}\n" << destbuff << "\n";
-				cfile2.flush();
-
-				//write compressed buffer to file
-				write(ofd[i], destbuff, compsize);
-
-				//free(destbuff);
-				delete[] destbuff;
-
-				currbuff = "";
-				ulBuffNum++;
-				ulIOff = 0;
-				*/
-			}
-			else
-			{
-				ulIOff += ulsize;
-			}
-			free(tmpbuf);
-
-			if (newmodule)
-			{
-				newmodule = false;
-				cfile << "had a new module " << (const char *) key1 << "{" << offset << "}\n";
-				writeblock(i);
-			}
-			else if (newtestament)
-			{
-				newtestament = false;
-				cfile << "had a new testament " << (const char *) key1 << "{" << offset << "}\n";
-			}
-			else if (newbook)
-			{
-				newbook = false;
-				cfile << "had a new book " << (const char *) key1 << "{" << offset << "}\n";
-			}
-			else if (newchapter)
-			{
-				newchapter = false;
-				cfile << "had a new chapter " << (const char *) key1 << "{" << offset << "}\n";
-			}
-			else
-			{
-				key1++;
-			}
-
-			if (key1.Chapter()!=key2.Chapter() || (key1.Book()!=key2.Book()))
-			{
-				newchapter = true;
-				cfile << "got a new chapter " << (const char *) key1 << "\n";
-			}
-			if (key1.Book()!=key2.Book())
-			{
-				newbook = true;
-				cfile << "got a new book " << (const char *) key1 << "\n";
-			}
-			key2 = key1;
-
-		}
-		else
-		{
-			cfile << "empty offset\n";
-			// write to verse index into compressed
-			write(ovxfd[i], &ulNone, 4);    // current buffer number
-			write(ovxfd[i], &size, 2);    // verse size
-			write(ovxfd[i], &ulNone, 4);    // offset within the buffer
-		}
-	}
-	while ( (key1.Testament()==i+1) && ((key1.compare("Revelation of John 22:21")==-1) || (lasttodo)));
-
-	close(ifd[i]);
-	close(ofd[i]);
-	close(ixfd[i]);
-	close(oxfd[i]);
-	close(ovxfd[i]);
-	close(itestfd[i]);
-	close(itestxfd[i]);
-}
-	return 1;
-}
+// Compression on variable granularity
+
+#include <fcntl.h>
+#include <iostream>
+#include <fstream>
+#include <string>
+
+#ifndef __GNUC__
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <zlib.h>
+#include <versekey.h>
+
+int iBufSize, ulBuffNum;
+ofstream cfile;
+ofstream cfile2;
+
+int ofd[2], oxfd[2], ovxfd[2];
+int ifd[2], ixfd[2];
+int itestfd[2], itestxfd[2];
+unsigned long ulIOff=0, ulCOff=0, ulFOff=0, ulNone=0;
+string currbuff="";
+
+
+int openreadfile(char *buffer, char *path, const char *filename)
+{
+	int filenum;
+	sprintf(buffer, "%s/%s", path, filename);
+	cfile << buffer << "\n";
+	filenum =  open(buffer, O_RDONLY|O_BINARY);
+	if (filenum > 0)
+	{
+		return filenum;
+	}
+	else
+	{
+		cerr << "failed to open file to read\n";
+		exit(-1);
+	}
+}
+
+int openwritefile(char *buffer, char *path, const char *filename)
+{
+	int filenum;
+	sprintf(buffer, "%s/%s", path, filename);
+	cfile << buffer << "\n";
+	filenum =  open(buffer, O_WRONLY|O_BINARY|O_CREAT|O_TRUNC);
+	if (filenum > 0)
+	{
+		return filenum;
+	}
+	else
+	{
+		cerr << "failed to open file to read\n";
+		exit(-1);
+	}
+}
+
+int bytebound(unsigned long offset, VerseKey &thekey)
+{
+	unsigned long bufferoff;
+	cfile << "byteboundtest " << thekey << "\n";
+	bufferoff = iBufSize * (ulBuffNum+1);
+	if (offset > bufferoff)
+	{
+		return 1;
+	}
+	else
+	{
+		return 0;
+	}
+}
+
+int versebound(unsigned long offset, VerseKey &thekey)
+{
+	cfile << "verseboundtest " << thekey << "\n";
+	return 1;
+}
+
+int chapterbound(unsigned long offset, VerseKey &thekey)
+{
+	VerseKey testkey;
+	testkey = thekey;
+	testkey++;
+	//cfile << "chapterboundtest " << testkey;
+	if (testkey.Verse()==1 || (!thekey.compare("Revelation of John 22:21")))
+	{
+		//cfile << " 1\n";
+		return 1;
+	}
+	else
+	{
+		//cfile << " 0\n";
+		return 0;
+	}
+}
+
+int bookbound(unsigned long offset, VerseKey &thekey)
+{
+	VerseKey testkey;
+	testkey = thekey;
+	cfile << "bookboundtest " << testkey << "\n";
+	testkey++;
+	if (testkey.Chapter()==1 || (!thekey.compare("Revelation of John 22:21")))
+	{
+		return 1;
+	}
+	else
+	{
+		return 0;
+	}
+}
+
+
+typedef int (*boundfunc)(unsigned long offset, VerseKey &thekey);
+
+int writeblock(int i)
+{
+	char *destbuff=NULL;
+	unsigned long compsize = 0, buffsize=0;
+
+	cfile << "compressing block\n";
+	// compress current buffer
+	buffsize = currbuff.length();
+	write(itestfd[i], currbuff.c_str(), buffsize);
+	compsize = (unsigned long) (buffsize*1.01)+20;  // at least 1% bigger than buffer + 12 bytes
+	//cfile << "{" << compsize << "}";
+	//destbuff = (char *) calloc(compsize + 1, 1);
+	destbuff = new char[compsize];
+	if (compress((Bytef*)destbuff, &compsize, (const Bytef*)currbuff.c_str(), buffsize)!=Z_OK)
+	{
+		cerr << "Could not compress buffer: exiting\n";
+		delete[] destbuff;
+		exit(-1);
+	}
+	//cout << "Compressed buffer{" << compsize << "}\n" << destbuff << "\n";
+	//cout.flush();
+	// write to compressed file index
+	ulCOff = lseek(ofd[i], 0, SEEK_END);
+	write(oxfd[i], &ulCOff, 4);    // offset in compressed file
+	write(oxfd[i], &compsize, 4);	 // compressed size
+	write(oxfd[i], &buffsize, 4);	 // uncompressed size
+	cfile << buffsize << " -> " << compsize << "\n";
+	cfile2 << "Compressed{" << compsize << "}\n" << destbuff << "\n";
+	cfile2.flush();
+
+	//write compressed buffer to file
+	write(ofd[i], destbuff, compsize);
+
+	//free(destbuff);
+	delete[] destbuff;
+
+	currbuff = "";
+	ulBuffNum++;
+	ulIOff = 0;
+	return 1;
+}
+
+
+
+int main(int argc, char **argv)
+{
+	VerseKey key1, key2, key3;
+	int i;
+	char xbuff[64];
+	unsigned long offset;
+	unsigned short size=0;
+	unsigned long ulsize=0;
+	char *tmpbuf=NULL;
+	int iType;
+	boundfunc blockbound[4] = {bytebound, versebound, chapterbound, bookbound};
+	bool newbook=true, newchapter=true, newtestament = true, newmodule = true, lasttodo=true;
+
+	if ((argc < 2) || (argc > 4)) {
+		cerr << "usage: " << argv[0] << " datapath [compression type [buffer size]]\n";
+		exit(1);
+	}
+
+	if (argc>2)
+	{
+		iType = atoi(argv[2]);
+		if (argc==4)
+		{
+			iBufSize = atoi(argv[3]);
+		}
+		else
+		{
+			iBufSize = 1;
+		}
+	}
+	else
+	{
+		iType = 2;
+		iBufSize = 1;
+	}
+
+	cfile.open("raw2z.log", ios::out);
+	if (!cfile.is_open())
+	{
+		cerr << "Failed to open log file\n";
+		exit(-1);
+	}
+	cfile2.open("raw2z.lg2", ios::out);
+	if (!cfile2.is_open())
+	{
+		cerr << "Failed to open log file\n";
+		exit(-1);
+	}
+	cfile << iType << " " << iBufSize << "\n";
+
+	if ((iType<=0) || (iType > 4) || !iBufSize || !strcmp(argv[1], "-h") || !strcmp(argv[1], "--help") || !strcmp(argv[1], "/?") || !strcmp(argv[1], "-help"))
+	{
+		cfile << argv[0] << " - a tool to create compressed Sword modules\n";
+		cfile << "version 0.1\n\n";
+		cfile << "usage: "<< argv[0] << " datapath [compression type [buffer size]]\n\n";
+		cfile << "datapath: the directory in which to find the raw module\n";
+		cfile << "compression type: (default 2)\n" << "   1 - bytes\n" << "   2 - verses\n" << "   3 - chapters\n" << "   4 - books\n";
+		cfile << "buffer size (default 1): the number of the compression type in each block\n";
+		exit(1);
+	}
+
+	//zobj = new SWCompress();
+	//rawdrv = new RawVerse(argv[1]);
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+	cfile << "opening files\n";
+
+	tmpbuf = new char [ strlen(argv[1]) + 11 ];
+
+	//original files
+	ifd[0] = openreadfile(tmpbuf, argv[1], "ot");
+	ixfd[0] = openreadfile(tmpbuf, argv[1], "ot.vss");
+	ifd[1] = openreadfile(tmpbuf, argv[1], "nt");
+	ixfd[1] = openreadfile(tmpbuf, argv[1], "nt.vss");
+
+switch ( iType) {
+	case 1 :
+		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.rzz");
+		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.rzs");
+		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.rzv");
+		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.rzz");
+		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.rzs");
+		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.rzv");
+		//boundfunc = bytebound;
+		break;
+	case 2 :
+		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.vzz");
+		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.vzs");
+		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.vzv");
+		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.vzz");
+		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.vzs");
+		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.vzv");
+		break;
+	case 3 :
+		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.czz");
+		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.czs");
+		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.czv");
+		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.czz");
+		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.czs");
+		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.czv");
+		break;
+	case 4 :
+		ofd[0] = openwritefile(tmpbuf, argv[1], "ot.bzz");
+		oxfd[0] = openwritefile(tmpbuf, argv[1], "ot.bzs");
+		ovxfd[0] = openwritefile(tmpbuf, argv[1], "ot.bzv");
+		ofd[1] = openwritefile(tmpbuf, argv[1], "nt.bzz");
+		oxfd[1] = openwritefile(tmpbuf, argv[1], "nt.bzs");
+		ovxfd[1] = openwritefile(tmpbuf, argv[1], "nt.bzv");
+		break;
+	default:
+		cerr << "Unknown compression type\n";
+		exit(-1);
+}
+	itestfd[0] = openwritefile(tmpbuf, argv[1], "ot.tst");
+	itestfd[1] = openwritefile(tmpbuf, argv[1], "nt.tst");
+	itestxfd[0] = openwritefile(tmpbuf, argv[1], "ot.tdx");
+	itestxfd[1] = openwritefile(tmpbuf, argv[1], "nt.tdx");
+
+
+	delete [] tmpbuf;
+
+	//cfile << "about to start\n";
+
+for ( i=0; i<2; i++)
+{
+	ulIOff=0, ulBuffNum=0;
+	currbuff = "";
+	key1 = (i == 1) ? "Matthew 1:1" : "Genesis 1:1";
+	key2 = key3 = key1;
+	newtestament = true;
+
+	cfile << "key: " << key1 << " Testament {" << key1.Testament()-1 << "}\n";
+	//cfile << "Chapter {" << key.Chapter() << "}\n";
+	//cfile << "Verse {" << key.Verse() << "}\n";
+	//cfile << key.compare("Revelation of John 22:21") << "\n";
+	//cfile << key.compare("Genesis 1:1") << "\n";
+	do
+	{
+		//cfile << "ok";
+		// read current verse offset
+		if (read(ixfd[i], &offset, 4) != 4)
+		{
+			cfile << "Failed to read input verse offsets?\n";
+			break;
+		}
+		if (read(ixfd[i], &size, 2) != 2)
+		{
+			cfile << "Failed to read input verse sizes?\n";
+			break;
+		}
+		cfile << "key:" << key1 << " offset:" << offset << " size:" << size << "\n";
+		sprintf(xbuff, "key{%s} offset{%ld} size{%d}\n", (const char *)key1, offset, size);
+		write(itestxfd[i], &xbuff, strlen(xbuff));
+		ulsize = size;
+		if (!offset && !size)
+		{
+			//Check for module header
+			if (read(ixfd[i], &ulIOff, 4) != 4)
+			{
+				cfile << "Failed to read input verse offsets?\n";
+				break;
+			}
+			ulsize = ulIOff;
+			ulIOff = 0;
+			lseek(ixfd[i], 6, SEEK_SET);
+		}
+
+		if (ulsize)
+		{
+			// read current verse and add to current buffer
+			tmpbuf = (char *) calloc(ulsize + 1, 1);
+			lseek(ifd[i], offset, SEEK_SET);
+			read(ifd[i], tmpbuf, ulsize);
+			currbuff += tmpbuf;
+			//cfile << currbuff << "\n";
+
+			// write to verse index into compressed
+			write(ovxfd[i], &ulBuffNum, 4);    // current buffer number
+			write(ovxfd[i], &ulIOff, 4);    // offset within the buffer
+			write(ovxfd[i], &size, 2);    // verse size
+
+			ulFOff = lseek(ofd[i], 0, SEEK_CUR) + size;
+			if (key1.compare("Revelation of John 22:21")!=-1)
+			{
+				lasttodo = false;
+			}
+			if (blockbound[iType-1](ulFOff, key1)/*at block boudary*/)
+			{
+				writeblock(i);
+				/*
+				cfile << "compressing block\n";
+				// compress current buffer
+				buffsize = currbuff.length();
+				write(itestfd[i], currbuff.c_str(), buffsize);
+				compsize = (unsigned long) (buffsize*1.01)+20;  // at least 1% bigger than buffer + 12 bytes
+				//cfile << "{" << compsize << "}";
+				//destbuff = (char *) calloc(compsize + 1, 1);
+				destbuff = new char[compsize];
+				if (compress((Bytef*)destbuff, &compsize, (const Bytef*)currbuff.c_str(), buffsize)!=Z_OK)
+				{
+					cerr << "Could not compress buffer: exiting\n";
+					delete[] destbuff;
+					exit(-1);
+				}
+				//cout << "Compressed buffer{" << compsize << "}\n" << destbuff << "\n";
+				//cout.flush();
+				// write to compressed file index
+				ulCOff = lseek(ofd[i], 0, SEEK_END);
+				write(oxfd[i], &ulCOff, 4);    // offset in compressed file
+				write(oxfd[i], &compsize, 4);	 // compressed size
+				write(oxfd[i], &buffsize, 4);	 // uncompressed size
+				cfile << buffsize << " -> " << compsize << "\n";
+				cfile2 << "Compressed{" << compsize << "}\n" << destbuff << "\n";
+				cfile2.flush();
+
+				//write compressed buffer to file
+				write(ofd[i], destbuff, compsize);
+
+				//free(destbuff);
+				delete[] destbuff;
+
+				currbuff = "";
+				ulBuffNum++;
+				ulIOff = 0;
+				*/
+			}
+			else
+			{
+				ulIOff += ulsize;
+			}
+			free(tmpbuf);
+
+			if (newmodule)
+			{
+				newmodule = false;
+				cfile << "had a new module " << (const char *) key1 << "{" << offset << "}\n";
+				writeblock(i);
+			}
+			else if (newtestament)
+			{
+				newtestament = false;
+				cfile << "had a new testament " << (const char *) key1 << "{" << offset << "}\n";
+			}
+			else if (newbook)
+			{
+				newbook = false;
+				cfile << "had a new book " << (const char *) key1 << "{" << offset << "}\n";
+			}
+			else if (newchapter)
+			{
+				newchapter = false;
+				cfile << "had a new chapter " << (const char *) key1 << "{" << offset << "}\n";
+			}
+			else
+			{
+				key1++;
+			}
+
+			if (key1.Chapter()!=key2.Chapter() || (key1.Book()!=key2.Book()))
+			{
+				newchapter = true;
+				cfile << "got a new chapter " << (const char *) key1 << "\n";
+			}
+			if (key1.Book()!=key2.Book())
+			{
+				newbook = true;
+				cfile << "got a new book " << (const char *) key1 << "\n";
+			}
+			key2 = key1;
+
+		}
+		else
+		{
+			cfile << "empty offset\n";
+			// write to verse index into compressed
+			write(ovxfd[i], &ulNone, 4);    // current buffer number
+			write(ovxfd[i], &size, 2);    // verse size
+			write(ovxfd[i], &ulNone, 4);    // offset within the buffer
+		}
+	}
+	while ( (key1.Testament()==i+1) && ((key1.compare("Revelation of John 22:21")==-1) || (lasttodo)));
+
+	close(ifd[i]);
+	close(ofd[i]);
+	close(ixfd[i]);
+	close(oxfd[i]);
+	close(ovxfd[i]);
+	close(itestfd[i]);
+	close(itestxfd[i]);
+}
+	return 1;
+}

Modified: trunk/src/utilfuns/swbuf.cpp
===================================================================
--- trunk/src/utilfuns/swbuf.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/swbuf.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
 *  swbuf.cpp  - code for SWBuf used as a transport and utility for data buffers
 *
-* $Id: swbuf.cpp,v 1.20 2004/06/16 09:04:20 mgruner Exp $
+* $Id$
 *
 * Copyright 2003 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society

Modified: trunk/src/utilfuns/utilxml.cpp
===================================================================
--- trunk/src/utilfuns/utilxml.cpp	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/utilxml.cpp	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,7 +1,7 @@
 /******************************************************************************
  *  utilxml.cpp   - implementaion of utility classes to handle XML processing
  *
- * $Id: utilxml.cpp,v 1.18 2004/05/19 22:03:36 joachim Exp $
+ * $Id$
  *
  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society

Modified: trunk/src/utilfuns/zlib/adler32.c
===================================================================
--- trunk/src/utilfuns/zlib/adler32.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/adler32.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h 
  */
 
-/* @(#) $Id: adler32.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #include "zlib.h"
 

Modified: trunk/src/utilfuns/zlib/compress.c
===================================================================
--- trunk/src/utilfuns/zlib/compress.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/compress.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h 
  */
 
-/* @(#) $Id: compress.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #include "zlib.h"
 

Modified: trunk/src/utilfuns/zlib/crc32.c
===================================================================
--- trunk/src/utilfuns/zlib/crc32.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/crc32.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h 
  */
 
-/* @(#) $Id: crc32.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #include "zlib.h"
 

Modified: trunk/src/utilfuns/zlib/deflate.c
===================================================================
--- trunk/src/utilfuns/zlib/deflate.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/deflate.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -47,7 +47,7 @@
  *
  */
 
-/* @(#) $Id: deflate.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #include "deflate.h"
 

Modified: trunk/src/utilfuns/zlib/deflate.h
===================================================================
--- trunk/src/utilfuns/zlib/deflate.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/deflate.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -8,7 +8,7 @@
    subject to change. Applications should only use zlib.h.
  */
 
-/* @(#) $Id: deflate.h,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #ifndef _DEFLATE_H
 #define _DEFLATE_H

Modified: trunk/src/utilfuns/zlib/gzio.c
===================================================================
--- trunk/src/utilfuns/zlib/gzio.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/gzio.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -5,7 +5,7 @@
  * Compile this file with -DNO_DEFLATE to avoid the compression code.
  */
 
-/* @(#) $Id: gzio.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #include <stdio.h>
 

Modified: trunk/src/utilfuns/zlib/trees.c
===================================================================
--- trunk/src/utilfuns/zlib/trees.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/trees.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -29,7 +29,7 @@
  *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
  */
 
-/* @(#) $Id: trees.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 /* #define GEN_TREES_H */
 

Modified: trunk/src/utilfuns/zlib/uncompr.c
===================================================================
--- trunk/src/utilfuns/zlib/uncompr.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/uncompr.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h 
  */
 
-/* @(#) $Id: uncompr.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #include "zlib.h"
 

Modified: trunk/src/utilfuns/zlib/zutil.c
===================================================================
--- trunk/src/utilfuns/zlib/zutil.c	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/zutil.c	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,7 +3,7 @@
  * For conditions of distribution and use, see copyright notice in zlib.h 
  */
 
-/* @(#) $Id: zutil.c,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #include "zutil.h"
 

Modified: trunk/src/utilfuns/zlib/zutil.h
===================================================================
--- trunk/src/utilfuns/zlib/zutil.h	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/src/utilfuns/zlib/zutil.h	2005-01-01 04:42:26 UTC (rev 1688)
@@ -8,7 +8,7 @@
    subject to change. Applications should only use zlib.h.
  */
 
-/* @(#) $Id: zutil.h,v 1.2 2002/10/07 22:28:15 scribe Exp $ */
+/* @(#) $Id$ */
 
 #ifndef _Z_UTIL_H
 #define _Z_UTIL_H

Modified: trunk/tests/bcppmake/filtertest.bpf
===================================================================
--- trunk/tests/bcppmake/filtertest.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/tests/bcppmake/filtertest.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,4 +3,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/tests/bcppmake/mgrtest.bpf
===================================================================
--- trunk/tests/bcppmake/mgrtest.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/tests/bcppmake/mgrtest.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,4 +3,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/tests/bcppmake/parsekey.bpf
===================================================================
--- trunk/tests/bcppmake/parsekey.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/tests/bcppmake/parsekey.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -3,4 +3,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/cipherraw.bpf
===================================================================
--- trunk/utilities/bcppmake/cipherraw.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/cipherraw.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/diatheke.bpf
===================================================================
--- trunk/utilities/bcppmake/diatheke.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/diatheke.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,14 +1,16 @@
-USEUNIT("..\..\apps\console\diatheke\diatheke.cpp");
-USEUNIT("..\..\apps\console\diatheke\thmlcgi.cpp");
-USEUNIT("..\..\apps\console\diatheke\corediatheke.cpp");
-USEUNIT("..\..\apps\console\diatheke\diafiltmgr.cpp");
-USEUNIT("..\..\apps\console\diatheke\diathekemgr.cpp");
-USEUNIT("..\..\apps\console\diatheke\gbfcgi.cpp");
+USEUNIT("..\diatheke\diatheke.cpp");
+USEUNIT("..\diatheke\thmlcgi.cpp");
+USEUNIT("..\diatheke\corediatheke.cpp");
+USEUNIT("..\diatheke\diafiltmgr.cpp");
+USEUNIT("..\diatheke\diathekemgr.cpp");
+USEUNIT("..\diatheke\gbfcgi.cpp");
 USELIB("..\..\lib\libsword.lib");
 USELIB("..\..\..\icu-sword\as_is\borland\icuin.lib");
 USELIB("..\..\..\icu-sword\as_is\borland\icuuc.lib");
 USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib");
+USEUNIT("..\diatheke\osiscgi.cpp");
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/diatheke.bpr
===================================================================
--- trunk/utilities/bcppmake/diatheke.bpr	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/diatheke.bpr	2005-01-01 04:42:26 UTC (rev 1688)
@@ -4,12 +4,9 @@
   <MACROS>
     <VERSION value="BCB.05.03"/>
     <PROJECT value="diatheke.exe"/>
-    <OBJFILES value="..\..\apps\console\diatheke\diatheke.obj 
-      ..\..\apps\console\diatheke\thmlcgi.obj 
-      ..\..\apps\console\diatheke\corediatheke.obj 
-      ..\..\apps\console\diatheke\diafiltmgr.obj 
-      ..\..\apps\console\diatheke\diathekemgr.obj 
-      ..\..\apps\console\diatheke\gbfcgi.obj"/>
+    <OBJFILES value="..\diatheke\diatheke.obj ..\diatheke\thmlcgi.obj 
+      ..\diatheke\corediatheke.obj ..\diatheke\diafiltmgr.obj 
+      ..\diatheke\diathekemgr.obj ..\diatheke\gbfcgi.obj ..\diatheke\osiscgi.obj"/>
     <RESFILES value=""/>
     <IDLFILES value=""/>
     <IDLGENFILES value=""/>
@@ -24,7 +21,7 @@
       ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi 
       VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi 
       dclocx50.bpi bcb2kaxserver50.bpi"/>
-    <PATHCPP value=".;"/>
+    <PATHCPP value=".;..\diatheke"/>
     <PATHPAS value=".;"/>
     <PATHRC value=".;"/>
     <PATHASM value=".;"/>
@@ -34,13 +31,13 @@
     <USERDEFINES value=""/>
     <SYSDEFINES value="NO_STRICT;_NO_VCL;_RTLDLL;USEPACKAGES"/>
     <MAINSOURCE value="diatheke.bpf"/>
-    <INCLUDEPATH value="..\..\apps\console\diatheke;$(BCB)\include;$(BCB)\include\vcl;..\..\include"/>
-    <LIBPATH value="..\..\apps\console\diatheke;..\..\lib;$(BCB)\lib\obj;$(BCB)\lib"/>
+    <INCLUDEPATH value="..\diatheke;$(BCB)\include;$(BCB)\include\vcl;..\..\include"/>
+    <LIBPATH value="..\diatheke;..\..\lib;$(BCB)\lib\obj;$(BCB)\lib"/>
     <WARNINGS value="-w-par"/>
   </MACROS>
   <OPTIONS>
-    <IDLCFLAGS value="-I..\..\apps\console\diatheke -I$(BCB)\include -I$(BCB)\include\vcl 
-      -I..\..\include -src_suffix cpp -D_DEBUG -boa"/>
+    <IDLCFLAGS value="-I..\diatheke -I$(BCB)\include -I$(BCB)\include\vcl -I..\..\include 
+      -src_suffix cpp -D_DEBUG -boa"/>
     <CFLAG1 value="-O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -tWC -tWM -c"/>
     <PFLAGS value="-$Y- -$L- -$D- -v -JPHNE -M"/>
     <RFLAGS value=""/>
@@ -82,14 +79,14 @@
 
 [HistoryLists\hlIncludePath]
 Count=3
-Item0=..\..\apps\console\diatheke;$(BCB)\include;$(BCB)\include\vcl;..\..\include
-Item1=..\..\apps\console\diatheke;$(BCB)\include;$(BCB)\include\vcl;..\..\include\
-Item2=..\..\apps\console\diatheke;$(BCB)\include;$(BCB)\include\vcl
+Item0=..\diatheke;$(BCB)\include;$(BCB)\include\vcl;..\..\include
+Item1=..\diatheke;$(BCB)\include;$(BCB)\include\vcl;..\..\include\
+Item2=..\diatheke;$(BCB)\include;$(BCB)\include\vcl
 
 [HistoryLists\hlLibraryPath]
 Count=2
-Item0=..\..\apps\console\diatheke;..\..\lib;$(BCB)\lib\obj;$(BCB)\lib
-Item1=..\..\apps\console\diatheke;$(BCB)\lib\obj;$(BCB)\lib
+Item0=..\diatheke;..\..\lib;$(BCB)\lib\obj;$(BCB)\lib
+Item1=..\diatheke;$(BCB)\lib\obj;$(BCB)\lib
 
 [HistoryLists\hlDebugSourcePath]
 Count=1

Modified: trunk/utilities/bcppmake/imp2gbs.bpf
===================================================================
--- trunk/utilities/bcppmake/imp2gbs.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/imp2gbs.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/imp2ld.bpf
===================================================================
--- trunk/utilities/bcppmake/imp2ld.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/imp2ld.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/imp2vs.bpf
===================================================================
--- trunk/utilities/bcppmake/imp2vs.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/imp2vs.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Added: trunk/utilities/bcppmake/installmgr.bpf
===================================================================
--- trunk/utilities/bcppmake/installmgr.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/installmgr.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,10 @@
+USEUNIT("..\installmgr.cpp");
+USELIB("..\..\..\icu-sword\as_is\borland\icuin.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib");
+USELIB("..\..\..\icu-sword\as_is\borland\icuuc.lib");
+USELIB("..\..\lib\libsword.lib");
+//---------------------------------------------------------------------------
+This file is used by the project manager only and should be treated like the project file
+
+
+main
\ No newline at end of file

Added: trunk/utilities/bcppmake/installmgr.bpr
===================================================================
--- trunk/utilities/bcppmake/installmgr.bpr	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/installmgr.bpr	2005-01-01 04:42:26 UTC (rev 1688)
@@ -0,0 +1,122 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!-- C++Builder XML Project -->
+<PROJECT>
+  <MACROS>
+    <VERSION value="BCB.05.03"/>
+    <PROJECT value="installmgr.exe"/>
+    <OBJFILES value="..\installmgr.obj"/>
+    <RESFILES value=""/>
+    <IDLFILES value=""/>
+    <IDLGENFILES value=""/>
+    <DEFFILE value=""/>
+    <RESDEPEN value="$(RESFILES)"/>
+    <LIBFILES value="..\..\..\icu-sword\as_is\borland\icuin.lib 
+      ..\..\..\icu-sword\as_is\borland\icudatab.lib 
+      ..\..\..\icu-sword\as_is\borland\icuuc.lib ..\..\lib\libsword.lib"/>
+    <LIBRARIES value=""/>
+    <SPARELIBS value=""/>
+    <PACKAGES value="VCL50.bpi VCLX50.bpi bcbsmp50.bpi QRPT50.bpi VCLDB50.bpi VCLBDE50.bpi 
+      ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi 
+      VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi 
+      dclocx50.bpi bcb2kaxserver50.bpi"/>
+    <PATHCPP value=".;.."/>
+    <PATHPAS value=".;"/>
+    <PATHRC value=".;"/>
+    <PATHASM value=".;"/>
+    <DEBUGLIBPATH value="$(BCB)\lib\debug"/>
+    <RELEASELIBPATH value="$(BCB)\lib\release"/>
+    <LINKER value="tlink32"/>
+    <USERDEFINES value="_ICU_;_ICUSWORD_"/>
+    <SYSDEFINES value="NO_STRICT;_NO_VCL"/>
+    <MAINSOURCE value="installmgr.bpf"/>
+    <INCLUDEPATH value="..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl"/>
+    <LIBPATH value="..\;..;..\..\lib;$(BCB)\lib\obj;$(BCB)\lib"/>
+    <WARNINGS value="-w-par"/>
+  </MACROS>
+  <OPTIONS>
+    <IDLCFLAGS value="-I..\. -I.. -I..\..\include -I$(BCB)\include -I$(BCB)\include\vcl 
+      -src_suffix cpp -D_ICU_ -D_ICUSWORD_ -boa"/>
+    <CFLAG1 value="-O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -tWC -tWM -c"/>
+    <PFLAGS value="-$Y- -$L- -$D- -v -JPHNE -M"/>
+    <RFLAGS value=""/>
+    <AFLAGS value="/mx /w2 /zn"/>
+    <LFLAGS value="-D&quot;&quot; -ap -Tpe -x -Gn"/>
+  </OPTIONS>
+  <LINKER>
+    <ALLOBJ value="c0x32.obj $(OBJFILES)"/>
+    <ALLRES value="$(RESFILES)"/>
+    <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32mt.lib"/>
+  </LINKER>
+  <IDEOPTIONS>
+[Version Info]
+IncludeVerInfo=0
+AutoIncBuild=0
+MajorVer=1
+MinorVer=0
+Release=0
+Build=0
+Debug=0
+PreRelease=0
+Special=0
+Private=0
+DLL=0
+Locale=1033
+CodePage=1252
+
+[Version Info Keys]
+CompanyName=
+FileDescription=
+FileVersion=1.0.0.0
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=1.0.0.0
+Comments=
+
+[HistoryLists\hlIncludePath]
+Count=4
+Item0=..\;..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item1=..\;..\..\utilities;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item2=..;..\..\include;$(BCB)\include;$(BCB)\include\vcl
+Item3=..;$(BCB)\include;$(BCB)\include\vcl
+
+[HistoryLists\hlLibraryPath]
+Count=5
+Item0=..\;..;..\..\lib;$(BCB)\lib\obj;$(BCB)\lib
+Item1=..;..\..\lib;$(BCB)\lib\obj;$(BCB)\lib
+Item2=..\;..;$(BCB)\lib\obj;$(BCB)\lib
+Item3=..\;..\..\utilities;$(BCB)\lib\obj;$(BCB)\lib
+Item4=..;$(BCB)\lib\obj;$(BCB)\lib
+
+[HistoryLists\hlDebugSourcePath]
+Count=1
+Item0=$(BCB)\source\vcl
+
+[HistoryLists\hlConditionals]
+Count=2
+Item0=_ICU_;_ICUSWORD_
+Item1=_DEBUG
+
+[Debugging]
+DebugSourceDirs=$(BCB)\source\vcl
+
+[Parameters]
+RunParams=RWP ./ 3 2 abc
+HostApplication=
+RemoteHost=
+RemotePath=
+RemoteDebug=0
+
+[Compiler]
+ShowInfoMsgs=0
+LinkDebugVcl=0
+LinkCGLIB=0
+
+[Language]
+ActiveLang=
+ProjectLang=
+RootDir=
+  </IDEOPTIONS>
+</PROJECT>
\ No newline at end of file

Modified: trunk/utilities/bcppmake/mkfastmod.bpf
===================================================================
--- trunk/utilities/bcppmake/mkfastmod.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/mkfastmod.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/mod2imp.bpf
===================================================================
--- trunk/utilities/bcppmake/mod2imp.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/mod2imp.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/mod2osis.bpf
===================================================================
--- trunk/utilities/bcppmake/mod2osis.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/mod2osis.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/mod2vpl.bpf
===================================================================
--- trunk/utilities/bcppmake/mod2vpl.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/mod2vpl.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/mod2zmod.bpf
===================================================================
--- trunk/utilities/bcppmake/mod2zmod.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/mod2zmod.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/osis2mod.bpf
===================================================================
--- trunk/utilities/bcppmake/osis2mod.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/osis2mod.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/step2vpl.bpf
===================================================================
--- trunk/utilities/bcppmake/step2vpl.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/step2vpl.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/stepdump.bpf
===================================================================
--- trunk/utilities/bcppmake/stepdump.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/stepdump.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/utilities.bpg
===================================================================
--- trunk/utilities/bcppmake/utilities.bpg	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/utilities.bpg	2005-01-01 04:42:26 UTC (rev 1688)
@@ -12,7 +12,7 @@
 PROJECTS = icuuc.lib icuin.lib libsword.lib osis2mod.exe mod2zmod.exe \
   mod2vpl.exe mkfastmod.exe imp2gbs.exe vpl2mod.exe imp2ld.exe imp2vs.exe \
   mod2imp.exe cipherraw.exe step2vpl.exe stepdump.exe mod2osis.exe vs2osisref.exe \
-  diatheke.exe xml2gbs.exe
+  diatheke.exe xml2gbs.exe installmgr.exe
 #------------------------------------------------------------------------------
 default: $(PROJECTS)
 #------------------------------------------------------------------------------
@@ -93,4 +93,8 @@
   $(ROOT)\bin\bpr2mak $**
   $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
 
+installmgr.exe: installmgr.bpr
+  $(ROOT)\bin\bpr2mak $**
+  $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak
 
+

Modified: trunk/utilities/bcppmake/vpl2mod.bpf
===================================================================
--- trunk/utilities/bcppmake/vpl2mod.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/vpl2mod.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/vs2osisref.bpf
===================================================================
--- trunk/utilities/bcppmake/vs2osisref.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/vs2osisref.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/bcppmake/xml2gbs.bpf
===================================================================
--- trunk/utilities/bcppmake/xml2gbs.bpf	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/bcppmake/xml2gbs.bpf	2005-01-01 04:42:26 UTC (rev 1688)
@@ -6,4 +6,5 @@
 //---------------------------------------------------------------------------
 This file is used by the project manager only and should be treated like the project file
 
-
main
\ No newline at end of file
+
+main
\ No newline at end of file

Modified: trunk/utilities/diatheke/pqa/Diatheke.pqa
===================================================================
--- trunk/utilities/diatheke/pqa/Diatheke.pqa	2004-12-30 03:58:55 UTC (rev 1687)
+++ trunk/utilities/diatheke/pqa/Diatheke.pqa	2005-01-01 04:42:26 UTC (rev 1688)
@@ -1,6 +1,8 @@
 Diatheke.pqa
 
-
+
+T®™D–$¡+°¢NH•„XQ'	Jb,(‰Š%q"‰GD	3€ªøPM‰OG“²&RÕ@ŒIbJ°)0£p’D¬
 L(Äœ$)‰˜Q‰\H¢B&
-L
+L
+Îj#¡ˆ¼î<T"æS/V5RìzáÓz\lµPP‹«!”t«øGA"Æpƒµ_
 
\ No newline at end of file



More information about the sword-cvs mailing list