summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDaniel Glassey <wdg@debian.org>2015-09-07 11:14:57 +0100
committerDaniel Glassey <wdg@debian.org>2015-09-07 11:14:57 +0100
commit7b6c8b08e9d29332dcd0a1029e7421334bfb6f61 (patch)
treedc263ee8b6c923716a8e0fed64756b7af1238dc7 /examples
parent7a00574163029c0c2b649878c95d5acbd083564a (diff)
Imported Upstream version 1.7.3+dfsg
Diffstat (limited to 'examples')
-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
13 files changed, 1037 insertions, 11 deletions
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;
+}
+