summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--ChangeLog57
-rw-r--r--LICENSE46
-rw-r--r--Makefile.in1
-rw-r--r--aclocal.m415
-rw-r--r--bindings/csharp/AssemblyInfo.cs39
-rw-r--r--bindings/csharp/InstallManager.cs97
-rw-r--r--bindings/csharp/Makefile7
-rw-r--r--bindings/csharp/Manager.cs162
-rw-r--r--bindings/csharp/Module.cs214
-rw-r--r--bindings/csharp/NativeMethods.cs260
-rw-r--r--bindings/csharp/README24
-rw-r--r--bindings/csharp/Sword.csproj44
-rw-r--r--bindings/csharp/Sword.sln39
-rw-r--r--bindings/csharp/examples/LookupExample.cs117
-rw-r--r--bindings/csharp/examples/LookupExample.csproj45
-rw-r--r--bindings/csharp/examples/Makefile7
-rw-r--r--bindings/csharp/sword.snkbin0 -> 596 bytes
-rw-r--r--bindings/csharp/tests/AssemblyInfo.cs40
-rw-r--r--bindings/csharp/tests/InstallManagerTests.cs132
-rw-r--r--bindings/csharp/tests/Main.cs25
-rw-r--r--bindings/csharp/tests/ManagerTests.cs111
-rw-r--r--bindings/csharp/tests/ModuleTests.cs162
-rw-r--r--bindings/csharp/tests/Sword.Tests.csproj57
-rw-r--r--bindings/flatapi.cpp1578
-rw-r--r--bindings/java-jni/jni/swordstub.cpp13
-rw-r--r--bindings/swig/package/aclocal.m415
-rwxr-xr-xbindings/swig/package/config.guess151
-rwxr-xr-xbindings/swig/package/config.sub30
-rwxr-xr-xbindings/swig/package/configure4
-rw-r--r--bindings/swig/package/m4/libtool.m44
-rwxr-xr-xconfig.guess151
-rwxr-xr-xconfig.sub30
-rwxr-xr-xconfigure58
-rw-r--r--configure.ac34
-rw-r--r--doc/Doxyfile2
-rwxr-xr-xdoc/QUICKSTART.ubuntu34
-rw-r--r--examples/Makefile.am2
-rw-r--r--examples/Makefile.in3
-rw-r--r--examples/classes/Makefile4
-rw-r--r--examples/classes/flatapilookup.c63
-rw-r--r--examples/classes/flatapiparsekey.c65
-rw-r--r--examples/classes/flatapisearch.c66
-rw-r--r--examples/classes/simplechapter.cpp (renamed from examples/classes/showchapter.cpp)10
-rw-r--r--examples/cmdline/Makefile.in1
-rw-r--r--examples/cmdline/lookup.cpp9
-rw-r--r--examples/tasks/CMakeLists.txt15
-rw-r--r--examples/tasks/Makefile.am11
-rw-r--r--examples/tasks/Makefile.in619
-rw-r--r--examples/tasks/parallelbibles.cpp180
-rw-r--r--include/bz2comprs.h4
-rw-r--r--include/defs.h12
-rw-r--r--include/flatapi.h533
-rw-r--r--include/rawstr.h4
-rw-r--r--include/rawstr4.h4
-rw-r--r--include/rawverse.h4
-rw-r--r--include/rawverse4.h4
-rw-r--r--include/swcomprs.h4
-rw-r--r--include/swmgr.h20
-rw-r--r--include/swversion.h8
-rw-r--r--include/thmlxhtml.h4
-rw-r--r--include/utf8nfc.h5
-rw-r--r--include/xzcomprs.h4
-rw-r--r--include/ztext.h13
-rw-r--r--include/zverse.h4
-rw-r--r--lib/Makefile.in1
-rw-r--r--lib/vcppmake/libsword.vcxproj4
-rw-r--r--m4/libtool.m44
-rw-r--r--src/mgr/swmgr.cpp4
-rw-r--r--src/modules/comments/zcom/zcom.cpp22
-rw-r--r--src/modules/common/bz2comprs.cpp4
-rw-r--r--src/modules/common/rawstr.cpp7
-rw-r--r--src/modules/common/rawstr4.cpp7
-rw-r--r--src/modules/common/rawverse.cpp5
-rw-r--r--src/modules/common/rawverse4.cpp8
-rw-r--r--src/modules/common/swcomprs.cpp4
-rw-r--r--src/modules/common/xzcomprs.cpp4
-rw-r--r--src/modules/common/zipcomprs.cpp4
-rw-r--r--src/modules/common/zverse.cpp54
-rw-r--r--src/modules/filters/osisheadings.cpp18
-rw-r--r--src/modules/filters/osishtmlhref.cpp24
-rw-r--r--src/modules/filters/osismorphsegmentation.cpp8
-rw-r--r--src/modules/filters/osisplain.cpp4
-rw-r--r--src/modules/filters/osisrtf.cpp6
-rw-r--r--src/modules/filters/osisscripref.cpp6
-rw-r--r--src/modules/filters/osisxhtml.cpp36
-rw-r--r--src/modules/filters/teihtmlhref.cpp27
-rw-r--r--src/modules/filters/teirtf.cpp19
-rw-r--r--src/modules/filters/teixhtml.cpp22
-rw-r--r--src/modules/filters/thmlheadings.cpp26
-rw-r--r--src/modules/filters/thmlscripref.cpp6
-rw-r--r--src/modules/filters/thmlxhtml.cpp20
-rw-r--r--src/modules/filters/unicodertf.cpp3
-rw-r--r--src/modules/filters/utf16utf8.cpp5
-rw-r--r--src/modules/filters/utf8html.cpp3
-rw-r--r--src/modules/filters/utf8latin1.cpp5
-rw-r--r--src/modules/filters/utf8nfc.cpp17
-rw-r--r--src/modules/filters/utf8nfkd.cpp6
-rw-r--r--src/modules/filters/utf8utf16.cpp6
-rw-r--r--tests/Makefile.in1
-rw-r--r--tests/cppunit/Makefile.in1
-rw-r--r--tests/osistest.cpp4
-rwxr-xr-xusrinst.sh11
-rw-r--r--utilities/Makefile.in1
-rw-r--r--utilities/diatheke/Makefile.in1
-rw-r--r--utilities/diatheke/README4
-rw-r--r--utilities/diatheke/corediatheke.cpp90
-rw-r--r--utilities/diatheke/corediatheke.h8
-rw-r--r--utilities/diatheke/diatheke.cpp53
-rw-r--r--utilities/diatheke/diathekemgr.cpp7
-rw-r--r--utilities/osis2mod.cpp107
111 files changed, 5221 insertions, 949 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c82f15d..7d943d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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 @@ ENDIF(NOT SWORD_BUILD_UTILS STREQUAL "No")
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")
##############################################################################################
diff --git a/ChangeLog b/ChangeLog
index a8eeb32..18f2a9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
API ChangeLog
+27-Apr-2014 Troy A. Griffitts <scribe@crosswire.org>
+ Added C# bindings contributed by Daniel Hughes <trampster@gmail.com>
* Release 1.7.0 *
@@ -8,15 +10,16 @@ API ChangeLog
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@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@crosswire.org>
Added basic bibliography method to SWModule
@@ -115,10 +118,10 @@ API ChangeLog
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@crosswire.org>
@@ -165,8 +168,8 @@ API ChangeLog
30-Jan-2012 Manfred Bergmann <manfred.bergmann@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@crosswire.org>
Removed SynodalP v11n from library
@@ -212,8 +215,8 @@ API ChangeLog
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@crosswire.org>
Introducing localised keys to imp2vs.cpp
@@ -1357,10 +1360,11 @@ Kolatzek.
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 +1380,9 @@ Kolatzek.
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 +1404,17 @@ Kolatzek.
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 +1428,8 @@ Kolatzek.
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 +1448,9 @@ Kolatzek.
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 ...
diff --git a/LICENSE b/LICENSE
index c1bc4e5..e7b0341 100644
--- a/LICENSE
+++ b/LICENSE
@@ -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 @@ software--to make sure the software is free for all its users. This
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 @@ patent must be licensed for everyone's free use or not licensed at all.
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 @@ above, provided that you also meet all of these conditions:
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 from a designated place, then offering equivalent
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 @@ impose that choice.
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 @@ make exceptions for this. Our decision will be guided by the two goals
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,9 +288,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
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
@@ -302,7 +302,7 @@ convey the exclusion of warranty; and each file should have at least
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 @@ the "copyright" line and a pointer to where the full notice is found.
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 @@ necessary. Here is a sample; alter the names:
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.
diff --git a/Makefile.in b/Makefile.in
index 36b209e..ecd78dd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -308,7 +308,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/aclocal.m4 b/aclocal.m4
index fea5b70..7f0263d 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -220,6 +220,21 @@ m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_NOARCH_INSTALLDIR
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
+
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
diff --git a/bindings/csharp/AssemblyInfo.cs b/bindings/csharp/AssemblyInfo.cs
new file mode 100644
index 0000000..896a505
--- /dev/null
+++ b/bindings/csharp/AssemblyInfo.cs
@@ -0,0 +1,39 @@
+// 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.
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle("Sword")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("daniel")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
diff --git a/bindings/csharp/InstallManager.cs b/bindings/csharp/InstallManager.cs
new file mode 100644
index 0000000..186ad2f
--- /dev/null
+++ b/bindings/csharp/InstallManager.cs
@@ -0,0 +1,97 @@
+// 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.
+using System;
+using System.Collections.Generic;
+
+namespace Sword
+{
+ public class InstallManager : IDisposable
+ {
+ readonly IntPtr _handle;
+
+ public InstallManager (string baseDirectory)
+ {
+ _handle = NativeMethods.org_crosswire_sword_InstallMgr_new(baseDirectory, IntPtr.Zero);
+ }
+
+ public void SetUserDisclaimerConfirmed()
+ {
+ NativeMethods.org_crosswire_sword_InstallMgr_setUserDisclaimerConfirmed(_handle);
+ }
+
+ /// <summary>
+ /// Retrieves a list of sources from the master server.
+ /// </summary>
+ /// <returns>
+ /// True if successful
+ /// False if SetUserDisclaimerConfirmed has not been called.
+ /// False if the sync failed.
+ /// </returns>
+ public bool SyncConfig()
+ {
+ int result = NativeMethods.org_crosswire_sword_InstallMgr_syncConfig(_handle);
+ return result == 0 ? true : false;
+ }
+
+ /// <summary>
+ /// Gets the remote sources.
+ /// You may need to call SyncConfig before calling this
+ /// to get an upto date source list.
+ /// </summary>
+ public IEnumerable<string> RemoteSources
+ {
+ get
+ {
+ IntPtr remoteSourcesPtr = NativeMethods.org_crosswire_sword_InstallMgr_getRemoteSources(_handle);
+ return NativeMethods.MarshalStringArray(remoteSourcesPtr);
+ }
+ }
+
+ public bool RefreshRemoteSource(string sourceName)
+ {
+ int result = NativeMethods.org_crosswire_sword_InstallMgr_refreshRemoteSource(_handle, sourceName);
+ return result == 0 ? true : false;
+ }
+
+ public IEnumerable<ModInfo> GetRemoteModInfoList(Manager manager, string sourceName)
+ {
+ IntPtr pointer = NativeMethods.org_crosswire_sword_InstallMgr_getRemoteModInfoList(_handle, manager.Handle, sourceName);
+ return NativeMethods.MarshallModInfoArray(pointer);
+ }
+
+ public bool RemoteInstallModule(Manager to, string sourceName, string modName)
+ {
+ int result = NativeMethods.org_crosswire_sword_InstallMgr_remoteInstallModule(_handle, to.Handle, sourceName, modName);
+ return result == 0 ? true : false;
+ }
+
+ protected void Dispose(bool disposing)
+ {
+ if(disposing)
+ {
+ if(_handle != IntPtr.Zero)
+ {
+ NativeMethods.org_crosswire_sword_InstallMgr_delete(_handle);
+ }
+ }
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.Collect();
+ }
+ }
+}
+
diff --git a/bindings/csharp/Makefile b/bindings/csharp/Makefile
new file mode 100644
index 0000000..98047cd
--- /dev/null
+++ b/bindings/csharp/Makefile
@@ -0,0 +1,7 @@
+all: Sword.exe
+
+Sword.exe:
+ xbuild Sword.csproj /p:Configuration=Release
+
+clean:
+ xbuild Sword.csproj /p:Configuration=Release /t:Clean
diff --git a/bindings/csharp/Manager.cs b/bindings/csharp/Manager.cs
new file mode 100644
index 0000000..85d9a83
--- /dev/null
+++ b/bindings/csharp/Manager.cs
@@ -0,0 +1,162 @@
+// 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.
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Sword
+{
+ public class Manager : IDisposable
+ {
+ IntPtr _handle;
+
+ public Manager ()
+ {
+ _handle = NativeMethods.org_crosswire_sword_SWMgr_new();
+ }
+
+ public Manager (string path)
+ {
+ _handle = NativeMethods.org_crosswire_sword_SWMgr_newWithPath(path);
+ }
+
+
+ internal IntPtr Handle
+ {
+ get
+ {
+ return _handle;
+ }
+ }
+
+ protected void Dispose(bool disposing)
+ {
+ if(disposing)
+ {
+ if(_handle != IntPtr.Zero)
+ {
+ NativeMethods.org_crosswire_sword_SWMgr_delete(_handle);
+ _handle = IntPtr.Zero;
+ }
+ }
+ }
+
+ public Module GetModuleByName(string name)
+ {
+ IntPtr modulePtr = NativeMethods.org_crosswire_sword_SWMgr_getModuleByName(_handle, name);
+ if(modulePtr == IntPtr.Zero)
+ {
+ return null;
+ }
+ return new Module(modulePtr);
+ }
+
+ /// <summary>
+ /// Gets a list of the installed modules
+ /// </summary>
+ public IEnumerable<ModInfo> GetModInfoList()
+ {
+ IntPtr modulesPointer = NativeMethods.org_crosswire_sword_SWMgr_getModInfoList(_handle);
+ ModInfo modInfo = (ModInfo)Marshal.PtrToStructure(modulesPointer, typeof(ModInfo));
+
+ while (modInfo.Name != null)
+ {
+ yield return modInfo;
+ modulesPointer = new IntPtr(modulesPointer.ToInt64() + Marshal.SizeOf(typeof(ModInfo)));
+ modInfo = (ModInfo)Marshal.PtrToStructure(modulesPointer, typeof(ModInfo));
+ }
+ }
+
+ public string Version
+ {
+ get
+ {
+ IntPtr versionPtr = NativeMethods.org_crosswire_sword_SWMgr_version(_handle);
+ return Marshal.PtrToStringAnsi(versionPtr);
+ }
+ }
+
+ public string PrefixPath
+ {
+ get
+ {
+ IntPtr prefixPathPtr = NativeMethods.org_crosswire_sword_SWMgr_getPrefixPath(_handle);
+ return Marshal.PtrToStringAnsi(prefixPathPtr);
+ }
+ }
+
+ public string ConfigPath
+ {
+ get
+ {
+ IntPtr configPathPtr = NativeMethods.org_crosswire_sword_SWMgr_getConfigPath(_handle);
+ return Marshal.PtrToStringAnsi(configPathPtr);
+ }
+ }
+
+ public void SetGlobalOption(string option, string @value)
+ {
+ NativeMethods.org_crosswire_sword_SWMgr_setGlobalOption(_handle, option, @value);
+ }
+
+ public IEnumerable<string> GetGlobalOptionValues(string option)
+ {
+ IntPtr optionsPtr = NativeMethods.org_crosswire_sword_SWMgr_getGlobalOptionValues(_handle, option);
+ return NativeMethods.MarshalStringArray(optionsPtr);
+ }
+
+ public void SetCipherKey(string modName, byte[] key)
+ {
+ NativeMethods.org_crosswire_sword_SWMgr_setCipherKey(_handle, modName, key);
+ }
+
+ public bool Javascript
+ {
+ set
+ {
+ NativeMethods.org_crosswire_sword_SWMgr_setJavascript(_handle, value);
+ }
+ }
+
+ public IEnumerable<string> AvailableLocales
+ {
+ get
+ {
+ IntPtr localesPtr = NativeMethods.org_crosswire_sword_SWMgr_getAvailableLocales(_handle);
+ return NativeMethods.MarshalStringArray(localesPtr);
+ }
+ }
+
+ public string DefaultLocale
+ {
+ set
+ {
+ NativeMethods.org_crosswire_sword_SWMgr_setDefaultLocale(_handle, value);
+ }
+ }
+
+ public string Translate(string text, string localeName)
+ {
+ IntPtr translatedPtr = NativeMethods.org_crosswire_sword_SWMgr_translate(_handle, text, localeName);
+ return Marshal.PtrToStringAnsi(translatedPtr);
+ }
+
+ public void Dispose ()
+ {
+ Dispose (true);
+ GC.Collect();
+ }
+ }
+}
+
diff --git a/bindings/csharp/Module.cs b/bindings/csharp/Module.cs
new file mode 100644
index 0000000..b9cb965
--- /dev/null
+++ b/bindings/csharp/Module.cs
@@ -0,0 +1,214 @@
+// 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.
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+
+namespace Sword
+{
+ public class Module
+ {
+ IntPtr _handle;
+
+ internal Module(IntPtr handle)
+ {
+ _handle = handle;
+ }
+
+ public string Name
+ {
+ get
+ {
+ IntPtr namePtr = NativeMethods.org_crosswire_sword_SWModule_getName(_handle);
+ return Marshal.PtrToStringAnsi(namePtr);
+ }
+ }
+
+ public string Description
+ {
+ get
+ {
+ IntPtr descriptionPtr = NativeMethods.org_crosswire_sword_SWModule_getDescription(_handle);
+ return Marshal.PtrToStringAnsi(descriptionPtr);
+ }
+ }
+
+ public string Category
+ {
+ get
+ {
+ IntPtr categoryPtr = NativeMethods.org_crosswire_sword_SWModule_getCategory(_handle);
+ return Marshal.PtrToStringAnsi(categoryPtr);
+ }
+ }
+
+
+ /// <summary>
+ /// 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)
+ /// </summary>
+ public string KeyText
+ {
+ get
+ {
+ IntPtr keyTextPtr = NativeMethods.org_crosswire_sword_SWModule_getKeyText(_handle);
+ return Marshal.PtrToStringAnsi(keyTextPtr);
+ }
+ set
+ {
+ NativeMethods.org_crosswire_sword_SWModule_setKeyText(_handle, value);
+ }
+ }
+
+ public string RenderText()
+ {
+ IntPtr keyTextPtr = NativeMethods.org_crosswire_sword_SWModule_renderText(_handle);
+ return Marshal.PtrToStringAnsi(keyTextPtr);
+ }
+
+ public string RawEntry
+ {
+ get
+ {
+ IntPtr keyTextPtr = NativeMethods.org_crosswire_sword_SWModule_getRawEntry(_handle);
+ return Marshal.PtrToStringAnsi(keyTextPtr);
+ }
+ set
+ {
+ NativeMethods.org_crosswire_sword_SWModule_setRawEntry(_handle, value);
+ }
+ }
+
+ public string StripText()
+ {
+ IntPtr keyTextPtr = NativeMethods.org_crosswire_sword_SWModule_stripText(_handle);
+ return Marshal.PtrToStringAnsi(keyTextPtr);
+ }
+
+ public IEnumerable<SearchHit> Search(string searchString, SearchType searchType, long flags, string scope)
+ {
+ IntPtr searchHitPtr = NativeMethods.org_crosswire_sword_SWModule_search(_handle, searchString, (int)searchType, flags, scope, IntPtr.Zero);
+ SearchHit searchHit = (SearchHit)Marshal.PtrToStructure(searchHitPtr, typeof(SearchHit));
+ while (!searchHit.IsNull())
+ {
+ yield return searchHit;
+ searchHitPtr = new IntPtr(searchHitPtr.ToInt64() + Marshal.SizeOf(typeof(SearchHit)));
+ searchHit = (SearchHit)Marshal.PtrToStructure(searchHitPtr, typeof(SearchHit));
+ }
+ }
+
+ public void TerminateSearch()
+ {
+ NativeMethods.org_crosswire_sword_SWModule_terminateSearch(_handle);
+ }
+
+ public char PopError()
+ {
+ return NativeMethods.org_crosswire_sword_SWModule_popError(_handle);
+ }
+
+ public long EntrySize
+ {
+ get
+ {
+ return NativeMethods.org_crosswire_sword_SWModule_getEntrySize(_handle);
+ }
+ }
+
+ public IEnumerable<string> GetEntryAttribute(string level1, string level2, string level3, char filteredBool)
+ {
+ IntPtr attributePtrs = NativeMethods.org_crosswire_sword_SWModule_getEntryAttribute(_handle, level1, level2, level3, filteredBool);
+ return NativeMethods.MarshalStringArray(attributePtrs);
+ }
+
+ public IEnumerable<string> ParseKeyList(string keyText)
+ {
+ IntPtr keyListPtrs = NativeMethods.org_crosswire_sword_SWModule_parseKeyList(_handle, keyText);
+ return NativeMethods.MarshalStringArray(keyListPtrs);
+ }
+
+ public bool HasKeyChildren()
+ {
+ char hasChildren = NativeMethods.org_crosswire_sword_SWModule_hasKeyChildren(_handle);
+ return hasChildren == 1 ? true : false;
+ }
+
+ /// <summary>
+ /// 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]
+ /// </summary>
+ public IEnumerable<string> KeyChildren
+ {
+ get
+ {
+ IntPtr childrenPtr = NativeMethods.org_crosswire_sword_SWModule_getKeyChildren(_handle);
+ return NativeMethods.MarshalStringArray(childrenPtr);
+ }
+ }
+
+ public string KeyParent
+ {
+ get
+ {
+ IntPtr keyPtr = NativeMethods.org_crosswire_sword_SWModule_getKeyChildren(_handle);
+ return Marshal.PtrToStringAnsi(keyPtr);
+ }
+ }
+
+ public void Prevous()
+ {
+ NativeMethods.org_crosswire_sword_SWModule_previous(_handle);
+ }
+
+ public void Next()
+ {
+ NativeMethods.org_crosswire_sword_SWModule_next(_handle);
+ }
+
+ public void Begin()
+ {
+ NativeMethods.org_crosswire_sword_SWModule_begin(_handle);
+ }
+
+ public string RenderHeader
+ {
+ get
+ {
+ IntPtr headerPtr = NativeMethods.org_crosswire_sword_SWModule_getRenderHeader(_handle);
+ return Marshal.PtrToStringAnsi(headerPtr);
+ }
+ }
+
+ public string GetConfigEntry(string key)
+ {
+ IntPtr entryPtr = NativeMethods.org_crosswire_sword_SWModule_getConfigEntry(_handle, key);
+ return Marshal.PtrToStringAnsi(entryPtr);
+ }
+
+ public void DeleteSearchFramework()
+ {
+ NativeMethods.org_crosswire_sword_SWModule_deleteSearchFramework(_handle);
+ }
+
+ public bool HasSearchFramework()
+ {
+ return NativeMethods.org_crosswire_sword_SWModule_hasSearchFramework(_handle);
+ }
+ }
+}
+
diff --git a/bindings/csharp/NativeMethods.cs b/bindings/csharp/NativeMethods.cs
new file mode 100644
index 0000000..6a3c911
--- /dev/null
+++ b/bindings/csharp/NativeMethods.cs
@@ -0,0 +1,260 @@
+// 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.
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+
+namespace Sword
+{
+ public enum SearchType
+ {
+ REGEX = 1,
+ PHRASE = -1,
+ MULTIWORD = -2,
+ ENTRYATTR = -3,
+ LUCENE = -4
+ };
+
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+ public struct ModInfo
+ {
+ public string Name;
+ public string Description;
+ public string Category;
+ public string Language;
+ };
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct SearchHit
+ {
+ IntPtr _modName;
+ IntPtr _key;
+ long Score;
+
+ public bool IsNull()
+ {
+ return _key == IntPtr.Zero;
+ }
+ public string Key
+ {
+ get
+ {
+ if(_key == IntPtr.Zero)
+ {
+ return null;
+ }
+ return Marshal.PtrToStringAnsi(_key);
+ }
+ }
+
+ public string ModName
+ {
+ get
+ {
+ if(_modName == IntPtr.Zero)
+ {
+ return null;
+ }
+ return Marshal.PtrToStringAnsi(_modName);
+ }
+ }
+ };
+
+ public static class NativeMethods
+ {
+
+
+ public const string DLLNAME = "libsword.so";
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_new();
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_newWithPath(string path);
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_getModuleByName(IntPtr hSWMgr, string moduleName);
+
+ [DllImport(DLLNAME)]
+ public static extern void org_crosswire_sword_SWModule_setKeyText(IntPtr hSWModule, string key);
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWModule_renderText(IntPtr hSWModule);
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getRawEntry(IntPtr hSWModule);
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getKeyText(IntPtr hSWModule);
+
+ [DllImport(DLLNAME)]
+ public static extern void org_crosswire_sword_SWMgr_delete(IntPtr hSWMgr);
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_getModInfoList(IntPtr hSWMgr);
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWModule_stripText(IntPtr hSWModule);
+
+ [DllImport(DLLNAME)]
+ public static extern void org_crosswire_sword_SWModule_setRawEntry(IntPtr hSWModule, string entryBuffer);
+
+ [DllImport(DLLNAME)]
+ public static extern void org_crosswire_sword_SWModule_terminateSearch(IntPtr hSWModule);
+
+ [DllImport(DLLNAME)]
+ public static extern char org_crosswire_sword_SWModule_popError(IntPtr hSWModule);
+
+ [DllImport(DLLNAME)]
+ public static extern long org_crosswire_sword_SWModule_getEntrySize(IntPtr hSWModule);
+
+ [DllImport(DLLNAME)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getEntryAttribute(IntPtr hSWModule, string level1, string level2, string level3, char filteredBool);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_parseKeyList(IntPtr hSWModule, string keyText);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_search(IntPtr hSWModule, string searchString, int searchType, long flags, string scope, IntPtr progressReporter);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern char org_crosswire_sword_SWModule_hasKeyChildren(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getKeyChildren(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getName(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getDescription(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getCategory(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getKeyParent(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWModule_previous(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWModule_next(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWModule_begin(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getRenderHeader(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWModule_getConfigEntry(IntPtr hSWModule, string key);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWModule_deleteSearchFramework(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern bool org_crosswire_sword_SWModule_hasSearchFramework(IntPtr hSWModule);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_version(IntPtr hSWMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_getPrefixPath(IntPtr hSWMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_getConfigPath(IntPtr hSWMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWMgr_setGlobalOption(IntPtr hSWMgr, string option, string val);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_getGlobalOptionValues(IntPtr hSWMgr, string option);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWMgr_setCipherKey(IntPtr hSWMgr, string modName, byte[] key);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWMgr_setJavascript(IntPtr hSWMgr, bool valueBool);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_getAvailableLocales(IntPtr hSWMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_SWMgr_setDefaultLocale(IntPtr hSWMgr, string name);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_SWMgr_translate(IntPtr hSWMgr, string text, string localeName);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_InstallMgr_reInit(IntPtr hInstallMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_InstallMgr_new(string baseDir, IntPtr statusReporter);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_InstallMgr_setUserDisclaimerConfirmed(IntPtr hInstallMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern int org_crosswire_sword_InstallMgr_syncConfig(IntPtr hInstallMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_InstallMgr_getRemoteSources(IntPtr hInstallMgr);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern IntPtr org_crosswire_sword_InstallMgr_getRemoteModInfoList(IntPtr hInstallMgr, IntPtr hSWMgr_deltaCompareTo, string sourceName);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern int org_crosswire_sword_InstallMgr_refreshRemoteSource(IntPtr hInstallMgr, string sourceName);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern int org_crosswire_sword_InstallMgr_remoteInstallModule(IntPtr hInstallMgr_from, IntPtr hSWMgr_to, string sourceName, string modName);
+
+ [DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
+ public static extern void org_crosswire_sword_InstallMgr_delete(IntPtr hInstallMgr);
+
+ public static IEnumerable<string> MarshalStringArray(IntPtr arrayPtr)
+ {
+ if(arrayPtr == IntPtr.Zero)
+ {
+ yield break;
+ }
+
+ while(arrayPtr != IntPtr.Zero)
+ {
+ IntPtr ptr = Marshal.ReadIntPtr(arrayPtr);
+ if(ptr == IntPtr.Zero)
+ {
+ yield break;
+ }
+ string key = Marshal.PtrToStringAnsi(ptr);
+ yield return key;
+ arrayPtr = new IntPtr(arrayPtr.ToInt64() + IntPtr.Size);
+ }
+ }
+
+ public static IEnumerable<ModInfo> MarshallModInfoArray(IntPtr pointer)
+ {
+ ModInfo modInfo = (ModInfo)Marshal.PtrToStructure(pointer, typeof(ModInfo));
+
+ while (modInfo.Name != null)
+ {
+ yield return modInfo;
+ pointer = new IntPtr(pointer.ToInt64() + Marshal.SizeOf(typeof(ModInfo)));
+ modInfo = (ModInfo)Marshal.PtrToStructure(pointer, typeof(ModInfo));
+ }
+ }
+ }
+}
+
diff --git a/bindings/csharp/README b/bindings/csharp/README
new file mode 100644
index 0000000..11ad4c5
--- /dev/null
+++ b/bindings/csharp/README
@@ -0,0 +1,24 @@
+Building on debian/ubuntu the commandline way
+1. sudo apt-get install cli-common-dev
+2. sudo apt-get install mono-xbuild
+3. navigate to bindings/csharp
+4. make or xbuild Sword.csproj to build the bindings project only
+5. xbuild Sword.sln to build everything; bindings, unit tests and LookupExample.
+
+Building on debian/ubuntu the IDE way
+1. sudo apt-get install MonoDevelop
+2. launch MonoDevelop and open sword/bindings/csharp/Sword.sln
+3. Hit the run button
+
+Unit Tests
+MonoDevelop has a unit test runner built in.
+1. launch the Sword.sln file in monodevelop
+2. View->Unit Testing
+3. Right click on top level test (Sword)
+4. Run test
+
+LookupExample
+1. Navigate to sword/bindings/csharp/examples
+2. make
+3. output will be in bin/Release
+4. mono LookupExample.exe KJV john.3.16
diff --git a/bindings/csharp/Sword.csproj b/bindings/csharp/Sword.csproj
new file mode 100644
index 0000000..544703c
--- /dev/null
+++ b/bindings/csharp/Sword.csproj
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{EFEE3557-86F2-4E46-AF7E-8BADEE240764}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>Sword</RootNamespace>
+ <AssemblyName>CSSword</AssemblyName>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>sword.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AssemblyInfo.cs" />
+ <Compile Include="NativeMethods.cs" />
+ <Compile Include="Module.cs" />
+ <Compile Include="Manager.cs" />
+ <Compile Include="InstallManager.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/bindings/csharp/Sword.sln b/bindings/csharp/Sword.sln
new file mode 100644
index 0000000..9ff1ea6
--- /dev/null
+++ b/bindings/csharp/Sword.sln
@@ -0,0 +1,39 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sword", "Sword.csproj", "{EFEE3557-86F2-4E46-AF7E-8BADEE240764}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sword.Tests", "tests\Sword.Tests.csproj", "{72212684-1186-4F68-8FBD-BDBFDB8CC9BC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LookupExample", "examples\LookupExample.csproj", "{60F12DE9-FBC5-42B1-8341-9AB097D661AE}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {60F12DE9-FBC5-42B1-8341-9AB097D661AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {60F12DE9-FBC5-42B1-8341-9AB097D661AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {60F12DE9-FBC5-42B1-8341-9AB097D661AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {60F12DE9-FBC5-42B1-8341-9AB097D661AE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {72212684-1186-4F68-8FBD-BDBFDB8CC9BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {72212684-1186-4F68-8FBD-BDBFDB8CC9BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {72212684-1186-4F68-8FBD-BDBFDB8CC9BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {72212684-1186-4F68-8FBD-BDBFDB8CC9BC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EFEE3557-86F2-4E46-AF7E-8BADEE240764}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EFEE3557-86F2-4E46-AF7E-8BADEE240764}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EFEE3557-86F2-4E46-AF7E-8BADEE240764}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EFEE3557-86F2-4E46-AF7E-8BADEE240764}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = Sword.csproj
+ Policies = $0
+ $0.DotNetNamingPolicy = $1
+ $1.DirectoryNamespaceAssociation = None
+ $1.ResourceNamePolicy = FileFormatDefault
+ $0.StandardHeader = $2
+ $2.Text = @Copyright 2002-2014 CrossWire Bible Society (http://www.crosswire.org)\n \tCrossWire Bible Society\n \tP. O. Box 2528\n \tTempe, AZ 85280-2528\n \n This program is free software; you can redistribute it and/or modify it\n under the terms of the GNU General Public License as published by the\n Free Software Foundation version 2.\n \n This program is distributed in the hope that it will be useful, but\n WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n General Public License for more details.
+ $2.IncludeInNewFiles = True
+ EndGlobalSection
+EndGlobal
diff --git a/bindings/csharp/examples/LookupExample.cs b/bindings/csharp/examples/LookupExample.cs
new file mode 100644
index 0000000..5a63e88
--- /dev/null
+++ b/bindings/csharp/examples/LookupExample.cs
@@ -0,0 +1,117 @@
+// 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.
+using System;
+
+namespace Sword.Tests
+{
+ class LookupExample
+ {
+ public static void Main (string[] args)
+ {
+ if (args.Length != 2)
+ {
+ Console.WriteLine ("usage: lookup <module> <key>");
+ return;
+ }
+ Lookup(args[0], args[1]);
+ return;
+ }
+
+ public static void Lookup(string modName, string key)
+ {
+ using(var manager = new Manager())
+ {
+ var module = manager.GetModuleByName(modName);
+
+ if (module == null)
+ {
+ Console.Error.WriteLine("Could not find module {0}. Available modules:", modName);
+ foreach(var modInfo in manager.GetModInfoList())
+ {
+ Console.WriteLine ("{0}\t - {1}", modInfo.Name, modInfo.Description);
+ }
+ return;
+ }
+
+ module.KeyText = key;
+
+ Console.WriteLine(module.KeyText);
+ Console.WriteLine("==Raw=Entry============");
+ Console.WriteLine(module.RawEntry);
+ Console.WriteLine("==Render=Text============");
+ Console.WriteLine(module.RenderText());
+ Console.WriteLine("==Strip=Text============");
+ Console.WriteLine(module.StripText());
+ Console.WriteLine("==========================");
+ }
+ }
+
+ public static void ParseKeyList()
+ {
+ using(var manager = new Manager())
+ {
+ var module = manager.GetModuleByName("ESV");
+
+ if (module == null)
+ {
+ Console.Error.WriteLine("Could not find module {0}. Available modules:", "ESV");
+ foreach(var modInfo in manager.GetModInfoList())
+ {
+ Console.WriteLine ("{0}\t - {1}", modInfo.Name, modInfo.Description);
+ }
+ return;
+ }
+
+ module.KeyText = "jn.3.16";
+
+ Console.WriteLine("==Render=Entry============");
+ Console.WriteLine(module.KeyText);
+ Console.WriteLine("RenderText: " + module.RenderText());
+ Console.WriteLine("StripText: " + module.StripText());
+
+ Console.WriteLine("RawText: " + module.RawEntry);
+ Console.WriteLine("==========================");
+
+ foreach(var key in module.ParseKeyList("James 1:19-30"))
+ {
+ Console.WriteLine (key);
+ }
+ }
+ }
+
+ public static void Search()
+ {
+ using(var manager = new Manager())
+ {
+ var module = manager.GetModuleByName("ESV");
+
+ if (module == null)
+ {
+ Console.Error.WriteLine("Could not find module {0}. Available modules:", "ESV");
+ foreach(var modInfo in manager.GetModInfoList())
+ {
+ Console.WriteLine ("{0}\t - {1}", modInfo.Name, modInfo.Description);
+ }
+ return;
+ }
+
+ foreach(var hit in module.Search("sin", SearchType.REGEX, 0, null))
+ {
+ Console.WriteLine(hit.Key);
+ }
+ module.TerminateSearch();
+ }
+ }
+ }
+}
diff --git a/bindings/csharp/examples/LookupExample.csproj b/bindings/csharp/examples/LookupExample.csproj
new file mode 100644
index 0000000..aad4e7e
--- /dev/null
+++ b/bindings/csharp/examples/LookupExample.csproj
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{60F12DE9-FBC5-42B1-8341-9AB097D661AE}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>LookupExample</RootNamespace>
+ <AssemblyName>LookupExample</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <Commandlineparameters>ESV john.3.16</Commandlineparameters>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <Compile Include="LookupExample.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Sword.csproj">
+ <Project>{EFEE3557-86F2-4E46-AF7E-8BADEE240764}</Project>
+ <Name>Sword</Name>
+ </ProjectReference>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/bindings/csharp/examples/Makefile b/bindings/csharp/examples/Makefile
new file mode 100644
index 0000000..968a6c6
--- /dev/null
+++ b/bindings/csharp/examples/Makefile
@@ -0,0 +1,7 @@
+all: LookupExample.exe
+
+LookupExample.exe: LookupExample.cs
+ xbuild LookupExample.csproj /p:Configuration=Release
+
+clean:
+ xbuild LookupExample.csproj /p:Configuration=Release /t:Clean
diff --git a/bindings/csharp/sword.snk b/bindings/csharp/sword.snk
new file mode 100644
index 0000000..950b10c
--- /dev/null
+++ b/bindings/csharp/sword.snk
Binary files differ
diff --git a/bindings/csharp/tests/AssemblyInfo.cs b/bindings/csharp/tests/AssemblyInfo.cs
new file mode 100644
index 0000000..d6b8076
--- /dev/null
+++ b/bindings/csharp/tests/AssemblyInfo.cs
@@ -0,0 +1,40 @@
+// 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.
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle("Sword.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("daniel")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+
diff --git a/bindings/csharp/tests/InstallManagerTests.cs b/bindings/csharp/tests/InstallManagerTests.cs
new file mode 100644
index 0000000..057c141
--- /dev/null
+++ b/bindings/csharp/tests/InstallManagerTests.cs
@@ -0,0 +1,132 @@
+// 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.
+using System;
+using NUnit.Framework;
+using System.Linq;
+
+namespace Sword.Tests
+{
+ [TestFixture]
+ public class InstallManagerTests
+ {
+ InstallManager _installManager;
+
+ [SetUp]
+ public void Setup()
+ {
+ _installManager = new InstallManager("baseDirectory");
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ _installManager.Dispose();
+ }
+
+ [Test]
+ public void SetUserDisclaimerConfirmed_Called_DoesntCrash()
+ {
+ _installManager.SetUserDisclaimerConfirmed();
+ }
+
+ [Test]
+ public void SyncConfig_UserDisclaimerConfirmed_ReturnsTrue()
+ {
+ //arrange
+ _installManager.SetUserDisclaimerConfirmed();
+
+ //act
+ bool result = _installManager.SyncConfig();
+
+ //assert
+ Assert.That (result, Is.True);
+ }
+
+ [Test]
+ public void SyncConfig_UserDisclaimerNotConfirmed_ReturnsFalse()
+ {
+ //act
+ bool result = _installManager.SyncConfig();
+
+ //assert
+ Assert.That (result, Is.False);
+ }
+
+ [Test]
+ public void RemoteSources_Called_ReturnsRemoteSources()
+ {
+ //arrange
+ _installManager.SetUserDisclaimerConfirmed();
+ _installManager.SyncConfig();
+
+ //act
+ var remoteSources = _installManager.RemoteSources.ToArray();
+
+ //assert
+ Assert.That (remoteSources.Length > 0);
+ }
+
+ [Test]
+ public void RefreshRemoteSource_Called_ReturnsTrue()
+ {
+ //arrange
+ _installManager.SetUserDisclaimerConfirmed();
+ _installManager.SyncConfig();
+ string firstSource = _installManager.RemoteSources.First();
+ bool result = _installManager.RefreshRemoteSource(firstSource);
+
+ //act
+ Assert.That (result, Is.True);
+ }
+
+ [Test]
+ public void GetRemoteModInfoList_FirstSource_ReturnsModInfoList()
+ {
+ //arrange
+ _installManager.SetUserDisclaimerConfirmed();
+ _installManager.SyncConfig();
+ string firstSource = _installManager.RemoteSources.First();
+ _installManager.RefreshRemoteSource(firstSource);
+
+ ModInfo[] remoteModInfos;
+ using(Manager manager = new Manager())
+ {
+ //act
+ remoteModInfos = _installManager.GetRemoteModInfoList(manager, firstSource).ToArray();
+ }
+
+ //assert
+ Assert.That (remoteModInfos.Length, Is.GreaterThan(0));
+ }
+
+ [Test]
+ public void RemoteInstallModule_KJV_ReturnsTrue()
+ {
+ //arrange
+ _installManager.SetUserDisclaimerConfirmed();
+ Assert.That (_installManager.SyncConfig(), Is.True);
+ Assert.That (_installManager.RefreshRemoteSource("CrossWire"), Is.True);
+
+ using(Manager manager = new Manager("LocalManager"))
+ {
+ //act
+ bool result = _installManager.RemoteInstallModule(manager, "CrossWire", "KJV");
+
+ //assert
+ Assert.That (result, Is.True);
+ }
+ }
+ }
+}
+
diff --git a/bindings/csharp/tests/Main.cs b/bindings/csharp/tests/Main.cs
new file mode 100644
index 0000000..1f96c81
--- /dev/null
+++ b/bindings/csharp/tests/Main.cs
@@ -0,0 +1,25 @@
+// Copyright 2002-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.
+using System;
+
+namespace Sword.Tests
+{
+ public class MainClass
+ {
+ public static void Main(string[] args)
+ {
+ }
+ }
+}
+
diff --git a/bindings/csharp/tests/ManagerTests.cs b/bindings/csharp/tests/ManagerTests.cs
new file mode 100644
index 0000000..6f71b33
--- /dev/null
+++ b/bindings/csharp/tests/ManagerTests.cs
@@ -0,0 +1,111 @@
+// 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.
+using System;
+using NUnit.Framework;
+using System.IO;
+using System.Linq;
+
+namespace Sword.Tests
+{
+ [TestFixture]
+ public class ManagerTests
+ {
+ Manager _manager;
+
+ [TestFixtureSetUp]
+ public void Setup()
+ {
+ _manager = new Manager();
+ }
+
+ [TestFixtureTearDown]
+ public void TearDown()
+ {
+ _manager.Dispose();
+ }
+
+ [Test]
+ public void Version_Get_ReturnsAVersion()
+ {
+ //act
+ string swordVersion = _manager.Version;
+
+ //assert
+ Version version;
+ Assert.That (Version.TryParse(swordVersion, out version));
+ }
+
+ [Test]
+ public void PrefixPath_Get_ReturnsValidPath()
+ {
+ //act
+ string prefixPath = _manager.PrefixPath;
+
+ //assert
+ Assert.That (Directory.Exists(prefixPath), Is.True);
+ }
+
+ [Test]
+ public void ConfigPath_Get_ReturnsValidPath()
+ {
+ //act
+ string configPath = _manager.ConfigPath;
+
+ //assert
+ Assert.That (Directory.Exists(configPath), Is.True);
+ }
+
+ [Test]
+ public void SetCipherKey_Called_DoesntCrash()
+ {
+ //act
+ _manager.SetCipherKey("ESV", new byte[32]);
+ }
+
+ [Test]
+ public void Javascript_Set_DoesntCrash()
+ {
+ //act
+ _manager.Javascript = true;
+ }
+
+ [Test]
+ public void AvailableLocales_Get_DoesntCrash()
+ {
+ //act
+ var availableLocales = _manager.AvailableLocales.ToArray();
+
+ //Assert
+ Assert.That (availableLocales[0].Contains("en"));
+ }
+
+ [Test]
+ public void DefaultLocale_SetToEn_DoesntCrash()
+ {
+ //act
+ _manager.DefaultLocale = "en";
+ }
+
+ [Test]
+ public void Translate_EnglishToEnglish_ReturnsOrginal()
+ {
+ //act
+ var result = _manager.Translate("love", "en");
+
+ //assert
+ Assert.That (result, Is.EqualTo("love"));
+ }
+ }
+}
+
diff --git a/bindings/csharp/tests/ModuleTests.cs b/bindings/csharp/tests/ModuleTests.cs
new file mode 100644
index 0000000..71cbea8
--- /dev/null
+++ b/bindings/csharp/tests/ModuleTests.cs
@@ -0,0 +1,162 @@
+// 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.
+using System;
+using NUnit.Framework;
+using System.IO;
+
+namespace Sword.Tests
+{
+ [TestFixture]
+ public class ModuleTests
+ {
+ Module _swordModule;
+ Manager _swordManager;
+
+ [TestFixtureSetUp]
+ public void Setup()
+ {
+ _swordManager = new Manager("LocalManager");
+ _swordModule = _swordManager.GetModuleByName("ESV");
+
+ if(_swordModule != null)
+ {
+ return;
+ }
+ using(var installManager = new InstallManager("baseDirectory"))
+ {
+ installManager.SetUserDisclaimerConfirmed();
+ installManager.SyncConfig();
+ installManager.RefreshRemoteSource("CrossWire");
+
+ installManager.RemoteInstallModule(_swordManager, "CrossWire", "ESV");
+ _swordModule = _swordManager.GetModuleByName("ESV");
+ }
+ }
+
+ [TestFixtureTearDown]
+ public void TearDown()
+ {
+ _swordManager.Dispose();
+ }
+
+ [Test]
+ public void Name_Get_Esv()
+ {
+ //arrange
+ //act
+ string name =_swordModule.Name;
+
+ //assert
+ Assert.That (name, Is.EqualTo ("ESV"));
+ }
+
+ [Test]
+ public void Description_Get_DescriptionCorrect()
+ {
+ //arrange
+ //act
+ string description =_swordModule.Description;
+
+ //assert
+ Assert.That (description, Is.EqualTo ("English Standard Version"));
+ }
+
+ [Test]
+ public void Catagory_Get_CatagoryCorrect()
+ {
+ //arrange
+ //act
+ string catagory =_swordModule.Category;
+
+ //assert
+ Assert.That (catagory, Is.EqualTo ("Biblical Texts"));
+ }
+
+ [Test]
+ public void Previous_John3v16_John3v15()
+ {
+ //arrange
+ _swordModule.KeyText = "jn.3.16";
+
+ //act
+ _swordModule.Prevous();
+
+ //assert
+ Assert.That (_swordModule.KeyText, Is.EqualTo( "John 3:15"));
+ }
+
+ [Test]
+ public void Next_John3v15_John3v16()
+ {
+ //arrange
+ _swordModule.KeyText = "jn.3.15";
+
+ //act
+ _swordModule.Next();
+
+ //assert
+ Assert.That (_swordModule.KeyText, Is.EqualTo( "John 3:16"));
+ }
+
+ [Test]
+ public void Begin_John3v15_Genesis1v1()
+ {
+ //arrange
+ _swordModule.KeyText = "jn.3.15";
+
+ //act
+ _swordModule.Begin();
+
+ //assert
+ Assert.That (_swordModule.KeyText, Is.EqualTo( "Genesis 1:1"));
+ }
+
+ [Test]
+ public void RenderHeader_John3v16_ReturnsNonNullOrEmpty()
+ {
+ //arrange
+ _swordModule.KeyText = "jn.3.16";
+
+ //act
+ string header = _swordModule.RenderHeader;
+
+ //assert
+ Assert.That (!string.IsNullOrEmpty(header));
+ }
+
+ [Test]
+ public void RawEntry_Get_ContainsVerse()
+ {
+ //arrange
+ _swordModule.KeyText = "jn.3.16";
+
+ //act
+ string rawEntry = _swordModule.RawEntry;
+
+ //assert
+ Assert.That (rawEntry.Contains ("God so loved"));
+ }
+
+ public void HasSearchFramework_Doesnt_ReturnsFalse()
+ {
+ //arrange
+ //act
+ bool hasSearchFramework = _swordModule.HasSearchFramework();
+
+ //assert
+ Assert.That (hasSearchFramework, Is.False);
+ }
+ }
+}
+
diff --git a/bindings/csharp/tests/Sword.Tests.csproj b/bindings/csharp/tests/Sword.Tests.csproj
new file mode 100644
index 0000000..1e44fda
--- /dev/null
+++ b/bindings/csharp/tests/Sword.Tests.csproj
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{72212684-1186-4F68-8FBD-BDBFDB8CC9BC}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>Sword.Tests</RootNamespace>
+ <AssemblyName>CSSword.Tests</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <Commandlineparameters>ESV jn.3.16</Commandlineparameters>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="nunit.core, Version=2.5.10.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
+ <Private>False</Private>
+ <Package>mono-nunit</Package>
+ </Reference>
+ <Reference Include="nunit.framework, Version=2.5.10.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
+ <Private>False</Private>
+ <Package>mono-nunit</Package>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="AssemblyInfo.cs" />
+ <Compile Include="ModuleTests.cs" />
+ <Compile Include="ManagerTests.cs" />
+ <Compile Include="InstallManagerTests.cs" />
+ <Compile Include="Main.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ItemGroup>
+ <ProjectReference Include="..\Sword.csproj">
+ <Project>{EFEE3557-86F2-4E46-AF7E-8BADEE240764}</Project>
+ <Name>Sword</Name>
+ </ProjectReference>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/bindings/flatapi.cpp b/bindings/flatapi.cpp
index 55cf083..1c6872c 100644
--- a/bindings/flatapi.cpp
+++ b/bindings/flatapi.cpp
@@ -3,9 +3,9 @@
* flatapi.cpp - This file contains an api usable by non-C++
* environments
*
- * $Id: flatapi.cpp 2921 2013-07-28 17:21:44Z scribe $
+ * $Id: flatapi.cpp 3226 2014-05-02 03:01:35Z greg.hellings $
*
- * 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,1461 @@
*
*/
-#include <stdio.h>
-
-#include <rawtext.h>
-#include <rawcom.h>
-#include <rawld.h>
-#include <strkey.h>
-#include <listkey.h>
-#include <versekey.h>
+#include <iostream>
+#include <vector>
+#include <map>
+
+#include <swversion.h>
#include <swmgr.h>
-#include <markupfiltmgr.h>
-#ifndef NO_SWORD_NAMESPACE
-using namespace sword;
-#endif
+#include <installmgr.h>
+#include <remotetrans.h>
+#include <versekey.h>
+#include <treekeyidx.h>
+#include <filemgr.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 *)handle; if (!hmgr) return failReturn; WebMgr *mgr = hmgr->mgr; if (!mgr) return failReturn;
+
+#define GETSWMODULE(handle, failReturn) HandleSWModule *hmod = (HandleSWModule *)handle; if (!hmod) return failReturn; SWModule *module = hmod->mod; if (!module) return failReturn;
+
+#define GETINSTMGR(handle, failReturn) HandleInstMgr *hinstmgr = (HandleInstMgr *)handle; if (!hinstmgr) return failReturn; InstallMgr *installMgr = hinstmgr->installMgr; if (!installMgr) 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;
+ }
+}
+
+
+void clearModInfo(org_crosswire_sword_ModInfo **modInfo) {
+ 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;
+ delete [] (*modInfo)[i].version;
+ delete [] (*modInfo)[i].delta;
+ }
+ else break;
+ }
+ free((*modInfo));
+ (*modInfo) = 0;
+ }
+}
+
+
+struct pu {
+ char last;
+ SWHANDLE progressReporter;
+
+ void init(SWHANDLE pr) { progressReporter = pr; last = 0; }
+/*
+ pu(JNIEnv *env, jobject pr) : env(env), progressReporter(pr), last(0) {}
+ JNIEnv *env;
+ jobject progressReporter;
+*/
+};
+void percentUpdate(char percent, void *userData) {
+ struct pu *p = (struct pu *)userData;
+
+ if (percent != p->last) {
+ p->last = percent;
+/*
+ jclass cls = p->env->GetObjectClass(p->progressReporter);
+ jmethodID mid = p->env->GetMethodID(cls, "progressReport", "(I)V");
+ if (mid != 0) {
+ p->env->CallVoidMethod(p->progressReporter, mid, (jint)percent);
+ }
+*/
+ }
+}
+
+class MyStatusReporter : public StatusReporter {
+public:
+ int last;
+ SWHANDLE statusReporter;
+ MyStatusReporter() : last(0), statusReporter(0) {}
+ void init(SWHANDLE sr) { statusReporter = sr; last = 0; }
+ virtual void update(unsigned long totalBytes, unsigned long completedBytes) {
+ int p = (totalBytes > 0) ? (int)(74.0 * ((double)completedBytes / (double)totalBytes)) : 0;
+ for (;last < p; ++last) {
+ if (!last) {
+ SWBuf output;
+ output.setFormatted("[ File Bytes: %ld", totalBytes);
+ while (output.size() < 75) output += " ";
+ output += "]";
+// cout << output.c_str() << "\n ";
+ }
+// cout << "-";
+ }
+// cout.flush();
+ }
+ virtual void preStatus(long totalBytes, long completedBytes, const char *message) {
+ SWBuf output;
+ output.setFormatted("[ Total Bytes: %ld; Completed Bytes: %ld", totalBytes, completedBytes);
+ while (output.size() < 75) output += " ";
+ output += "]";
+// cout << "\n" << output.c_str() << "\n ";
+// int p = (int)(74.0 * (double)completedBytes/totalBytes);
+// for (int i = 0; i < p; ++i) { cout << "="; }
+// cout << "\n\n" << message << "\n";
+ last = 0;
+ }
+};
+
+class HandleSWModule {
+public:
+ SWModule *mod;
+ char *renderBuf;
+ char *stripBuf;
+ char *renderHeader;
+ char *rawEntry;
+ char *configEntry;
+ struct pu peeuuu;
+ // 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].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() {
+ ::clearModInfo(&modInfo);
+ }
+
+ ~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);
+ }
+};
+
+
+class HandleInstMgr {
+public:
+ static const char **remoteSources;
+ InstallMgr *installMgr;
+ org_crosswire_sword_ModInfo *modInfo;
+ std::map<SWModule *, HandleSWModule *> moduleHandles;
+
+ MyStatusReporter statusReporter;
+ HandleInstMgr() : installMgr(0), modInfo(0) {}
+ HandleInstMgr(InstallMgr *mgr) {
+ this->installMgr = installMgr;
+ this->modInfo = 0;
+ }
+
+ ~HandleInstMgr() {
+ clearModInfo();
+ for (std::map<SWModule *, HandleSWModule *>::iterator it = moduleHandles.begin(); it != moduleHandles.end(); ++it) {
+ delete it->second;
+ }
+ delete installMgr;
+ }
+
+ HandleSWModule *getModuleHandle(SWModule *mod) {
+ if (!mod) return 0;
+ if (moduleHandles.find(mod) == moduleHandles.end()) {
+ moduleHandles[mod] = new HandleSWModule(mod);
+ }
+ return moduleHandles[mod];
+ }
+
+ static void clearRemoteSources() {
+ clearStringArray(&remoteSources);
+ }
+
+ void clearModInfo() {
+ ::clearModInfo(&modInfo);
+ }
+};
+
+
+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;
+
+const char **HandleInstMgr::remoteSources = 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;
+
+ HandleInstMgr::remoteSources = 0;
+ }
+ ~InitStatics() {
+ HandleSWModule::clearSearchHits();
+ HandleSWModule::clearEntryAttributes();
+ HandleSWModule::clearParseKeyList();
+ HandleSWModule::clearKeyChildren();
+
+ HandleSWMgr::clearGlobalOptions();
+ HandleSWMgr::clearGlobalOptionValues();
+
+ HandleInstMgr::clearRemoteSources();
+ }
+} _initStatics;
+
+
+
+}
+
+
+
+
+//
+// SWModule methods
+//
//
-extern "C" SWHANDLE SWMgr_new(char filterType) {
- return (SWHANDLE) new SWMgr(new MarkupFilterMgr(filterType));
+
+/*
+ * 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;
+
+
+ hmod->peeuuu.init(progressReporter);
+ 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, 0, &percentUpdate, &(hmod->peeuuu));
+ delete parser;
+ }
+ else result = module->search(searchString, searchType, flags, 0, 0, &percentUpdate, &(hmod->peeuuu));
+
+ 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) {
+
+ GETSWMODULE(hSWModule, 0);
-SWHANDLE SWMgr_getConfig(SWHANDLE hmgr) {
- SWMgr *mgr = (SWMgr *)hmgr;
- return (mgr) ? (SWHANDLE)mgr->config : 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) {
+
+ GETSWMODULE(hSWModule, 0);
-SWHANDLE SWMgr_getModulesIterator(SWHANDLE hmgr) {
- static ModItType it;
+ hmod->clearEntryAttributes();
- SWMgr *mgr = (SWMgr *)hmgr;
- if (mgr) {
- it.it = mgr->Modules.begin();
- it.end = mgr->Modules.end();
+ 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;
+ }
+ else {
+ i1Start = entryAttribs.begin();
+ i1End = entryAttribs.end();
}
- return (SWHANDLE)&it;
+ 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 < (int)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) {
+
+ 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) {
+
+ GETSWMODULE(hSWModule, );
+
+ sword::SWKey *key = module->getKey();
+ sword::VerseKey *vkey = SWDYNAMIC_CAST(VerseKey, key);
+ if (vkey) {
+ if ((*keyText=='+' || *keyText=='-')) {
+ if (!sword::stricmp(keyText+1, "book")) {
+ vkey->setBook(vkey->getBook() + ((*keyText=='+')?1:-1));
+ return;
+ }
+ else if (!sword::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) {
+
+ GETSWMODULE(hSWModule, 0);
-SWHANDLE SWMgr_getModuleByName(SWHANDLE hmgr, const char *name) {
- SWMgr *mgr = (SWMgr *)hmgr;
- return (mgr) ? (SWHANDLE) mgr->Modules[name] : 0;
+ return module->getKeyText();
}
+/*
+ * Class: org_crosswire_sword_SWModule
+ * Method: hasKeyChildren
+ * Signature: ()Z
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_hasKeyChildren
+ (SWHANDLE hSWModule) {
+
+ GETSWMODULE(hSWModule, 0);
+
+ sword::SWKey *key = module->getKey();
+ char retVal = 0;
-const char *SWMgr_getPrefixPath(SWHANDLE hmgr) {
- SWMgr *mgr = (SWMgr *)hmgr;
- return (mgr) ? mgr->prefixPath : 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;
+ */
+
+// 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();
+ }
+ }
+ }
-const char *SWMgr_getConfigPath(SWHANDLE hmgr) {
- SWMgr *mgr = (SWMgr *)hmgr;
- return (mgr) ? mgr->configPath : 0;
+ 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) {
+
+ GETSWMODULE(hSWModule, 0);
-void SWMgr_setGlobalOption(SWHANDLE hmgr, const char *option, const char *value) {
- SWMgr *mgr = (SWMgr *)hmgr;
- if (mgr)
- mgr->setGlobalOption(option, value);
+ return module->getName();
}
+/*
+ * Class: org_crosswire_sword_SWModule
+ * Method: getDescription
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getDescription
+ (SWHANDLE hSWModule) {
-const char *SWMgr_getGlobalOption(SWHANDLE hmgr, const char *option) {
- SWMgr *mgr = (SWMgr *)hmgr;
- return (mgr) ? (const char *)mgr->getGlobalOption(option) : 0;
+ 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);
-const char *SWMgr_getGlobalOptionTip(SWHANDLE hmgr, const char *option) {
- SWMgr *mgr = (SWMgr *)hmgr;
- return (mgr) ? (const char *)mgr->getGlobalOptionTip(option) : 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();
-// 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();
+ 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) {
+
+ GETSWMODULE(hSWModule, );
-// static void nullPercent (char percent, void *userData);
-void SWModule_terminateSearch(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- if (module)
- module->terminateSearch = true;
+ 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;
+}
+
+/*
+ * 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) {
+
+ GETSWMODULE(hSWModule, 0);
+
+ stdstr(&(hmod->renderHeader), assureValidUTF8(((const char *)(module->getRenderHeader() ? module->getRenderHeader():""))));
+
+ return hmod->renderHeader;
}
- /** 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: getRawEntry
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWModule_getRawEntry
+ (SWHANDLE hSWModule) {
+
+ GETSWMODULE(hSWModule, 0);
+
+ stdstr(&(hmod->rawEntry), assureValidUTF8(((const char *)module->getRawEntry())));
+
+ return hmod->rawEntry;
}
+/*
+ * 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, );
-int SWModule_getEntrySize(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- return (module) ? module->getEntrySize() : 0;
+ module->setEntry(entryBuffer);
}
-void SWModule_setKeyText(SWHANDLE hmodule, const char *key) {
- SWModule *module = (SWModule *)hmodule;
- if (module)
- module->setKey(key);
+/*
+ * 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;
}
-// 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: deleteSearchFramework
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWModule_deleteSearchFramework
+ (SWHANDLE hSWModule) {
+
+ GETSWMODULE(hSWModule, );
+
+ module->deleteSearchFramework();
}
-
-// 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: hasSearchFramework
+ * Signature: ()Z
+ */
+char SWDLLEXPORT org_crosswire_sword_SWModule_hasSearchFramework
+ (SWHANDLE hSWModule) {
+
+ GETSWMODULE(hSWModule, 0);
+
+ return (module->hasSearchFramework() && module->isSearchOptimallySupported("God", -4, 0, 0));
}
-
-const char *SWModule_getDescription(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->getDescription() : 0);
+
+
+
+//
+// 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));
}
-const char *SWModule_getType(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->getType() : 0);
+/*
+ * 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;
+}
+
+/*
+ * 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++;
+ }
-void SWModule_previous(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- if (module)
- (*module)--;
+ 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");
+ SWBuf version = module->getConfigEntry("Version");
+ 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()));
+ stdstr(&(milist[i++].version), assureValidUTF8(version.c_str()));
+ stdstr(&(milist[i++].delta), "");
+ if (i >= size) break;
+ }
+ }
+ hmgr->modInfo = milist;
+ return milist;
}
+/*
+ * 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);
-void SWModule_next(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- if (module)
- (*module)++;
+ return (SWHANDLE)hmgr->getModuleHandle(hmgr->mgr->getModule(moduleName));
}
+/*
+ * Class: org_crosswire_sword_SWMgr
+ * Method: getPrefixPath
+ * Signature: ()Ljava/lang/String;
+ */
+const char * SWDLLEXPORT org_crosswire_sword_SWMgr_getPrefixPath
+ (SWHANDLE hSWMgr) {
+
+ GETSWMGR(hSWMgr, 0);
-void SWModule_begin(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- if (module)
- (*module) = TOP;
+ return mgr->prefixPath;
}
-
-
-const char *SWModule_getStripText(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->stripText() : 0);
+
+/*
+ * 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_getRenderText(SWHANDLE hmodule) {
- SWModule *module = (SWModule *)hmodule;
- return (const char *)((module) ? module->renderText().c_str() : 0);
+
+/*
+ * 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_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: 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_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: 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_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: 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);
+ (void)errStatus;
+ return hmgr->filterBuf.c_str();
}
-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: getGlobalOptions
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptions
+ (SWHANDLE hSWMgr) {
+
+ GETSWMGR(hSWMgr, 0);
+
+ 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;
}
-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: getGlobalOptionValues
+ * Signature: (Ljava/lang/String;)[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_SWMgr_getGlobalOptionValues
+ (SWHANDLE hSWMgr, const char *option) {
+
+ 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) {
+ GETSWMGR(hSWMgr, );
-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;
+ mgr->setCipherKey(modName, key);
}
-//-----------------------------------------------------------------
-// stringlist_iterator methods
+/*
+ * Class: org_crosswire_sword_SWMgr
+ * Method: setJavascript
+ * Signature: (Z)V
+ */
+void SWDLLEXPORT org_crosswire_sword_SWMgr_setJavascript
+ (SWHANDLE hSWMgr, char valueBool) {
-void stringlist_iterator_next(SWHANDLE hsli) {
- StringList::iterator *sli = (StringList::iterator *)hsli;
- (*sli)++;
+ GETSWMGR(hSWMgr, );
+
+ mgr->setJavascript(valueBool);
+}
+
+/*
+ * 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) {
+
+ // 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);
+
+ return LocaleMgr::getSystemLocaleMgr()->translate(text, localeName);
+}
+
+
+
+
+//
+// InstallMgr methods
+//
+//
+
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: new
+ * Signature: (Ljava/lang/String;Lorg/crosswire/android/sword/SWModule/SearchProgressReporter;)V
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_InstallMgr_new
+ (const char *baseDir, SWHANDLE statusReporter) {
+ SWBuf confPath = SWBuf(baseDir) + "/InstallMgr.conf";
+ // be sure we have at least some config file already out there
+ if (!FileMgr::existsFile(confPath.c_str())) {
+ FileMgr::createParent(confPath.c_str());
+// remove(confPath.c_str());
+
+ SWConfig config(confPath.c_str());
+ config["General"]["PassiveFTP"] = "true";
+ config.Save();
+ }
+ HandleInstMgr *hinstmgr = new HandleInstMgr();
+ hinstmgr->statusReporter.init(statusReporter);
+ hinstmgr->installMgr = new InstallMgr(baseDir, &(hinstmgr->statusReporter));
+ return (SWHANDLE) hinstmgr;
+}
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: setUserDisclaimerConfirmed
+ * Signature: ()V
+ */
+void SWDLLEXPORT org_crosswire_sword_InstallMgr_setUserDisclaimerConfirmed
+ (SWHANDLE hInstallMgr) {
+
+ GETINSTMGR(hInstallMgr, );
+
+ installMgr->setUserDisclaimerConfirmed(true);
+}
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: syncConfig
+ * Signature: ()I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_syncConfig
+ (SWHANDLE hInstallMgr) {
+
+ GETINSTMGR(hInstallMgr, -1);
+
+ return installMgr->refreshRemoteSourceConfiguration();
}
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: uninstallModule
+ * Signature: (Lorg/crosswire/android/sword/SWMgr;Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_uninstallModule
+ (SWHANDLE hInstallMgr, SWHANDLE hSWMgr_removeFrom, const char *modName) {
+
+ GETINSTMGR(hInstallMgr, -1);
+ GETSWMGR(hSWMgr_removeFrom, -1);
-const char *stringlist_iterator_val(SWHANDLE hsli) {
- StringList::iterator *sli = (StringList::iterator *)hsli;
- return (const char *)(*sli)->c_str();
+ SWModule *module;
+ ModMap::iterator it = mgr->Modules.find(modName);
+ if (it == mgr->Modules.end()) {
+ return -2;
+ }
+ module = it->second;
+ return installMgr->removeModule(mgr, module->getName());
}
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: getRemoteSources
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteSources
+ (SWHANDLE hInstallMgr) {
+ GETINSTMGR(hInstallMgr, 0);
-//-----------------------------------------------------------------
-// listkey_iterator methods
+ hinstmgr->clearRemoteSources();
+ sword::StringList vals = LocaleMgr::getSystemLocaleMgr()->getAvailableLocales();
+ const char **retVal = 0;
+ int count = 0;
+ for (InstallSourceMap::iterator it = installMgr->sources.begin(); it != installMgr->sources.end(); ++it) {
+ count++;
+ }
+ retVal = (const char **)calloc(count+1, sizeof(const char *));
+ count = 0;
+ for (InstallSourceMap::iterator it = installMgr->sources.begin(); it != installMgr->sources.end(); ++it) {
+ stdstr((char **)&(retVal[count++]), it->second->caption.c_str());
+ }
-void listkey_iterator_next(SWHANDLE lki) {
- ListKey *lk = (ListKey*)lki;
- (*lk)++;
+ hinstmgr->remoteSources = retVal;
+ return retVal;
}
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: refreshRemoteSource
+ * Signature: (Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_refreshRemoteSource
+ (SWHANDLE hInstallMgr, const char *sourceName) {
+
+ GETINSTMGR(hInstallMgr, -1);
-const char *listkey_iterator_val(SWHANDLE lki) {
- ListKey *lk = (ListKey*)lki;
- if(!lk->popError())
- return (const char *) lk->getText();
- return NULL;
+ InstallSourceMap::iterator source = installMgr->sources.find(sourceName);
+ if (source == installMgr->sources.end()) {
+ return -3;
+ }
+
+ return installMgr->refreshRemoteSource(source->second);
}
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: getRemoteModInfoList
+ * Signature: (Lorg/crosswire/android/sword/SWMgr;Ljava/lang/String;)[Lorg/crosswire/android/sword/SWMgr/ModInfo;
+ */
+const struct org_crosswire_sword_ModInfo * SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteModInfoList
+ (SWHANDLE hInstallMgr, SWHANDLE hSWMgr_deltaCompareTo, const char *sourceName) {
+ GETINSTMGR(hInstallMgr, 0);
+ GETSWMGR(hSWMgr_deltaCompareTo, 0);
-//-----------------------------------------------------------------
-// modmap methods
+ struct org_crosswire_sword_ModInfo *retVal = 0;
-void ModList_iterator_next(SWHANDLE hmmi) {
- ModItType *it = (ModItType *)hmmi;
- if (it->it != it->end)
- it->it++;
+ hinstmgr->clearModInfo();
+
+ InstallSourceMap::iterator source = installMgr->sources.find(sourceName);
+ if (source == installMgr->sources.end()) {
+ retVal = (struct org_crosswire_sword_ModInfo *)calloc(1, sizeof(struct org_crosswire_sword_ModInfo));
+ hinstmgr->modInfo = retVal;
+ return retVal;
+ }
+
+ std::map<SWModule *, int> modStats = installMgr->getModuleStatus(*mgr, *source->second->getMgr());
+
+ int size = 0;
+ for (std::map<SWModule *, int>::iterator it = modStats.begin(); it != modStats.end(); ++it) {
+ size++;
+ }
+ retVal = (struct org_crosswire_sword_ModInfo *)calloc(size+1, sizeof(struct org_crosswire_sword_ModInfo));
+ int i = 0;
+ for (std::map<SWModule *, int>::iterator it = modStats.begin(); it != modStats.end(); ++it) {
+ SWModule *module = it->first;
+ int status = it->second;
+
+ SWBuf version = module->getConfigEntry("Version");
+ SWBuf statusString = " ";
+ if (status & InstallMgr::MODSTAT_NEW) statusString = "*";
+ if (status & InstallMgr::MODSTAT_OLDER) statusString = "-";
+ if (status & InstallMgr::MODSTAT_UPDATED) statusString = "+";
+
+ SWBuf type = module->getType();
+ SWBuf cat = module->getConfigEntry("Category");
+ if (cat.length() > 0) type = cat;
+
+ stdstr(&(retVal[i].name), assureValidUTF8(module->getName()));
+ stdstr(&(retVal[i].description), assureValidUTF8(module->getDescription()));
+ stdstr(&(retVal[i].category), assureValidUTF8(type.c_str()));
+ stdstr(&(retVal[i].language), assureValidUTF8(module->getLanguage()));
+ stdstr(&(retVal[i].version), assureValidUTF8(version.c_str()));
+ stdstr(&(retVal[i++].delta), assureValidUTF8(statusString.c_str()));
+ if (i >= size) break;
+ }
+ hinstmgr->modInfo = retVal;
+ return retVal;
}
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: remoteInstallModule
+ * Signature: (Lorg/crosswire/android/sword/SWMgr;Ljava/lang/String;Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_remoteInstallModule
+ (SWHANDLE hInstallMgr_from, SWHANDLE hSWMgr_to, const char *sourceName, const char *modName) {
+
+ GETINSTMGR(hInstallMgr_from, -1);
+ GETSWMGR(hSWMgr_to, -1);
+
+ InstallSourceMap::iterator source = installMgr->sources.find(sourceName);
+
+ if (source == installMgr->sources.end()) {
+ return -3;
+ }
+
+ InstallSource *is = source->second;
+ SWMgr *rmgr = is->getMgr();
+ SWModule *module;
+
+ ModMap::iterator it = rmgr->Modules.find(modName);
+
+ if (it == rmgr->Modules.end()) {
+ return -4;
+ }
+
+ module = it->second;
+
+ int error = installMgr->installModule(mgr, 0, module->getName(), is);
+
+ return error;
+}
+
+/*
+ * 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 *sourceName, const char *modName) {
+
+ GETINSTMGR(hInstallMgr, 0);
+
+ InstallSourceMap::iterator source = installMgr->sources.find(sourceName);
+
+ if (source == installMgr->sources.end()) {
+ return 0;
+ }
+
+ SWMgr *mgr = source->second->getMgr();
+
+ sword::SWModule *module = mgr->getModule(modName);
+
+ if (!module) {
+ return 0;
+ }
+
+ return (SWHANDLE)hinstmgr->getModuleHandle(module);
-SWHANDLE ModList_iterator_val(SWHANDLE hmmi) {
- ModItType *it = (ModItType *)hmmi;
- return (it->it != it->end) ? (SWHANDLE)it->it->second : 0;
}
diff --git a/bindings/java-jni/jni/swordstub.cpp b/bindings/java-jni/jni/swordstub.cpp
index a8ddb16..435a3f1 100644
--- a/bindings/java-jni/jni/swordstub.cpp
+++ b/bindings/java-jni/jni/swordstub.cpp
@@ -2,7 +2,7 @@
*
* swordstub.cpp - JNI bindings
*
- * $Id: swordstub.cpp 2894 2013-07-16 04:38:43Z scribe $
+ * $Id: swordstub.cpp 3184 2014-04-17 04:30:54Z greg.hellings $
*
* Copyright 2009-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -1132,6 +1132,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_crosswire_android_sword_SWModule_search
SWModule *module = getModule(env, me);
+ // TODO: remove this from the stack
struct pu peeuuu(env, progressReporter);
if (module) {
@@ -1245,11 +1246,11 @@ SWLog::getSystemLog()->logDebug("uninstallModule %s\n", modName);
return -2;
}
module = it->second;
- installMgr->removeModule(mgr, module->getName());
+ int retVal = installMgr->removeModule(mgr, module->getName());
env->ReleaseStringUTFChars(modNameJS, modName);
- return 0;
+ return retVal;
}
@@ -1350,9 +1351,9 @@ SWLog::getSystemLog()->logDebug("remoteListModules returning %d length array\n",
SWBuf version = module->getConfigEntry("Version");
SWBuf statusString = " ";
- if (it->second & InstallMgr::MODSTAT_NEW) statusString = "*";
- if (it->second & InstallMgr::MODSTAT_OLDER) statusString = "-";
- if (it->second & InstallMgr::MODSTAT_UPDATED) statusString = "+";
+ if (status & InstallMgr::MODSTAT_NEW) statusString = "*";
+ if (status & InstallMgr::MODSTAT_OLDER) statusString = "-";
+ if (status & InstallMgr::MODSTAT_UPDATED) statusString = "+";
SWBuf type = module->getType();
SWBuf cat = module->getConfigEntry("Category");
diff --git a/bindings/swig/package/aclocal.m4 b/bindings/swig/package/aclocal.m4
index 0c2ed70..094585c 100644
--- a/bindings/swig/package/aclocal.m4
+++ b/bindings/swig/package/aclocal.m4
@@ -220,6 +220,21 @@ m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_NOARCH_INSTALLDIR
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
+
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
diff --git a/bindings/swig/package/config.guess b/bindings/swig/package/config.guess
index b79252d..1804e9f 100755
--- a/bindings/swig/package/config.guess
+++ b/bindings/swig/package/config.guess
@@ -1,8 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012, 2013 Free Software Foundation, Inc.
-timestamp='2013-06-10'
+timestamp='2012-12-29'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -24,7 +26,7 @@ timestamp='2013-06-10'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
@@ -50,7 +52,9 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+2012, 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -132,27 +136,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- ;;
-esac
-
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -874,21 +857,21 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -901,54 +884,59 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -967,63 +955,54 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
+ echo sparc-unknown-linux-gnu
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
+ echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
+ echo powerpc64-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1256,21 +1235,19 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
diff --git a/bindings/swig/package/config.sub b/bindings/swig/package/config.sub
index c765b34..52f04bc 100755
--- a/bindings/swig/package/config.sub
+++ b/bindings/swig/package/config.sub
@@ -1,8 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012, 2013 Free Software Foundation, Inc.
-timestamp='2013-04-24'
+timestamp='2012-12-29'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -68,7 +70,9 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+2012, 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -252,7 +256,7 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arceb \
+ | arc \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
@@ -286,17 +290,16 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
+ | nios | nios2 \
| ns16k | ns32k \
| open8 \
- | or1k | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
@@ -366,7 +369,7 @@ case $basic_machine in
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
@@ -404,13 +407,12 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
@@ -1352,7 +1354,7 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
+ | -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1498,6 +1500,9 @@ case $os in
-aros*)
os=-aros
;;
+ -kaos*)
+ os=-kaos
+ ;;
-zvmoe)
os=-zvmoe
;;
@@ -1589,9 +1594,6 @@ case $basic_machine in
mips*-*)
os=-elf
;;
- or1k-*)
- os=-elf
- ;;
or32-*)
os=-coff
;;
diff --git a/bindings/swig/package/configure b/bindings/swig/package/configure
index 7e38cc8..b05da08 100755
--- a/bindings/swig/package/configure
+++ b/bindings/swig/package/configure
@@ -6682,10 +6682,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- powerpcle-*linux*)
+ powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
- powerpc-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
diff --git a/bindings/swig/package/m4/libtool.m4 b/bindings/swig/package/m4/libtool.m4
index 126202f..f12cfdf 100644
--- a/bindings/swig/package/m4/libtool.m4
+++ b/bindings/swig/package/m4/libtool.m4
@@ -1326,10 +1326,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- powerpcle-*linux*)
+ powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
- powerpc-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
diff --git a/config.guess b/config.guess
index b79252d..1804e9f 100755
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012, 2013 Free Software Foundation, Inc.
-timestamp='2013-06-10'
+timestamp='2012-12-29'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -24,7 +26,7 @@ timestamp='2013-06-10'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
@@ -50,7 +52,9 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+2012, 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -132,27 +136,6 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- ;;
-esac
-
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -874,21 +857,21 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -901,54 +884,59 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ LIBC=gnu
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -967,63 +955,54 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
+ echo sparc-unknown-linux-gnu
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
+ echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
+ echo powerpc64-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
+ echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1256,21 +1235,19 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
+ case $UNAME_PROCESSOR in
+ i386)
+ eval $set_cc_for_build
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ UNAME_PROCESSOR="x86_64"
+ fi
+ fi ;;
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
diff --git a/config.sub b/config.sub
index c765b34..52f04bc 100755
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2013 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012, 2013 Free Software Foundation, Inc.
-timestamp='2013-04-24'
+timestamp='2012-12-29'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -68,7 +70,9 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
+2012, 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -252,7 +256,7 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arceb \
+ | arc \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
@@ -286,17 +290,16 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
+ | nios | nios2 \
| ns16k | ns32k \
| open8 \
- | or1k | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
@@ -366,7 +369,7 @@ case $basic_machine in
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
@@ -404,13 +407,12 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
@@ -1352,7 +1354,7 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
+ | -sym* | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1498,6 +1500,9 @@ case $os in
-aros*)
os=-aros
;;
+ -kaos*)
+ os=-kaos
+ ;;
-zvmoe)
os=-zvmoe
;;
@@ -1589,9 +1594,6 @@ case $basic_machine in
mips*-*)
os=-elf
;;
- or1k-*)
- os=-elf
- ;;
or32-*)
os=-coff
;;
diff --git a/configure b/configure
index 4f8ab3e..626ddec 100755
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
#! /bin/sh
# From configure.ac Revision: 1.45 .
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for sword 1.7.2.
+# Generated by GNU Autoconf 2.69 for sword 1.7.3.
#
# Report bugs to <sword-bugs@crosswire.org>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='sword'
PACKAGE_TARNAME='sword'
-PACKAGE_VERSION='1.7.2'
-PACKAGE_STRING='sword 1.7.2'
+PACKAGE_VERSION='1.7.3'
+PACKAGE_STRING='sword 1.7.3'
PACKAGE_BUGREPORT='sword-bugs@crosswire.org'
PACKAGE_URL='http://crosswire.org/sword'
@@ -680,7 +680,6 @@ AM_CFLAGS
AM_CXXFLAGS
enable_profile
enable_debug
-ICU_VER
dir_confdef
with_conf
with_icusword
@@ -1423,7 +1422,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures sword 1.7.2 to adapt to many kinds of systems.
+\`configure' configures sword 1.7.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1494,7 +1493,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of sword 1.7.2:";;
+ short | recursive ) echo "Configuration of sword 1.7.3:";;
esac
cat <<\_ACEOF
@@ -1636,7 +1635,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-sword configure 1.7.2
+sword configure 1.7.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2144,7 +2143,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by sword $as_me 1.7.2, which was
+It was created by sword $as_me 1.7.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3121,7 +3120,7 @@ fi
# Define the identity of the package.
PACKAGE='sword'
- VERSION='1.7.2'
+ VERSION='1.7.3'
cat >>confdefs.h <<_ACEOF
@@ -7218,10 +7217,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- powerpcle-*linux*)
+ powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
- powerpc-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -16629,7 +16628,6 @@ fi
# ---------------------------------------------------------------------
# Find ICU tools
# ---------------------------------------------------------------------
-ICU_VER=
ICU_LIBS=
ICU_IOLIBS=
if test x$with_icu = xyes; then
@@ -16674,28 +16672,18 @@ $as_echo "no" >&6; }
fi
-# The icu-config script was new in icu 2.2
- if test "$ICU_CONFIG" = "no" ; then
- echo "*** The icu-config script installed by icu could not be found"
- echo "*** continuing anyway and assuming 2.1 or earlier"
- ICU_VER="2.1"
- ICU_LIBS="-licui18n -licuuc -licudata"
- ICU_IOLIBS="-lustdio"
- else
- ICU_VER=`$ICU_CONFIG --version`
+ if test "$ICU_CONFIG" != "no" ; then
ICU_LIBS=`$ICU_CONFIG --ldflags`
- #ICU_IOLIBS=`if test $(echo "$ICU_VER >= 3.0"|bc) -eq 1; then $ICU_CONFIG --ldflags-icuio; else $ICU_CONFIG --ldflags-ustdio; fi;`
ICU_IOLIBS=`$ICU_CONFIG --ldflags-icuio`
+ with_icu=yes
+ LIBS="$LIBS $ICU_LIBS $ICU_IOLIBS"
+ AM_CXXFLAGS="$AM_CXXFLAGS -D_ICU_"
+ AM_CFLAGS="$AM_CFLAGS -D_ICU_"
+ else
+ echo "*** The icu-config script installed by icu could not be found"
+ echo "*** compiling without ICU support"
+ with_icu=no
fi
- AM_CXXFLAGS="$AM_CXXFLAGS -D_ICU_"
- AM_CFLAGS="$AM_CFLAGS -D_ICU_"
-fi
-
-if test "x$ICU_LIBS" != x; then
- with_icu=yes
- LIBS="$LIBS $ICU_LIBS $ICU_IOLIBS"
-else
- with_icu=no
fi
@@ -16904,7 +16892,6 @@ SWORD_VERSION_NUM=$V1$V2$V3$V4
-
# ---------------------------------------------------------------------
# Conditional variables
# ---------------------------------------------------------------------
@@ -17050,7 +17037,7 @@ fi
# ---------------------------------------------------------------------
# Final output
# ---------------------------------------------------------------------
-ac_config_files="$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="$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"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -17662,7 +17649,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by sword $as_me 1.7.2, which was
+This file was extended by sword $as_me 1.7.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17729,7 +17716,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-sword config.status 1.7.2
+sword config.status 1.7.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -18245,6 +18232,7 @@ do
"utilities/Makefile") CONFIG_FILES="$CONFIG_FILES utilities/Makefile" ;;
"examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
"examples/cmdline/Makefile") CONFIG_FILES="$CONFIG_FILES examples/cmdline/Makefile" ;;
+ "examples/tasks/Makefile") CONFIG_FILES="$CONFIG_FILES examples/tasks/Makefile" ;;
"utilities/diatheke/Makefile") CONFIG_FILES="$CONFIG_FILES utilities/diatheke/Makefile" ;;
"sword.pc") CONFIG_FILES="$CONFIG_FILES sword.pc" ;;
"include/swversion.h") CONFIG_FILES="$CONFIG_FILES include/swversion.h" ;;
diff --git a/configure.ac b/configure.ac
index bb687cb..e5568ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@
# Version change: Change line 8 only !
# Change it immediately after a release
-AC_INIT(sword, 1.7.2, sword-bugs@crosswire.org, sword, http://crosswire.org/sword)
+AC_INIT(sword, 1.7.3, sword-bugs@crosswire.org, sword, http://crosswire.org/sword)
AC_CONFIG_SRCDIR(sword.bmp)
AC_PREREQ(2.52)
AC_REVISION($Revision: 1.45 $)
@@ -172,33 +172,22 @@ fi
# ---------------------------------------------------------------------
# Find ICU tools
# ---------------------------------------------------------------------
-ICU_VER=
ICU_LIBS=
ICU_IOLIBS=
if test x$with_icu = xyes; then
AC_PATH_PROG(ICU_CONFIG, icu-config, no)
-# The icu-config script was new in icu 2.2
- if test "$ICU_CONFIG" = "no" ; then
- echo "*** The icu-config script installed by icu could not be found"
- echo "*** continuing anyway and assuming 2.1 or earlier"
- ICU_VER="2.1"
- ICU_LIBS="-licui18n -licuuc -licudata"
- ICU_IOLIBS="-lustdio"
- else
- ICU_VER=`$ICU_CONFIG --version`
+ if test "$ICU_CONFIG" != "no" ; then
ICU_LIBS=`$ICU_CONFIG --ldflags`
- #ICU_IOLIBS=`if test $(echo "$ICU_VER >= 3.0"|bc) -eq 1; then $ICU_CONFIG --ldflags-icuio; else $ICU_CONFIG --ldflags-ustdio; fi;`
ICU_IOLIBS=`$ICU_CONFIG --ldflags-icuio`
+ with_icu=yes
+ LIBS="$LIBS $ICU_LIBS $ICU_IOLIBS"
+ AM_CXXFLAGS="$AM_CXXFLAGS -D_ICU_"
+ AM_CFLAGS="$AM_CFLAGS -D_ICU_"
+ else
+ echo "*** The icu-config script installed by icu could not be found"
+ echo "*** compiling without ICU support"
+ with_icu=no
fi
- AM_CXXFLAGS="$AM_CXXFLAGS -D_ICU_"
- AM_CFLAGS="$AM_CFLAGS -D_ICU_"
-fi
-
-if test "x$ICU_LIBS" != x; then
- with_icu=yes
- LIBS="$LIBS $ICU_LIBS $ICU_IOLIBS"
-else
- with_icu=no
fi
@@ -338,7 +327,6 @@ AC_SUBST(with_icusword)
AC_SUBST(with_conf)
AC_SUBST(dir_confdef)
AC_SUBST(CC)
-AC_SUBST(ICU_VER)
AC_SUBST(enable_debug)
AC_SUBST(enable_profile)
@@ -384,7 +372,7 @@ AM_CONDITIONAL(BUILDEXAMPLES, test x$enable_examples = xyes)
# ---------------------------------------------------------------------
# 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
diff --git a/doc/Doxyfile b/doc/Doxyfile
index 49901f5..118e8b3 100644
--- a/doc/Doxyfile
+++ b/doc/Doxyfile
@@ -55,7 +55,7 @@ PROJECT_NAME = "The SWORD Project"
# This could be handy for archiving the generated documentation or
# if some version control system is used.
-PROJECT_NUMBER = "1.7.2"
+PROJECT_NUMBER = "1.7.3"
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put.
diff --git a/doc/QUICKSTART.ubuntu b/doc/QUICKSTART.ubuntu
new file mode 100755
index 0000000..23a7b5a
--- /dev/null
+++ b/doc/QUICKSTART.ubuntu
@@ -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
+
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 3160def..5b8fc5f 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -1,3 +1,3 @@
AUTOMAKE_OPTIONS = 1.6
-SUBDIRS = cmdline
+SUBDIRS = cmdline tasks
diff --git a/examples/Makefile.in b/examples/Makefile.in
index 31f1f33..016b881 100644
--- a/examples/Makefile.in
+++ b/examples/Makefile.in
@@ -218,7 +218,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -332,7 +331,7 @@ with_icu = @with_icu@
with_icusword = @with_icusword@
with_zlib = @with_zlib@
AUTOMAKE_OPTIONS = 1.6
-SUBDIRS = cmdline
+SUBDIRS = cmdline tasks
all: all-recursive
.SUFFIXES:
diff --git a/examples/classes/Makefile b/examples/classes/Makefile
index aca68d0..c626fb0 100644
--- a/examples/classes/Makefile
+++ b/examples/classes/Makefile
@@ -1,4 +1,4 @@
-TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition showchapter
+TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition simplechapter flatapilookup flatapiparsekey flatapisearch
all: $(TARGETS)
clean:
@@ -6,5 +6,7 @@ clean:
.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++
diff --git a/examples/classes/flatapilookup.c b/examples/classes/flatapilookup.c
new file mode 100644
index 0000000..b76e7e2
--- /dev/null
+++ b/examples/classes/flatapilookup.c
@@ -0,0 +1,63 @@
+/******************************************************************************
+ *
+ * flatapilookup.c -
+ *
+ * $Id: flatapilookup.c 3162 2014-04-17 04:05:54Z greg.hellings $
+ *
+ * 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 <flatapi.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;
+}
diff --git a/examples/classes/flatapiparsekey.c b/examples/classes/flatapiparsekey.c
new file mode 100644
index 0000000..a8616a2
--- /dev/null
+++ b/examples/classes/flatapiparsekey.c
@@ -0,0 +1,65 @@
+/******************************************************************************
+ *
+ * flatapiparsekey.c -
+ *
+ * $Id: flatapiparsekey.c 3162 2014-04-17 04:05:54Z greg.hellings $
+ *
+ * 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 <flatapi.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;
+}
diff --git a/examples/classes/flatapisearch.c b/examples/classes/flatapisearch.c
new file mode 100644
index 0000000..59e0074
--- /dev/null
+++ b/examples/classes/flatapisearch.c
@@ -0,0 +1,66 @@
+/******************************************************************************
+ *
+ * flatapisearch.c -
+ *
+ * $Id: flatapisearch.c 3165 2014-04-17 04:07:57Z greg.hellings $
+ *
+ * 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 <flatapi.h>
+
+int main(int argc, char **argv) {
+ if (argc != 3) {
+ fprintf(stderr, "\nusage: %s <modname> <\"search terms\">\n"
+ "\tExample: %s KJV \"God love world\"\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 struct org_crosswire_sword_SearchHit *results = org_crosswire_sword_SWModule_search(module, argv[2], org_crosswire_sword_SWModule_SEARCHTYPE_MULTIWORD, 0, 0, 0);
+
+ printf("==========================\n");
+ printf("Parsing: %s\n", argv[2]);
+ printf("==========================\n");
+ while (results && results->modName) {
+ printf("%s\n", results->key);
+ ++results;
+ }
+ printf("==========================\n");
+
+ org_crosswire_sword_SWMgr_delete(mgr);
+
+ return 0;
+}
diff --git a/examples/classes/showchapter.cpp b/examples/classes/simplechapter.cpp
index f170b51..2178181 100644
--- a/examples/classes/showchapter.cpp
+++ b/examples/classes/simplechapter.cpp
@@ -1,10 +1,10 @@
/******************************************************************************
*
- * showchapter.cpp -
+ * simplechapter.cpp -
*
- * $Id: showchapter.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: simplechapter.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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
@@ -33,9 +33,9 @@ using namespace std;
int main(int argc, char **argv) {
SWMgr library;
- SWModule *kjv = library.getModule("KJV");
+ SWModule *kjv = library.getModule((argc > 1)?argv[1]:"KJV");
- kjv->setKey(argc > 1 ? argv[1] : "Jn.3.16");
+ kjv->setKey(argc > 2 ? argv[2] : "Jn.3.16");
VerseKey *key = (VerseKey *)kjv->getKey();
diff --git a/examples/cmdline/Makefile.in b/examples/cmdline/Makefile.in
index a3cb2f4..a6fa444 100644
--- a/examples/cmdline/Makefile.in
+++ b/examples/cmdline/Makefile.in
@@ -240,7 +240,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/examples/cmdline/lookup.cpp b/examples/cmdline/lookup.cpp
index 505b5e1..2ff80c8 100644
--- a/examples/cmdline/lookup.cpp
+++ b/examples/cmdline/lookup.cpp
@@ -3,7 +3,7 @@
* lookup.cpp - Simple example of how to retrieve an entry from a
* SWORD module
*
- * $Id: lookup.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: lookup.cpp 3187 2014-04-17 04:34:03Z greg.hellings $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -102,12 +102,19 @@ int main(int argc, char **argv)
AttributeTypeList::iterator i1;
AttributeList::iterator i2;
AttributeValue::iterator i3;
+ bool heading = false;
+ bool preverse = false;
for (i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); ++i1) {
std::cout << "[ " << i1->first << " ]\n";
+ heading = (i1->first == "Heading");
for (i2 = i1->second.begin(); i2 != i1->second.end(); ++i2) {
std::cout << "\t[ " << i2->first << " ]\n";
+ preverse = (heading && i2->first == "Preverse");
for (i3 = i2->second.begin(); i3 != i2->second.end(); ++i3) {
std::cout << "\t\t" << i3->first << " = " << i3->second << "\n";
+ if (preverse) {
+ std::cout << "\t\tmodule->renderText(heading[" << i3->first << "]) = " << target->renderText(i3->second) << "\n";
+ }
}
}
}
diff --git a/examples/tasks/CMakeLists.txt b/examples/tasks/CMakeLists.txt
new file mode 100644
index 0000000..dceeb0b
--- /dev/null
+++ b/examples/tasks/CMakeLists.txt
@@ -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})
+
diff --git a/examples/tasks/Makefile.am b/examples/tasks/Makefile.am
new file mode 100644
index 0000000..bdc5169
--- /dev/null
+++ b/examples/tasks/Makefile.am
@@ -0,0 +1,11 @@
+AUTOMAKE_OPTIONS = 1.6
+AM_CPPFLAGS = -I $(top_srcdir)/include
+if USE_INTERNAL_REGEX
+AM_CPPFLAGS += -I$(top_srcdir)/include/internal/regex
+endif
+LDADD = $(top_builddir)/lib/libsword.la
+
+noinst_PROGRAMS = parallelbibles
+
+parallelbibles_SOURCES = parallelbibles.cpp
+
diff --git a/examples/tasks/Makefile.in b/examples/tasks/Makefile.in
new file mode 100644
index 0000000..3b08667
--- /dev/null
+++ b/examples/tasks/Makefile.in
@@ -0,0 +1,619 @@
+# Makefile.in generated by automake 1.13.4 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@USE_INTERNAL_REGEX_TRUE@am__append_1 = -I$(top_srcdir)/include/internal/regex
+noinst_PROGRAMS = parallelbibles$(EXEEXT)
+subdir = examples/tasks
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_clucene.m4 \
+ $(top_srcdir)/m4/cppunit.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_parallelbibles_OBJECTS = parallelbibles.$(OBJEXT)
+parallelbibles_OBJECTS = $(am_parallelbibles_OBJECTS)
+parallelbibles_LDADD = $(LDADD)
+parallelbibles_DEPENDENCIES = $(top_builddir)/lib/libsword.la
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+SOURCES = $(parallelbibles_SOURCES)
+DIST_SOURCES = $(parallelbibles_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLUCENE2_CFLAGS = @CLUCENE2_CFLAGS@
+CLUCENE2_LIBS = @CLUCENE2_LIBS@
+CLUCENE_CXXFLAGS = @CLUCENE_CXXFLAGS@
+CLUCENE_LIBS = @CLUCENE_LIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@
+CPPUNIT_CONFIG = @CPPUNIT_CONFIG@
+CPPUNIT_LIBS = @CPPUNIT_LIBS@
+CURL_CONFIG = @CURL_CONFIG@
+CURL_LIBS = @CURL_LIBS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+ICU_CONFIG = @ICU_CONFIG@
+ICU_IOLIBS = @ICU_IOLIBS@
+ICU_LIBS = @ICU_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWORD_VERSION_MAJOR = @SWORD_VERSION_MAJOR@
+SWORD_VERSION_MICRO = @SWORD_VERSION_MICRO@
+SWORD_VERSION_MINOR = @SWORD_VERSION_MINOR@
+SWORD_VERSION_NANO = @SWORD_VERSION_NANO@
+SWORD_VERSION_NUM = @SWORD_VERSION_NUM@
+SWORD_VERSION_STR = @SWORD_VERSION_STR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+dir_confdef = @dir_confdef@
+docdir = @docdir@
+dvidir = @dvidir@
+enable_debug = @enable_debug@
+enable_profile = @enable_profile@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_mingw32 = @target_mingw32@
+target_os = @target_os@
+target_system = @target_system@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+with_conf = @with_conf@
+with_icu = @with_icu@
+with_icusword = @with_icusword@
+with_zlib = @with_zlib@
+AUTOMAKE_OPTIONS = 1.6
+AM_CPPFLAGS = -I $(top_srcdir)/include $(am__append_1)
+LDADD = $(top_builddir)/lib/libsword.la
+parallelbibles_SOURCES = parallelbibles.cpp
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign examples/tasks/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign examples/tasks/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+parallelbibles$(EXEEXT): $(parallelbibles_OBJECTS) $(parallelbibles_DEPENDENCIES) $(EXTRA_parallelbibles_DEPENDENCIES)
+ @rm -f parallelbibles$(EXEEXT)
+ $(AM_V_CXXLD)$(CXXLINK) $(parallelbibles_OBJECTS) $(parallelbibles_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parallelbibles.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \
+ ctags-am distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/examples/tasks/parallelbibles.cpp b/examples/tasks/parallelbibles.cpp
new file mode 100644
index 0000000..dd57f86
--- /dev/null
+++ b/examples/tasks/parallelbibles.cpp
@@ -0,0 +1,180 @@
+/******************************************************************************
+ *
+ * parallelbibles.cpp - This examples demonstrates a strategy for
+ * displaying Bibles in parallel
+ *
+ * $Id: parallelbibles.cpp 3030 2014-02-28 02:14:44Z scribe $
+ *
+ * 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 <markupfiltmgr.h>
+#include <swmodule.h>
+#include <versekey.h>
+#include <iostream>
+#include <vector>
+#include <stdio.h>
+
+
+using namespace sword;
+using namespace std;
+
+
+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();
+
+ master->setText(key);
+ int curVerse = master->getVerse();
+ int curChapter = master->getChapter();
+ int curBook = master->getBook();
+
+ for (master->setVerse(1); (master->getBook() == curBook)
+ && (master->getChapter() == curChapter)
+ && !master->popError();
+ (*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 << (*module)->renderText() << "</td>";
+ }
+ }
+ cout << "</tr>";
+ }
+ delete master;
+}
+
+
+void outputHeader(vector<SWModule *>modules, const char *key) {
+
+ modules[0]->setKey(key);
+
+ // force a render so our key snaps to a module entry and we get nicely formatted keytext output later
+ // otherwise we just get what the user typed
+ modules[0]->renderText();
+
+ cout
+ << "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
+ << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
+ << "<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:og=\"http://ogp.me/ns#\" xmlns:fb=\"https://www.facebook.com/2008/fbml\" xml:lang=\"en_US\" lang=\"en_US\">"
+ << "<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: " << 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\"/>"
+ << "<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js\"></script>"
+ << "<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js\"></script>"
+ << "<link rel=\"alternate stylesheet\" type=\"text/css\" media=\"all\" title=\"Washed Out\" href=\"http://crosswire.org/study/wash.css\" />"
+ << "<link rel=\"alternate stylesheet\" type=\"text/css\" media=\"all\" title=\"Parchment\" href=\"http://crosswire.org/study/parchment.css\" />"
+ << "<link rel=\"alternate stylesheet\" type=\"text/css\" media=\"all\" title=\"Sandy Creek\" href=\"http://crosswire.org/study/sandy.css\" />"
+ << "<!--For printing stuff -->"
+ << "<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" href=\"http://crosswire.org/study/print.css\" />"
+ << "<script type=\"text/javascript\" src=\"http://crosswire.org/study/swordweb.js\"></script>"
+ << "</head>"
+ << "<body onload=\"onPageLoad();\" class=\"ltor\">"
+ << "<div id=\"pageBorderTop\"></div>"
+ << "<div id=\"header\">"
+ << "<h1>The Bible Tool</h1>"
+ << "</div>"
+ << "<div id=\"content-main\">"
+ << "<div id=\"paralleldisplay\">"
+ << "<style>"
+ << modules[0]->getRenderHeader()
+ << "</style>"
+ << "<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(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\">"
+ << "<p>"
+ << "<a href=\"http://www.americanbible.org/\" title=\"American Bible Society\"><img src=\"http://crosswire.org/study/images/logo_abs.gif\" width=\"105\" height=\"64\" alt=\"American Bible Society\" /></a>"
+ << "<a href=\"http://crosswire.org/\" title=\"CrossWire Bible Society\"><img src=\"http://crosswire.org/study/images/logo_cwbs.gif\" width=\"161\" height=\"64\" alt=\"CrossWire Bible Society\" /></a>"
+ << "<a href=\"http://sbl-site.org/\" title=\"Society of Biblical Literature\"><img src=\"http://crosswire.org/study/images/logo_fbl.gif\" width=\"86\" height=\"64\" alt=\"Society of Biblical Literature\" /></a>"
+ << "</p>"
+ << "<p>Copyright &copy; 2003-2011 <a href=\"http://www.crosswire.org/\">CrossWire Bible Society</a></p>"
+ << "<div id=\"pageBorderBottom\"><br /></div>"
+ << "</div>"
+ << "</body>"
+ << "</html>";
+}
+
+
+int main(int argc, char **argv) {
+
+ SWMgr library(new MarkupFilterMgr(FMT_XHTML));
+
+ if (argc < 3) {
+ fprintf(stderr, "\nusage: %s <modname> [modname ...] <\"key\">\n"
+ "\tExample: %s KJV ESV \"James 1:19\"\n\n", argv[0], argv[0]);
+ exit(-1);
+ }
+
+ vector<SWModule *> modules;
+ for (int i = 1; i < argc-1; ++i) {
+ SWModule *bible = library.getModule(argv[i]);
+ if (!bible) {
+ fprintf(stderr, "Could not find module [%s]. Available modules:\n", argv[i]);
+ ModMap::iterator it;
+ for (it = library.Modules.begin(); it != library.Modules.end(); ++it) {
+ fprintf(stderr, "[%s]\t - %s\n", (*it).second->getName(), (*it).second->getDescription());
+ }
+ exit(-2);
+ }
+ modules.push_back(bible);
+ }
+
+ outputHeader(modules, argv[argc-1]);
+ parallelDisplay(modules, argv[argc-1]);
+ outputFooter(modules);
+
+ return 0;
+}
+
diff --git a/include/bz2comprs.h b/include/bz2comprs.h
index c1e1648..8452dfc 100644
--- a/include/bz2comprs.h
+++ b/include/bz2comprs.h
@@ -3,9 +3,9 @@
* bz2comprs.h - Bzip2Compress, a driver class that provides bzip2
* compression (Burrows–Wheeler with Huffman coding)
*
- * $Id: bz2comprs.h 2858 2013-07-08 03:08:10Z chrislit $
+ * $Id: bz2comprs.h 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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
diff --git a/include/defs.h b/include/defs.h
index fd1ebf5..fdad3db 100644
--- a/include/defs.h
+++ b/include/defs.h
@@ -2,7 +2,7 @@
*
* defs.h - Global defines, mostly platform-specific stuff
*
- * $Id: defs.h 2942 2013-08-03 08:39:02Z chrislit $
+ * $Id: defs.h 3156 2014-04-17 03:50:37Z greg.hellings $
*
* Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -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 @@ SWORD_NAMESPACE_START
+#ifdef __cplusplus
enum {DIRECTION_LTR = 0, DIRECTION_RTL, DIRECTION_BIDI};
enum {FMT_UNKNOWN = 0, FMT_PLAIN, FMT_THML, FMT_GBF, FMT_HTML, FMT_HTMLHREF, FMT_RTF, FMT_OSIS, FMT_WEBIF, FMT_TEI, FMT_XHTML};
enum {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
diff --git a/include/flatapi.h b/include/flatapi.h
index 4c59ba6..c5f8412 100644
--- a/include/flatapi.h
+++ b/include/flatapi.h
@@ -2,9 +2,9 @@
*
* flatapi.h - This file contains an api usable by non-C++ environments
*
- * $Id: flatapi.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: flatapi.h 3184 2014-04-17 04:30:54Z greg.hellings $
*
- * 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,484 @@
*
*/
-#ifndef SWORDAPI_H
-#define SWORDAPI_H
+#ifndef SWORDFLATAPI_H
+#define SWORDFLATAPI_H
-#include <defs.h>
#include <inttypes.h>
-#ifdef __cplusplus
-#endif
+#include <defs.h>
+#ifdef __cplusplus
extern "C" {
+#endif
#define SWHANDLE intptr_t
+struct org_crosswire_sword_ModInfo {
+ char *name;
+ char *description;
+ char *category;
+ char *language;
+ char *version;
+ char *delta;
+};
-//-----------------------------------------------------------------
-// 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
-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);
+#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);
-//-----------------------------------------------------------------
-// SWMgr methods
+/*
+ * 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);
+
+
+
+
+
+//
+// InstallMgr 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);
-
-
-//-----------------------------------------------------------------
-// SWModule methods
-
-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);
-
-SWHANDLE SWDLLEXPORT listkey_getVerselistIterator(const char *list, const char *key, const char *v11n = "KJV");
-}
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: new
+ * Signature: (Ljava/lang/String;Lorg/crosswire/android/sword/SWModule/SearchProgressReporter;)V
+ */
+SWHANDLE SWDLLEXPORT org_crosswire_sword_InstallMgr_new
+ (const char *baseDir, SWHANDLE statusReporter);
+
+/*
+ * 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);
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: uninstallModule
+ * Signature: (Lorg/crosswire/android/sword/SWMgr;Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_uninstallModule
+ (SWHANDLE hInstallMgr, SWHANDLE hSWMgr_removeFrom, const char *modName);
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: getRemoteSources
+ * Signature: ()[Ljava/lang/String;
+ */
+const char ** SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteSources
+ (SWHANDLE hInstallMgr);
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: refreshRemoteSource
+ * Signature: (Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_refreshRemoteSource
+ (SWHANDLE hInstallMgr, const char *sourceName);
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: getRemoteModInfoList
+ * Signature: (Lorg/crosswire/android/sword/SWMgr;Ljava/lang/String;)[Lorg/crosswire/android/sword/SWMgr/ModInfo;
+ */
+const struct org_crosswire_sword_ModInfo * SWDLLEXPORT org_crosswire_sword_InstallMgr_getRemoteModInfoList
+ (SWHANDLE hInstallMgr, SWHANDLE hSWMgr_deltaCompareTo, const char *sourceName);
+
+/*
+ * Class: org_crosswire_sword_InstallMgr
+ * Method: remoteInstallModule
+ * Signature: (Lorg/crosswire/android/sword/SWMgr;Ljava/lang/String;Ljava/lang/String;)I
+ */
+int SWDLLEXPORT org_crosswire_sword_InstallMgr_remoteInstallModule
+ (SWHANDLE hInstallMgr_from, SWHANDLE hSWMgr_to, const char *sourceName, const char *modName);
+
+/*
+ * 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 *sourceName, const char *modName);
+
#ifdef __cplusplus
+}
#endif
-
#endif
diff --git a/include/rawstr.h b/include/rawstr.h
index 58fc141..478035d 100644
--- a/include/rawstr.h
+++ b/include/rawstr.h
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: rawstr.h 3181 2014-04-17 04:27:57Z greg.hellings $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -49,7 +49,7 @@ protected:
static const int IDXENTRYSIZE;
public:
- static char nl;
+ static const char nl;
RawStr(const char *ipath, int fileMode = -1, bool caseSensitive = false);
virtual ~RawStr();
void getIDXBuf(long ioffset, char **buf) const;
diff --git a/include/rawstr4.h b/include/rawstr4.h
index 7767cb9..71f50dc 100644
--- a/include/rawstr4.h
+++ b/include/rawstr4.h
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr4.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: rawstr4.h 3181 2014-04-17 04:27:57Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -48,7 +48,7 @@ protected:
void doSetText(const char *key, const char *buf, long len = -1);
void doLinkEntry(const char *destkey, const char *srckey);
public:
- char nl;
+ static const char nl;
RawStr4(const char *ipath, int fileMode = -1, bool caseSensitive = false);
virtual ~RawStr4();
void getIDXBuf(long ioffset, char **buf) const;
diff --git a/include/rawverse.h b/include/rawverse.h
index 0b63491..4c919cd 100644
--- a/include/rawverse.h
+++ b/include/rawverse.h
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class VerseKey
*
- * $Id: rawverse.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: rawverse.h 3181 2014-04-17 04:27:57Z greg.hellings $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -47,7 +47,7 @@ protected:
void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
public:
- static const char *nl;
+ static const char nl;
RawVerse(const char *ipath, int fileMode = -1);
virtual ~RawVerse();
void findOffset(char testmt, long idxoff, long *start, unsigned short *end) const;
diff --git a/include/rawverse4.h b/include/rawverse4.h
index a78ed71..0b66dbe 100644
--- a/include/rawverse4.h
+++ b/include/rawverse4.h
@@ -5,7 +5,7 @@
* ??.vss and provides lookup and parsing functions based
* on class VerseKey
*
- * $Id: rawverse4.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: rawverse4.h 3181 2014-04-17 04:27:57Z greg.hellings $
*
* Copyright 2007-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -48,7 +48,7 @@ protected:
void doLinkEntry(char testmt, long destidxoff, long srcidxoff);
public:
- static const char *nl;
+ static const char nl;
RawVerse4(const char *ipath, int fileMode = -1);
virtual ~RawVerse4();
void findOffset(char testmt, long idxoff, long *start, unsigned long *end) const;
diff --git a/include/swcomprs.h b/include/swcomprs.h
index 9b06fe1..247ffcd 100644
--- a/include/swcomprs.h
+++ b/include/swcomprs.h
@@ -3,9 +3,9 @@
* swcomprs.h - definition of Class SWCompress used for data
* compression
*
- * $Id: swcomprs.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: swcomprs.h 3175 2014-04-17 04:21:31Z greg.hellings $
*
- * Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 1996-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
diff --git a/include/swmgr.h b/include/swmgr.h
index 5c98d11..1dad90a 100644
--- a/include/swmgr.h
+++ b/include/swmgr.h
@@ -3,9 +3,9 @@
* swmgr.h - definition of class SWMgr used to interact with an install
* base of sword modules.
*
- * $Id: swmgr.h 2941 2013-08-03 07:08:24Z chrislit $
+ * $Id: swmgr.h 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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
@@ -86,7 +88,7 @@ class SWOptionFilter;
* SWMgr exposes an installed module set and can be asked to configure the desired
* markup and options which modules will produce.
*
- * @version $Id: swmgr.h 2941 2013-08-03 07:08:24Z chrislit $
+ * @version $Id: swmgr.h 3156 2014-04-17 03:50:37Z greg.hellings $
*/
class SWDLLEXPORT SWMgr {
private:
diff --git a/include/swversion.h b/include/swversion.h
index 2235a66..5f71dab 100644
--- a/include/swversion.h
+++ b/include/swversion.h
@@ -3,7 +3,7 @@
* swversion.h - definition of class SWVersion used to compare version
* info
*
- * $Id: swversion.h 3007 2014-01-14 04:47:16Z greg.hellings $
+ * $Id: swversion.h 3156 2014-04-17 03:50:37Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -24,11 +24,11 @@
#ifndef SWVERSION_H
#define SWVERSION_H
-#define SWORD_VERSION_NUM 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>
diff --git a/include/thmlxhtml.h b/include/thmlxhtml.h
index b0b5ef3..c3406ad 100644
--- a/include/thmlxhtml.h
+++ b/include/thmlxhtml.h
@@ -2,7 +2,7 @@
*
* thmlxhtml.h - Implementation of ThMLXHTML
*
- * $Id: thmlxhtml.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: thmlxhtml.h 3196 2014-04-24 03:04:07Z greg.hellings $
*
* Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -38,7 +38,7 @@ protected:
public:
MyUserData(const SWModule *module, const SWKey *key);//: BasicFilterUserData(module, key) {}
bool inscriptRef;
- bool SecHead;
+ char SecHead;
bool BiblicalText;
SWBuf version;
XMLTag startTag;
diff --git a/include/utf8nfc.h b/include/utf8nfc.h
index c8798cc..1240cca 100644
--- a/include/utf8nfc.h
+++ b/include/utf8nfc.h
@@ -2,7 +2,7 @@
*
* utf8nfc.h - Implementation of UTF8NFC
*
- * $Id: utf8nfc.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: utf8nfc.h 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -32,10 +32,11 @@
SWORD_NAMESPACE_START
+/** This filter normalizes UTF-8 encoded text
+ */
class SWDLLEXPORT UTF8NFC : public SWFilter {
private:
UConverter* conv;
- UChar *source, *target;
UErrorCode err;
public:
UTF8NFC();
diff --git a/include/xzcomprs.h b/include/xzcomprs.h
index c468288..49b43bc 100644
--- a/include/xzcomprs.h
+++ b/include/xzcomprs.h
@@ -3,9 +3,9 @@
* xzcomprs.h - XzCompress, a driver class that provides xz (LZMA2)
* compression
*
- * $Id: xzcomprs.h 2850 2013-07-02 09:57:20Z chrislit $
+ * $Id: xzcomprs.h 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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
diff --git a/include/ztext.h b/include/ztext.h
index c8855c9..4bdcc8d 100644
--- a/include/ztext.h
+++ b/include/ztext.h
@@ -3,7 +3,7 @@
* ztext.h - code for class 'zText'- a module that reads compressed text
* files: ot and nt using indexs ??.vss
*
- * $Id: ztext.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: ztext.h 3176 2014-04-17 04:22:36Z greg.hellings $
*
* Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -49,9 +49,7 @@ class SWDLLEXPORT zText:public zVerse, public SWText {
bool sameBlock(VerseKey * lastWriteKey, VerseKey * key);
int blockType;
-
public:
-
zText(const char *ipath, const char *iname = 0, const char *idesc = 0,
int blockType = CHAPTERBLOCKS, SWCompress *icomp = 0,
SWDisplay *idisp = 0, SWTextEncoding encoding = ENC_UNKNOWN,
@@ -65,16 +63,16 @@ public:
virtual void increment(int steps = 1);
virtual void decrement(int steps = 1) { increment(-steps); }
- // write interface ----------------------------
+ // write interface ----------------------------
virtual bool isWritable() const;
static char createModule(const char *path, int blockBound, const char *v11n = "KJV") {
return zVerse::createModule(path, blockBound, v11n);
}
- virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
- virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
+ virtual void setEntry(const char *inbuf, long len = -1); // Modify current module entry
+ virtual void linkEntry(const SWKey *linkKey); // Link current module entry to other module entry
virtual void deleteEntry(); // Delete current module entry
- // end write interface ------------------------
+ // end write interface ------------------------
virtual void rawZFilter(SWBuf &buf, char direction = 0) const { rawFilter(buf, (SWKey *)(long)direction); }// hack, use key as direction for enciphering
@@ -86,7 +84,6 @@ public:
virtual bool hasEntry(const SWKey *k) const;
SWMODULE_OPERATORS
-
};
SWORD_NAMESPACE_END
diff --git a/include/zverse.h b/include/zverse.h
index c5fe8ee..22bf913 100644
--- a/include/zverse.h
+++ b/include/zverse.h
@@ -1,11 +1,11 @@
/******************************************************************************
*
- * rawverse.h - code for class 'zVerse'- a module that reads raw text
+ * zverse.h - code for class 'zVerse'- a module that reads raw text
* files: ot and nt using indexs ??.bks ??.cps ??.vss
* and provides lookup and parsing functions based on
* class VerseKey
*
- * $Id: zverse.h 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: zverse.h 3180 2014-04-17 04:26:37Z greg.hellings $
*
* Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 70a06a6..f1fa89f 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -505,7 +505,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/lib/vcppmake/libsword.vcxproj b/lib/vcppmake/libsword.vcxproj
index 4f38573..fdf4854 100644
--- a/lib/vcppmake/libsword.vcxproj
+++ b/lib/vcppmake/libsword.vcxproj
@@ -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>
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 126202f..f12cfdf 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1326,10 +1326,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
- powerpcle-*linux*)
+ powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
- powerpc-*linux*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
diff --git a/src/mgr/swmgr.cpp b/src/mgr/swmgr.cpp
index 0a2d583..b41c411 100644
--- a/src/mgr/swmgr.cpp
+++ b/src/mgr/swmgr.cpp
@@ -2,9 +2,9 @@
*
* swmgr.cpp - used to interact with an install base of sword modules
*
- * $Id: swmgr.cpp 2985 2013-10-04 14:38:14Z scribe $
+ * $Id: swmgr.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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
diff --git a/src/modules/comments/zcom/zcom.cpp b/src/modules/comments/zcom/zcom.cpp
index 65c4ca8..839baf5 100644
--- a/src/modules/comments/zcom/zcom.cpp
+++ b/src/modules/comments/zcom/zcom.cpp
@@ -3,7 +3,7 @@
* zcom.cpp - code for class 'zCom'- a module that reads raw commentary
* files
*
- * $Id: zcom.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: zcom.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
* Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -68,24 +68,24 @@ bool zCom::isWritable() const {
/******************************************************************************
- * 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);
-
- rawFilter(entryBuf, key);
+
+ zReadText(key.getTestament(), start, size, buffnum, entryBuf);
+ rawFilter(entryBuf, &key);
// if (!isUnicode())
prepText(entryBuf);
diff --git a/src/modules/common/bz2comprs.cpp b/src/modules/common/bz2comprs.cpp
index 16f6d11..7863e98 100644
--- a/src/modules/common/bz2comprs.cpp
+++ b/src/modules/common/bz2comprs.cpp
@@ -3,9 +3,9 @@
* bz2comprs.cpp - Bzip2Compress, a driver class that provides bzip2
* compression (Burrows–Wheeler with Huffman coding)
*
- * $Id: bz2comprs.cpp 2858 2013-07-08 03:08:10Z chrislit $
+ * $Id: bz2comprs.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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
diff --git a/src/modules/common/rawstr.cpp b/src/modules/common/rawstr.cpp
index 788ab6e..12371ab 100644
--- a/src/modules/common/rawstr.cpp
+++ b/src/modules/common/rawstr.cpp
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: rawstr.cpp 3181 2014-04-17 04:27:57Z greg.hellings $
*
* Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -43,7 +43,7 @@ SWORD_NAMESPACE_START
*/
int RawStr::instance = 0;
-char RawStr::nl = '\n';
+const char RawStr::nl = '\n';
const int RawStr::IDXENTRYSIZE = 6;
@@ -372,7 +372,6 @@ void RawStr::doSetText(const char *ikey, const char *buf, long len)
__s32 shiftSize;
__u16 size;
__u16 outsize;
- static const char nl[] = {13, 10};
char *tmpbuf = 0;
char *key = 0;
char *dbKey = 0;
@@ -452,7 +451,7 @@ void RawStr::doSetText(const char *ikey, const char *buf, long len)
datfd->write(outbuf, (int)size);
// add a new line to make data file easier to read in an editor
- datfd->write(&nl, 2);
+ datfd->write(&nl, 1);
idxfd->write(&outstart, 4);
idxfd->write(&outsize, 2);
diff --git a/src/modules/common/rawstr4.cpp b/src/modules/common/rawstr4.cpp
index e2ce899..c88e70d 100644
--- a/src/modules/common/rawstr4.cpp
+++ b/src/modules/common/rawstr4.cpp
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class StrKey
*
- * $Id: rawstr4.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: rawstr4.cpp 3181 2014-04-17 04:27:57Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -44,6 +44,7 @@ SWORD_NAMESPACE_START
*/
int RawStr4::instance = 0;
+const char RawStr4::nl = '\n';
const int RawStr4::IDXENTRYSIZE = 8;
@@ -59,7 +60,6 @@ RawStr4::RawStr4(const char *ipath, int fileMode, bool caseSensitive) : caseSens
{
SWBuf buf;
- nl = '\n';
lastoff = -1;
path = 0;
stdstr(&path, ipath);
@@ -380,7 +380,6 @@ void RawStr4::doSetText(const char *ikey, const char *buf, long len) {
__s32 shiftSize;
__u32 size;
__u32 outsize;
- static const char nl[] = {13, 10};
char *tmpbuf = 0;
char *key = 0;
char *dbKey = 0;
@@ -460,7 +459,7 @@ void RawStr4::doSetText(const char *ikey, const char *buf, long len) {
datfd->write(outbuf, (long)size);
// add a new line to make data file easier to read in an editor
- datfd->write(&nl, 2);
+ datfd->write(&nl, 1);
idxfd->write(&outstart, 4);
idxfd->write(&outsize, 4);
diff --git a/src/modules/common/rawverse.cpp b/src/modules/common/rawverse.cpp
index 5527d38..34fba10 100644
--- a/src/modules/common/rawverse.cpp
+++ b/src/modules/common/rawverse.cpp
@@ -5,6 +5,7 @@
* and provides lookup and parsing functions based on
* class VerseKey
*
+ * $Id: rawverse.cpp 3181 2014-04-17 04:27:57Z greg.hellings $
*
* Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -44,7 +45,7 @@ SWORD_NAMESPACE_START
*/
int RawVerse::instance = 0;
-const char *RawVerse::nl = "\r\n";
+const char RawVerse::nl = '\n';
/******************************************************************************
@@ -193,7 +194,7 @@ void RawVerse::doSetText(char testmt, long idxoff, const char *buf, long len)
textfp[testmt-1]->write(buf, (int)size);
// add a new line to make data file easier to read in an editor
- textfp[testmt-1]->write(nl, 2);
+ textfp[testmt-1]->write(&nl, 1);
}
else {
start = 0;
diff --git a/src/modules/common/rawverse4.cpp b/src/modules/common/rawverse4.cpp
index b87ea0d..100ef6b 100644
--- a/src/modules/common/rawverse4.cpp
+++ b/src/modules/common/rawverse4.cpp
@@ -6,7 +6,7 @@
* and provides lookup and parsing functions based on
* class VerseKey
*
- * $Id: rawverse4.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: rawverse4.cpp 3182 2014-04-17 04:28:36Z greg.hellings $
*
* Copyright 2007-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -46,7 +46,7 @@ SWORD_NAMESPACE_START
*/
int RawVerse4::instance = 0;
-const char *RawVerse4::nl = "\r\n";
+const char RawVerse4::nl = '\n';
/******************************************************************************
@@ -131,7 +131,7 @@ void RawVerse4::findOffset(char testmt, long idxoff, long *start, unsigned long
*start = swordtoarch32(tmpStart);
*size = swordtoarch32(tmpSize);
- if (len < 2) {
+ if (len < 4) {
*size = (unsigned long)((*start) ? (textfp[testmt-1]->seek(0, SEEK_END) - (long)*start) : 0); // if for some reason we get an error reading size, make size to end of file
}
}
@@ -195,7 +195,7 @@ void RawVerse4::doSetText(char testmt, long idxoff, const char *buf, long len)
textfp[testmt-1]->write(buf, (int)size);
// add a new line to make data file easier to read in an editor
- textfp[testmt-1]->write(nl, 2);
+ textfp[testmt-1]->write(&nl, 1);
}
else {
start = 0;
diff --git a/src/modules/common/swcomprs.cpp b/src/modules/common/swcomprs.cpp
index 9df8e7d..a9ac72e 100644
--- a/src/modules/common/swcomprs.cpp
+++ b/src/modules/common/swcomprs.cpp
@@ -2,9 +2,9 @@
*
* swcomprs.cpp - a driver class that provides compression utilities
*
- * $Id: swcomprs.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: swcomprs.cpp 3175 2014-04-17 04:21:31Z greg.hellings $
*
- * Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 1996-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
diff --git a/src/modules/common/xzcomprs.cpp b/src/modules/common/xzcomprs.cpp
index db8a4a8..513e170 100644
--- a/src/modules/common/xzcomprs.cpp
+++ b/src/modules/common/xzcomprs.cpp
@@ -3,9 +3,9 @@
* xzcomprs.cpp - XzCompress, a driver class that provides xz (LZMA2)
* compression
*
- * $Id: xzcomprs.cpp 2850 2013-07-02 09:57:20Z chrislit $
+ * $Id: xzcomprs.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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
diff --git a/src/modules/common/zipcomprs.cpp b/src/modules/common/zipcomprs.cpp
index 3e44abd..28471d8 100644
--- a/src/modules/common/zipcomprs.cpp
+++ b/src/modules/common/zipcomprs.cpp
@@ -3,9 +3,9 @@
* zipcomprs.cpp - ZipCompress, a driver class that provides zlib
* compression
*
- * $Id: zipcomprs.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: zipcomprs.cpp 3175 2014-04-17 04:21:31Z greg.hellings $
*
- * 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
diff --git a/src/modules/common/zverse.cpp b/src/modules/common/zverse.cpp
index c280d98..cd63eca 100644
--- a/src/modules/common/zverse.cpp
+++ b/src/modules/common/zverse.cpp
@@ -5,7 +5,7 @@
* and provides lookup and parsing functions based on
* class VerseKey for compressed modules
*
- * $Id: zverse.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: zverse.cpp 3166 2014-04-17 04:08:45Z greg.hellings $
*
* Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -428,7 +428,11 @@ char zVerse::createModule(const char *ipath, int blockBound, const char *v11n)
{
char *path = 0;
char *buf = new char [ strlen (ipath) + 20 ];
+ char retVal = 0;
FileDesc *fd, *fd2;
+ __s32 offset = 0;
+ __s16 size = 0;
+ VerseKey vk;
stdstr(&path, ipath);
@@ -438,69 +442,81 @@ char zVerse::createModule(const char *ipath, int blockBound, const char *v11n)
sprintf(buf, "%s/ot.%czs", path, uniqueIndexID[blockBound]);
FileMgr::removeFile(buf);
fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
- fd->getFd();
+ if (fd->getFd() < 1) goto erroropen1;
FileMgr::getSystemFileMgr()->close(fd);
sprintf(buf, "%s/nt.%czs", path, uniqueIndexID[blockBound]);
FileMgr::removeFile(buf);
fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
- fd->getFd();
+ if (fd->getFd() < 1) goto erroropen1;
FileMgr::getSystemFileMgr()->close(fd);
sprintf(buf, "%s/ot.%czz", path, uniqueIndexID[blockBound]);
FileMgr::removeFile(buf);
fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
- fd->getFd();
+ if (fd->getFd() < 1) goto erroropen1;
FileMgr::getSystemFileMgr()->close(fd);
sprintf(buf, "%s/nt.%czz", path, uniqueIndexID[blockBound]);
FileMgr::removeFile(buf);
- fd2 = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
- fd2->getFd();
+ fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
+ if (fd->getFd() < 1) goto erroropen1;
FileMgr::getSystemFileMgr()->close(fd);
sprintf(buf, "%s/ot.%czv", path, uniqueIndexID[blockBound]);
FileMgr::removeFile(buf);
fd = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
- fd->getFd();
+ if (fd->getFd() < 1) goto erroropen1;
sprintf(buf, "%s/nt.%czv", path, uniqueIndexID[blockBound]);
FileMgr::removeFile(buf);
fd2 = FileMgr::getSystemFileMgr()->open(buf, FileMgr::CREAT|FileMgr::WRONLY, FileMgr::IREAD|FileMgr::IWRITE);
- fd2->getFd();
+ if (fd2->getFd() < 1) goto erroropen2;
- VerseKey vk;
vk.setVersificationSystem(v11n);
vk.setIntros(true);
- __s32 offset = 0;
- __s16 size = 0;
offset = archtosword32(offset);
size = archtosword16(size);
for (vk = TOP; !vk.popError(); vk++) {
if (vk.getTestament() < 2) {
- fd->write(&offset, 4); //compBufIdxOffset
- fd->write(&offset, 4);
- fd->write(&size, 2);
+ if (fd->write(&offset, 4) != 4) goto writefailure; //compBufIdxOffset
+ if (fd->write(&offset, 4) != 4) goto writefailure;
+ if (fd->write(&size, 2) != 2) goto writefailure;
}
else {
- fd2->write(&offset, 4); //compBufIdxOffset
- fd2->write(&offset, 4);
- fd2->write(&size, 2);
+ if (fd2->write(&offset, 4) != 4) goto writefailure; //compBufIdxOffset
+ if (fd2->write(&offset, 4) != 4) goto writefailure;
+ if (fd2->write(&size, 2) != 2) goto writefailure;
}
}
fd2->write(&offset, 4); //compBufIdxOffset
fd2->write(&offset, 4);
fd2->write(&size, 2);
- FileMgr::getSystemFileMgr()->close(fd);
+ goto cleanup;
+
+erroropen1:
+ retVal = -1;
+ goto cleanup1;
+
+erroropen2:
+ retVal = -1;
+ goto cleanup;
+
+writefailure:
+ retVal = -2;
+
+cleanup:
FileMgr::getSystemFileMgr()->close(fd2);
+cleanup1:
+ FileMgr::getSystemFileMgr()->close(fd);
delete [] path;
delete [] buf;
- return 0;
+ return retVal;
}
diff --git a/src/modules/filters/osisheadings.cpp b/src/modules/filters/osisheadings.cpp
index 783fa81..7a5f525 100644
--- a/src/modules/filters/osisheadings.cpp
+++ b/src/modules/filters/osisheadings.cpp
@@ -3,7 +3,7 @@
* osisheadings.cpp - SWFilter descendant to hide or show headings
* in an OSIS module
*
- * $Id: osisheadings.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: osisheadings.cpp 3194 2014-04-24 03:02:47Z greg.hellings $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -91,6 +91,7 @@ bool OSISHeadings::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
if (name == u->currentHeadingName) {
if (tag.isEndTag(u->sID)) {
if (!u->depth-- || u->sID) {
+ // see comment below about preverse div changed and needing to preserve the <title> container tag for old school pre-verse titles
// we've just finished a heading. It's all stored up in u->heading
bool canonical = (SWBuf("true") == u->currentHeadingTag.getAttribute("canonical"));
bool preverse = (SWBuf("x-preverse") == u->currentHeadingTag.getAttribute("subType") || SWBuf("x-preverse") == u->currentHeadingTag.getAttribute("subtype"));
@@ -98,7 +99,20 @@ bool OSISHeadings::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
// do we want to put anything in EntryAttributes?
if (u->module->isProcessEntryAttributes() && (option || canonical || !preverse)) {
SWBuf buf; buf.appendFormatted("%i", u->headerNum++);
- u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][buf] = u->heading;
+ // leave the actual <title...> wrapper in if we're part of an old school preverse title
+ // because now frontend have to deal with preverse as a div which may or may not include <title> elements
+ // and they can't simply wrap all preverse material in <h1>, like they probably did previously
+ SWBuf heading;
+ if (u->currentHeadingName == "title") {
+ XMLTag wrapper = u->currentHeadingTag;
+ if (SWBuf("x-preverse") == wrapper.getAttribute("subType")) wrapper.setAttribute("subType", 0);
+ else if (SWBuf("x-preverse") == wrapper.getAttribute("subtype")) wrapper.setAttribute("subtype", 0);
+ heading = wrapper;
+ heading += u->heading;
+ heading += tag;
+ }
+ else heading = u->heading;
+ u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][buf] = heading;
StringList attributes = u->currentHeadingTag.getAttributeNames();
for (StringList::const_iterator it = attributes.begin(); it != attributes.end(); it++) {
diff --git a/src/modules/filters/osishtmlhref.cpp b/src/modules/filters/osishtmlhref.cpp
index 74b2da7..9cda9ab 100644
--- a/src/modules/filters/osishtmlhref.cpp
+++ b/src/modules/filters/osishtmlhref.cpp
@@ -2,9 +2,9 @@
*
* osishtmlhref.cpp - OSIS to HTML with hrefs filter
*
- * $Id: osishtmlhref.cpp 3005 2014-01-09 04:06:11Z greg.hellings $
+ * $Id: osishtmlhref.cpp 3173 2014-04-17 04:20:33Z greg.hellings $
*
- * 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 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
// 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);
@@ -481,9 +481,15 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
if (type == "bold" || type == "b" || type == "x-b") {
outText("<b>", buf, u);
}
- else if (type == "ol") {
+ else if (type == "ol" || type == "overline" || type == "x-overline") {
outText("<span style=\"text-decoration:overline\">", buf, u);
}
+ else if (type == "super") {
+ outText("<sup>", buf, u);
+ }
+ else if (type == "sub") {
+ outText("<sub>", buf, u);
+ }
else { // all other types
outText("<i>", buf, u);
}
@@ -503,7 +509,15 @@ bool OSISHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserDat
else if (type == "ol") {
outText("</span>", buf, u);
}
- else outText("</i>", buf, u);
+ else if (type == "sup") {
+ outText("</sup>", buf, u);
+ }
+ else if (type == "sub") {
+ outText("</sub>", buf, u);
+ }
+ else {
+ outText("</i>", buf, u);
+ }
}
}
diff --git a/src/modules/filters/osismorphsegmentation.cpp b/src/modules/filters/osismorphsegmentation.cpp
index 9afc0a1..1d91428 100644
--- a/src/modules/filters/osismorphsegmentation.cpp
+++ b/src/modules/filters/osismorphsegmentation.cpp
@@ -4,7 +4,7 @@
* morphemes (for morpheme segmented Hebrew in
* the WLC)
*
- * $Id: osismorphsegmentation.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: osismorphsegmentation.cpp 3186 2014-04-17 04:33:19Z greg.hellings $
*
* Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -78,13 +78,15 @@ char OSISMorphSegmentation::processText(SWBuf &text, const SWKey * /*key*/, cons
if (!strncmp(token.c_str(), "seg ", 4) || !strncmp(token.c_str(), "/seg", 4)) {
tag = token;
- if (!tag.isEndTag() && tag.getAttribute("type") && !strcmp("morph", tag.getAttribute("type"))) { //<seg type="morph"> start tag
+ if (!tag.isEndTag() && tag.getAttribute("type") &&
+ ( !strcmp("morph", tag.getAttribute("type"))
+ || !strcmp("x-morph", tag.getAttribute("type")))) { //<seg type="morph"> start tag
hide = !option; //only hide if option is Off
tagText = "";
inMorpheme = true;
}
- if (tag.isEndTag()) {
+ if (tag.isEndTag() && inMorpheme) {
buf.setFormatted("%.3d", morphemeNum++);
module->getEntryAttributes()["Morpheme"][buf]["body"] = tagText;
inMorpheme = false;
diff --git a/src/modules/filters/osisplain.cpp b/src/modules/filters/osisplain.cpp
index 6e583a4..24f5518 100644
--- a/src/modules/filters/osisplain.cpp
+++ b/src/modules/filters/osisplain.cpp
@@ -2,7 +2,7 @@
*
* osisplain.cpp - An SWFilter that provides stripping of OSIS tags
*
- * $Id: osisplain.cpp 2984 2013-09-20 12:18:45Z scribe $
+ * $Id: osisplain.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -185,7 +185,7 @@ bool OSISPlain::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
// 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');
diff --git a/src/modules/filters/osisrtf.cpp b/src/modules/filters/osisrtf.cpp
index 291aa08..7bc5639 100644
--- a/src/modules/filters/osisrtf.cpp
+++ b/src/modules/filters/osisrtf.cpp
@@ -2,9 +2,9 @@
*
* osisrtf.cpp - OSIS to RTF filter
*
- * $Id: osisrtf.cpp 3005 2014-01-09 04:06:11Z greg.hellings $ *
+ * $Id: osisrtf.cpp 3156 2014-04-17 03:50:37Z greg.hellings $ *
*
- * 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 @@ bool OSISRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *us
// 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);
diff --git a/src/modules/filters/osisscripref.cpp b/src/modules/filters/osisscripref.cpp
index 2bb7d15..99d6709 100644
--- a/src/modules/filters/osisscripref.cpp
+++ b/src/modules/filters/osisscripref.cpp
@@ -3,9 +3,9 @@
* osisscripref.cpp - SWFilter descendant to hide or show scripture
* references in an OSIS module
*
- * $Id: osisscripref.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: osisscripref.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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 @@ namespace {
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;
}
diff --git a/src/modules/filters/osisxhtml.cpp b/src/modules/filters/osisxhtml.cpp
index b1040a9..3f75c4a 100644
--- a/src/modules/filters/osisxhtml.cpp
+++ b/src/modules/filters/osisxhtml.cpp
@@ -2,9 +2,9 @@
*
* osisxhtml.cpp - Render filter for classed XHTML of an OSIS module
*
- * $Id: osisxhtml.cpp 3005 2014-01-09 04:06:11Z greg.hellings $
+ * $Id: osisxhtml.cpp 3205 2014-05-01 02:31:28Z greg.hellings $
*
- * 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
@@ -38,9 +38,7 @@ const char *OSISXHTML::getHeader() const {
.divineName { font-variant: small-caps; }\n\
.wordsOfJesus { color: red; }\n\
.transChangeSupplied { font-style: italic; }\n\
- .small, .sub, .sup { font-size: .83em }\n\
- .sub { vertical-align: sub }\n\
- .sup { vertical-align: super }\n\
+ .overline { text-decoration: overline; }\n\
.indent1 { margin-left: 10px }\n\
.indent2 { margin-left: 20px }\n\
.indent3 { margin-left: 30px }\n\
@@ -291,7 +289,7 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
URL::encode(vkey->getText()).c_str(),
ch,
ch,
- (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
+ (renderNoteNumbers ? noteName.c_str() : ""));
}
else {
buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
@@ -301,7 +299,7 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
URL::encode(u->key->getText()).c_str(),
ch,
ch,
- (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
+ (renderNoteNumbers ? noteName.c_str() : ""));
}
}
}
@@ -330,7 +328,7 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
// 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);
@@ -563,15 +561,15 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
// but we have used "ol" in the past, as well. Once a valid
// OSIS overline attribute is made available, these should all
// eventually be deprecated and never documented that they are supported.
- else if (type == "ol" || type == "overline" || type == "x-overline") {
- outText("<span style=\"text-decoration:overline\">", buf, u);
+ else if (type == "ol" || type == "overline" || type == "x-overline") {
+ outText("<span class=\"overline\">", buf, u);
}
else if (type == "super") {
- outText("<span class=\"sup\">", buf, u);
+ outText("<sup>", buf, u);
}
else if (type == "sub") {
- outText("<span class=\"sub\">", buf, u);
+ outText("<sub>", buf, u);
}
else { // all other types
outText("<i>", buf, u);
@@ -589,12 +587,18 @@ bool OSISXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
if (type == "bold" || type == "b" || type == "x-b") {
outText("</b>", buf, u);
}
- else if ( type == "ol"
- || type == "super"
- || type == "sub") {
+ else if (type == "ol") {
outText("</span>", buf, u);
}
- else outText("</i>", buf, u);
+ else if (type == "sup") {
+ outText("</sup>", buf, u);
+ }
+ else if (type == "sub") {
+ outText("</sub>", buf, u);
+ }
+ else {
+ outText("</i>", buf, u);
+ }
}
}
diff --git a/src/modules/filters/teihtmlhref.cpp b/src/modules/filters/teihtmlhref.cpp
index 43fe584..f08f994 100644
--- a/src/modules/filters/teihtmlhref.cpp
+++ b/src/modules/filters/teihtmlhref.cpp
@@ -2,7 +2,7 @@
*
* teihtmlhref.cpp - TEI to HTML with hrefs filter
*
- * $Id: teihtmlhref.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: teihtmlhref.cpp 3160 2014-04-17 04:02:17Z greg.hellings $
*
* Copyright 2008-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -87,26 +87,29 @@ bool TEIHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData
SWBuf rend = tag.getAttribute("rend");
u->lastHi = rend;
- if (rend == "ital")
- buf += "<i>";
- else if (rend == "italic")
+ if (rend == "italic" || rend == "ital")
buf += "<i>";
else if (rend == "bold")
buf += "<b>";
- else if (rend == "sup")
- buf += "<small><sup>";
-
+ else if (rend == "super" || rend == "sup")
+ buf += "<sup>";
+ else if (rend == "sub")
+ buf += "<sub>";
+ else if (rend == "overline")
+ buf += "<span style=\"text-decoration:overline\">";
}
else if (tag.isEndTag()) {
SWBuf rend = u->lastHi;
- if (rend == "ital")
- buf += "</i>";
- else if (rend == "italic")
+ if (rend == "italic" || rend == "ital")
buf += "</i>";
else if (rend == "bold")
buf += "</b>";
- else if (rend == "sup")
- buf += "</sup></small>";
+ else if (rend == "super" || rend == "sup")
+ buf += "</sup>";
+ else if (rend == "sub")
+ buf += "</sub>";
+ else if (rend == "overline")
+ buf += "</span>";
}
}
diff --git a/src/modules/filters/teirtf.cpp b/src/modules/filters/teirtf.cpp
index 979e4a6..1213221 100644
--- a/src/modules/filters/teirtf.cpp
+++ b/src/modules/filters/teirtf.cpp
@@ -2,7 +2,7 @@
*
* teirtf.cpp - TEI to RTF filter
*
- * $Id: teirtf.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: teirtf.cpp 3160 2014-04-17 04:02:17Z greg.hellings $
*
* Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -76,13 +76,14 @@ bool TEIRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *use
else if (!strcmp(tag.getName(), "hi") || !strcmp(tag.getName(), "emph")) {
SWBuf rend = tag.getAttribute("rend");
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
- if (rend == "ital" || rend == "italic")
+ if (rend == "italic" || rend == "ital")
buf += "{\\i1 ";
else if (rend == "bold")
buf += "{\\b1 ";
- else if (rend == "sup")
+ else if (rend == "super" || rend == "sup")
buf += "{\\super ";
-
+ else if (rend == "sub")
+ buf += "{\\sub ";
}
else if (tag.isEndTag()) {
buf += "}";
@@ -112,6 +113,16 @@ bool TEIRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *use
}
}
+ // <orth>
+ else if (!strcmp(tag.getName(), "orth")) {
+ if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+ buf += "{\\b1 ";
+ }
+ else if (tag.isEndTag()) {
+ buf += "}";
+ }
+ }
+
// <div>
else if (!strcmp(tag.getName(), "div")) {
diff --git a/src/modules/filters/teixhtml.cpp b/src/modules/filters/teixhtml.cpp
index 6a390a1..4ae0d89 100644
--- a/src/modules/filters/teixhtml.cpp
+++ b/src/modules/filters/teixhtml.cpp
@@ -2,7 +2,7 @@
*
* teixhtml.cpp - TEI to XHTML filter
*
- * $Id: teixhtml.cpp 2984 2013-09-20 12:18:45Z scribe $
+ * $Id: teixhtml.cpp 3161 2014-04-17 04:04:03Z greg.hellings $
*
* Copyright 2012-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -87,28 +87,28 @@ bool TEIXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *u
SWBuf rend = tag.getAttribute("rend");
u->lastHi = rend;
- if (rend == "ital")
- buf += "<i>";
- else if (rend == "italic")
+ if (rend == "italic" || rend == "ital")
buf += "<i>";
else if (rend == "bold")
buf += "<b>";
- else if (rend == "sup")
- buf += "<small><sup>";
+ else if (rend == "super" || rend == "sup")
+ buf += "<sup>";
+ else if (rend == "sub")
+ buf += "<sub>";
else if (rend == "overline")
buf += "<span style=\"text-decoration:overline\">";
}
else if (tag.isEndTag()) {
SWBuf rend = u->lastHi;
- if (rend == "ital")
- buf += "</i>";
- else if (rend == "italic")
+ if (rend == "italic" || rend == "ital")
buf += "</i>";
else if (rend == "bold")
buf += "</b>";
- else if (rend == "sup")
- buf += "</sup></small>";
+ else if (rend == "super" || rend == "sup")
+ buf += "</sup>";
+ else if (rend == "sub")
+ buf += "</sub>";
else if (rend == "overline")
buf += "</span>";
}
diff --git a/src/modules/filters/thmlheadings.cpp b/src/modules/filters/thmlheadings.cpp
index 46498d0..99bd12a 100644
--- a/src/modules/filters/thmlheadings.cpp
+++ b/src/modules/filters/thmlheadings.cpp
@@ -3,7 +3,7 @@
* thmlheadings.cpp - SWFilter descendant to hide or show headings
* in a ThML module
*
- * $Id: thmlheadings.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: thmlheadings.cpp 3195 2014-04-24 03:03:26Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -86,13 +86,22 @@ char ThMLHeadings::processText(SWBuf &text, const SWKey *key, const SWModule *mo
tag = token;
if (hide && tag.isEndTag()) {
if (module->isProcessEntryAttributes() && (option || (!preverse))) {
+ SWBuf heading;
+ SWBuf cls = startTag.getAttribute("class");
+ if (!cls.startsWith("fromEntryAttributes")) {
+ cls = SWBuf("fromEntryAttributes ") + cls;
+ startTag.setAttribute("class", cls);
+ }
+ heading += startTag;
+ heading += header;
+ heading += tag;
if (preverse) {
sprintf(buf, "%i", pvHeaderNum++);
- module->getEntryAttributes()["Heading"]["Preverse"][buf] = header;
+ module->getEntryAttributes()["Heading"]["Preverse"][buf] = heading;
}
else {
sprintf(buf, "%i", headerNum++);
- module->getEntryAttributes()["Heading"]["Interverse"][buf] = header;
+ module->getEntryAttributes()["Heading"]["Interverse"][buf] = heading;
if (option) { // we want the tag in the text
text.append(header);
}
@@ -143,8 +152,17 @@ char ThMLHeadings::processText(SWBuf &text, const SWKey *key, const SWModule *mo
}
*/
}
- else
+ else {
isheader = false;
+ SWBuf cls = tag.getAttribute("class");
+ if (cls.startsWith("fromEntryAttributes ")) {
+ cls << SWBuf("fromEntryAttributes ").size();
+ tag.setAttribute("class", cls);
+ token = tag;
+ token << 1;
+ token.setSize(token.size() - 1);
+ }
+ }
}
if (withinDiv && isheader) {
diff --git a/src/modules/filters/thmlscripref.cpp b/src/modules/filters/thmlscripref.cpp
index 1ea4a40..3a8b12a 100644
--- a/src/modules/filters/thmlscripref.cpp
+++ b/src/modules/filters/thmlscripref.cpp
@@ -3,9 +3,9 @@
* thmlscripref.cpp - SWFilter descendant to hide or show scripture
* referebces in a ThML module
*
- * $Id: thmlscripref.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: thmlscripref.cpp 3156 2014-04-17 03:50:37Z greg.hellings $
*
- * 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 @@ namespace {
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;
}
diff --git a/src/modules/filters/thmlxhtml.cpp b/src/modules/filters/thmlxhtml.cpp
index b17eb50..eb9c40a 100644
--- a/src/modules/filters/thmlxhtml.cpp
+++ b/src/modules/filters/thmlxhtml.cpp
@@ -2,7 +2,7 @@
*
* thmlxhtml.cpp - ThML to classed XHTML
*
- * $Id: thmlxhtml.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: thmlxhtml.cpp 3205 2014-05-01 02:31:28Z greg.hellings $
*
* Copyright 2011-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -230,7 +230,7 @@ bool ThMLXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
URL::encode(vkey->getText()).c_str(),
ch,
ch,
- (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
+ (renderNoteNumbers ? noteName.c_str() : ""));
}
else {
char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
@@ -241,7 +241,7 @@ bool ThMLXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
URL::encode(u->key->getText()).c_str(),
ch,
ch,
- (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
+ (renderNoteNumbers ? noteName.c_str() : ""));
}
u->suspendTextPassThru = true;
}
@@ -289,7 +289,7 @@ bool ThMLXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
URL::encode(footnoteNumber.c_str()).c_str(),
URL::encode(u->version.c_str()).c_str(),
URL::encode(vkey->getText()).c_str(),
- (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
+ (renderNoteNumbers ? noteName.c_str() : ""));
}
}
@@ -299,17 +299,19 @@ bool ThMLXHTML::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *
}
else if (tag.getName() && !strcmp(tag.getName(), "div")) {
if (tag.isEndTag() && u->SecHead) {
- buf += "</i></b><br />";
+ buf += "</h";
+ buf += u->SecHead;
+ buf += ">";
u->SecHead = false;
}
else if (tag.getAttribute("class")) {
if (!stricmp(tag.getAttribute("class"), "sechead")) {
- u->SecHead = true;
- buf += "<br /><b><i>";
+ u->SecHead = '3';
+ buf += "<h3>";
}
else if (!stricmp(tag.getAttribute("class"), "title")) {
- u->SecHead = true;
- buf += "<br /><b><i>";
+ u->SecHead = '2';
+ buf += "<h2>";
}
else {
buf += tag;
diff --git a/src/modules/filters/unicodertf.cpp b/src/modules/filters/unicodertf.cpp
index 997597b..1cde086 100644
--- a/src/modules/filters/unicodertf.cpp
+++ b/src/modules/filters/unicodertf.cpp
@@ -2,7 +2,7 @@
*
* unicodertf.cpp - SWFilter descendant to convert UTF-8 to RTF tags
*
- * $Id: unicodertf.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: unicodertf.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -20,7 +20,6 @@
*
*/
-#include <stdlib.h>
#include <stdio.h>
#include <unicodertf.h>
#include <swbuf.h>
diff --git a/src/modules/filters/utf16utf8.cpp b/src/modules/filters/utf16utf8.cpp
index 6356284..d224db2 100644
--- a/src/modules/filters/utf16utf8.cpp
+++ b/src/modules/filters/utf16utf8.cpp
@@ -2,7 +2,7 @@
*
* utf16utf8.cpp - SWFilter descendant to convert UTF-16 to UTF-8
*
- * $Id: utf16utf8.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: utf16utf8.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -21,9 +21,6 @@
*/
-#include <stdlib.h>
-#include <stdio.h>
-
#include <utf16utf8.h>
#include <swbuf.h>
diff --git a/src/modules/filters/utf8html.cpp b/src/modules/filters/utf8html.cpp
index 1f05ac7..d504418 100644
--- a/src/modules/filters/utf8html.cpp
+++ b/src/modules/filters/utf8html.cpp
@@ -3,7 +3,7 @@
* utf8html.cpp - SWFilter descendant to convert a UTF-8 stream to
* HTML escapes
*
- * $Id: utf8html.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: utf8html.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -21,7 +21,6 @@
*
*/
-#include <stdlib.h>
#include <stdio.h>
#include <utf8html.h>
#include <swbuf.h>
diff --git a/src/modules/filters/utf8latin1.cpp b/src/modules/filters/utf8latin1.cpp
index 1bf8d3b..db5237c 100644
--- a/src/modules/filters/utf8latin1.cpp
+++ b/src/modules/filters/utf8latin1.cpp
@@ -2,7 +2,7 @@
*
* utf8latin1.cpp - SWFilter descendant to convert UTF-8 to Latin-1
*
- * $Id: utf8latin1.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: utf8latin1.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -20,9 +20,6 @@
*
*/
-#include <stdlib.h>
-#include <stdio.h>
-
#include <utf8latin1.h>
#include <swbuf.h>
diff --git a/src/modules/filters/utf8nfc.cpp b/src/modules/filters/utf8nfc.cpp
index 49f12bb..06bd76f 100644
--- a/src/modules/filters/utf8nfc.cpp
+++ b/src/modules/filters/utf8nfc.cpp
@@ -3,7 +3,7 @@
* utf8nfc.cpp - SWFilter descendant to perform NFC (canonical
* composition normalization) on UTF-8 text
*
- * $Id: utf8nfc.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: utf8nfc.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -23,9 +23,6 @@
#ifdef _ICU_
-#include <stdlib.h>
-
-#include <utilstr.h>
#include <unicode/unistr.h>
#include <unicode/normlzr.h>
#include <unicode/unorm.h>
@@ -48,16 +45,16 @@ char UTF8NFC::processText(SWBuf &text, const SWKey *key, const SWModule *module)
if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
- UErrorCode status = U_ZERO_ERROR;
- UnicodeString source(text.getRawData(), text.length(), conv, status);
+ err = U_ZERO_ERROR;
+ UnicodeString source(text.getRawData(), text.length(), conv, err);
UnicodeString target;
- status = U_ZERO_ERROR;
- Normalizer::normalize(source, UNORM_NFC, 0, target, status);
+ err = U_ZERO_ERROR;
+ Normalizer::normalize(source, UNORM_NFC, 0, target, err);
- status = U_ZERO_ERROR;
+ err = U_ZERO_ERROR;
text.setSize(text.size()*2); // potentially, it can grow to 2x the original size
- int32_t len = target.extract(text.getRawData(), text.size(), conv, status);
+ int32_t len = target.extract(text.getRawData(), text.size(), conv, err);
text.setSize(len);
return 0;
diff --git a/src/modules/filters/utf8nfkd.cpp b/src/modules/filters/utf8nfkd.cpp
index e4454d2..3a782ab 100644
--- a/src/modules/filters/utf8nfkd.cpp
+++ b/src/modules/filters/utf8nfkd.cpp
@@ -3,7 +3,7 @@
* utf8nfkd.cpp - SWFilter descendant to perform NFKD (compatability
* decomposition normalization) on UTF-8 text
*
- * $Id: utf8nfkd.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: utf8nfkd.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -23,10 +23,6 @@
#ifdef _ICU_
-#include <stdlib.h>
-
-#include <utilstr.h>
-
#include <utf8nfkd.h>
#include <swbuf.h>
diff --git a/src/modules/filters/utf8utf16.cpp b/src/modules/filters/utf8utf16.cpp
index be8ad4b..958f1d9 100644
--- a/src/modules/filters/utf8utf16.cpp
+++ b/src/modules/filters/utf8utf16.cpp
@@ -2,7 +2,7 @@
*
* utf8utf16.cpp - SWFilter descendant to convert UTF-8 to UTF-16
*
- * $Id: utf8utf16.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: utf8utf16.cpp 3157 2014-04-17 03:56:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -20,10 +20,7 @@
*
*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <sysdata.h>
#include <utf8utf16.h>
#include <utilstr.h>
#include <swbuf.h>
@@ -68,7 +65,6 @@ char UTF8UTF16::processText(SWBuf &text, const SWKey *key, const SWModule *modul
text.setSize(text.size()-2);
return 0;
-
}
SWORD_NAMESPACE_END
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 63fec25..bd00344 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -432,7 +432,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/tests/cppunit/Makefile.in b/tests/cppunit/Makefile.in
index e6d5aa9..925b831 100644
--- a/tests/cppunit/Makefile.in
+++ b/tests/cppunit/Makefile.in
@@ -420,7 +420,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/tests/osistest.cpp b/tests/osistest.cpp
index 210f749..cfc09bb 100644
--- a/tests/osistest.cpp
+++ b/tests/osistest.cpp
@@ -2,7 +2,7 @@
*
* osistest.cpp -
*
- * $Id: osistest.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: osistest.cpp 3185 2014-04-17 04:32:00Z greg.hellings $
*
* Copyright 20122013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -69,7 +69,7 @@ int main(int argc, char **argv) {
SWModule *module = library.getModule(argv[1]);
if (!module) {
- cerr << "\nCouldn't file modules: " << argv[1] << "\n" << endl;
+ cerr << "\nCouldn't find module: " << argv[1] << "\n" << endl;
exit(-2);
}
diff --git a/usrinst.sh b/usrinst.sh
index 41463eb..49cd2fd 100755
--- a/usrinst.sh
+++ b/usrinst.sh
@@ -3,7 +3,7 @@
# usrinst.sh - Convenience script specifying most common development options
# to ./configure
#
-# $Id: usrinst.sh 2986 2013-10-05 12:32:49Z scribe $
+# $Id: usrinst.sh 3164 2014-04-17 04:06:51Z greg.hellings $
#
# Copyright 2002-2013 CrossWire Bible Society (http://www.crosswire.org)
# CrossWire Bible Society
@@ -31,7 +31,7 @@ fi
OPTIONS="--sysconfdir=/etc $OPTIONS"
OPTIONS="--without-conf $OPTIONS"
OPTIONS="--disable-shared $OPTIONS"
-#OPTIONS="--enable-debug $OPTIONS"
+OPTIONS="--enable-debug $OPTIONS"
#OPTIONS="--enable-profile $OPTIONS"
#OPTIONS="--with-cxx11regex $OPTIONS"
@@ -61,10 +61,9 @@ echo ""
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 ""
diff --git a/utilities/Makefile.in b/utilities/Makefile.in
index 88e720e..b64304e 100644
--- a/utilities/Makefile.in
+++ b/utilities/Makefile.in
@@ -406,7 +406,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/utilities/diatheke/Makefile.in b/utilities/diatheke/Makefile.in
index c76a8c5..3971a8a 100644
--- a/utilities/diatheke/Makefile.in
+++ b/utilities/diatheke/Makefile.in
@@ -216,7 +216,6 @@ GREP = @GREP@
ICU_CONFIG = @ICU_CONFIG@
ICU_IOLIBS = @ICU_IOLIBS@
ICU_LIBS = @ICU_LIBS@
-ICU_VER = @ICU_VER@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
diff --git a/utilities/diatheke/README b/utilities/diatheke/README
index 7421a6d..df39d86 100644
--- a/utilities/diatheke/README
+++ b/utilities/diatheke/README
@@ -47,6 +47,8 @@ default page to create a custom index.html for your users.
----------------------------------------------------------------------
VERSION HISTORY
+4.7
+
4.6 July 16, 2013
Updated for Sword 1.7.0.
@@ -75,7 +77,7 @@ VERSION HISTORY
COPYRIGHT
The Diatheke Suite and its components, Diatheke, Diatheke/CGI, and
-Diatheke/Tcl are Copyright 1999-2013 by CrossWire Bible Society.
+Diatheke/Tcl are Copyright 1999-2014 by CrossWire Bible Society.
HANDiatheke is Copyright 2000-2001 by CrossWire Bible Society.
The Diatheke Suite and all of its components are licensed through
the GNU General Public License and are intended for free distribution.
diff --git a/utilities/diatheke/corediatheke.cpp b/utilities/diatheke/corediatheke.cpp
index 37f9448..6e05e7c 100644
--- a/utilities/diatheke/corediatheke.cpp
+++ b/utilities/diatheke/corediatheke.cpp
@@ -2,9 +2,9 @@
*
* corediatheke.cpp -
*
- * $Id: corediatheke.cpp 2931 2013-07-31 13:07:26Z scribe $
+ * $Id: corediatheke.cpp 3207 2014-05-01 02:48:10Z greg.hellings $
*
- * 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,17 +120,28 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
ListKey listkey;
SectionMap::iterator sit;
ConfigEntMap::iterator eit;
-
SWModule *target;
+
char *font = 0;
+ SWBuf modlanguage;
+ SWBuf modlocale;
+ SWBuf syslanguage;
+ SWBuf syslocale;
char inputformat = 0;
SWBuf encoding;
char querytype = 0;
- if (locale) {
- LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(locale);
+ if (!locale) { locale = "en";
}
+
+ syslocale = SWBuf(locale);
+ syslocale.append(".en");
+ LocaleMgr *lom = LocaleMgr::getSystemLocaleMgr();
+ lom->setDefaultLocaleName(syslocale);
+ syslanguage = lom->translate(syslocale, "locales");
+
+
//deal with queries to "system"
if (!::stricmp(text, "system")) {
querytype = QT_SYSTEM;
@@ -148,6 +159,19 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
target = (*it).second;
SWKey *p = target->createKey();
VerseKey *parser = SWDYNAMIC_CAST(VerseKey, p);
+
+
+ if (target->getLanguage()) {
+ modlocale = target->getLanguage();
+ LocaleMgr *lm = LocaleMgr::getSystemLocaleMgr();
+ modlanguage = lm->translate(modlocale.append(".en"), "locales");
+ modlocale -= 3;
+ }
+ else {
+ modlocale = "en";
+ modlanguage = "English";
+ }
+
if (!parser) {
delete p;
parser = new VerseKey();
@@ -314,15 +338,17 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*output << ";}}";
}
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 << "\"/>";
}
+
if (text.length()) {
*output << (char*)target->getKeyText();
+ *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 << "\">";
+ *output << ": <span style=\"font:\"" << font << ";\""
+ << " lang=\"" << modlocale << "\">";
}
else if (outputformat == FMT_RTF) {
*output << ": {\\f1 ";
@@ -331,16 +357,14 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*output << ": ";
}
*output << text;
- 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 << "}";
}
- *output << "(";
- *output << target->getName();
- *output << ")\n";
+ *output << "(" << target->getName() << ")\n";
}
if (outputformat == FMT_RTF) {
@@ -371,7 +395,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*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 << "\"/>";
}
for (i = 0; i < listkey.getCount() && maxverses; i++) {
@@ -381,10 +406,14 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*parser = element->getUpperBound();
while (maxverses && *target->getKey() <= *parser) {
*output << (char*)target->getKeyText();
+ 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 << ">";
+ }
if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << ": <font face=\"";
- *output << font;
- *output << "\">";
+ *output << ": <span style=\"font:\"" << font << ";\"" << " lang=\"" << modlocale << "\">";
}
else if (outputformat == FMT_RTF) {
*output << ": {\\f1 ";
@@ -393,8 +422,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*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 << "}";
@@ -420,10 +449,16 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
else {
target->setKey(*listkey.getElement(i));
*output << (char*)target->getKeyText();
+ 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 << ">";
+ }
+ }
+
if (font && (outputformat == FMT_HTML || outputformat == FMT_HTMLHREF || outputformat == FMT_XHTML || outputformat == FMT_THML || outputformat == FMT_CGI)) {
- *output << ": <font face=\"";
- *output << font;
- *output << "\">";
+ *output << ": <font face=\"" << font << "\">";
}
else if (outputformat == FMT_RTF) {
*output << ": {\\f1 ";
@@ -432,8 +467,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
*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 << "}";
@@ -452,7 +487,8 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
maxverses--;
}
}
-
+
+
*output << "(";
*output << target->getName();
*output << ")\n";
@@ -462,6 +498,4 @@ void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAI
}
}
- delete parser;
-}
diff --git a/utilities/diatheke/corediatheke.h b/utilities/diatheke/corediatheke.h
index 833825e..cac0845 100644
--- a/utilities/diatheke/corediatheke.h
+++ b/utilities/diatheke/corediatheke.h
@@ -2,7 +2,7 @@
*
* corediatheke.h -
*
- * $Id: corediatheke.h 2900 2013-07-16 07:48:52Z chrislit $
+ * $Id: corediatheke.h 3189 2014-04-17 05:00:28Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -30,6 +30,7 @@
#include "diathekemgr.h"
#include <localemgr.h>
+#include <swlocale.h>
#define QT_BIBLE 1
#define QT_COMM 2
@@ -62,6 +63,11 @@
#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;
diff --git a/utilities/diatheke/diatheke.cpp b/utilities/diatheke/diatheke.cpp
index 159e3a5..1649169 100644
--- a/utilities/diatheke/diatheke.cpp
+++ b/utilities/diatheke/diatheke.cpp
@@ -2,9 +2,9 @@
*
* diatheke.cpp -
*
- * $Id: diatheke.cpp 2903 2013-07-16 11:11:18Z chrislit $
+ * $Id: diatheke.cpp 3170 2014-04-17 04:14:38Z greg.hellings $
*
- * Copyright 1999-2013 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 1999-2014 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -21,7 +21,7 @@
*/
/******************************************************************************
- * Diatheke 4.6 by Chris Little <chrislit@crosswire.org>
+ * Diatheke 4.7 by Chris Little <chrislit@crosswire.org>
* http://www.crosswire.org/sword/diatheke
*/
@@ -37,8 +37,8 @@ using std::cout;
void printsyntax() {
//if we got this far without exiting, something went wrong, so print syntax
- fprintf (stderr, "Diatheke command-line SWORD frontend Version 4.6\n");
- fprintf (stderr, "Copyright 1999-2013 by the CrossWire Bible Society\n");
+ fprintf (stderr, "Diatheke command-line SWORD frontend Version 4.7\n");
+ fprintf (stderr, "Copyright 1999-2014 by the CrossWire Bible Society\n");
fprintf (stderr, "http://www.crosswire.org/sword/diatheke/\n");
fprintf (stderr, "\n");
fprintf (stderr, "usage: diatheke <-b module_name> [-s search_type] [-r search_range]\n");
@@ -49,8 +49,9 @@ void printsyntax() {
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");
@@ -70,6 +71,8 @@ void printsyntax() {
fprintf (stderr, " diatheke -b KJV -o fmnx -k Jn 3:16\n");
fprintf (stderr, " diatheke -b WHNU -t Latin -o mn -k Mt 24\n");
fprintf (stderr, " diatheke -b KJV -s phrase -r Mt -k love\n");
+
+ exit(EXIT_FAILURE);
}
int main(int argc, char **argv)
@@ -94,19 +97,30 @@ int main(int argc, char **argv)
}
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])) {
@@ -233,8 +247,11 @@ int main(int argc, char **argv)
if (i < argc) {
SWBuf key = argv[i];
i++;
- for (; i < argc; i++)
+ for (; i < argc; i++) {
+ if (!::stricmp("-h", argv[i]) || !::stricmp("--help", argv[i]))
+ printsyntax();
key = key + " " + argv[i];
+ }
ref = new char[key.length() + 1];
strcpy (ref, key.c_str());
if (strlen(ref))
@@ -257,12 +274,18 @@ int main(int argc, char **argv)
}
}
*/
+ else {
+ // unexpected argument, so print the syntax
+ // -h, --help, /?, etc. will trigger this
+ printsyntax();
+ }
}
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;
diff --git a/utilities/diatheke/diathekemgr.cpp b/utilities/diatheke/diathekemgr.cpp
index a64b570..aa79fcf 100644
--- a/utilities/diatheke/diathekemgr.cpp
+++ b/utilities/diatheke/diathekemgr.cpp
@@ -2,7 +2,7 @@
*
* diathekemgr.cpp - DiathekeMgr
*
- * $Id: diathekemgr.cpp 2833 2013-06-29 06:40:28Z chrislit $
+ * $Id: diathekemgr.cpp 3167 2014-04-17 04:12:12Z greg.hellings $
*
* Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -76,13 +76,14 @@ DiathekeMgr::~DiathekeMgr()
void DiathekeMgr::AddRenderFilters(SWModule *module, ConfigEntMap &section)
{
SWBuf lang;
- bool rtl;
ConfigEntMap::iterator entry;
lang = ((entry = section.find("Lang")) != section.end()) ? (*entry).second : (SWBuf)"en";
- rtl = ((entry = section.find("Direction")) != section.end()) ? ((*entry).second == "RtoL") : false;
#ifdef _ICU_
+ bool rtl;
+ rtl = ((entry = section.find("Direction")) != section.end()) ? ((*entry).second == "RtoL") : false;
+
if (shape) {
module->addRenderFilter(arshaping);
}
diff --git a/utilities/osis2mod.cpp b/utilities/osis2mod.cpp
index eab2ee0..b8514b1 100644
--- a/utilities/osis2mod.cpp
+++ b/utilities/osis2mod.cpp
@@ -2,9 +2,9 @@
*
* osis2mod.cpp - Utility to import a module in OSIS format
*
- * $Id: osis2mod.cpp 2893 2013-07-16 03:07:02Z scribe $
+ * $Id: osis2mod.cpp 3177 2014-04-17 04:24:37Z greg.hellings $
*
- * 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 @@ bool isValidRef(const char *buf) {
*/
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
@@ -465,7 +465,7 @@ void makeValidRef(VerseKey &key) {
void writeEntry(SWBuf &text, bool force = false) {
char keyOsisID[255];
- static const char* revision = "<milestone type=\"x-importer\" subType=\"x-osis2mod\" n=\"$Rev: 2893 $\"/>";
+ static const char* revision = "<milestone type=\"x-importer\" subType=\"x-osis2mod\" n=\"$Rev: 3177 $\"/>";
static bool firstOT = true;
static bool firstNT = true;
@@ -528,8 +528,9 @@ void writeEntry(SWBuf &text, bool force = false) {
// If the entry already exists, then append this entry to the text.
// This is for verses that are outside the chosen versification. They are appended to the prior verse.
// The space should not be needed if we retained verse tags.
- SWBuf currentText = module->getRawEntry();
- if (currentText.length()) {
+ if (module->hasEntry(&currentVerse)) {
+ module->flush();
+ SWBuf currentText = module->getRawEntry();
cout << "INFO(WRITE): Appending entry: " << currentVerse.getOSISRef() << ": " << activeVerseText << endl;
activeVerseText = currentText + " " + activeVerseText;
}
@@ -1140,7 +1141,7 @@ bool handleToken(SWBuf &text, XMLTag token) {
* 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 +1162,9 @@ XMLTag transformBSP(XMLTag t) {
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 +1223,7 @@ XMLTag transformBSP(XMLTag t) {
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 +1278,10 @@ void writeLinks()
}
}
-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,37 +1294,57 @@ void usage(const char *app, const char *error = 0) {
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");
@@ -1531,7 +1552,15 @@ void processOSIS(istream& infile) {
int main(int argc, char **argv) {
- fprintf(stderr, "You are running osis2mod: $Rev: 2893 $\n");
+ fprintf(stderr, "You are running osis2mod: $Rev: 3177 $\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) {