[sword-svn] r3156 - in branches/sword-1-7-x: . bindings bindings/clx/test1 doc examples examples/classes examples/tasks include lib/vcppmake pix src/mgr src/modules/comments/zcom src/modules/common src/modules/filters utilities utilities/diatheke utilities/kylixmake

greg.hellings at crosswire.org greg.hellings at crosswire.org
Wed Apr 16 20:50:37 MST 2014


Author: greg.hellings
Date: 2014-04-16 20:50:37 -0700 (Wed, 16 Apr 2014)
New Revision: 3156

Added:
   branches/sword-1-7-x/doc/QUICKSTART.ubuntu
   branches/sword-1-7-x/examples/classes/flatapilookup.c
   branches/sword-1-7-x/examples/classes/flatapiparsekey.c
   branches/sword-1-7-x/examples/classes/simplechapter.cpp
   branches/sword-1-7-x/examples/tasks/
   branches/sword-1-7-x/examples/tasks/CMakeLists.txt
Removed:
   branches/sword-1-7-x/examples/classes/showchapter.cpp
Modified:
   branches/sword-1-7-x/
   branches/sword-1-7-x/CMakeLists.txt
   branches/sword-1-7-x/ChangeLog
   branches/sword-1-7-x/LICENSE
   branches/sword-1-7-x/bindings/clx/test1/test1.res
   branches/sword-1-7-x/bindings/flatapi.cpp
   branches/sword-1-7-x/configure.ac
   branches/sword-1-7-x/examples/Makefile.am
   branches/sword-1-7-x/examples/classes/Makefile
   branches/sword-1-7-x/examples/tasks/parallelbibles.cpp
   branches/sword-1-7-x/include/bz2comprs.h
   branches/sword-1-7-x/include/defs.h
   branches/sword-1-7-x/include/flatapi.h
   branches/sword-1-7-x/include/swmgr.h
   branches/sword-1-7-x/include/swversion.h
   branches/sword-1-7-x/include/xzcomprs.h
   branches/sword-1-7-x/lib/vcppmake/libsword.vcxproj
   branches/sword-1-7-x/pix/sword.gif
   branches/sword-1-7-x/src/mgr/swmgr.cpp
   branches/sword-1-7-x/src/modules/comments/zcom/zcom.cpp
   branches/sword-1-7-x/src/modules/common/bz2comprs.cpp
   branches/sword-1-7-x/src/modules/common/xzcomprs.cpp
   branches/sword-1-7-x/src/modules/filters/osishtmlhref.cpp
   branches/sword-1-7-x/src/modules/filters/osisplain.cpp
   branches/sword-1-7-x/src/modules/filters/osisrtf.cpp
   branches/sword-1-7-x/src/modules/filters/osisscripref.cpp
   branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp
   branches/sword-1-7-x/src/modules/filters/thmlscripref.cpp
   branches/sword-1-7-x/usrinst.sh
   branches/sword-1-7-x/utilities/diatheke/corediatheke.cpp
   branches/sword-1-7-x/utilities/diatheke/corediatheke.h
   branches/sword-1-7-x/utilities/diatheke/diatheke.cpp
   branches/sword-1-7-x/utilities/kylixmake/mod2zmod.res
   branches/sword-1-7-x/utilities/osis2mod.cpp
Log:
Merged up through r3079.



Property changes on: branches/sword-1-7-x
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:2989-2991,2997,3001-3004,3006
   + /trunk:2989-2991,2997,3001-3004,3006,3010-3013,3015-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3080

Modified: branches/sword-1-7-x/CMakeLists.txt
===================================================================
--- branches/sword-1-7-x/CMakeLists.txt	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/CMakeLists.txt	2014-04-17 03:50:37 UTC (rev 3156)
@@ -15,7 +15,7 @@
 # A CMake port of the SWORD build system... we hope
 PROJECT(libsword CXX C)
 CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
-SET(SWORD_VERSION 1.7.2)
+SET(SWORD_VERSION 1.7.3)
 
 # Make sure it's an out-of-stream build
 IF(${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
@@ -270,6 +270,7 @@
 
 IF(SWORD_BUILD_EXAMPLES STREQUAL "Yes")
 	ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/examples/cmdline")
+	ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/examples/tasks")
 ENDIF(SWORD_BUILD_EXAMPLES STREQUAL "Yes")
 
 ##############################################################################################

Modified: branches/sword-1-7-x/ChangeLog
===================================================================
--- branches/sword-1-7-x/ChangeLog	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/ChangeLog	2014-04-17 03:50:37 UTC (rev 3156)
@@ -8,15 +8,16 @@
 		by "John Austin", which allows removal of references based on
 		a type/subtype combination. .conf usage is:
 		GlobalOptionFilter=OSISReferenceLinks|Option Name|Option Tip
-			|OSIS Reference Type|OSIS Reference SubType|Default Value
+			|OSIS Reference Type|OSIS Reference SubType
+			|Default Value
 		e.g,
 		GlobalOptionFilter=OSISReferenceLinks|Reference Material Links
-			|Hide or show links in the Biblical text to study helps|x-glossary
-			||On
+			|Hide or show links in the Biblical text to study helps
+			|x-glossary||On
 
 14-Aug-2013	Troy A. Griffitts <scribe at crosswire.org>
 	Added new version macros in swversion.h and removed
-		config.h as a packaged and included entity 
+		config.h as a packaged and included entity
 
 2-Aug-2013	Chris Little <chrislit at crosswire.org>
 	Added basic bibliography method to SWModule
@@ -115,10 +116,10 @@
 		C++ SWORD stuff. Wrappers are necessary
 	Added FilterProvider and FilterProviderFactory. They have been
 		created to add the possibility for application to override
-		the default filters (render/strip). To add a custom FilterProvider,
-		subclass DefaultFilterProvider and override the methods that are
-		required to return other filter instances. Then initialize the
-		Factory with this provider
+		the default filters (render/strip). To add a custom
+		FilterProvider, subclass DefaultFilterProvider and override the
+		methods that are required to return other filter instances.
+		Then initialize the Factory with this provider
 		+[FilterProviderFactory initWithImpl:<your impl>]
 
 07-Nov-2012	Chris Little <chrislit at crosswire.org>
@@ -165,8 +166,8 @@
 
 30-Jan-2012	Manfred Bergmann <manfred.bergmann at me.com>
 	Update to Lion Project. All SWORD utils are now in Xcode project and can
-		be built from there. They are however prepared to be used from with
-		Eloquent
+		be built from there. They are however prepared to be used from
+		with Eloquent
 
 07-Dec-2011	Chris Little <chrislit at crosswire.org>
 	Removed SynodalP v11n from library
@@ -212,8 +213,8 @@
 		Added listModulesForType: method.
 		Added convenience constructor for SwordInstallSourceController.
 		SwordLocaleManager can be initialized with a given path to
-		locales.d. Swordbible decodeRef class method will now only pass back
-		values where not NULL was delivered.
+		locales.d. Swordbible decodeRef class method will now only pass
+		back values where not NULL was delivered.
 
 16-Mar-2011 Peter von Kaehne <refdoc at crosswire.org>
 	Introducing localised keys to imp2vs.cpp
@@ -1357,10 +1358,11 @@
 	Changed font copyright notice in n27u4
 
 09-Dec-1997
-	Fixed Search window in BibleCS to search currently focused Bible Text module
-		and report such in the title bar.
+	Fixed Search window in BibleCS to search currently focused Bible Text
+		module and report such in the title bar.
 	Added ALPHA website to the CD Loader
-	Added a full report of the About section of a module when installing. (BibleCS)
+	Added a full report of the About section of a module when installing.
+		(BibleCS)
 	Renamed module n26u4 to n27u4.
 
 04-Dec-1997
@@ -1376,8 +1378,9 @@
 	Added SWFilter and modified appropriate modules to use these.
 	Added RawGBF class that automatically adds a GBFPlain filter to
 		strip GBF tags before searching.
-	Added sword/frontend/windoze/cbuilder/biblecs frontend.  To build, use cmdline
-		compiler: make -fsword  DO NOT OPEN sword.mak WITH C++BUILDER
+	Added sword/frontend/windoze/cbuilder/biblecs frontend.  To build, use
+		cmdline compiler: make -fsword  DO NOT OPEN sword.mak WITH
+		C++BUILDER
 	Added sword/frontend/windoze/cbuilder/biblecs/cdstartup for autorun
 		CDROMs.
 	Made some functions const.
@@ -1399,16 +1402,17 @@
 	Added .Search() method to SWModule
 	Added SWListKey key type to facilitate lists of verses (used by .Search)
 	Added .Headings() boolean method to VerseKey to allow incrementor to
-		work including or excluding headers (e.g. chapter/book/testm/mod)
+		work including or excluding headers (e.g.
+		chapter/book/testm/mod)
 	Started z series of modules for compression access using the compression
 		algorithms in the STEP specs.  (These are either not done or
 		extremely unstable, be warned ;)
 	Added .Index() method to VerseKey
 	Changed VerseKey incrementors to use Index(Index() [+-] val) instead of
 		counting on Normalize();
-	Added checks and output appropriate in VerseKey.freshtext() for headings.
-		This also fixed some bugs when trying to display VerseKey when
-		indexed to a heading.
+	Added checks and output appropriate in VerseKey.freshtext() for
+		headings. This also fixed some bugs when trying to display
+		VerseKey when indexed to a heading.
 	Added frontend/widoze/Delphi20/swtxtdsp: the beginings of a Delphi RTF
 		control.
 	Changed Makefiles slightly for more logical compiles.
@@ -1422,7 +1426,8 @@
 8-Apr-1996
 	Fixed bug in VerseKey for old testament references!
 	Fixed VerseKey from crashing when set with text that it cannot parse.
-	Removed the need for Keys data files.  Added information instead to canon.h
+	Removed the need for Keys data files.  Added information instead to
+		canon.h
 	Added procedural API (frontend/windoze/bcowl25/swordapi) and 16 & 32
 		bit DLLs for windoze (sword16.dll; sword32.dll).
 	Added Delphi components (frontend/windoze/delphi20/swordvc) and
@@ -1441,9 +1446,9 @@
 	Added module 'vines' (Vine's Bible Dictionary)
 	Added executable demo 'lookup' that used RawLD and the 'eastons'and
 		'vines' modules to lookup argv[1] (module decided by argv[2])
-	Moved sword/frontend/windows/bcowl25 to examples/windoze/bcowl25/multimod
-		and added lexicon/dictionary support to demo. (Highligh a word and
-		right-click for menu)
+	Moved sword/frontend/windows/bcowl25 to
+		examples/windoze/bcowl25/multimod and added lexicon/dictionary
+		support to demo. (Highligh a word and right-click for menu)
 	Fixed VerseKey post-increment bug (operator ++(int))
 	... once again: probably more that I forgot ...
 

Modified: branches/sword-1-7-x/LICENSE
===================================================================
--- branches/sword-1-7-x/LICENSE	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/LICENSE	2014-04-17 03:50:37 UTC (rev 3156)
@@ -1,23 +1,23 @@
-The SWORD Project is (c) 1994-2006 The CrossWire Bible Society, under the
+The SWORD Project is (c) 1994-2014 The CrossWire Bible Society, under the
 terms of the GNU GPL, as stated below.
 
 NOTE: The text of the GNU GPL license is copyrighted by the Free Software
-Foundation, Inc., but The SWORD Project is copyrighted Corporately under:
+Foundation, Inc., but The SWORD Project is copyrighted corporately by:
 
 		CrossWire Bible Society
 		P. O. Box 2528
 		Tempe, AZ  85280-2528
 
 _________________________________________________________________
-		    GNU GENERAL PUBLIC LICENSE
-			  Version 2, June 1991
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
 
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-					 675 Mass Ave, Cambridge, MA 02139, USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-			    Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -26,7 +26,7 @@
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -66,8 +66,8 @@
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
+
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -121,7 +121,7 @@
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -179,7 +179,7 @@
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -236,7 +236,7 @@
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -266,7 +266,7 @@
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-			    NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -288,10 +288,10 @@
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-			END OF TERMS AND CONDITIONS
-
-	Appendix: How to Apply These Terms to Your New Programs
+                     END OF TERMS AND CONDITIONS
 
+            How to Apply These Terms to Your New Programs
+
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
 free software which everyone can redistribute and change under these terms.
@@ -302,7 +302,7 @@
 the "copyright" line and a pointer to where the full notice is found.
 
     <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) 19yy  <name of author>
+    Copyright (C) <year>  <name of author>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -314,16 +314,16 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
 If the program is interactive, make it output a short notice like this
 when it starts in an interactive mode:
 
-    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision version 69, Copyright (C) year name of author
     Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
     This is free software, and you are welcome to redistribute it
     under certain conditions; type `show c' for details.
@@ -346,5 +346,5 @@
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.


Property changes on: branches/sword-1-7-x/bindings/clx/test1/test1.res
___________________________________________________________________
Deleted: svn:keywords
   - author date id
Deleted: svn:eol-style
   - native
Added: svn:mime-type
   + application/octet-stream

Modified: branches/sword-1-7-x/bindings/flatapi.cpp
===================================================================
--- branches/sword-1-7-x/bindings/flatapi.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/bindings/flatapi.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *
  * $Id$
  *
- * Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2002-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -21,361 +21,1201 @@
  *
  */
 
-#include <stdio.h>
- 
-#include <rawtext.h>
-#include <rawcom.h>
-#include <rawld.h>
-#include <strkey.h>
-#include <listkey.h>
+#include <iostream>
+#include <vector>
+#include <map>
+
+#include <swversion.h>
+#include <swmgr.h>
+#include <installmgr.h>
 #include <versekey.h>
-#include <swmgr.h>
-#include <markupfiltmgr.h>
-#ifndef NO_SWORD_NAMESPACE
-using namespace sword;
-#endif
+#include <treekeyidx.h>
+#include <swbuf.h>
+#include <localemgr.h>
+#include <utilstr.h>
+#include "corba/orbitcpp/webmgr.hpp"
+
 extern "C" {
-#include "flatapi.h"
+#include <flatapi.h>
 }
 
-typedef struct {
-	ModMap::iterator it;
-//	void *it;
-	ModMap::iterator end;
-//	void *end;
-} ModItType;
+using sword::VerseKey;
+using sword::SWVersion;
+using sword::SWBuf;
+using sword::TreeKeyIdx;
 
 
-//-----------------------------------------------------------------
-// SWMgr methods
+#define GETSWMGR(handle, failReturn) HandleSWMgr *hmgr = (HandleSWMgr *)hSWMgr; if (!hmgr) return failReturn; WebMgr *mgr = hmgr->mgr; if (!mgr) return failReturn;
+
+#define GETSWMODULE(handle, failReturn) HandleSWModule *hmod = (HandleSWModule *)hSWModule; if (!hmod) return failReturn; SWModule *module = hmod->mod; if (!module) return failReturn;
+
+
+namespace {
+
+
+void clearStringArray(const char ***stringArray) {
+	if (*stringArray) {
+		for (int i = 0; true; ++i) {
+			if ((*stringArray)[i]) {
+				delete [] (*stringArray)[i];
+			}
+			else break;
+		}
+		free((*stringArray));
+		(*stringArray) = 0;
+	}
+}
+
+
+class HandleSWModule {
+public:
+	SWModule *mod;
+	char *renderBuf;
+	char *stripBuf;
+	char *renderHeader;
+	char *rawEntry;
+	char *configEntry;
+	// making searchHits cache static saves memory only having a single
+	// outstanding copy, but also is not threadsafe.  Remove static here
+	// and fix compiling bugs and add clearSearchHits() to d-tor to change
+	static org_crosswire_sword_SearchHit *searchHits;
+	static const char **entryAttributes;
+	static const char **parseKeyList;
+	static const char **keyChildren;
+
+	HandleSWModule(SWModule *mod) {
+		this->mod = mod;
+		this->renderBuf = 0;
+		this->stripBuf = 0;
+		this->renderHeader = 0;
+		this->rawEntry = 0;
+		this->configEntry = 0;
+	}
+	~HandleSWModule() {
+		delete [] renderBuf;
+		delete [] stripBuf;
+		delete [] renderHeader;
+		delete [] rawEntry;
+		delete [] configEntry;
+	}
+
+	static void clearSearchHits() {
+		if (searchHits) {
+			for (int i = 0; true; ++i) {
+				if (searchHits[i].modName) {
+					delete [] searchHits[i].modName;
+					delete [] searchHits[i].key;
+				}
+				else break;
+			}
+			free(searchHits);
+			searchHits = 0;
+		}
+	}
+	static void clearEntryAttributes() {
+		clearStringArray(&entryAttributes);
+	}
+	static void clearParseKeyList() {
+		clearStringArray(&parseKeyList);
+	}
+	static void clearKeyChildren() {
+		clearStringArray(&keyChildren);
+	}
+};
+
+
+class HandleSWMgr {
+public:
+	WebMgr *mgr;
+	org_crosswire_sword_ModInfo *modInfo;
+	std::map<SWModule *, HandleSWModule *> moduleHandles;
+	SWBuf filterBuf;
+	static const char **globalOptions;
+	static const char **globalOptionValues;
+	static const char **availableLocales;
+
+	HandleSWMgr(WebMgr *mgr) {
+		this->mgr = mgr;
+		this->modInfo = 0;
+	}
+
+	void clearModInfo() {
+		if (modInfo) {
+			for (int i = 0; true; ++i) {
+				if (modInfo[i].name) {
+					delete [] modInfo[i].name;
+					delete [] modInfo[i].description;
+					delete [] modInfo[i].category;
+					delete [] modInfo[i].language;
+				}
+				else break;
+			}
+			free(modInfo);
+			modInfo = 0;
+		}
+	}
+
+	~HandleSWMgr() {
+		clearModInfo();
+		for (std::map<SWModule *, HandleSWModule *>::iterator it = moduleHandles.begin(); it != moduleHandles.end(); ++it) {
+			delete it->second;
+		}
+		delete mgr;
+	}
+
+	HandleSWModule *getModuleHandle(SWModule *mod) {
+		if (!mod) return 0;
+		if (moduleHandles.find(mod) == moduleHandles.end()) {
+			moduleHandles[mod] = new HandleSWModule(mod);
+		}
+		return moduleHandles[mod];
+	}
+
+	static void clearGlobalOptions() {
+		clearStringArray(&globalOptions);
+	}
+
+	static void clearGlobalOptionValues() {
+		clearStringArray(&globalOptionValues);
+	}
+
+	static void clearAvailableLocales() {
+		clearStringArray(&availableLocales);
+	}
+};
+
+
+org_crosswire_sword_SearchHit *HandleSWModule::searchHits = 0;
+const char **HandleSWModule::entryAttributes = 0;
+const char **HandleSWModule::parseKeyList = 0;
+const char **HandleSWModule::keyChildren = 0;
+
+const char **HandleSWMgr::globalOptions = 0;
+const char **HandleSWMgr::globalOptionValues = 0;
+const char **HandleSWMgr::availableLocales = 0;
+
+class InitStatics {
+public:
+	InitStatics() {
+// these are redundant with the static declarations above, but ??? doesn't hurt
+		HandleSWModule::searchHits = 0;
+		HandleSWModule::entryAttributes = 0;
+		HandleSWModule::parseKeyList = 0;
+		HandleSWModule::keyChildren = 0;
+
+		HandleSWMgr::globalOptions = 0;
+		HandleSWMgr::globalOptionValues = 0;
+		HandleSWMgr::availableLocales = 0;
+	}
+	~InitStatics() {
+		HandleSWModule::clearSearchHits();
+		HandleSWModule::clearEntryAttributes();
+		HandleSWModule::clearParseKeyList();
+		HandleSWModule::clearKeyChildren();
+
+		HandleSWMgr::clearGlobalOptions();
+		HandleSWMgr::clearGlobalOptionValues();
+	}
+} _initStatics;
+
+}
+
+
+
+
 //
-extern "C" SWHANDLE SWMgr_new(char filterType) { 
-	return (SWHANDLE) new SWMgr(new MarkupFilterMgr(filterType));
+// SWModule methods
+//
+//
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    terminateSearch
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_terminateSearch
+  (SWHANDLE hSWModule) {
+
+	GETSWMODULE(hSWModule, );
+
+	module->terminateSearch = true;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    search
+ * Signature: (Ljava/lang/String;IJLjava/lang/String;Lorg/crosswire/android/sword/SWModule/SearchProgressReporter;)[Lorg/crosswire/android/sword/SWModule/SearchHit;
+ */
+const struct org_crosswire_sword_SearchHit * SWDLLEXPORT org_crosswire_sword_SWModule_search
+  (SWHANDLE hSWModule, const char *searchString, int searchType, long flags, const char *scope, SWHANDLE progressReporter) {
 
-// SWConfig *, SWConfig *, bool, SWFilterMgr *
-SWHANDLE SWMgr_newEx(SWHANDLE hiconfig, SWHANDLE hisysconfig, char autoload, SWHANDLE hfilterMgr) {
-	SWConfig *iconfig = (SWConfig *)hiconfig;
-	SWConfig *isysconfig = (SWConfig *)hisysconfig;
-	SWFilterMgr *filterMgr = (SWFilterMgr *)hfilterMgr;
+	GETSWMODULE(hSWModule, 0);
+
+	hmod->clearSearchHits();
+
+	sword::ListKey lscope;
+	sword::ListKey result;
+
+
+	if ((scope) && (strlen(scope)) > 0) {
+		sword::SWKey *p = module->createKey();
+        	sword::VerseKey *parser = SWDYNAMIC_CAST(VerseKey, p);
+	        if (!parser) {
+        		delete p;
+	                parser = new VerseKey();
+	        }
+	        *parser = module->getKeyText();
+		lscope = parser->parseVerseList(scope, *parser, true);
+		result = module->search(searchString, searchType, flags, &lscope);
+                delete parser;
+	}
+	else	result = module->search(searchString, searchType, flags);
+
+	int count = 0;
+	for (result = sword::TOP; !result.popError(); result++) count++;
+
+	// if we're sorted by score, let's re-sort by verse, because Java can always re-sort by score
+	result = sword::TOP;
+	if ((count) && (long)result.getElement()->userData)
+		result.sort();
+
+	struct org_crosswire_sword_SearchHit *retVal = (struct org_crosswire_sword_SearchHit *)calloc(count+1, sizeof(struct org_crosswire_sword_SearchHit));
 	
-	return (SWHANDLE) new SWMgr(iconfig, isysconfig, autoload, filterMgr);
+	int i = 0;
+	for (result = sword::TOP; !result.popError(); result++) {
+		// don't alloc this; we have a persistent const char * in SWModule we can just reference
+		retVal[i].modName = module->getName();
+		stdstr(&(retVal[i].key), assureValidUTF8(result.getShortText()));
+		retVal[i].score = (long)result.getElement()->userData;
+		// in case we limit count to a max number of hits
+		if (i >= count) break;
+	}
+	hmod->searchHits = retVal;
+	return retVal;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    error
+ * Signature: ()C
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_popError
+  (SWHANDLE hSWModule) {
 
-void SWMgr_delete(SWHANDLE hmgr) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	if (mgr)
-		delete mgr;
+	GETSWMODULE(hSWModule, -1);
+
+	return module->popError();
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getEntrySize
+ * Signature: ()J
+ */
+long SWDLLEXPORT org_crosswire_sword_SWModule_getEntrySize
+  (SWHANDLE hSWModule) {
 
-SWHANDLE SWMgr_getConfig(SWHANDLE hmgr) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	return (mgr) ? (SWHANDLE)mgr->config : 0;
+	GETSWMODULE(hSWModule, 0);
+
+	return module->getEntrySize();
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getEntryAttribute
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWModule_getEntryAttribute
+  (SWHANDLE hSWModule, const char *level1, const char *level2, const char *level3, char filteredBool) {
 
-SWHANDLE SWMgr_getModulesIterator(SWHANDLE hmgr) {
-	static ModItType it;
+	GETSWMODULE(hSWModule, 0);
 
-	SWMgr *mgr = (SWMgr *)hmgr;
-	if (mgr) {
-	    it.it = mgr->Modules.begin();
-	    it.end = mgr->Modules.end();
+	hmod->clearEntryAttributes();
+
+	module->renderText();	// force parse
+	std::vector<SWBuf> results;
+
+	sword::AttributeTypeList &entryAttribs = module->getEntryAttributes();
+	sword::AttributeTypeList::iterator i1Start, i1End;
+	sword::AttributeList::iterator i2Start, i2End;
+	sword::AttributeValue::iterator i3Start, i3End;
+
+	if ((level1) && (*level1)) {
+		i1Start = entryAttribs.find(level1);
+		i1End = i1Start;
+		if (i1End != entryAttribs.end())
+			++i1End;
 	}
-	return (SWHANDLE)&it;
+	else {
+		i1Start = entryAttribs.begin();
+		i1End   = entryAttribs.end();
+	}
+	for (;i1Start != i1End; ++i1Start) {
+		if ((level2) && (*level2)) {
+			i2Start = i1Start->second.find(level2);
+			i2End = i2Start;
+			if (i2End != i1Start->second.end())
+				++i2End;
+		}
+		else {
+			i2Start = i1Start->second.begin();
+			i2End   = i1Start->second.end();
+		}
+		for (;i2Start != i2End; ++i2Start) {
+			if ((level3) && (*level3)) {
+				i3Start = i2Start->second.find(level3);
+				i3End = i3Start;
+				if (i3End != i2Start->second.end())
+					++i3End;
+			}
+			else {
+				i3Start = i2Start->second.begin();
+				i3End   = i2Start->second.end();
+			}
+			for (;i3Start != i3End; ++i3Start) {
+				results.push_back(i3Start->second);
+			}
+			if (i3Start != i3End)
+				break;
+		}
+		if (i2Start != i2End)
+			break;
+	}
+
+	const char **retVal = (const char **)calloc(results.size()+1, sizeof(const char *));
+	for (int i = 0; i < results.size(); i++) {
+		if (filteredBool) {
+			stdstr((char **)&(retVal[i]), assureValidUTF8(module->renderText(results[i].c_str())));
+		}
+		else {
+			stdstr((char **)&(retVal[i]), assureValidUTF8(results[i].c_str()));
+		}
+	}
+
+	hmod->entryAttributes = retVal;
+	return retVal;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    parseKeyList
+ * Signature: (Ljava/lang/String;)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWModule_parseKeyList
+  (SWHANDLE hSWModule, const char *keyText) {
 
-SWHANDLE SWMgr_getModuleByName(SWHANDLE hmgr, const char *name) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	return (mgr) ? (SWHANDLE) mgr->Modules[name] : 0;
+	GETSWMODULE(hSWModule, 0);
+
+	hmod->clearParseKeyList();
+
+	sword::VerseKey *parser = dynamic_cast<VerseKey *>(module->getKey());
+	const char **retVal = 0;
+	if (parser) {
+		sword::ListKey result;
+		result = parser->parseVerseList(keyText, *parser, true);
+		int count = 0;
+		for (result = sword::TOP; !result.popError(); result++) {
+			count++;
+		}
+		retVal = (const char **)calloc(count+1, sizeof(const char *));
+		count = 0;
+		for (result = sword::TOP; !result.popError(); result++) {
+			stdstr((char **)&(retVal[count++]), assureValidUTF8(VerseKey(result).getOSISRef()));
+		}
+	}
+	else	{
+		retVal = (const char **)calloc(2, sizeof(const char *));
+		stdstr((char **)&(retVal[0]), assureValidUTF8(keyText));
+	}
+
+	hmod->parseKeyList = retVal;
+	return retVal;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    setKeyText
+ * Signature: (Ljava/lang/String;)V
+ */
+// Special values handled for VerseKey modules:
+//	[+-][book|chapter]	- [de|in]crement by chapter or book
+//	(e.g.	"+chapter" will increment the VerseKey 1 chapter)
+//	[=][key]		- position absolutely and don't normalize
+//	(e.g.	"jn.1.0" for John Chapter 1 intro; "jn.0.0" For Book of John Intro)
+void SWDLLEXPORT org_crosswire_sword_SWModule_setKeyText
+  (SWHANDLE hSWModule, const char *keyText) {
 
-const char *SWMgr_getPrefixPath(SWHANDLE hmgr) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	return (mgr) ? mgr->prefixPath : 0;
+	GETSWMODULE(hSWModule, );
+
+	sword::SWKey *key = module->getKey();
+	sword::VerseKey *vkey = SWDYNAMIC_CAST(VerseKey, key);
+	if (vkey) {
+		if ((*keyText=='+' || *keyText=='-')) {
+			if (!stricmp(keyText+1, "book")) {
+				vkey->setBook(vkey->getBook() + ((*keyText=='+')?1:-1));
+				return;
+			}
+			else if (!stricmp(keyText+1, "chapter")) {
+				vkey->setChapter(vkey->getChapter() + ((*keyText=='+')?1:-1));
+				return;
+			}
+		}
+		else if (*keyText=='=') {
+			vkey->setIntros(true);
+			vkey->setAutoNormalize(false);
+			vkey->setText(keyText+1);
+			return;
+		}
+	}
+
+	module->setKey(keyText);
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getKeyText
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getKeyText
+  (SWHANDLE hSWModule) {
 
-const char *SWMgr_getConfigPath(SWHANDLE hmgr) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	return (mgr) ? mgr->configPath : 0;
+	GETSWMODULE(hSWModule, 0);
+
+	return module->getKeyText();
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    hasKeyChildren
+ * Signature: ()Z
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_hasKeyChildren
+  (SWHANDLE hSWModule) {
 
-void SWMgr_setGlobalOption(SWHANDLE hmgr, const char *option, const char *value) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	if (mgr)
-		mgr->setGlobalOption(option, value);
+	GETSWMODULE(hSWModule, 0);
+
+	sword::SWKey *key = module->getKey();
+	char retVal = 0;
+
+	TreeKeyIdx *tkey = SWDYNAMIC_CAST(TreeKeyIdx, key);
+	if (tkey) {
+		retVal = tkey->hasChildren()?1:0;
+	}
+	return retVal;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getKeyChildren
+ * Signature: ()[Ljava/lang/String;
+ */
 
-const char *SWMgr_getGlobalOption(SWHANDLE hmgr, const char *option) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	return (mgr) ? (const char *)mgr->getGlobalOption(option) : 0;
+// This method returns child nodes for a genbook,
+// but has special handling if called on a VerseKey module:
+//  [0..7] [testament, book, chapter, verse, chapterMax, verseMax, bookName, osisRef]
+const char ** SWDLLEXPORT org_crosswire_sword_SWModule_getKeyChildren
+  (SWHANDLE hSWModule) {
+
+	GETSWMODULE(hSWModule, 0);
+
+	hmod->clearKeyChildren();
+
+	sword::SWKey *key = module->getKey();
+	const char **retVal = 0;
+	int count = 0;
+
+	sword::VerseKey *vkey = SWDYNAMIC_CAST(VerseKey, key);
+	if (vkey) {
+		retVal = (const char **)calloc(9, sizeof(const char *));
+		SWBuf num;
+		num.appendFormatted("%d", vkey->getTestament());
+		stdstr((char **)&(retVal[0]), num.c_str());
+		num = "";
+		num.appendFormatted("%d", vkey->getBook());
+		stdstr((char **)&(retVal[1]), num.c_str());
+		num = "";
+		num.appendFormatted("%d", vkey->getChapter());
+		stdstr((char **)&(retVal[2]), num.c_str());
+		num = "";
+		num.appendFormatted("%d", vkey->getVerse());
+		stdstr((char **)&(retVal[3]), num.c_str());
+		num = "";
+		num.appendFormatted("%d", vkey->getChapterMax());
+		stdstr((char **)&(retVal[4]), num.c_str());
+		num = "";
+		num.appendFormatted("%d", vkey->getVerseMax());
+		stdstr((char **)&(retVal[5]), num.c_str());
+		stdstr((char **)&(retVal[6]), vkey->getBookName());
+		stdstr((char **)&(retVal[7]), vkey->getOSISRef());
+	}
+	else {
+		TreeKeyIdx *tkey = SWDYNAMIC_CAST(TreeKeyIdx, key);
+		if (tkey) {
+			if (tkey->firstChild()) {
+				do {
+					count++;
+				}
+				while (tkey->nextSibling());
+				tkey->parent();
+			}
+			retVal = (const char **)calloc(count+1, sizeof(const char *));
+			count = 0;
+			if (tkey->firstChild()) {
+				do {
+					stdstr((char **)&(retVal[count++]), assureValidUTF8(tkey->getLocalName()));
+				}
+				while (tkey->nextSibling());
+				tkey->parent();
+			}
+		}
+	}
+
+	hmod->keyChildren = retVal;
+	return retVal;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getName
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getName
+  (SWHANDLE hSWModule) {
 
-const char *SWMgr_getGlobalOptionTip(SWHANDLE hmgr, const char *option) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	return (mgr) ? (const char *)mgr->getGlobalOptionTip(option) : 0;
+	GETSWMODULE(hSWModule, 0);
+
+	return module->getName();
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getDescription
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getDescription
+  (SWHANDLE hSWModule) {
 
-// ret: forward_iterator
-SWHANDLE SWMgr_getGlobalOptionsIterator(SWHANDLE hmgr) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	static StringList::iterator it;
-	static StringList optionslist;
-	if (mgr) {
-		optionslist = mgr->getGlobalOptions();
-		it = optionslist.begin();
+	GETSWMODULE(hSWModule, 0);
+
+	return module->getDescription();
+}
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getCategory
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getCategory
+  (SWHANDLE hSWModule) {
+
+	static SWBuf type;
+
+	GETSWMODULE(hSWModule, 0);
+
+	type = module->getType();
+	SWBuf cat = module->getConfigEntry("Category");
+	if (cat.length() > 0)
+		type = cat;
+
+	return type.c_str();
+}
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getKeyParent
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getKeyParent
+  (SWHANDLE hSWModule) {
+
+	static SWBuf retVal;
+
+	GETSWMODULE(hSWModule, 0);
+
+	sword::SWKey *key = module->getKey();
+
+	retVal = "";
+
+	TreeKeyIdx *tkey = SWDYNAMIC_CAST(TreeKeyIdx, key);
+	if (tkey) {
+		if (tkey->parent()) {
+			retVal = tkey->getText();
+		}
 	}
-	return (SWHANDLE)&it;
+	return assureValidUTF8(retVal.c_str());
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    previous
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_previous
+  (SWHANDLE hSWModule) {
 
-// ret: forward_iterator
-SWHANDLE SWMgr_getGlobalOptionValuesIterator(SWHANDLE hmgr, const char *option) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	static StringList::iterator it;
-	
-	if (mgr) 
-		it = mgr->getGlobalOptionValues(option).begin();
-	return (SWHANDLE)&it;
+	GETSWMODULE(hSWModule, );
+
+	module->decrement();
 }
 
 
-void SWMgr_setCipherKey(SWHANDLE hmgr, const char *modName, const char *key) {
-	SWMgr *mgr = (SWMgr *)hmgr;
-	if (mgr)
-		mgr->setCipherKey(modName, key);
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    next
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_next
+  (SWHANDLE hSWModule) {
+
+	GETSWMODULE(hSWModule, );
+
+	module->increment();
 }
 
 
-//-----------------------------------------------------------------
-// SWModule methods
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    begin
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_begin
+  (SWHANDLE hSWModule) {
 
-// static void nullPercent (char percent, void *userData);
-void SWModule_terminateSearch(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	if (module)
-		module->terminateSearch = true;
+	GETSWMODULE(hSWModule, );
+
+	module->setPosition(sword::TOP);
 }
 
-// SWModule (const const char *imodname = 0, const const char *imoddesc = 0, SWDisplay * idisp = 0, const char *imodtype = 0, SWTextEncoding encoding = ENC_UNKNOWN, SWTextDirection dir = DIRECTION_LTR, SWTextMarkup markup = FMT_UNKNOWN, const char* modlang = 0);
-// virtual ~ SWModule ();
 
-SWHANDLE SWModule_doSearch(SWHANDLE hmodule, const char *searchString, int type, int params ,void (*percent) (char, void *), void *percentUserData) {
-	
-	static ListKey results;
-	SWKey * scope = 0;
-	SWModule *module = (SWModule *)hmodule;
-	if (!module) 	
-		return -1;
-	
-	results.clear();
-	results = module->search(searchString, type, params, scope, 0, percent, (void *) &percentUserData);
-	
-	return (SWHANDLE)&results;
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getStripText
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_stripText
+  (SWHANDLE hSWModule) {
+
+	GETSWMODULE(hSWModule, 0);
+
+	stdstr(&(hmod->stripBuf), assureValidUTF8((const char *)module->stripText()));
+
+	return hmod->stripBuf;
 }
-  /** Gets and clears error status
-  *
-  * @return error status
-  */
-char SWModule_error(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (module) ? module->popError() : 0;
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getRenderText
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_renderText
+  (SWHANDLE hSWModule) {
+
+	GETSWMODULE(hSWModule, 0);
+
+	stdstr(&(hmod->renderBuf), assureValidUTF8((const char *)module->renderText().c_str()));
+
+	return hmod->renderBuf;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getRenderHeader
+ * Signature: ()Ljava/lang/String;
+ */
+// CSS styles associated with this text
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getRenderHeader
+  (SWHANDLE hSWModule) {
 
-int SWModule_getEntrySize(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (module) ? module->getEntrySize() : 0;
+	GETSWMODULE(hSWModule, 0);
+
+	stdstr(&(hmod->renderHeader), assureValidUTF8(((const char *)(module->getRenderHeader() ? module->getRenderHeader():""))));
+
+	return hmod->renderHeader;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getRawEntry
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getRawEntry
+  (SWHANDLE hSWModule) {
 
-void SWModule_setKeyText(SWHANDLE hmodule, const char *key) {
-	SWModule *module = (SWModule *)hmodule;
-	if (module)
-		module->setKey(key);
+	GETSWMODULE(hSWModule, 0);
+
+	stdstr(&(hmod->rawEntry), assureValidUTF8(((const char *)module->getRawEntry())));
+
+	return hmod->rawEntry;
 }
 
-//  virtual char setKey (const SWKey &ikey);
-//  virtual SWKey & Key () const {
-  
-const char *SWModule_getKeyText(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (const char *)((module) ? module->getKeyText() : 0);
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    setRawEntry
+ * Signature: (Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_setRawEntry
+  (SWHANDLE hSWModule, const char *entryBuffer) {
+
+	GETSWMODULE(hSWModule, );
+
+	module->setEntry(entryBuffer);
 }
-  
 
-//  virtual char Display ();
-//  virtual SWDisplay *Disp (SWDisplay * idisp = 0);
-  
-const char *SWModule_getName(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (const char *)((module) ? module->getName() : 0);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getConfigEntry
+ * Signature: (Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getConfigEntry
+  (SWHANDLE hSWModule, const char *key) {
+
+	GETSWMODULE(hSWModule, 0);
+
+	stdstr(&(hmod->configEntry), (module->getConfigEntry(key) ? assureValidUTF8(module->getConfigEntry(key)).c_str() : 0));
+
+	return hmod->configEntry;
 }
-  
 
-const char *SWModule_getDescription(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (const char *)((module) ? module->getDescription() : 0);
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    deleteSearchFramework
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_deleteSearchFramework
+  (SWHANDLE hSWModule) {
+
+	GETSWMODULE(hSWModule, );
+
+	module->deleteSearchFramework(); 
 }
 
 
-const char *SWModule_getType(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (const char *)((module) ? module->getType() : 0);
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    hasSearchFramework
+ * Signature: ()Z
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_hasSearchFramework
+  (SWHANDLE hSWModule) {
+
+	GETSWMODULE(hSWModule, 0);
+
+	return (module->hasSearchFramework() && module->isSearchOptimallySupported("God", -4, 0, 0));
 }
 
 
-void SWModule_previous(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	if (module)
-		(*module)--;
+
+
+//
+// SWMgr methods
+//
+//
+
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    new
+ * Signature: ()V
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_new() { 
+	SWConfig *sysConf = 0;
+	return (SWHANDLE) new HandleSWMgr(new WebMgr(sysConf));
 }
 
 
-void SWModule_next(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	if (module)
-		(*module)++;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    delete
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_delete(SWHANDLE hSWMgr) {
+	HandleSWMgr *hmgr = (HandleSWMgr *)hSWMgr;
+	if (hmgr) delete hmgr;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    version
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_version
+  (SWHANDLE hSWMgr) {
+	// we don't actually need an SWMgr to get version
+	static SWVersion v;
+	return v.currentVersion;
+}
 
-void SWModule_begin(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	if (module)
-		(*module) = TOP;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getModInfoList
+ * Signature: ()[Lorg/crosswire/android/sword/SWMgr/ModInfo;
+ */
+const struct org_crosswire_sword_ModInfo * SWDLLEXPORT org_crosswire_sword_SWMgr_getModInfoList
+  (SWHANDLE hSWMgr) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	sword::SWModule *module = 0;
+
+	hmgr->clearModInfo();
+
+	int size = 0;
+	for (sword::ModMap::iterator it = mgr->Modules.begin(); it != mgr->Modules.end(); ++it) {
+		if ((!(it->second->getConfigEntry("CipherKey"))) || (*(it->second->getConfigEntry("CipherKey"))))
+			size++;
+	}
+
+	struct org_crosswire_sword_ModInfo *milist = (struct org_crosswire_sword_ModInfo *)calloc(size+1, sizeof(struct org_crosswire_sword_ModInfo));
+	int i = 0;
+	for (sword::ModMap::iterator it = mgr->Modules.begin(); it != mgr->Modules.end(); ++it) {
+		module = it->second;
+		if ((!(module->getConfigEntry("CipherKey"))) || (*(module->getConfigEntry("CipherKey")))) {
+			SWBuf type = module->getType();
+			SWBuf cat = module->getConfigEntry("Category");
+			if (cat.length() > 0)
+				type = cat;
+			stdstr(&(milist[i].name), assureValidUTF8(module->getName()));
+			stdstr(&(milist[i].description), assureValidUTF8(module->getDescription()));
+			stdstr(&(milist[i].category), assureValidUTF8(type.c_str()));
+			stdstr(&(milist[i++].language), assureValidUTF8(module->getLanguage()));
+			if (i >= size) break;
+		}
+	}
+	hmgr->modInfo = milist;
+	return milist;
 }
-  
-  
-const char *SWModule_getStripText(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (const char *)((module) ? module->stripText() : 0);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getModuleByName
+ * Signature: (Ljava/lang/String;)Lorg/crosswire/android/sword/SWModule;
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_getModuleByName
+  (SWHANDLE hSWMgr, const char *moduleName) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	return (SWHANDLE)hmgr->getModuleHandle(hmgr->mgr->getModule(moduleName));
 }
-  
-  
-const char *SWModule_getRenderText(SWHANDLE hmodule) {
-	SWModule *module = (SWModule *)hmodule;
-	return (const char *)((module) ? module->renderText().c_str() : 0);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getPrefixPath
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getPrefixPath
+  (SWHANDLE hSWMgr) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	return mgr->prefixPath;
 }
 
-const char *SWModule_getEntryAttributes(SWHANDLE hmodule, const char *level1, const char *level2, const char *level3) {
-	SWModule *module = (SWModule *)hmodule;
-	static SWBuf retval;	
-	module->renderText();                 	
-	retval = module->getEntryAttributes()[level1][level2][level3].c_str();
-	return (retval.length()) ? (const char*)retval.c_str() : NULL;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getConfigPath
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getConfigPath
+  (SWHANDLE hSWMgr) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	return mgr->configPath;
 }
 
-const char *SWModule_getPreverseHeader(SWHANDLE hmodule, const char *key, int pvHeading) {
-	SWModule *module = (SWModule *)hmodule;
-	static SWBuf preverseHeading;
-	char buf[12];	
-	sprintf(buf, "%i", pvHeading);  
-	module->setKey(key);	
-	module->renderText();                 	
-	preverseHeading = module->getEntryAttributes()["Heading"]["Preverse"][buf].c_str();
-	return (preverseHeading.length()) ? (const char*)preverseHeading.c_str() : NULL;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setGlobalOption
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setGlobalOption
+  (SWHANDLE hSWMgr, const char *option, const char *value) {
+
+	GETSWMGR(hSWMgr, );
+	mgr->setGlobalOption(option, value);
 }
 
-const char *SWModule_getFootnoteType(SWHANDLE hmodule, const char *key, const char *note) {
-	SWModule *module = (SWModule *)hmodule;
-	static SWBuf type;
-	module->popError();
-	module->setKey(key);
-	module->renderText();	
-	type = module->getEntryAttributes()["Footnote"][note]["type"].c_str();
-	return (type) ? (const char*)type.c_str() : NULL;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOption
+ * Signature: (Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOption
+  (SWHANDLE hSWMgr, const char *option) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	return mgr->getGlobalOption(option);
 }
 
-const char *SWModule_getFootnoteBody(SWHANDLE hmodule, const char *key, const char *note) {
-	SWModule *module = (SWModule *)hmodule;
-	static SWBuf body;
-	module->popError();
-	module->setKey(key);
-	module->renderText();
-	body = module->getEntryAttributes()["Footnote"][note]["body"].c_str();
-	SWKey *keybuf = module->getKey();;
-	module->renderFilter(body, keybuf);
-	return (body) ? (const char*)body.c_str() : NULL;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOptionTip
+ * Signature: (Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptionTip
+  (SWHANDLE hSWMgr, const char *option) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	return mgr->getGlobalOptionTip(option);
 }
 
-const char *SWModule_getFootnoteRefList(SWHANDLE hmodule, const char *key, const char *note) {
-	SWModule *module = (SWModule *)hmodule;
-	static SWBuf refList;
-	module->popError();
-	module->setKey(key);
-	module->renderText();	
-	refList = module->getEntryAttributes()["Footnote"][note]["refList"].c_str();
-	return (refList) ? (const char*)refList.c_str() : NULL;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    filterText
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_filterText
+  (SWHANDLE hSWMgr, const char *filterName, const char *text) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	hmgr->filterBuf = text;
+
+// why was this in bindings/corba/omniorb?
+//	mgr->setGlobalOption("Greek Accents", "Off");
+
+	char errStatus = mgr->filterText(filterName, hmgr->filterBuf);
+	return hmgr->filterBuf.c_str();
 }
 
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOptions
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptions
+  (SWHANDLE hSWMgr) {
 
+	GETSWMGR(hSWMgr, 0);
 
-SWHANDLE listkey_getVerselistIterator(const char *list, const char *key, const char *v11n) {
-	VerseKey versekey;
-        versekey.setVersificationSystem(v11n);
-	static ListKey verses;
-	
-	versekey.setText(key);
-	verses.clear();
-	verses = versekey.parseVerseList(list, versekey);
-	return (SWHANDLE)&verses;
+	const char **retVal;
+	hmgr->clearGlobalOptions();
+
+	sword::StringList options = mgr->getGlobalOptions();
+	int count = 0;
+	for (sword::StringList::iterator it = options.begin(); it != options.end(); ++it) {
+		count++;
+	}
+	retVal = (const char **)calloc(count+1, sizeof(const char *));
+	count = 0;
+	for (sword::StringList::iterator it = options.begin(); it != options.end(); ++it) {
+		stdstr((char **)&((*retVal)[count++]), it->c_str());
+	}
+
+	hmgr->globalOptions = retVal;
+	return retVal;
 }
 
-//-----------------------------------------------------------------
-// stringlist_iterator methods
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOptionValues
+ * Signature: (Ljava/lang/String;)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptionValues
+  (SWHANDLE hSWMgr, const char *option) {
 
-void stringlist_iterator_next(SWHANDLE hsli) {
-	StringList::iterator *sli = (StringList::iterator *)hsli;
-	(*sli)++;
+	GETSWMGR(hSWMgr, 0);
+
+	const char **retVal = 0;
+	hmgr->clearGlobalOptionValues();
+
+	sword::StringList options = mgr->getGlobalOptionValues(option);
+	int count = 0;
+	for (sword::StringList::iterator it = options.begin(); it != options.end(); ++it) {
+		count++;
+	}
+	retVal = (const char **)calloc(count+1, sizeof(const char *));
+	count = 0;
+	for (sword::StringList::iterator it = options.begin(); it != options.end(); ++it) {
+		stdstr((char **)&((*retVal)[count++]), it->c_str());
+	}
+
+	hmgr->globalOptionValues = retVal;
+	return retVal;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setCipherKey
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setCipherKey
+  (SWHANDLE hSWMgr, const char *modName, const char *key) {
 
-const char *stringlist_iterator_val(SWHANDLE hsli) {
-	StringList::iterator *sli = (StringList::iterator *)hsli;
-	return (const char *)(*sli)->c_str();
+	GETSWMGR(hSWMgr, );
+
+	mgr->setCipherKey(modName, key);
 }
 
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setJavascript
+ * Signature: (Z)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setJavascript
+  (SWHANDLE hSWMgr, char valueBool) {
 
+	GETSWMGR(hSWMgr, );
 
-//-----------------------------------------------------------------
-// listkey_iterator methods
+	mgr->setJavascript(valueBool);
+}
 
-void listkey_iterator_next(SWHANDLE lki) {
-	ListKey *lk = (ListKey*)lki;
-	(*lk)++;
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getAvailableLocales
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getAvailableLocales
+  (SWHANDLE hSWMgr) {
+
+	GETSWMGR(hSWMgr, 0);
+
+	hmgr->clearAvailableLocales();
+	sword::StringList localeNames = LocaleMgr::getSystemLocaleMgr()->getAvailableLocales();
+	const char **retVal = 0;
+	int count = 0;
+	for (sword::StringList::iterator it = localeNames.begin(); it != localeNames.end(); ++it) {
+		count++;
+	}
+	retVal = (const char **)calloc(count+1, sizeof(const char *));
+	count = 0;
+	for (sword::StringList::iterator it = localeNames.begin(); it != localeNames.end(); ++it) {
+		stdstr((char **)&((*retVal)[count++]), it->c_str());
+	}
+
+	hmgr->availableLocales = retVal;
+	return retVal;
 }
 
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setDefaultLocale
+ * Signature: (Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setDefaultLocale
+  (SWHANDLE hSWMgr, const char *name) {
 
-const char *listkey_iterator_val(SWHANDLE lki) {	
-	ListKey *lk = (ListKey*)lki;
-	if(!lk->popError())
-		return (const char *) lk->getText();
-	return NULL;
+	// we don't actually need an SWMgr instance for this
+	GETSWMGR(hSWMgr, );
+
+	LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(name);
 }
 
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    translate
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_translate
+  (SWHANDLE hSWMgr, const char *text, const char *localeName) {
 
+	GETSWMGR(hSWMgr, 0);
 
-//-----------------------------------------------------------------
-// modmap methods
+	return LocaleMgr::getSystemLocaleMgr()->translate(text, localeName);
+}
 
-void ModList_iterator_next(SWHANDLE hmmi) {
-	ModItType *it  = (ModItType *)hmmi;
-	if (it->it != it->end)
-		it->it++;
+
+
+
+//
+// InstallMgr methods
+//
+//
+
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    reInit
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_InstallMgr_reInit
+  (SWHANDLE hInstallMgr) {}
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    setUserDisclaimerConfirmed
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_InstallMgr_setUserDisclaimerConfirmed
+  (SWHANDLE hInstallMgr) {}
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    syncConfig
+ * Signature: ()I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_syncConfig
+  (SWHANDLE hInstallMgr) {
+
+	return 0;
 }
 
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    uninstallModule
+ * Signature: (Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_uninstallModule
+  (SWHANDLE hInstallMgr, const char *) {
 
-SWHANDLE ModList_iterator_val(SWHANDLE hmmi) {
-	ModItType *it  = (ModItType *)hmmi;
-	return (it->it != it->end) ? (SWHANDLE)it->it->second : 0;
+	return 0;
 }
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    getRemoteSources
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteSources
+  (SWHANDLE hInstallMgr) {
+
+	return 0;
+}
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    refreshRemoteSource
+ * Signature: (Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_refreshRemoteSource
+  (SWHANDLE hInstallMgr, const char *) {
+
+	return 0;
+}
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    getRemoteModInfoList
+ * Signature: (Ljava/lang/String;)[Lorg/crosswire/android/sword/SWMgr/ModInfo;
+ */
+const struct org_crosswire_sword_ModInfo * SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteModInfoList
+  (SWHANDLE hInstallMgr, const char *) {
+
+	return 0;
+}
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    remoteInstallModule
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_remoteInstallModule
+  (SWHANDLE hInstallMgr, const char *, const char *) {
+
+	return 0;
+}
+
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    getRemoteModuleByName
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Lorg/crosswire/android/sword/SWModule;
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteModuleByName
+  (SWHANDLE hInstallMgr, const char *, const char *) {
+
+	return 0;
+}

Modified: branches/sword-1-7-x/configure.ac
===================================================================
--- branches/sword-1-7-x/configure.ac	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/configure.ac	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
 # Version change: Change line 8 only !
 # Change it immediately after a release
 
-AC_INIT(sword, 1.7.2, sword-bugs at crosswire.org, sword, http://crosswire.org/sword)
+AC_INIT(sword, 1.7.3, sword-bugs at crosswire.org, sword, http://crosswire.org/sword)
 AC_CONFIG_SRCDIR(sword.bmp)
 AC_PREREQ(2.52)
 AC_REVISION($Revision: 1.45 $)
@@ -384,7 +384,7 @@
 # ---------------------------------------------------------------------
 # Final output
 # ---------------------------------------------------------------------
-AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile tests/cppunit/Makefile utilities/Makefile examples/Makefile examples/cmdline/Makefile utilities/diatheke/Makefile sword.pc include/swversion.h sword.spec)
+AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile tests/cppunit/Makefile utilities/Makefile examples/Makefile examples/cmdline/Makefile examples/tasks/Makefile utilities/diatheke/Makefile sword.pc include/swversion.h sword.spec)
 AC_OUTPUT
 
 echo

Copied: branches/sword-1-7-x/doc/QUICKSTART.ubuntu (from rev 3031, trunk/doc/QUICKSTART.ubuntu)
===================================================================
--- branches/sword-1-7-x/doc/QUICKSTART.ubuntu	                        (rev 0)
+++ branches/sword-1-7-x/doc/QUICKSTART.ubuntu	2014-04-17 03:50:37 UTC (rev 3156)
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Quickstart (tested on Ubuntu versions 9.10-13.10)
+#
+# You should probably be able to also run this QUICKSTART
+
+# For a build of the latest code directly from source control:
+
+# From a fresh Ubuntu installation, this should get you all the necessary
+# packages for a full featured install of the SWORD libs, compile and install
+# the engine, install a modules, and test with a simple command line tool:
+
+# install necessary packages for all features of SWORD to be enabled
+sudo apt-get install autoconf autogen automake subversion make g++ libtool zlib1g-dev libicu-dev libclucene-dev libcurl4-openssl-dev
+
+# checkout and build the source tree
+svn co https://crosswire.org/svn/sword/trunk sword
+cd sword
+./autogen.sh
+
+# you may want to review and edit usrinst.sh to see if the default options
+# meet your needs
+./usrinst.sh
+make -j
+sudo make install
+sudo make install_config
+
+# install a module
+sudo installmgr -init -sc -r CrossWire -ri CrossWire KJV
+
+# build and test a simple command line example tool
+cd examples/cmdline
+make
+./lookup KJV jn.3.16 
+

Modified: branches/sword-1-7-x/examples/Makefile.am
===================================================================
--- branches/sword-1-7-x/examples/Makefile.am	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/examples/Makefile.am	2014-04-17 03:50:37 UTC (rev 3156)
@@ -1,3 +1,3 @@
 AUTOMAKE_OPTIONS = 1.6
 
-SUBDIRS = cmdline
+SUBDIRS = cmdline tasks

Modified: branches/sword-1-7-x/examples/classes/Makefile
===================================================================
--- branches/sword-1-7-x/examples/classes/Makefile	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/examples/classes/Makefile	2014-04-17 03:50:37 UTC (rev 3156)
@@ -1,4 +1,4 @@
-TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition showchapter
+TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition simplechapter flatapilookup flatapiparsekey
 all: $(TARGETS)
 
 clean:
@@ -6,5 +6,7 @@
 
 .cpp:
 	g++ -O0 -g -Wall -Werror `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword`
+.c:
+	gcc -O0 -g -Wall -Werror `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword` -lstdc++
 
 


Property changes on: branches/sword-1-7-x/examples/classes/Makefile
___________________________________________________________________
Modified: svn:keywords
   - author date id
   + Author Date Id

Copied: branches/sword-1-7-x/examples/classes/flatapilookup.c (from rev 3059, trunk/examples/classes/flatapilookup.c)
===================================================================
--- branches/sword-1-7-x/examples/classes/flatapilookup.c	                        (rev 0)
+++ branches/sword-1-7-x/examples/classes/flatapilookup.c	2014-04-17 03:50:37 UTC (rev 3156)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ *
+ *  flatapilookup.c -	
+ *
+ * $Id$
+ *
+ * Copyright 2014 CrossWire Bible Society (http://www.crosswire.org)
+ *	CrossWire Bible Society
+ *	P. O. Box 2528
+ *	Tempe, AZ  85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <swordminflat.h>
+
+int main(int argc, char **argv) {
+	if (argc != 3) {
+		fprintf(stderr, "\nusage: %s <modname> <\"lookup key\">\n"
+							 "\tExample: lookup KJV \"James 1:19\"\n\n", argv[0]);
+		exit(-1);
+	}
+
+
+	SWHANDLE mgr = org_crosswire_sword_SWMgr_new();
+
+	SWHANDLE module = org_crosswire_sword_SWMgr_getModuleByName(mgr, argv[1]);
+
+	if (!module) {
+		fprintf(stderr, "Could not find module [%s].  Available modules:\n", argv[1]);
+		const struct org_crosswire_sword_ModInfo *modInfos = org_crosswire_sword_SWMgr_getModInfoList(mgr);
+		while (modInfos && modInfos->name) {
+			fprintf(stderr, "[%s]\t - %s\n", modInfos->name, modInfos->description);
+			++modInfos;
+		}
+		org_crosswire_sword_SWMgr_delete(mgr);
+		exit(-1);
+	}
+
+	org_crosswire_sword_SWModule_setKeyText(module, argv[2]);
+
+	// we render before we print keyText so our keyText snaps to the closest entry 
+	const char *renderText = org_crosswire_sword_SWModule_renderText(module);
+	printf("==Render=Entry============\n");
+	printf("%s\n", org_crosswire_sword_SWModule_getKeyText(module));
+	printf("%s\n", renderText);
+	printf("==========================\n");
+
+	org_crosswire_sword_SWMgr_delete(mgr);
+
+	return 0;
+}


Property changes on: branches/sword-1-7-x/examples/classes/flatapilookup.c
___________________________________________________________________
Added: svn:keywords
   + Author Date Id
Added: svn:eol-style
   + native

Copied: branches/sword-1-7-x/examples/classes/flatapiparsekey.c (from rev 3059, trunk/examples/classes/flatapiparsekey.c)
===================================================================
--- branches/sword-1-7-x/examples/classes/flatapiparsekey.c	                        (rev 0)
+++ branches/sword-1-7-x/examples/classes/flatapiparsekey.c	2014-04-17 03:50:37 UTC (rev 3156)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ *
+ *  flatapiparsekey.c -	
+ *
+ * $Id$
+ *
+ * Copyright 2014 CrossWire Bible Society (http://www.crosswire.org)
+ *	CrossWire Bible Society
+ *	P. O. Box 2528
+ *	Tempe, AZ  85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <swordminflat.h>
+
+int main(int argc, char **argv) {
+	if (argc != 3) {
+		fprintf(stderr, "\nusage: %s <modname> <\"keyText\">\n"
+							 "\tExample: %s KJV \"James 1:19-30,34\"\n\n", argv[0], argv[0]);
+		exit(-1);
+	}
+
+
+	SWHANDLE mgr = org_crosswire_sword_SWMgr_new();
+
+	SWHANDLE module = org_crosswire_sword_SWMgr_getModuleByName(mgr, argv[1]);
+
+	if (!module) {
+		fprintf(stderr, "Could not find module [%s].  Available modules:\n", argv[1]);
+		const struct org_crosswire_sword_ModInfo *modInfos = org_crosswire_sword_SWMgr_getModInfoList(mgr);
+		while (modInfos && modInfos->name) {
+			fprintf(stderr, "[%s]\t - %s\n", modInfos->name, modInfos->description);
+			++modInfos;
+		}
+		org_crosswire_sword_SWMgr_delete(mgr);
+		exit(-1);
+	}
+
+	const char **results = org_crosswire_sword_SWModule_parseKeyList(module, argv[2]);
+
+	printf("==========================\n");
+	printf("Parsing: %s\n", argv[2]);
+	printf("==========================\n");
+	while (results && *results) {
+		printf("%s\n", *results);
+		++results;
+	}
+	printf("==========================\n");
+
+	org_crosswire_sword_SWMgr_delete(mgr);
+
+	return 0;
+}


Property changes on: branches/sword-1-7-x/examples/classes/flatapiparsekey.c
___________________________________________________________________
Added: svn:keywords
   + Author Date Id
Added: svn:eol-style
   + native

Deleted: branches/sword-1-7-x/examples/classes/showchapter.cpp
===================================================================
--- branches/sword-1-7-x/examples/classes/showchapter.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/examples/classes/showchapter.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -1,57 +0,0 @@
-/******************************************************************************
- *
- *  showchapter.cpp -	
- *
- * $Id$
- *
- * Copyright 2013 CrossWire Bible Society (http://www.crosswire.org)
- *	CrossWire Bible Society
- *	P. O. Box 2528
- *	Tempe, AZ  85280-2528
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- */
-
-#include <swmgr.h>
-#include <swmodule.h>
-#include <versekey.h>
-#include <iostream>
-
-
-using namespace sword;
-using namespace std;
-
-
-int main(int argc, char **argv) {
-
-	SWMgr library;
-	SWModule *kjv = library.getModule("KJV");
-
-	kjv->setKey(argc > 1 ? argv[1] : "Jn.3.16");
-
-	VerseKey *key = (VerseKey *)kjv->getKey();
-
-	int curVerse = key->getVerse();
-	int curChapter = key->getChapter();
-	int curBook = key->getBook();
-
-	for (key->setVerse(1);
-				(key->getBook()    == curBook)    &&
-				(key->getChapter() == curChapter) &&
-				!kjv->popError();
-				(*kjv)++) {
-		if (key->getVerse() == curVerse) cout << "* ";
-		cout << key->getVerse() << " " << kjv->stripText() << "\n";
-	}
-
-	return 0;
-}
-

Copied: branches/sword-1-7-x/examples/classes/simplechapter.cpp (from rev 3030, trunk/examples/classes/simplechapter.cpp)
===================================================================
--- branches/sword-1-7-x/examples/classes/simplechapter.cpp	                        (rev 0)
+++ branches/sword-1-7-x/examples/classes/simplechapter.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ *
+ *  simplechapter.cpp -	
+ *
+ * $Id$
+ *
+ * Copyright 2013-2014 CrossWire Bible Society (http://www.crosswire.org)
+ *	CrossWire Bible Society
+ *	P. O. Box 2528
+ *	Tempe, AZ  85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <swmgr.h>
+#include <swmodule.h>
+#include <versekey.h>
+#include <iostream>
+
+
+using namespace sword;
+using namespace std;
+
+
+int main(int argc, char **argv) {
+
+	SWMgr library;
+	SWModule *kjv = library.getModule((argc > 1)?argv[1]:"KJV");
+
+	kjv->setKey(argc > 2 ? argv[2] : "Jn.3.16");
+
+	VerseKey *key = (VerseKey *)kjv->getKey();
+
+	int curVerse = key->getVerse();
+	int curChapter = key->getChapter();
+	int curBook = key->getBook();
+
+	for (key->setVerse(1);
+				(key->getBook()    == curBook)    &&
+				(key->getChapter() == curChapter) &&
+				!kjv->popError();
+				(*kjv)++) {
+		if (key->getVerse() == curVerse) cout << "* ";
+		cout << key->getVerse() << " " << kjv->stripText() << "\n";
+	}
+
+	return 0;
+}
+

Copied: branches/sword-1-7-x/examples/tasks/CMakeLists.txt (from rev 3035, trunk/examples/tasks/CMakeLists.txt)
===================================================================
--- branches/sword-1-7-x/examples/tasks/CMakeLists.txt	                        (rev 0)
+++ branches/sword-1-7-x/examples/tasks/CMakeLists.txt	2014-04-17 03:50:37 UTC (rev 3156)
@@ -0,0 +1,15 @@
+##################################################################################
+# These are some examples.  If you want examples to be built, you need to define
+# SWORD_BUILD_EXAMPLES="Yes".  These will not be installed, so don't worry about
+# that.
+# 
+MESSAGE(STATUS "\n-- CONFIGURING LIBRARY EXAMPLES")
+SET(example_PROGRAMS
+	parallelbibles
+)
+
+FOREACH(DEMO ${example_PROGRAMS})
+	ADD_EXECUTABLE("${DEMO}"	"${DEMO}.cpp")
+	TARGET_LINK_LIBRARIES("${DEMO}" sword)
+ENDFOREACH(DEMO ${example_PROGRAMS})
+

Modified: branches/sword-1-7-x/examples/tasks/parallelbibles.cpp
===================================================================
--- trunk/examples/tasks/parallelbibles.cpp	2014-02-28 05:17:25 UTC (rev 3034)
+++ branches/sword-1-7-x/examples/tasks/parallelbibles.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *
  * $Id: parallelbibles.cpp 3030 2014-02-28 02:14:44Z scribe $
  *
- * Copyright 2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2013-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -36,7 +36,6 @@
 
 void parallelDisplay(vector<SWModule *>modules, const char *key) {
 
-
 	// We'll use the first module's key as our master key to position all other modules.
 	VerseKey *master = (VerseKey *)modules[0]->createKey();
 
@@ -45,26 +44,25 @@
 	int curChapter = master->getChapter();
 	int curBook    = master->getBook();
 
-	cout << "<table><thead></thead><tbody>";
 	for (master->setVerse(1);	   (master->getBook()    == curBook)
 					&& (master->getChapter() == curChapter)
 					&& !master->popError();
-								(*master)++) {
-		cout << "<tr class=\"" << (master->getVerse() == curVerse ? "curverse":"verse") << "\">";
+										(*master)++) {
+
+		cout << "<tr class=\"" << (master->getVerse() == curVerse ? "currentverse":"verse") << "\">";
 		for (vector<SWModule *>::iterator module = modules.begin(); module != modules.end(); ++module) {
 			(*module)->setKey(master);
 			if (!(*module)->popError()) {
-				cout << "<td>" << "<span class=\"verseNum\">" << master->getVerse() << "</span> ";
+				cout << "<td>" << "<span class=\"versenum\">" << master->getVerse() << "</span> ";
 				cout << (*module)->renderText() << "</td>";
 			}
 		}
 		cout << "</tr>";
 	}
-	cout << "</tbody></table>";
-
 	delete master;
 }
 
+
 void outputHeader(vector<SWModule *>modules, const char *key) {
 
 	modules[0]->setKey(key);
@@ -80,7 +78,7 @@
 	<< "<head profile=\"http://www.w3.org/2000/08/w3c-synd/#\">"
 	<< "<meta name=\"keywords\" content=\"Jesus, Christ, Church, Bible, Iran, Persian, Persia, Azeri, Azerbaijan, Armenian, God, Gospel, CrossWire, Java, Web, Software\" />"
 	<< "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"
-	<< "<title>OSIS Web: James 1:19 - Parallel Bible study</title>"
+	<< "<title>OSIS Web: " << modules[0]->getKeyText() << " - Parallel Bible study</title>"
 	<< "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"http://crosswire.org/study/common.css\"  />"
 	<< "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" title=\"Washed Out\" href=\"http://crosswire.org/study/wash.css\"  />"
 	<< "<link rel=\"stylesheet\" type=\"text/css\" href=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css\"/>"
@@ -103,14 +101,36 @@
 	<<       "<style>"
 	<<         modules[0]->getRenderHeader()
 	<<       "</style>"
-	<<       "<h2>Parallel Viewing: " << modules[0]->getKeyText() << "</h2>";
+	<<       "<h2>Parallel Viewing: " << modules[0]->getKeyText() << "</h2><br/>"
+	<<       "<table><thead><tr>";
 
+	for (vector<SWModule *>::iterator module = modules.begin(); module != modules.end(); ++module) {
+		cout << "<th>" << (*module)->getDescription() << "</th>";
+	}
+
+	cout
+	<<       "</tr></thead><tbody>";
+
 	
 }
 
-void outputFooter() {
+void outputFooter(vector<SWModule *>modules) {
 
 	cout
+	<<       "</tbody><tfoot><tr>";
+
+	for (vector<SWModule *>::iterator module = modules.begin(); module != modules.end(); ++module) {
+		SWBuf copyLine = (*module)->getConfigEntry("ShortCopyright");
+		SWBuf promoLine = (*module)->getConfigEntry("ShortPromo");
+		cout
+		<< "<th>"
+		<< "<div class=\"copyLine\">" <<  copyLine << "</div>"
+		<< "<div class=\"promoLine\">" << promoLine << "</div>"
+		<< "</th>";
+	}
+
+	cout
+	<<       "</tr></tfoot></table>"
 	<<     "</div>"
 	<<   "</div>"
 	<<   "<div id=\"footer\">"
@@ -126,6 +146,7 @@
 	<< "</html>";
 }
 
+
 int main(int argc, char **argv) {
 
 	SWMgr library(new MarkupFilterMgr(FMT_XHTML));
@@ -152,7 +173,7 @@
 
 	outputHeader(modules, argv[argc-1]);
 	parallelDisplay(modules, argv[argc-1]);
-	outputFooter();
+	outputFooter(modules);
 
 	return 0;
 }

Modified: branches/sword-1-7-x/include/bz2comprs.h
===================================================================
--- branches/sword-1-7-x/include/bz2comprs.h	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/include/bz2comprs.h	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *
  * $Id$
  *
- * Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2000-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528

Modified: branches/sword-1-7-x/include/defs.h
===================================================================
--- branches/sword-1-7-x/include/defs.h	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/include/defs.h	2014-04-17 03:50:37 UTC (rev 3156)
@@ -25,12 +25,18 @@
 #ifndef SWORDDEFS_H
 #define SWORDDEFS_H
 
+// TODO: What is this? jansorg, why does NO_SWORD_NAMESPACE still define
+// a C++ namespace, and then force using it?  This makes no sense to me.
+// see commit 1195
 #ifdef NO_SWORD_NAMESPACE
  #define SWORD_NAMESPACE_START namespace sword {
  #define SWORD_NAMESPACE_END }; using namespace sword;
-#else
+#elif defined(__cplusplus)
  #define SWORD_NAMESPACE_START namespace sword {
  #define SWORD_NAMESPACE_END }
+#else
+ #define SWORD_NAMESPACE_START 
+ #define SWORD_NAMESPACE_END 
 #endif
 
 SWORD_NAMESPACE_START
@@ -154,10 +160,12 @@
 
 
 
+#ifdef __cplusplus
 enum {DIRECTION_LTR = 0, DIRECTION_RTL, DIRECTION_BIDI};
 enum {FMT_UNKNOWN = 0, FMT_PLAIN, FMT_THML, FMT_GBF, FMT_HTML, FMT_HTMLHREF, FMT_RTF, FMT_OSIS, FMT_WEBIF, FMT_TEI, FMT_XHTML};
 enum {ENC_UNKNOWN = 0, ENC_LATIN1, ENC_UTF8, ENC_SCSU, ENC_UTF16, ENC_RTF, ENC_HTML};
 enum {BIB_BIBTEX = 0, /* possible future formats: BIB_MARCXML, BIB_MARC21, BIB_DCMI BIB_OSISHEADER, BIB_SBL_XHTML, BIB_MLA_XHTML, BIB_APA_XHTML, BIB_CHICAGO_XHTML */};
+#endif
 
 SWORD_NAMESPACE_END
 #endif //SWORDDEFS_H

Modified: branches/sword-1-7-x/include/flatapi.h
===================================================================
--- branches/sword-1-7-x/include/flatapi.h	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/include/flatapi.h	2014-04-17 03:50:37 UTC (rev 3156)
@@ -4,7 +4,7 @@
  *
  * $Id$
  *
- * Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2002-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -20,87 +20,472 @@
  *
  */
 
-#ifndef SWORDAPI_H
-#define SWORDAPI_H
+#ifndef SWORDFLATAPI_H
+#define SWORDFLATAPI_H
 
+#include <inttypes.h>
 #include <defs.h>
-#include <inttypes.h>
+
 #ifdef __cplusplus
+extern "C" {
 #endif
 
-extern "C" {
-
 #define SWHANDLE intptr_t
 
+struct org_crosswire_sword_ModInfo {
+	char *name;
+	char *description;
+	char *category;
+	char *language;
+};
 
-//-----------------------------------------------------------------
-// stringlist_iterator methods
 
-void SWDLLEXPORT stringlist_iterator_next(SWHANDLE hsli);
-const char * SWDLLEXPORT stringlist_iterator_val(SWHANDLE hsli);
+struct org_crosswire_sword_SearchHit {
+	const char *modName;
+	char *key;
+	long  score;
+};
 
-//-----------------------------------------------------------------
-// listkey_iterator methods
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    reInit
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_InstallMgr_reInit
+  (SWHANDLE hInstallMgr);
 
-void SWDLLEXPORT listkey_iterator_next(SWHANDLE lki);
-const char * SWDLLEXPORT listkey_iterator_val(SWHANDLE hsli);
-	
-//-----------------------------------------------------------------
-// modmap methods
-//
-void SWDLLEXPORT ModList_iterator_next(SWHANDLE hmmi);
-SWHANDLE SWDLLEXPORT ModList_iterator_val(SWHANDLE hmmi);
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    setUserDisclaimerConfirmed
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_InstallMgr_setUserDisclaimerConfirmed
+  (SWHANDLE hInstallMgr);
 
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    syncConfig
+ * Signature: ()I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_syncConfig
+  (SWHANDLE hInstallMgr);
 
-//-----------------------------------------------------------------
-// SWMgr methods
-//
-SWHANDLE SWDLLEXPORT SWMgr_new(char filterType);
-// SWConfig *, SWConfig *, bool, SWFilterMgr *
-SWHANDLE SWDLLEXPORT SWMgr_newEx(SWHANDLE hiconfig, SWHANDLE hisysconfig, char autoload, SWHANDLE hfilterMgr);
-void     SWDLLEXPORT SWMgr_delete(SWHANDLE hmgr);
-SWHANDLE SWDLLEXPORT SWMgr_getConfig(SWHANDLE hmgr);
-SWHANDLE SWDLLEXPORT SWMgr_getModulesIterator(SWHANDLE hmgr);
-SWHANDLE SWDLLEXPORT SWMgr_getModuleByName(SWHANDLE hmgr, const char *name);
-const char *   SWDLLEXPORT SWMgr_getPrefixPath(SWHANDLE hmgr);
-const char *   SWDLLEXPORT SWMgr_getConfigPath(SWHANDLE hmgr);
-void     SWDLLEXPORT SWMgr_setGlobalOption(SWHANDLE hmgr, const char *option, const char *value);
-const char *   SWDLLEXPORT SWMgr_getGlobalOption(SWHANDLE hmgr, const char *option);
-const char *   SWDLLEXPORT SWMgr_getGlobalOptionTip(SWHANDLE hmgr, const char *option);
-// ret: forward_iterator
-SWHANDLE SWDLLEXPORT SWMgr_getGlobalOptionsIterator(SWHANDLE hmgr);
-// ret: forward_iterator
-SWHANDLE SWDLLEXPORT SWMgr_getGlobalOptionValuesIterator(SWHANDLE hmgr, const char *option);
-void     SWDLLEXPORT SWMgr_setCipherKey(SWHANDLE hmgr, const char *modName, const char *key);
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    uninstallModule
+ * Signature: (Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_uninstallModule
+  (SWHANDLE hInstallMgr, const char *);
 
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    getRemoteSources
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteSources
+  (SWHANDLE hInstallMgr);
 
-//-----------------------------------------------------------------
-// SWModule methods
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    refreshRemoteSource
+ * Signature: (Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_refreshRemoteSource
+  (SWHANDLE hInstallMgr, const char *);
 
-void  SWDLLEXPORT SWModule_terminateSearch(SWHANDLE hmodule);
-SWHANDLE SWDLLEXPORT SWModule_doSearch(SWHANDLE hmodule, const char *searchString, int type, int params,  void (*percent) (char, void *), void *percentUserData);
-char  SWDLLEXPORT SWModule_error(SWHANDLE hmodule);
-int   SWDLLEXPORT SWModule_getEntrySize(SWHANDLE hmodule);
-void  SWDLLEXPORT SWModule_setKeyText(SWHANDLE hmodule, const char *key);
-const char * SWDLLEXPORT SWModule_getKeyText(SWHANDLE hmodule);
-const char * SWDLLEXPORT SWModule_getName(SWHANDLE hmodule);
-const char * SWDLLEXPORT SWModule_getDescription(SWHANDLE hmodule);
-const char * SWDLLEXPORT SWModule_getType(SWHANDLE hmodule);
-void  SWDLLEXPORT SWModule_previous(SWHANDLE hmodule);
-void  SWDLLEXPORT SWModule_next(SWHANDLE hmodule);
-void  SWDLLEXPORT SWModule_begin(SWHANDLE hmodule);
-const char * SWDLLEXPORT SWModule_getStripText(SWHANDLE hmodule);
-const char * SWDLLEXPORT SWModule_getRenderText(SWHANDLE hmodule);
-const char * SWDLLEXPORT SWModule_getEntryAttributes(SWHANDLE hmodule, const char *level1, const char *level2, const char *level3);
-const char * SWDLLEXPORT SWModule_getPreverseHeader(SWHANDLE hmodule, const char *key, int pvHeading);
-const char * SWDLLEXPORT SWModule_getFootnoteType(SWHANDLE hmodule, const char *key, const char *note);
-const char * SWDLLEXPORT SWModule_getFootnoteBody(SWHANDLE hmodule, const char *key, const char *note);
-const char * SWDLLEXPORT SWModule_getFootnoteRefList(SWHANDLE hmodule, const char *key, const char *note);
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    getRemoteModInfoList
+ * Signature: (Ljava/lang/String;)[Lorg/crosswire/android/sword/SWMgr/ModInfo;
+ */
+const struct org_crosswire_sword_ModInfo * SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteModInfoList
+  (SWHANDLE hInstallMgr, const char *);
 
-SWHANDLE SWDLLEXPORT listkey_getVerselistIterator(const char *list, const char *key, const char *v11n = "KJV");
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    remoteInstallModule
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_remoteInstallModule
+  (SWHANDLE hInstallMgr, const char *, const char *);
 
+/*
+ * Class:     org_crosswire_sword_InstallMgr
+ * Method:    getRemoteModuleByName
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Lorg/crosswire/android/sword/SWModule;
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteModuleByName
+  (SWHANDLE hInstallMgr, const char *, const char *);
+
+
+#undef org_crosswire_sword_SWModule_SEARCHTYPE_REGEX
+#define org_crosswire_sword_SWModule_SEARCHTYPE_REGEX 1L
+#undef org_crosswire_sword_SWModule_SEARCHTYPE_PHRASE
+#define org_crosswire_sword_SWModule_SEARCHTYPE_PHRASE -1L
+#undef org_crosswire_sword_SWModule_SEARCHTYPE_MULTIWORD
+#define org_crosswire_sword_SWModule_SEARCHTYPE_MULTIWORD -2L
+#undef org_crosswire_sword_SWModule_SEARCHTYPE_ENTRYATTR
+#define org_crosswire_sword_SWModule_SEARCHTYPE_ENTRYATTR -3L
+#undef org_crosswire_sword_SWModule_SEARCHTYPE_LUCENE
+#define org_crosswire_sword_SWModule_SEARCHTYPE_LUCENE -4L
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    terminateSearch
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_terminateSearch
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    search
+ * Signature: (Ljava/lang/String;IJLjava/lang/String;Lorg/crosswire/android/sword/SWModule/SearchProgressReporter;)[Lorg/crosswire/android/sword/SWModule/SearchHit;
+ */
+const struct org_crosswire_sword_SearchHit * SWDLLEXPORT org_crosswire_sword_SWModule_search
+  (SWHANDLE hSWModule, const char *searchString, int searchType, long flags, const char *scope, SWHANDLE progressReporter);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    error
+ * Signature: ()C
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_popError
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getEntrySize
+ * Signature: ()J
+ */
+long SWDLLEXPORT org_crosswire_sword_SWModule_getEntrySize
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getEntryAttribute
+ * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWModule_getEntryAttribute
+  (SWHANDLE hSWModule, const char *level1, const char *level2, const char *level3, char filteredBool);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    parseKeyList
+ * Signature: (Ljava/lang/String;)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWModule_parseKeyList
+  (SWHANDLE hSWModule, const char *keyText);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    setKeyText
+ * Signature: (Ljava/lang/String;)V
+ */
+// Special values handled for VerseKey modules:
+//	[+-][book|chapter]	- [de|in]crement by chapter or book
+//	(e.g.	"+chapter" will increment the VerseKey 1 chapter)
+//	[=][key]		- position absolutely and don't normalize
+//	(e.g.	"jn.1.0" for John Chapter 1 intro; "jn.0.0" For Book of John Intro)
+void SWDLLEXPORT org_crosswire_sword_SWModule_setKeyText
+  (SWHANDLE hSWModule, const char *key);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getKeyText
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getKeyText
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    hasKeyChildren
+ * Signature: ()Z
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_hasKeyChildren
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getKeyChildren
+ * Signature: ()[Ljava/lang/String;
+ */
+
+// This method returns child nodes for a genbook,
+// but has special handling if called on a VerseKey module:
+//  [0..7] [testament, book, chapter, verse, chapterMax, verseMax, bookName, osisRef]
+const char ** SWDLLEXPORT org_crosswire_sword_SWModule_getKeyChildren
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getName
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getName
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getDescription
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getDescription
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getCategory
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getCategory
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getKeyParent
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getKeyParent
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    previous
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_previous
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    next
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_next
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    begin
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_begin
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getStripText
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_stripText
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getRenderText
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_renderText
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getRenderHeader
+ * Signature: ()Ljava/lang/String;
+ */
+// CSS styles associated with this text
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getRenderHeader
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getRawEntry
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getRawEntry
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    setRawEntry
+ * Signature: (Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_setRawEntry
+  (SWHANDLE hSWModule, const char *entryBuffer);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    getConfigEntry
+ * Signature: (Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getConfigEntry
+  (SWHANDLE hSWModule, const char *key);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    deleteSearchFramework
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_deleteSearchFramework
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWModule
+ * Method:    hasSearchFramework
+ * Signature: ()Z
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_hasSearchFramework
+  (SWHANDLE hSWModule);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    new
+ * Signature: ()V
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_new
+  ();
+
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    delete
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_delete
+  (SWHANDLE hSWMgr);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    version
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_version
+  (SWHANDLE hSWMgr);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getModInfoList
+ * Signature: ()[Lorg/crosswire/android/sword/SWMgr/ModInfo;
+ */
+const struct org_crosswire_sword_ModInfo * SWDLLEXPORT org_crosswire_sword_SWMgr_getModInfoList
+  (SWHANDLE hSWMgr);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getModuleByName
+ * Signature: (Ljava/lang/String;)Lorg/crosswire/android/sword/SWModule;
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_SWMgr_getModuleByName
+  (SWHANDLE hSWMgr, const char *moduleName);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getPrefixPath
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getPrefixPath
+  (SWHANDLE hSWMgr);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getConfigPath
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getConfigPath
+  (SWHANDLE hSWMgr);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setGlobalOption
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setGlobalOption
+  (SWHANDLE hSWMgr, const char *option, const char *value);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOption
+ * Signature: (Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOption
+  (SWHANDLE hSWMgr, const char *option);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOptionTip
+ * Signature: (Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptionTip
+  (SWHANDLE hSWMgr, const char *option);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    filterText
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_filterText
+  (SWHANDLE hSWMgr, const char *filterName, const char *text);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOptions
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptions
+  (SWHANDLE hSWMgr);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getGlobalOptionValues
+ * Signature: (Ljava/lang/String;)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptionValues
+  (SWHANDLE hSWMgr, const char *option);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setCipherKey
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setCipherKey
+  (SWHANDLE hSWMgr, const char *modName, const char *key);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setJavascript
+ * Signature: (Z)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setJavascript
+  (SWHANDLE hSWMgr, char valueBool);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    getAvailableLocales
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getAvailableLocales
+  (SWHANDLE hSWMgr);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    setDefaultLocale
+ * Signature: (Ljava/lang/String;)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setDefaultLocale
+  (SWHANDLE hSWMgr, const char *name);
+
+/*
+ * Class:     org_crosswire_sword_SWMgr
+ * Method:    translate
+ * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_translate
+  (SWHANDLE hSWMgr, const char *text, const char *localeName);
+
+#ifdef __cplusplus
 }
-#ifdef __cplusplus
 #endif
-
 #endif

Modified: branches/sword-1-7-x/include/swmgr.h
===================================================================
--- branches/sword-1-7-x/include/swmgr.h	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/include/swmgr.h	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *
  * $Id$
  *
- * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 1997-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -44,12 +44,14 @@
  *	if you decide to start a new project.
  *
  * Well known frontends are:
- *	-BibleTime (http://www.bibletime.info)
- *	-BPBible (http://bpbible.com)
- *	-Eloquent (http://www.macsword.com)
- *	-PocketSword (http://crosswire.org/pocketsword/)
- *	-SWORD for Windows (http://crosswire.org/sword/software/biblecs/)
- *	-Xiphos (http://xiphos.org) 
+ *	-BibleTime
+ *	-BPBible
+ *	-Eloquent
+ *	-PocketSword
+ *	-The SWORD Projectfor Windows
+ *	-Xiphos
+ * See http://crosswire.org/applications.jsp for links to each and a more
+ * complete list.
  */
 
 #ifndef SWMGR_H

Modified: branches/sword-1-7-x/include/swversion.h
===================================================================
--- branches/sword-1-7-x/include/swversion.h	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/include/swversion.h	2014-04-17 03:50:37 UTC (rev 3156)
@@ -24,11 +24,11 @@
 #ifndef SWVERSION_H
 #define SWVERSION_H
 
-#define SWORD_VERSION_NUM 107002000
-#define SWORD_VERSION_STR "1.7.2"
+#define SWORD_VERSION_NUM 107003000
+#define SWORD_VERSION_STR "1.7.3"
 #define SWORD_VERSION_MAJOR 1
 #define SWORD_VERSION_MINOR 7
-#define SWORD_VERSION_MICRO 2
+#define SWORD_VERSION_MICRO 3
 #define SWORD_VERSION_NANO 0
 
 #include <defs.h>

Modified: branches/sword-1-7-x/include/xzcomprs.h
===================================================================
--- branches/sword-1-7-x/include/xzcomprs.h	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/include/xzcomprs.h	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *
  * $Id$
  *
- * Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2000-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528

Modified: branches/sword-1-7-x/lib/vcppmake/libsword.vcxproj
===================================================================
--- branches/sword-1-7-x/lib/vcppmake/libsword.vcxproj	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/lib/vcppmake/libsword.vcxproj	2014-04-17 03:50:37 UTC (rev 3156)
@@ -85,8 +85,8 @@
       <Culture>0x0409</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>libcurl_a_debug.lib;ws2_32.lib;winmm.lib;wldap32.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories>../../../curl/builds/libcurl-vc10-x86-debug-static-ipv6-sspi-spnego-winssl/lib;../../../icu-sword/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>libcurl_a.lib;ws2_32.lib;winmm.lib;wldap32.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>../../../curl/builds/libcurl-vc10-x86-release-static-ipv6-sspi-spnego-winssl/lib;../../../icu-sword/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
       <DataExecutionPrevention>
       </DataExecutionPrevention>


Property changes on: branches/sword-1-7-x/pix/sword.gif
___________________________________________________________________
Deleted: svn:keywords
   - author date id
Deleted: svn:eol-style
   - native
Added: svn:mime-type
   + image/gif

Modified: branches/sword-1-7-x/src/mgr/swmgr.cpp
===================================================================
--- branches/sword-1-7-x/src/mgr/swmgr.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/mgr/swmgr.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -4,7 +4,7 @@
  *
  * $Id$
  *
- * Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 1998-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528

Modified: branches/sword-1-7-x/src/modules/comments/zcom/zcom.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/comments/zcom/zcom.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/comments/zcom/zcom.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -68,25 +68,25 @@
 
 
 /******************************************************************************
- * zCom::getRawEntry	- Returns the correct verse when char * cast
- *					is requested
+ * zCom::getRawEntry	- Returns the current verse buffer
  *
- * RET: string buffer with verse
+ * RET: buffer with verse
  */
+
 SWBuf &zCom::getRawEntryBuf() const {
 	long  start = 0;
 	unsigned short size = 0;
-	unsigned long buffnum;
-	VerseKey *key = &getVerseKey();
+	unsigned long buffnum = 0;
+	VerseKey &key = getVerseKey();
 
-	findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size, &buffnum);
+	findOffset(key.getTestament(), key.getTestamentIndex(), &start, &size, &buffnum);
 	entrySize = size;        // support getEntrySize call
-
+			  
 	entryBuf = "";
-	zReadText(key->getTestament(), start, size, buffnum, entryBuf);
+	
+	zReadText(key.getTestament(), start, size, buffnum, entryBuf);
+	rawFilter(entryBuf, &key);
 
-	rawFilter(entryBuf, key);
-
 //	if (!isUnicode())
 		prepText(entryBuf);
 

Modified: branches/sword-1-7-x/src/modules/common/bz2comprs.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/common/bz2comprs.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/common/bz2comprs.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *				
  * $Id$
  *
- * Copyright 2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2000-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528

Modified: branches/sword-1-7-x/src/modules/common/xzcomprs.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/common/xzcomprs.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/common/xzcomprs.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *				
  * $Id$
  *
- * Copyright 2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2000-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528

Modified: branches/sword-1-7-x/src/modules/filters/osishtmlhref.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osishtmlhref.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/filters/osishtmlhref.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -4,7 +4,7 @@
  * 
  * $Id$
  *
- * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2003-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -289,7 +289,7 @@
 		// Milestoned paragraphs, created by osis2mod
 		// <div type="paragraph" sID.../>
 		// <div type="paragraph" eID.../>
-		else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "paragraph")) {
+		else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && (!strcmp(tag.getAttribute("type"), "x-p") || !strcmp(tag.getAttribute("type"), "paragraph"))) {
 			// <div type="paragraph"  sID... />
 			if (tag.getAttribute("sID")) {	// non-empty start tag
 				outText("<!P><br />", buf, u);

Modified: branches/sword-1-7-x/src/modules/filters/osisplain.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osisplain.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/filters/osisplain.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -185,7 +185,7 @@
 		// Milestoned paragraph, created by osis2mod
 		// <div type="paragraph"  sID... />
 		// <div type="paragraph"  eID... />
-		else if (!strcmp(u->tag.getName(), "div") && u->tag.getAttribute("type") && !strcmp(u->tag.getAttribute("type"), "paragraph") &&
+		else if (!strcmp(u->tag.getName(), "div") && u->tag.getAttribute("type") && (!strcmp(u->tag.getAttribute("type"), "x-p") || !strcmp(u->tag.getAttribute("type"), "paragraph")) &&
 			(u->tag.isEmpty() && (u->tag.getAttribute("sID") || u->tag.getAttribute("eID")))) {
 				userData->supressAdjacentWhitespace = true;
 				buf.append('\n');

Modified: branches/sword-1-7-x/src/modules/filters/osisrtf.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osisrtf.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/filters/osisrtf.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -4,7 +4,7 @@
  *
  * $Id$ *
  *
- * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2003-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -284,7 +284,7 @@
 		// Milestoned paragraphs, created by osis2mod
 		// <div type="paragraph" sID.../>
 		// <div type="paragraph" eID.../>
-		else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "paragraph")) {
+		else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && (!strcmp(tag.getAttribute("type"), "x-p") || !strcmp(tag.getAttribute("type"), "paragraph"))) {
 			// <div type="paragraph"  sID... />
 			if (tag.getAttribute("sID")) {	// non-empty start tag
 				outText("{\\fi200\\par}", buf, u);

Modified: branches/sword-1-7-x/src/modules/filters/osisscripref.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osisscripref.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/filters/osisscripref.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *
  * $Id$
  *
- * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2003-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -35,7 +35,7 @@
 	static const char oTip[]  = "Toggles Scripture Cross-references On and Off if they exist";
 
 	static const StringList *oValues() {
-		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const SWBuf choices[3] = {"Off", "On", ""};
 		static const StringList oVals(&choices[0], &choices[2]);
 		return &oVals;
 	}

Modified: branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -4,7 +4,7 @@
  *
  * $Id$
  *
- * Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2011-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -330,7 +330,7 @@
 		// Milestoned paragraphs, created by osis2mod
 		// <div type="paragraph" sID.../>
 		// <div type="paragraph" eID.../>
-		else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "paragraph")) {
+		else if (tag.isEmpty() && !strcmp(tag.getName(), "div") && tag.getAttribute("type") && (!strcmp(tag.getAttribute("type"), "x-p") || !strcmp(tag.getAttribute("type"), "paragraph"))) {
 			// <div type="paragraph"  sID... />
 			if (tag.getAttribute("sID")) {	// non-empty start tag
 				u->outputNewline(buf);

Modified: branches/sword-1-7-x/src/modules/filters/thmlscripref.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/thmlscripref.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/src/modules/filters/thmlscripref.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -5,7 +5,7 @@
  *
  * $Id$
  *
- * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2001-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -37,7 +37,7 @@
 	static const char oTip[]  = "Toggles Scripture Cross-references On and Off if they exist";
 
 	static const StringList *oValues() {
-		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const SWBuf choices[3] = {"Off", "On", ""};
 		static const StringList oVals(&choices[0], &choices[2]);
 		return &oVals;
 	}

Modified: branches/sword-1-7-x/usrinst.sh
===================================================================
--- branches/sword-1-7-x/usrinst.sh	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/usrinst.sh	2014-04-17 03:50:37 UTC (rev 3156)
@@ -61,10 +61,9 @@
 echo "Next you might try something like: "
 echo ""
 echo "make"
-echo "su"
-echo "make install"
-echo "(and optionally)"
-echo "make install_config"
+echo "sudo make install"
+echo "# (and optionally)"
+echo "sudo make install_config"
 echo "make register"
 echo ""
 echo ""

Modified: branches/sword-1-7-x/utilities/diatheke/corediatheke.cpp
===================================================================
--- branches/sword-1-7-x/utilities/diatheke/corediatheke.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/utilities/diatheke/corediatheke.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -4,7 +4,7 @@
  *
  * $Id$
  *
- * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2001-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -120,9 +120,9 @@
 	ListKey listkey;
 	SectionMap::iterator sit;
 	ConfigEntMap::iterator eit;
-
+	const char * DEFAULT_FONT = "Gentium";
 	SWModule *target;
-	char *font = 0;
+	const char *font = 0;
 	char inputformat = 0;
 	SWBuf encoding;
 	char querytype = 0;
@@ -319,10 +319,11 @@
 
 		if (text.length()) {
 			*output << (char*)target->getKeyText();
-			if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
-				*output << ": <font face=\"";
-				*output << font;
-				*output << "\">";
+			if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+				*output << ": <span ";
+				if (font) { *output << "style=\"font:\"" << font << ";\""; }
+				if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
+				*output << ">";
 			}
 			else if (outputformat == FMT_RTF) {
 				*output << ": {\\f1 ";
@@ -331,7 +332,7 @@
 				*output << ": ";
 			}
 			*output << text;
-			if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
+			if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
 				*output << "</font>";
 			}
 			else if (outputformat == FMT_RTF) {
@@ -371,7 +372,8 @@
 			*output << ";}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}}";
 		}
 		else if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML) {
-			*output << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">";
+			*output << "<meta http-equiv=\"content-type\" content=\"text/html\" charset=\"UTF-8\""
+				   " lang=\"" <<  locale << "\" xml:lang=\"" <<   locale << "\"/>\n";
 		}
 
 		for (i = 0; i < listkey.getCount() && maxverses; i++) {
@@ -381,10 +383,11 @@
 				*parser = element->getUpperBound();
 				while (maxverses && *target->getKey() <= *parser) {
 					*output << (char*)target->getKeyText();
-					if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
-						*output << ": <font face=\"";
-						*output << font;
-						*output << "\">";
+					if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+						*output << ": <span ";
+						if (font) { *output << "style=\"font:\""  << font << ";\" " ;}
+						if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
+						*output << ">";
 					}
 					else if (outputformat == FMT_RTF) {
 						*output << ": {\\f1 ";
@@ -393,7 +396,7 @@
 						*output << ": ";
 					}
 					*output << target->renderText();
-					if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
+					if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
 						*output << "</font>";
 					}
 					else if (outputformat == FMT_RTF) {
@@ -420,11 +423,12 @@
 			else {
 				target->setKey(*listkey.getElement(i));
 				*output << (char*)target->getKeyText();
-				if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
-					*output << ": <font face=\"";
-					*output << font;
-					*output << "\">";
-				}
+				if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+						*output << ": <span ";
+						if (font) { *output << "style=\"font:\""  << font << ";\" " ;}
+						if (strcmp(modlocale,locale) !=0 ) { *output << "lang=\"" << modlocale << "\"";}
+						*output << ">";
+					}
 				else if (outputformat == FMT_RTF) {
 					*output << ": {\\f1 ";
 				}
@@ -432,8 +436,8 @@
 					*output << ": ";
 				}
 				*output << target->renderText();
-				if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
-					*output << "</font>";
+				if (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI) {
+					*output << "</span>";
 				}
 				else if (outputformat == FMT_RTF) {
 					*output << "}";

Modified: branches/sword-1-7-x/utilities/diatheke/corediatheke.h
===================================================================
--- branches/sword-1-7-x/utilities/diatheke/corediatheke.h	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/utilities/diatheke/corediatheke.h	2014-04-17 03:50:37 UTC (rev 3156)
@@ -62,7 +62,12 @@
 #define ST_REGEX 1     //  0
 #define ST_PHRASE 2    // -1
 #define ST_MULTIWORD 3 // -2
+#define ST_ENTRYATTRIB 4 // -3
+#define ST_CLUCENE 5 // -4
+#define ST_MULTILEMMA 6 // -5
 
+
+
 using namespace std;
 
 int hasalpha (char * string);

Modified: branches/sword-1-7-x/utilities/diatheke/diatheke.cpp
===================================================================
--- branches/sword-1-7-x/utilities/diatheke/diatheke.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/utilities/diatheke/diatheke.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -49,8 +49,9 @@
 	fprintf (stderr, "If <book> is \"system\" you may use these system keys: \"modulelist\",\n");
 	fprintf (stderr, "\"modulelistnames\", and \"localelist\".");
 	fprintf (stderr, "\n");
-	fprintf (stderr, "Valid search_type values are: regex, multiword, and phrase(def).\n");
-	fprintf (stderr, "Valid option_filters values are: n (Strong's numbers),\n");
+	fprintf (stderr, "Valid search_type values are: phrase (default), regex, multiword,\n");
+	fprintf (stderr, "  attribute, lucene, multilemma.\n");
+	fprintf (stderr, "Valid (output) option_filters values are: n (Strong's numbers),\n");
 	fprintf (stderr, "  f (Footnotes), m (Morphology), h (Section Headings),\n");
 	fprintf (stderr, "  c (Cantillation), v (Hebrew Vowels), a (Greek Accents), p (Arabic Vowels)\n");
 	fprintf (stderr, "  l (Lemmas), s (Scripture Crossrefs), r (Arabic Shaping),\n");
@@ -94,19 +95,30 @@
 		}
 		else if (!::stricmp("-s", argv[i])) {
 			if (i+1 <= argc) {
-				if (!::stricmp("phrase", argv[i+1])) {
+				i++;
+				if (!::stricmp("phrase", argv[i])) {
 					searchtype = ST_PHRASE;
-					i++;
 				}
-				else if (!::stricmp("regex", argv[i+1])) {
+				else if (!::stricmp("regex", argv[i])) {
 					searchtype = ST_REGEX;
-					i++;
 				}
-				else if (!::stricmp("multiword", argv[i+1])) {
+				else if (!::stricmp("multiword", argv[i])) {
 					searchtype = ST_MULTIWORD;
-					i++;
 				}
-				else i++;
+				else if (!::stricmp("lucene", argv[i])) {
+					searchtype = ST_CLUCENE;
+				}
+				else if (!::stricmp("attribute", argv[i])) {
+					searchtype = ST_ENTRYATTRIB;
+				}
+				else if (!::stricmp("multilemma", argv[i])) {
+					searchtype = ST_MULTILEMMA;
+				}
+				else {
+					fprintf (stderr, "Unknown search_type: %s\n", argv[i]);
+					fprintf (stderr, "Try diatheke --help\n");
+					return 0;
+				}
 			}
 		}
  		else if (!::stricmp("-r", argv[i])) {
@@ -263,6 +275,7 @@
 	if (runquery == (RQ_BOOK | RQ_REF)) {
  	    doquery(maxverses, outputformat, outputencoding, optionfilters, searchtype, range, text, locale, ref, &cout, script, variants);
 	}
+	//if we got this far without exiting, something went wrong, so print syntax
 	else printsyntax();
 
 	return 0;


Property changes on: branches/sword-1-7-x/utilities/kylixmake/mod2zmod.res
___________________________________________________________________
Deleted: svn:keywords
   - author date id
Deleted: svn:eol-style
   - native
Added: svn:mime-type
   + application/octet-stream

Modified: branches/sword-1-7-x/utilities/osis2mod.cpp
===================================================================
--- branches/sword-1-7-x/utilities/osis2mod.cpp	2014-04-15 21:27:54 UTC (rev 3155)
+++ branches/sword-1-7-x/utilities/osis2mod.cpp	2014-04-17 03:50:37 UTC (rev 3156)
@@ -4,7 +4,7 @@
  *
  * $Id$
  *
- * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2003-2014 CrossWire Bible Society (http://www.crosswire.org)
  *	CrossWire Bible Society
  *	P. O. Box 2528
  *	Tempe, AZ  85280-2528
@@ -414,10 +414,10 @@
  */
 void makeValidRef(VerseKey &key) {
 	VerseKey saveKey;
-	saveKey.setVersificationSystem(currentVerse.getVersificationSystem());
+	saveKey.setVersificationSystem(key.getVersificationSystem());
 	saveKey.setAutoNormalize(false);
 	saveKey.setIntros(true);
-	saveKey = currentVerse;
+	saveKey = key;
 
 	// Since isValidRef returned false constrain the key to the nearest prior reference.
 	// If we are past the last chapter set the reference to the last chapter
@@ -1140,7 +1140,7 @@
  * requiring each stored entry (i.e. verses) to be well-formed xml.
  * This routine normalizes container elements which could cross verse boundaries into milestones.
  * For most of these OSIS elements, there is a milestone form. However, p is not milestoneable.
- * For this reason, p is transformed into lb elements.
+ * For this reason, p is transformed into div elements with type x-p.
  * param t the tag to transform
  * return the transformed tag or the original one
  */
@@ -1161,9 +1161,9 @@
 
 	SWBuf tagName = t.getName();
 	if (!t.isEndTag()) {
-		// Transform <p> into <div type="paragraph"> and milestone it
+		// Transform <p> into <div type="x-p"> and milestone it
 		if (tagName == "p") {
-			t.setText("<div type=\"paragraph\" />");
+			t.setText("<div type=\"x-p\" />");
 			sprintf(buf, "gen%d", sID++);
 			t.setAttribute("sID", buf);
 		}
@@ -1222,7 +1222,7 @@
 			    tagName == "verse"
 			) {
 				// make this a clone of the start tag with sID changed to eID
-				// Note: in the case of </p> the topToken is a <div type="paragraph">
+				// Note: in the case of </p> the topToken is a <div type="x-p">
 				t = topToken;
 				t.setAttribute("eID", t.getAttribute("sID"));
 				t.setAttribute("sID", 0);
@@ -1277,10 +1277,10 @@
 	}
 }
 
-void usage(const char *app, const char *error = 0) {
-
+void usage(const char *app, const char *error = 0, const bool verboseHelp = false) {
+	
 	if (error) fprintf(stderr, "\n%s: %s\n", app, error);
-
+	
 	fprintf(stderr, "OSIS Bible/commentary module creation tool for The SWORD Project\n");
 	fprintf(stderr, "\nusage: %s <output/path> <osisDoc> [OPTIONS]\n", app);
 	fprintf(stderr, "  <output/path>\t\t an existing folder that the module will be written\n");
@@ -1293,38 +1293,58 @@
 	fprintf(stderr, "\t\t\t\t 2 - verse; 3 - chapter; 4 - book\n");
 	fprintf(stderr, "  -c <cipher_key>\t encipher module using supplied key\n");
 	fprintf(stderr, "\t\t\t\t (default no enciphering)\n");
+
+#ifdef _ICU_       
 	fprintf(stderr, "  -N\t\t\t do not convert UTF-8 or normalize UTF-8 to NFC\n");
-	fprintf(stderr, "\t\t\t\t (default is to convert to UTF-8, if needed,\n");
-	fprintf(stderr, "\t\t\t\t  and then normalize to NFC)\n");
-	fprintf(stderr, "\t\t\t\t Note: UTF-8 texts should be normalized to NFC.\n");
+	if (verboseHelp) {
+		fprintf(stderr, "\t\t\t\t (default is to convert to UTF-8, if needed,\n");
+		fprintf(stderr, "\t\t\t\t  and then normalize to NFC)\n");
+		fprintf(stderr, "\t\t\t\t Note: UTF-8 texts should be normalized to NFC.\n");
+	}
+#endif
+
 	fprintf(stderr, "  -s <2|4>\t\t bytes used to store entry size (default is 2).\n");
-	fprintf(stderr, "\t\t\t\t Note: useful for commentaries with very large\n");
-	fprintf(stderr, "\t\t\t\t entries in uncompressed modules\n");
-	fprintf(stderr, "\t\t\t\t (2 bytes to store size equal 65535 characters)\n");
+	if (verboseHelp) {
+		fprintf(stderr, "\t\t\t\t Note: useful for commentaries with very large\n");
+		fprintf(stderr, "\t\t\t\t entries in uncompressed modules\n");
+		fprintf(stderr, "\t\t\t\t (2 bytes to store size equal 65535 characters)\n");
+	}
 	fprintf(stderr, "  -v <v11n>\t\t specify a versification scheme to use (default is KJV)\n");
-	fprintf(stderr, "\t\t\t\t Note: The following are valid values for v11n:\n");
+	fprintf(stderr, "\t\t\t\t Note: The following are valid values for v11n:");
+
 	VersificationMgr *vmgr = VersificationMgr::getSystemVersificationMgr();
 	StringList av11n = vmgr->getVersificationSystems();
 	for (StringList::iterator loop = av11n.begin(); loop != av11n.end(); loop++) {
-		fprintf(stderr, "\t\t\t\t\t%s\n", (*loop).c_str());
+		if ((distance(av11n.begin(), loop) % 3) == 0) {
+			fprintf(stderr, "\n\t\t\t\t   %-12s", (*loop).c_str());
+		}
+		else {
+			fprintf(stderr, "\t%-12s", (*loop).c_str());
+		}
 	}
-	fprintf(stderr, "  -d <flags>\t\t turn on debugging (default is 0)\n");
-	fprintf(stderr, "\t\t\t\t Note: This flag may change in the future.\n");
-	fprintf(stderr, "\t\t\t\t Flags: The following are valid values:\n");
-	fprintf(stderr, "\t\t\t\t\t0   - no debugging\n");
-	fprintf(stderr, "\t\t\t\t\t1   - writes to module, very verbose\n");
-	fprintf(stderr, "\t\t\t\t\t2   - verse start and end\n");
-	fprintf(stderr, "\t\t\t\t\t4   - quotes, esp. Words of Christ\n");
-	fprintf(stderr, "\t\t\t\t\t8   - titles\n");
-	fprintf(stderr, "\t\t\t\t\t16  - inter-verse material\n");
-	fprintf(stderr, "\t\t\t\t\t32  - BSP to BCV transformations\n");
-	fprintf(stderr, "\t\t\t\t\t64  - v11n exceptions\n");
-	fprintf(stderr, "\t\t\t\t\t128 - parsing of osisID and osisRef\n");
-	fprintf(stderr, "\t\t\t\t\t256 - internal stack\n");
-	fprintf(stderr, "\t\t\t\t\t512 - miscellaneous\n");
-	fprintf(stderr, "\t\t\t\t This argument can be used more than once. (Or\n");
-	fprintf(stderr, "\t\t\t\t the flags may be added together.)\n");
 	fprintf(stderr, "\n");
+	
+	if (verboseHelp) {
+		fprintf(stderr, "  -d <flags>\t\t turn on debugging (default is 0)\n");
+		fprintf(stderr, "\t\t\t\t Note: This flag may change in the future.\n");
+		fprintf(stderr, "\t\t\t\t Flags: The following are valid values:\n");
+		fprintf(stderr, "\t\t\t\t\t0   - no debugging\n");
+		fprintf(stderr, "\t\t\t\t\t1   - writes to module, very verbose\n");
+		fprintf(stderr, "\t\t\t\t\t2   - verse start and end\n");
+		fprintf(stderr, "\t\t\t\t\t4   - quotes, esp. Words of Christ\n");
+		fprintf(stderr, "\t\t\t\t\t8   - titles\n");
+		fprintf(stderr, "\t\t\t\t\t16  - inter-verse material\n");
+		fprintf(stderr, "\t\t\t\t\t32  - BSP to BCV transformations\n");
+		fprintf(stderr, "\t\t\t\t\t64  - v11n exceptions\n");
+		fprintf(stderr, "\t\t\t\t\t128 - parsing of osisID and osisRef\n");
+		fprintf(stderr, "\t\t\t\t\t256 - internal stack\n");
+		fprintf(stderr, "\t\t\t\t\t512 - miscellaneous\n");
+		fprintf(stderr, "\t\t\t\t This argument can be used more than once. (Or\n");
+		fprintf(stderr, "\t\t\t\t the flags may be added together.)\n");
+	}
+	fprintf(stderr, "  -h \t\t\t print verbose usage text\n");
+	
+	fprintf(stderr, "\n");
 	fprintf(stderr, "See http://www.crosswire.org/wiki/osis2mod for more details.\n");
 	fprintf(stderr, "\n");
 	exit(EXIT_BAD_ARG);
@@ -1532,6 +1552,14 @@
 int main(int argc, char **argv) {
 
 	fprintf(stderr, "You are running osis2mod: $Rev$\n");
+	
+	if (argc > 1) {
+		for (int i = 1; i < argc; i++) {
+			if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
+				usage(*argv, "", true);
+			}
+		}
+	}
 
 	// Let's test our command line arguments
 	if (argc < 3) {




More information about the sword-cvs mailing list