From 03134fa5f6f25d92724ce4c183f9bbe12a9e37dc Mon Sep 17 00:00:00 2001 From: "Roberto C. Sanchez" Date: Sat, 29 Mar 2014 10:53:59 -0400 Subject: Imported Upstream version 1.5.11 --- utilities/diatheke/.cvsignore | 5 + utilities/diatheke/Makefile.am | 24 + utilities/diatheke/Makefile.in | 521 +++++++ utilities/diatheke/README | 76 + utilities/diatheke/cgi/Makefile.am | 6 + utilities/diatheke/cgi/dia-def.pl | 41 + utilities/diatheke/cgi/diatheke.pl | 509 ++++++ utilities/diatheke/cgi/index-private.html | 1264 +++++++++++++++ utilities/diatheke/cgi/index-public.html | 883 +++++++++++ utilities/diatheke/corediatheke.cpp | 449 ++++++ utilities/diatheke/corediatheke.h | 43 + utilities/diatheke/diafiltmgr.cpp | 228 +++ utilities/diatheke/diafiltmgr.h | 47 + utilities/diatheke/diatheke.cpp | 225 +++ utilities/diatheke/diatheke.dsp | 204 +++ utilities/diatheke/diatheke.dsw | 44 + utilities/diatheke/diathekemgr.cpp | 109 ++ utilities/diatheke/diathekemgr.h | 35 + utilities/diatheke/gbfcgi.cpp | 138 ++ utilities/diatheke/gbfcgi.h | 38 + utilities/diatheke/osiscgi.cpp | 325 ++++ utilities/diatheke/osiscgi.h | 48 + utilities/diatheke/pqa/Diatheke.pqa | Bin 0 -> 662 bytes utilities/diatheke/pqa/src/README | 1 + utilities/diatheke/pqa/src/all.html | 170 ++ utilities/diatheke/pqa/src/ancient.html | 32 + utilities/diatheke/pqa/src/dict.html | 32 + utilities/diatheke/pqa/src/english.html | 68 + utilities/diatheke/pqa/src/french.html | 26 + utilities/diatheke/pqa/src/german.html | 35 + utilities/diatheke/pqa/src/index.html | 43 + utilities/diatheke/pqa/src/lex.html | 29 + utilities/diatheke/pqa/src/other.html | 57 + utilities/diatheke/pqa/src/spanish.html | 29 + utilities/diatheke/soap/sapouni.cgi | 97 ++ utilities/diatheke/soap/soapatheke.pl | 16 + utilities/diatheke/tcl/biblebot-diatheke.tcl | 2131 ++++++++++++++++++++++++++ utilities/diatheke/thmlcgi.cpp | 193 +++ utilities/diatheke/thmlcgi.h | 38 + 39 files changed, 8259 insertions(+) create mode 100644 utilities/diatheke/.cvsignore create mode 100644 utilities/diatheke/Makefile.am create mode 100644 utilities/diatheke/Makefile.in create mode 100644 utilities/diatheke/README create mode 100644 utilities/diatheke/cgi/Makefile.am create mode 100755 utilities/diatheke/cgi/dia-def.pl create mode 100755 utilities/diatheke/cgi/diatheke.pl create mode 100644 utilities/diatheke/cgi/index-private.html create mode 100644 utilities/diatheke/cgi/index-public.html create mode 100644 utilities/diatheke/corediatheke.cpp create mode 100644 utilities/diatheke/corediatheke.h create mode 100644 utilities/diatheke/diafiltmgr.cpp create mode 100644 utilities/diatheke/diafiltmgr.h create mode 100644 utilities/diatheke/diatheke.cpp create mode 100644 utilities/diatheke/diatheke.dsp create mode 100644 utilities/diatheke/diatheke.dsw create mode 100644 utilities/diatheke/diathekemgr.cpp create mode 100644 utilities/diatheke/diathekemgr.h create mode 100644 utilities/diatheke/gbfcgi.cpp create mode 100644 utilities/diatheke/gbfcgi.h create mode 100644 utilities/diatheke/osiscgi.cpp create mode 100644 utilities/diatheke/osiscgi.h create mode 100644 utilities/diatheke/pqa/Diatheke.pqa create mode 100644 utilities/diatheke/pqa/src/README create mode 100644 utilities/diatheke/pqa/src/all.html create mode 100644 utilities/diatheke/pqa/src/ancient.html create mode 100644 utilities/diatheke/pqa/src/dict.html create mode 100644 utilities/diatheke/pqa/src/english.html create mode 100644 utilities/diatheke/pqa/src/french.html create mode 100644 utilities/diatheke/pqa/src/german.html create mode 100644 utilities/diatheke/pqa/src/index.html create mode 100644 utilities/diatheke/pqa/src/lex.html create mode 100644 utilities/diatheke/pqa/src/other.html create mode 100644 utilities/diatheke/pqa/src/spanish.html create mode 100755 utilities/diatheke/soap/sapouni.cgi create mode 100755 utilities/diatheke/soap/soapatheke.pl create mode 100644 utilities/diatheke/tcl/biblebot-diatheke.tcl create mode 100644 utilities/diatheke/thmlcgi.cpp create mode 100644 utilities/diatheke/thmlcgi.h (limited to 'utilities/diatheke') diff --git a/utilities/diatheke/.cvsignore b/utilities/diatheke/.cvsignore new file mode 100644 index 0000000..f5ce63f --- /dev/null +++ b/utilities/diatheke/.cvsignore @@ -0,0 +1,5 @@ +.deps +.libs +Makefile +Makefile.in +diatheke diff --git a/utilities/diatheke/Makefile.am b/utilities/diatheke/Makefile.am new file mode 100644 index 0000000..51a30c6 --- /dev/null +++ b/utilities/diatheke/Makefile.am @@ -0,0 +1,24 @@ +AUTOMAKE_OPTIONS = 1.6 + +INCLUDES = -I$(top_srcdir)/include + +bin_PROGRAMS = diatheke + +diatheke_SOURCES = diatheke.cpp corediatheke.cpp diathekemgr.cpp \ + diafiltmgr.cpp thmlcgi.cpp gbfcgi.cpp osiscgi.cpp + +if ICU +iculibs = -licui18n -licuuc +endif + +if USELUCENE +lucenelibs = -lclucene +endif + +diatheke_LDADD = $(top_builddir)/lib/libsword.la \ + $(iculibs) $(lucenelibs) + +noinst_HEADERS = corediatheke.h diafiltmgr.h diathekemgr.h gbfcgi.h thmlcgi.h \ + osiscgi.h + +include cgi/Makefile.am diff --git a/utilities/diatheke/Makefile.in b/utilities/diatheke/Makefile.in new file mode 100644 index 0000000..36d4273 --- /dev/null +++ b/utilities/diatheke/Makefile.in @@ -0,0 +1,521 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 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@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@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@ +bin_PROGRAMS = diatheke$(EXEEXT) +DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/cgi/Makefile.am +subdir = utilities/diatheke +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_clucene.m4 \ + $(top_srcdir)/m4/cppunit.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 = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_diatheke_OBJECTS = diatheke.$(OBJEXT) corediatheke.$(OBJEXT) \ + diathekemgr.$(OBJEXT) diafiltmgr.$(OBJEXT) thmlcgi.$(OBJEXT) \ + gbfcgi.$(OBJEXT) osiscgi.$(OBJEXT) +diatheke_OBJECTS = $(am_diatheke_OBJECTS) +am__DEPENDENCIES_1 = +diatheke_DEPENDENCIES = $(top_builddir)/lib/libsword.la \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(top_builddir)/include@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(diatheke_SOURCES) +DIST_SOURCES = $(diatheke_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_CXXFLAGS = @AM_CXXFLAGS@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +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_AM_CFLAGS = @CURL_AM_CFLAGS@ +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@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GENCCODE = @GENCCODE@ +GENCMN = @GENCMN@ +GENRB = @GENRB@ +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@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKGDATA = @PKGDATA@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XML_LIBS = @XML_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +with_conf = @with_conf@ +with_icu = @with_icu@ +with_zlib = @with_zlib@ +AUTOMAKE_OPTIONS = 1.6 +INCLUDES = -I$(top_srcdir)/include +diatheke_SOURCES = diatheke.cpp corediatheke.cpp diathekemgr.cpp \ + diafiltmgr.cpp thmlcgi.cpp gbfcgi.cpp osiscgi.cpp + +@ICU_TRUE@iculibs = -licui18n -licuuc +@USELUCENE_TRUE@lucenelibs = -lclucene +diatheke_LDADD = $(top_builddir)/lib/libsword.la \ + $(iculibs) $(lucenelibs) + +noinst_HEADERS = corediatheke.h diafiltmgr.h diathekemgr.h gbfcgi.h thmlcgi.h \ + osiscgi.h + +swcgidir = $(top_srcdir)/utilities/diatheke/cgi +EXTRA_DIST = $(swcgidir)/dia-def.pl $(swcgidir)/diatheke.pl \ + $(swcgidir)/index-private.html $(swcgidir)/index-public.html +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/cgi/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utilities/diatheke/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign utilities/diatheke/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 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +diatheke$(EXEEXT): $(diatheke_OBJECTS) $(diatheke_DEPENDENCIES) + @rm -f diatheke$(EXEEXT) + $(CXXLINK) $(diatheke_OBJECTS) $(diatheke_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/corediatheke.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diafiltmgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diatheke.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diathekemgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbfcgi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osiscgi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thmlcgi.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +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 $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$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) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +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: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_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-binPROGRAMS clean-generic clean-libtool 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 + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: 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: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS 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 uninstall uninstall-am \ + uninstall-binPROGRAMS + +# 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/utilities/diatheke/README b/utilities/diatheke/README new file mode 100644 index 0000000..5f1a793 --- /dev/null +++ b/utilities/diatheke/README @@ -0,0 +1,76 @@ +Diatheke Suite release 4.0 +by Chris Little + +This suite is intended for use with libraries and modules from +the SWORD Project, available at http://www.crosswire.org/ + +The latest versions of this suite and its components are available +at http://www.crosswire.org/sword/diatheke + +Version 4.0 of this suite consists of the following components: + +Diatheke 4.0 - a command line utility, good for lots of stuff +Diatheke/CGI 4.0 - a PERL CGI module interface to Diatheke 4.0 + +-------------------------------------------------------------------- +INSTALLING Diatheke/CGI + +To install Diatheke/CGI, first install PERL and a webserver such as +Apache that is capable of running PERL CGIs. Installing mod_perl is +recommended for a speed improvement, but is by no means necessary. + +Then copy the two .pl files from the ./cgi directory of this +distribution into your cgi-bin directory. Modify the top of +diatheke.pl to reflect the correct location of your your diatheke +command line utility binary and the default font if necessary. The +CGI is now installed and ready for access. + +diatheke.pl is the main lookup script. dia-def.pl is a supplemental +script used to set a default Bible translation (saved on the +user's computer as a cookie). + +Two sample HTML files are included as sample interfaces for an +general Web-Bible gateway. index-public.html includes all currently +available free texts while index-private.html includes all currently +available texts, including those which are encrypted because +of copyright and distribution restrictions. In any case, you should +only use these as a guide, adding and subtracting modules depending +on which modules you have installed and have permission to publish +on the internet or your intranet. The bottom section of each file +includes an example call to the dia-def.pl script to set a default +Bible version. + +You may also direct users directly to your perl script since it will +present a page with all of your modules. Or you may wish to use this +default page to create a custom index.html for your users. + +---------------------------------------------------------------------- +VERSION HISTORY + +4.0 July 8, 2001. + Updated to Sword 1.5.2 with innumerable bug fixes. + Now builds properly for Win32 using VC++. + Diatheke/Tcl and HANDiatheke were omitted, for the moment + from this release, but are still available in the CVS. + +3.0 March 31, 2001. + Self-generating HTML page for the lazy (Diatheke/CGI). + Localization support. (Diatheke and Diatheke/CGI). + +2.5 Now supports ThML. Numerous bugfixes. December 10, 2000. + Includes Diatheke 3.0, Diatheke/CGI 3.0, Diatheke/Tcl 3.0, + and HANDiatheke 3.0 (initial version, but version-synced) + +2.0 First public release, including Diatheke 2.0, Diatheke/CGI + 2.0, and Diatheke/Tcl 2.5. October 23, 1999. + +----------------------------------------------------------------------- +COPYRIGHT + +The Diatheke Suite and its components, Diatheke, Diatheke/CGI, and +Diatheke/Tcl are Copyright 1999, 2000, 2001 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. +See http://www.gnu.org/copyleft/gpl.html for details. + diff --git a/utilities/diatheke/cgi/Makefile.am b/utilities/diatheke/cgi/Makefile.am new file mode 100644 index 0000000..237aefd --- /dev/null +++ b/utilities/diatheke/cgi/Makefile.am @@ -0,0 +1,6 @@ +swcgidir = $(top_srcdir)/utilities/diatheke/cgi + +EXTRA_DIST = $(swcgidir)/dia-def.pl +EXTRA_DIST += $(swcgidir)/diatheke.pl +EXTRA_DIST += $(swcgidir)/index-private.html +EXTRA_DIST += $(swcgidir)/index-public.html diff --git a/utilities/diatheke/cgi/dia-def.pl b/utilities/diatheke/cgi/dia-def.pl new file mode 100755 index 0000000..e2f1d4f --- /dev/null +++ b/utilities/diatheke/cgi/dia-def.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +#change this variable to hostname of your server +@values = split(/\&/,$ENV{'QUERY_STRING'}); +$DOMAIN = $ENV{'REMOTE_ADDR'}; +$EXPIRES = 'Fri Dec 31 23:59:00 GMT 2005'; + +foreach $i (@values) { + ($varname, $mydata) = split(/=/,$i); + if ($varname eq "defversion") { + $COOKIE = "DEFTRANS=$mydata ; expires=$EXPIRES"; + } + elsif ($varname eq "locale") { + $COOKIE = "LOCALE=$mydata ; expires=$EXPIRES"; + } + elsif ($varname eq "settrans") { + $COOKIE = "SETTRANS=$mydata ; expires=$EXPIRES"; + } + elsif ($varname eq "setcomm") { + $COOKIE = "SETCOMM=$mydata ; expires=$EXPIRES"; + } + elsif ($varname eq "setld") { + $COOKIE = "SETLD=$mydata ; expires=$EXPIRES"; + } +} + +# Set the cookie and send the user the thank you page. +print "Set-cookie: $COOKIE\n"; +print "Content-type: text/html\n\n"; #Note extra newline to mark + #end of header. + +print ""; + + + + + + + + + diff --git a/utilities/diatheke/cgi/diatheke.pl b/utilities/diatheke/cgi/diatheke.pl new file mode 100755 index 0000000..ee36f11 --- /dev/null +++ b/utilities/diatheke/cgi/diatheke.pl @@ -0,0 +1,509 @@ +#!/usr/bin/perl + +# Typical Linux/Unix settings +$err = "2> /dev/null"; +$sword_path = "/home/sword"; # SWORD_PATH environment variable you want to use +$diatheke = "nice /usr/bin/diatheke"; # location of diatheke command line program + +# Typical Windows settings +#$err = ""; +#$sword_path = "C:\\Program Files\\CrossWire\\The SWORD Project"; # SWORD_PATH environment variable you want to use +#$diatheke = "$sword_path\\diatheke.exe"; # location of diatheke command line program + +$cgiurl = "http:\/\/www.crosswire.org\/cgi-bin"; + +$scriptname = "diatheke.pl"; +$defaultfontface = "Times New Roman, Times, Roman, serif"; # default font name +$maxverses = 50; # maximum number of verses diatheke will return per query (prevents people from asking for Gen1:1-Rev22:21) +$defaultbook = "KJV"; # book to query when none is selected, but a verse/search is entered +$deflocale = "abbr"; # this is just the default for cases where user has not selected a locale and his browser does not reveal one -- you can also set locale using locale= in the GET URL + +############################################################################### +## You should not need to edit anything below this line. +## Unless you want to modify functionality of course. :) +############################################################################### + +$version = "4.2"; + +sub shell_escape { + my $input = shift; + my $result = ''; + + foreach my $i (split //, $input) { + if ($i eq "'") { + $result .= "'\\''"; + } else { + $result .= $i; + } + } + return $result; +} + + +sub plussifyaddress { + ($p_ver = @_[0]) =~ tr/ /+/; + $p_newline = ""; + return $p_newline; +} + +sub urlvers { + $u_verse = @_[0]; + $u_version = @_[1]; + $u_oldverse = $u_verse; + $u_verse =~ tr/ /+/; + $u_newline = "$u_oldverse"; + return $u_newline; +} + +$ENV{'SWORD_PATH'} = $sword_path; + +print "Content-type: text/html\n\n"; + + +if ($ENV{'HTTP_COOKIE'}) { + + $cookie = $ENV{'HTTP_COOKIE'}; + $cookie =~ s/\; /=/g; + %cookiedata = split(/=/, $cookie); + + $defversion = $cookiedata{DEFTRANS}; + $locale = $cookiedata{LOCALE}; +} + +if ($defversion eq "") { + $defversion = 'KJV'; +} +if ($locale eq "") { + $locale = $ENV{'HTTP_ACCEPT_LANGUAGE'}; + $locale =~ s/(..).*/$1/; + if ($locale eq "") { + $locale = $deflocale; + } + elsif ($locale eq "en") { + $locale = "abbr"; + } +} + +$locale = shell_escape($locale); +$hostname = $ENV{'REMOTE_ADDR'}; +@values = split(/\&/,$ENV{'QUERY_STRING'}); +$n = 0; +$palm = 0; + +$latinxlit = ""; + +$optionfilters = ""; +$debug=1; +foreach $i (@values) { + ($varname, $mydata) = split(/=/,$i); + if ($varname ne "Submit" && $varname ne "lookup") { + if ($varname eq "verse") { + $verse = $mydata; + $verse =~ tr/+/ /; + $verse =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + $verse = shell_escape($verse); + } + elsif ($varname eq "search" && $mydata ne "" && $mydata ne "off") { + $search = "-s '" . shell_escape($mydata) . "'"; + } + elsif ($varname eq "range" && $mydata ne "" && $mydata ne "off") { + $range = $mydata; + $range =~ tr/+/ /; + $range =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + $range = "-r \"$range\""; + $range = shell_escape($range); + } + + elsif ($varname eq "strongs") { + $optionfilters .= "n"; + } + elsif ($varname eq "footnotes") { + $optionfilters .= "f"; + } + elsif ($varname eq "headings") { + $optionfilters .= "h"; + } + elsif ($varname eq "morph") { + $optionfilters .= "m"; + } + elsif ($varname eq "hebcant") { + $optionfilters .= "c"; + } + elsif ($varname eq "hebvowels") { + $optionfilters .= "v"; + } + elsif ($varname eq "grkacc") { + $optionfilters .= "a"; + } + elsif ($varname eq "lemmas") { + $optionfilters .= "l"; + } + elsif ($varname eq "scriprefs") { + $optionfilters .= "s"; + } + elsif ($varname eq "arshape") { + $optionfilters .= "r"; + } + elsif ($varname eq "bidi") { + $optionfilters .= "b"; + } + + elsif ($varname eq "latinxlit") { + $latinxlit = "-t Latin"; + } + + elsif ($varname eq "palm") { + $palm = 1; + } + elsif ($varname eq "debug") { + $debug = 1; + } + elsif ($varname eq "locale") { + $locale = shell_escape($mydata); + } + elsif ($varname eq "maxverses") { + $maxverses = shell_escape($mydata); + } + elsif ($mydata eq "on" || $mydata eq "ON") { + $versions[$n] = shell_escape($varname); + $n++; + } + } +} +if ($optionfilters ne "") { + $optionfilters = "-o " . $optionfilters; +} + + + +if ($n == 0) { + $versions[0] = $defaultbook; + $n++; +} + +if ($verse eq "") { + + @versionlist = `$diatheke -b system -k modulelist $err`; + @versionlist2 = @versionlist; + @localelist = `$diatheke -b system -k localelist $err`; + + print < + + +Diatheke Online Bible + + + + +
+

Verse/Commentary Lookup                                                                 + Verse or Search key:
+ Phrase Search
+ Multiple Word Search
+ Regular Expression Search
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
+ Custom Range Restriction + + +
+ +
+ + Show Strong's Numbers + + Show Section Headings
+ + Show Footnotes + + Show Scripture Cross-References
+ + Show Morphology + + Show Hebrew Vowels
+ + Show Lemmas + + Show Hebrew Cantillation + Marks
+ + Latin Transliterate + + + Show Greek Accents +
+
+ +DEF1 + + foreach $line (@versionlist) { + chomp($line); + + if ($line eq "Biblical Texts:") { + print ""; + } + elsif ($line eq "Commentaries:") { + print ""; + } + elsif ($line eq "Dictionaries:") { + print ""; + } + else { + $line =~ s/([^:]+) : (.+)/
Biblical Texts:
Commentaries:
Dictionaries & Lexica:
$2 ($1)<\/font><\/td><\/tr>/; + print "$line\n"; + } + + } + + print < + + +
+ Select default Bible version for cross-references: 

Select locale:  + +
+ + +DEF4 + +} +else { + + + +if ($palm == 0) { +print < +Diatheke Interlinear Bible + + + + + + + + + + +END +} +else { +print < +HANDiatheke + + + + + +END +} +for ($i = 0; $i < $n; $i++) { + + $line = "$diatheke $search $range $optionfilters $latinxlit -l '$locale' -m '$maxverses' -f cgi -b '$versions[$i]' -k '$verse' $err"; + + if ($debug) { + print "
command line: $line\n

"; + } + $line = `$line`; + + chomp($line); + + $line =~ s/!DIATHEKE_URL!/$scriptname\?/g; + +# Parse and link to Strong's references if present + + $info = `$diatheke -b info -k '$versions[$i]' $err`; + $info =~ /([^\;]+)\;([^\;]+)/; + $format = $1; + $type = $2; + + if ($versions[$i] eq "StrongsHebrew") { + $line =~ s/(see HEBREW for )([0-9]+)/$1$2\<\/a\>/g; + } + elsif($versions[$i] eq "StrongsGreek") { + $line =~ s/(see GREEK for )([0-9]+)/$1$2\<\/a\>/g; + } + #case for searches + elsif($search ne "") { + $line =~ s/([^<]+)<\/entry>/urlvers($1, $versions[$i])/eg; + } + #case for non-ThML, non-Bible texts + elsif($type ne "Biblical Texts") { + $book = $verse; + $book =~ s/^([A-Za-z0-9]+) [0-9]+:[0-9]+.*/$1/; + $chapter = $verse; + $chapter =~ s/[A-Za-z0-9]+ ([0-9]+):[0-9]+.*/$1/; + $line =~ s/\#*([1-9]*[A-Z][a-z]+\.*) ([0-9]+):([0-9]+-*,*[0-9]*)\|*/$1 $2:$3\<\/a\>/g; + $line =~ s/\#([0-9]+):([0-9]+-*,*[0-9]*)\|*/$book $1:$2\<\/a\>/g; + $line =~ s/\#([0-9]+-*,*[0-9]*)\|*/$book $chapter:$1\<\/a\>/g; + } + + if ($locale ne "abbr") { + $line =~ s/href=\"$scriptname([^\"]+)\"/href=\"$scriptname$1&locale=$locale\"/g; + } + if ($palm == 1) { + $line =~ s/href=\"$scriptname([^\"]+)\"/href=\"$cgiurl\/$scriptname$1&palm=on\"/g; + } + + print "$line

\n"; +} + +if ($palm == 1) { + print "
Powered by Diatheke (http:\/\/www.gotjesus.org\/sword\/diatheke) and the SWORD Project (http:\/\/www.crosswire.org\/sword)."; +} + +print "



"; + +} + + diff --git a/utilities/diatheke/cgi/index-private.html b/utilities/diatheke/cgi/index-private.html new file mode 100644 index 0000000..6afbc91 --- /dev/null +++ b/utilities/diatheke/cgi/index-private.html @@ -0,0 +1,1264 @@ + + + +Diatheke Online Bible + + + + +
+

Verse or Search key: + + + +
+
+ + Verse/Commentary Lookup
+ + Phrase Search
+ + Multiple Word Search
+ + Regular Expression Search
+
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + Show Strong's Numbers + + Show Section Headings
+ + Show Footnotes + + Show Scripture Cross-References
+ + Show Morphology + + Show Hebrew Vowels
+ + Show Lemmas + + Show Hebrew Cantillation + Marks
+ + Latin Transliterate + + + Show Greek Accents +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
English Biblical + Texts:
+
Non-English + Biblical Texts:
+ + American King James + Version (AKJV) + + Albanian Bible (ALB) +
+ + Analytical-Literal + Translation (ALT) + + 1953 Afrikaans Bybel + (Afr1953)
+ + 1901 American Standard + Version (ASV) + + 1983 Afrikaans Bybel + (Afr1983)
+ + 1965 Bible in Basic + English (BBE) + + Smith & Van Dyke Arabic + Bible (AraSVD)
+ + Bible in Worldwide + English (BWE) + + Chinese Glory Union + Bible (ChiGU)
+ + Brenton's English Translation + of the Septuagint (Brenton) + + Czech Bible Kralicka + (CzeBKR)
+ + The Common Edition: + New Testament (Common) + + Czech Ekumenicky Cesky + preklad (CzeCEP)
+ + Douay-Rheims Bible + (DR) + + Czech Preklad KMS Nova + smlouva (CzeKMS)
+ + Douay-Rheims 1899 American + Edition (DRA) + + Czech Nova kralicka + Bible (CzeNKB)
+ + 1889 Darby Bible (Darby) + + + Danske Bibel (Dan) +
+ + GOD'S WORD Translation + (GodsWord) + + Dutch Leidse Vertaling + (DutLEI)
+ + Hebrew Names Version + of the World English Bible (HNV) + + Dutch Lutherse Vertaling + (DutLU)
+ + Interlinear Greek New + Testament (IGNT) + + Dutch Netherlands Bijbelgenootschap + Vertaling 1951 (DutNBG)
+ + International Standard + Version (ISV) + + Dutch PALM-editie NT + (DutPALM)
+ + Jewish Publication + Society Old Testament (JPS) + + Dutch Statenvertaling + (DutSVV)
+ + 21st Century King James + Version (KJ21) + + Equadorian Shuar NT + (EquShr)
+ + King James Version + of 1611 w/ Strongs Numbers (KJV) + + Esperanto Bible (Esperanto)
+ + Green's Literal Translation + (LITV) + + Finnish 1938 PhyZ Raamattu + (FinPR)
+ + The Living Oracles + NT (LO) + + French Bible en francais + courant, edition revisee (FreBFC)
+ + Green's Modern King + James Version (MKJV) + + French Bible de Jerusalem + (FreBJ)
+ + Montgomery New Testament + (Montgomery) + + French Haitian Creole + Version (FreCrl)
+ + James Murdock's Translation + of the Syriac Peshitta (Murdock) + + French Darby Version + (FreDrb)
+ + New American Bible + (NAB) + + French 1910 Louis Segond + (FreLSG)
+ + New American Standard + Bible (NASB) + + French Nouvelle Edition + de Geneve 1979 (FreNEG)
+ + New American Standard + Bible 1995 Update (NASB95) + + French Traduction oecumenique + de la Bible (FreTOB)
+ + New Century Version + (NCV) + + German Bengel NT (GerBen)
+ + New International Version + (NIV) + + German Einheitsuebersetzung + der Heilegen Schrift (GerEin)
+ + New International Version, + British Edition (NIVBr) + + German Darby Unrevidierte + Elberfelder 1905 (GerElb)
+ + New Jerusalem Bible + (NJB) + + German 1912 Luther + (GerLut)
+ + New King James Version + (NKJV) + + German 1545 Luther + (GerLut1545)
+ + New Living Translation + (NLT) + + German Elberfelder + Bibel revidierte Fassung 1993 (GerRElb)
+ + New Revised Standard + Version (NRSV) + + German Revised Lutherbibel + 1984 (GerRLut)
+ + The Orthodox Jewish + Brit Chadasha (ORTHJBC) + + German 1951 Schlachter + Bibel (GerSch)
+ + J B Phillips New Testament + (Phillips) + + Gothic Codex Ambr. + A & Mss. (GothicA)
+ + Restored Name King + James Version (RNKJV) + + Gothic Codex Ambr. + B & Car. (GothicB)
+ + Revised Standard Version + (RSV) + + Hungarian Karoli (HunKar)
+ + Revised 1833 Webster + Version (RWebster) + + Icelandic Bible (Icelandic)
+ + The Emphasized Bible + by J. B. Rotherham (Rotherham) + + Indonesian Bahasa Indonesia + Sehari-hari (IndBIS)
+ + Todays English Version + (Good News Bible) 1966 and 1976 (TEV) + + Indonesian Terjemahan + Baru (IndTB)
+ + Third Millenium Bible + (TMB) + + Indonesian Terjemahan + Baru (IndTL)
+ + Twentieth Century New + Testament (Twenty) + + Italian NVB Nuovissima + Versione della Bibbbia San Paolo Edizione (ItaIEP)
+ + World English Bible + (WEB) + + Italian 1991 La Nuova + Diodati (ItaLND)
+ + Webster Bible (Websters) + + + Italian 1994 La Sacra + Bibbia Nuova Riveduta (ItaNRV)
+ + 1912 Weymouth NT (Weymouth) + + + Japanese JKUG Translation + (JapKUG)
+ + 1898 Young's Literal + Translation (YLT) + + Japanese JSNKI Translation + (JapSNKI)
  + + Ketchi Bible (Ketchi)
Unorthodox or + Heretical Biblical Texts: + + Korean Bible (Korean)
+ + Concordant Literal + New Testament (CLNT) + + Latvian New Testament + (Latvian)
+ + The Emphatic Diaglott + (Diaglott) + + Manx Gaelic Scripture + Portions (ManxGaelic)
+ + Joseph Smith Translation + (JST) + + Maori Bible (Maori)
+ + Revised Version, Improved + and Corrected (RVIC) + + Melanesian Pidgin Bible + (Mel)
  + + Norwegian 1930 Bokmal + (NorBok)
Original Language + Biblical Texts: + + Norwegian 1938 Nynorsk + (NorN38)
+ + Septuagint (LXX) + + Norwegian Bibel Konkordant + (NorNBK)
+ + Septuagint, Morphologically + Tagged Rahlfs' (LXXM) + + Norwegian 1994 Nynorsk + (NorNyn)
+ + Nestle Aland 27th Ed./ + UBS 4th Ed. Greek Text (N27U4) + + Norsk Bibelen (Norsk)
+ + Biblia Hebraica Stuttgartensia + (BHS) + + Philippine Nga Cebuano + (PhiCEB)
+ + 1991 Byzantine/Majority + Text (Byz) + + Polish Millenium Bible + 1984, 4th Ed. (PolBTP)
+ + 1894 Scrivener Textus + Receptus (Scrivner) + + Portuguese Joao Ferreira + de Almeida Atualizada (PorAA)
+ + 1550 Stephanus Textus + Receptus (Stephanus) + + Brazillian Portuguese + Joao Ferreira de Almeida, Corrigada Fiel 1995 (PorACF)
+ + Tischendorf's Eighth + Edition GNT (Tisch) + + Portuguese 1994 Almeida + Biblia (PorBRP)
+ + Latin Vulgate (Vulgate) + + Portuguese Almeida + Revista e Atualizada (PorRA)
+ + Latin Vulgate Psalms + from Hebrew (Vulgate_HebPs) + + Portuguese Almeida + Revista e Corrigida (PorRC)
+ + 1881 Westcott-Hort + Greek Text (WH) + + Russian Synodal Translation + (RST)
+ + Westcott-Hort with + NA27U4 variants (WHNU) + + Romanian Cornilescu + Version (RomCor)
  + + Romani (Gypsy) New + Testament (Romani)
Commentaries: + + Le Sainte Bible en + sango, 1996 (Sango)
+ + KJV Audio Bible read + by James Scourby (AudioKJV) + + Scots Gaelic Gospel + of Mark (ScotsGaelic)
+ + Barnes' New Testament + Notes (Barnes) + + Spanish La Biblia de + Las Americas (SpaLBA)
+ + Adam Clarke's Commentary + on the Bible (Clarke) + + Spanish Reina-Valera + (SpaRV)
+ + Darby Translation Notes + (DTN) + + Spanish Reina-Valera + Revised 1960 (SpaRV60)
+ + Family Bible Notes + (Family) + + Spanish Reina-Valera + Update 1995 (SpaRV95)
+ + Geneva Bible Translation + Notes (Geneva) + + Spanish Version Reina-Valera + Actualizada (SpaRVA)
+ + John Gill's Expositor + (Gill) + + Spanish 1569 Sagradas + Escrituras Version Antigua (SpaSEV)
+ + Jamieson Fausset Brown + Bible Commentary (JFB) + + Spanish 1858 Valera + New Testament (SpaVNT)
+ + Matthias Ansorgs Kommentar + (MAK) + + Swahili New Testament + (Swahili)
+ + Matthew Henry's Complete + Commentary on the Whole Bible (MHC) + + Swedish Bible 1917 + New Testament (SweSVE)
+ + Matthew Henry's Concise + Commentary on the Whole Bible (MHCC) + + Tagalog (John & James) + (Tagalog)
+ + The People's New Testament + (PNT) + + Tamil Bible (Tamil) +
+ + Personal Commentary + (Personal) + + Thai KJV (ThaiKJV) +
+ + Robertson's Word Pictures + (RWP) + + Turkish NT (Turkish) +
+ + Carl Heinrich Riegers + Kommentar (Rieger) + + Unaccented Modern Greek + Text (UMGreek)
+ + C. H. Spurgeon's Treasury + of David (TDavid) + + Ukrainian Bible (Ukrainian)
+ + The Fourfold Gospel + and Commentary on Acts of Apostles (TFG) + + Uma New Testament (Uma)
+ + Treasury of Scriptural + Knowledge (TSK) + + 1934 Vietnamese Bible + (Viet)
+ + John Wesley's Notes + on the Bible (Wesley) + + Xhosa Bible (Xhosa)
  
Dictionaries + & Lexica:Daily Devotionals: +
+ + American Tract Society + Bible Dictionary (AmTract) + + Jonathan Bagster's + Daily Light on the Daily Path (Daily)
+ + Brown-Driver-Briggs + Hebrew Lexicon (BDB) + + C. H. Spurgeon's Morning + and Evening: Daily Readins (SME)
+ + Easton's Bible Dictionary + (Eastons) + + 1989 Losung auf deutsch + (losung_de_89)
+ + Hitchcock's Bible Names + (Hitchcocks) + + 1990 Losung auf deutsch + (losung_de_90)
+ + International Standard + Bible Encyclopedia (ISBE) + + 1991 Losung auf deutsch + (losung_de_91)
+ + Nave's Topical Bible + (Naves) + + 1992 Losung auf deutsch + (losung_de_92)
+ + Packard's Morphological + Analysis Codes (Packard) + + 1993 Losung auf deutsch + (losung_de_93)
+ + Smith's Bible Dictionary + (Smiths) + + 1994 Losung auf deutsch + (losung_de_94)
+ + Strong's Greek Bible + Dictionary (StrongsGreek) + + 1995 Losung auf deutsch + (losung_de_95)
+ + Strong's Hebrew Bible + Dictionary (StrongsHebrew) + + 1996 Losung auf deutsch + (losung_de_96)
+ + Thayer's Greek Lexicon + (Thayer) + + 1997 Losung auf deutsch + (losung_de_97)
+ + R. A. Torrey's New + Topical Textbook (Torrey) + + 1998 Losung auf deutsch + (losung_de_98)
+ + Vines Bible Dictionary + (Vines) + + 1999 Losung auf deutsch + (losung_de_99)
+ + Webster's Revised Unabridged + Dictionary 1913 (WebstersDict) + + 1996 Watchwords (Losung) + in English (losung_en_96)
  + + 1997 Watchwords (Losung) + in English (losung_en_97)
  + + 1998 Watchwords (Losung) + in English (losung_en_98)
  + + 1999 Watchwords (Losung) + in English (losung_en_99)
  + + 1999 Watchwords (Losung) + en Castellano (losung_es_99)
  + + 1999 Watchwords (Losung) + in Dutch (losung_nl_99)
+

+ +
+ Select default Bible version for cross-references: 

Select locale:  + + +
+Many of these modules require a browser with good Unicode support such as Internet +Explorer 5.0+ and a good Unicode font such as Code 2000 (available at
http://home.att.net/~jameskass/). + + diff --git a/utilities/diatheke/cgi/index-public.html b/utilities/diatheke/cgi/index-public.html new file mode 100644 index 0000000..8406364 --- /dev/null +++ b/utilities/diatheke/cgi/index-public.html @@ -0,0 +1,883 @@ + + + +Diatheke Online Bible + + + + +
+

Verse or Search key: + + + +
+
+ + Verse/Commentary Lookup
+ + Phrase Search
+ + Multiple Word Search
+ + Regular Expression Search +
+

  + + + + + + + + + + + + + + + + + + + + + +
+ + Show Strong's Numbers + + Show Section Headings
+ + Show Footnotes + + Show Scripture Cross-References
+ + Show Morphology + + Show Hebrew Vowels
+ + Show Lemmas + + Show Hebrew Cantillation + Marks
+ + Latin Transliterate + + + Show Greek Accents +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
English Biblical + Texts:
+
Non-English + Biblical Texts:
+ + American King James + Version (AKJV) + + Albanian Bible (ALB) +
+ + 1901 American Standard + Version (ASV) + + Smith & Van Dyke Arabic + Bible (AraSVD)
+ + 1965 Bible in Basic + English (BBE) + + Chinese Glory Union + Bible (ChiGU)
+ + The Common Edition: + New Testament (Common) + + Czech Bible Kralicka + (CzeBKR)
+ + Douay-Rheims Bible + (DR) + + Czech Ekumenicky Cesky + preklad (CzeCEP)
+ + Douay-Rheims 1899 American + Edition (DRA) + + Czech Preklad KMS Nova + smlouva (CzeKMS)
+ + 1889 Darby Bible (Darby) + + + Czech Nova kralicka + Bible (CzeNKB)
+ + Hebrew Names Version + of the World English Bible (HNV) + + Danske Bibel (Dan) +
+ + Interlinear Greek New + Testament (IGNT) + + Esperanto Bible (Esperanto)
+ + International Standard + Version (ISV) + + Finnish 1938 PhyZ Raamattu + (FinPR)
+ + Jewish Publication + Society Old Testament (JPS) + + French Haitian Creole + Version (FreCrl)
+ + King James Version + of 1611 w/ Strongs Numbers (KJV) + + French 1910 Louis Segond + (FreLSG)
+ + The Living Oracles + NT (LO) + + German Bengel NT (GerBen)
+ + Montgomery New Testament + (Montgomery) + + German 1912 Luther + (GerLut)
+ + James Murdock's Translation + of the Syriac Peshitta (Murdock) + + German 1545 Luther + (GerLut1545)
+ + The Orthodox Jewish + Brit Chadasha (ORTHJBC) + + German 1951 Schlachter + Bibel (GerSch)
+ + Restored Name King + James Version (RNKJV) + + Gothic Codex Ambr. + A & Mss. (GothicA)
+ + Revised 1833 Webster + Version (RWebster) + + Gothic Codex Ambr. + B & Car. (GothicB)
+ + The Emphasized Bible + by J. B. Rotherham (Rotherham) + + Hungarian Karoli (HunKar)
+ + World English Bible + (WEB) + + Icelandic Bible (Icelandic)
+ + Webster Bible (Websters) + + + Indonesian Bahasa Indonesia + Sehari-hari (IndBIS)
+ + 1912 Weymouth NT (Weymouth) + + + Indonesian Terjemahan + Baru (IndTB)
+ + 1898 Young's Literal + Translation (YLT) + + Indonesian Terjemahan + Baru (IndTL)
  + + Italian 1991 La Nuova + Diodati (ItaLND)
Unorthodox or + Heretical Biblical Texts: + + Italian 1994 La Sacra + Bibbia Nuova Riveduta (ItaNRV)
+ + The Emphatic Diaglott + (Diaglott) + + Japanese JKUG Translation + (JapKUG)
+ + Joseph Smith Translation + (JST) + + Japanese JSNKI Translation + (JapSNKI)
  + + Ketchi Bible (Ketchi)
Original Language + Biblical Texts: + + Korean Bible (Korean)
+ + Septuagint (LXX) + + Latvian New Testament + (Latvian)
+ + Septuagint, Morphologically + Tagged Rahlfs' (LXXM) + + Manx Gaelic Scripture + Portions (ManxGaelic)
+ + Biblia Hebraica Stuttgartensia + (BHS) + + Maori Bible (Maori)
+ + 1991 Byzantine/Majority + Text (Byz) + + Melanesian Pidgin Bible + (Mel)
+ + 1894 Scrivener Textus + Receptus (Scrivner) + + Norsk Bibelen (Norsk)
+ + 1550 Stephanus Textus + Receptus (Stephanus) + + Portuguese Joao Ferreira + de Almeida Atualizada (PorAA)
+ + Tischendorf's Eighth + Edition GNT (Tisch) + + Russian Synodal Translation + (RST)
+ + Latin Vulgate (Vulgate) + + Romanian Cornilescu + Version (RomCor)
+ + Latin Vulgate Psalms + from Hebrew (Vulgate_HebPs) + + Scots Gaelic Gospel + of Mark (ScotsGaelic)
+ + 1881 Westcott-Hort + Greek Text (WH) + + Spanish Reina-Valera + (SpaRV)
+ + Westcott-Hort with + NA27U4 variants (WHNU) + + Spanish 1569 Sagradas + Escrituras Version Antigua (SpaSEV)
  + + Spanish 1858 Valera + New Testament (SpaVNT)
Commentaries: + + Swahili New Testament + (Swahili)
+ + Barnes' New Testament + Notes (Barnes) + + Swedish Bible 1917 + New Testament (SweSVE)
+ + Adam Clarke's Commentary + on the Bible (Clarke) + + Tagalog (John & James) + (Tagalog)
+ + Darby Translation Notes + (DTN) + + Thai KJV (ThaiKJV) +
+ + Family Bible Notes + (Family) + + Turkish NT (Turkish) +
+ + Geneva Bible Translation + Notes (Geneva) + + Unaccented Modern Greek + Text (UMGreek)
+ + Jamieson Fausset Brown + Bible Commentary (JFB) + + Ukrainian Bible (Ukrainian)
+ + Matthias Ansorgs Kommentar + (MAK) + + Uma New Testament (Uma)
+ + Matthew Henry's Complete + Commentary on the Whole Bible (MHC) + + 1934 Vietnamese Bible + (Viet)
+ + Matthew Henry's Concise + Commentary on the Whole Bible (MHCC) + + Xhosa Bible (Xhosa)
+ + The People's New Testament + (PNT) 
+ + Personal Commentary + (Personal)Daily Devotionals: +
+ + Robertson's Word Pictures + (RWP) + + Jonathan Bagster's + Daily Light on the Daily Path (Daily)
+ + Carl Heinrich Riegers + Kommentar (Rieger) + + C. H. Spurgeon's Morning + and Evening: Daily Readins (SME)
+ + C. H. Spurgeon's Treasury + of David (TDavid) + + 1989 Losung auf deutsch + (losung_de_89)
+ + The Fourfold Gospel + and Commentary on Acts of Apostles (TFG) + + 1990 Losung auf deutsch + (losung_de_90)
+ + Treasury of Scriptural + Knowledge (TSK) + + 1991 Losung auf deutsch + (losung_de_91)
+ + John Wesley's Notes + on the Bible (Wesley) + + 1992 Losung auf deutsch + (losung_de_92)
  + + 1993 Losung auf deutsch + (losung_de_93)
Dictionaries + & Lexica: + + 1994 Losung auf deutsch + (losung_de_94)
+ + American Tract Society + Bible Dictionary (AmTract) + + 1995 Losung auf deutsch + (losung_de_95)
+ + Brown-Driver-Briggs + Hebrew Lexicon (BDB) + + 1996 Losung auf deutsch + (losung_de_96)
+ + Easton's Bible Dictionary + (Eastons) + + 1997 Losung auf deutsch + (losung_de_97)
+ + Hitchcock's Bible Names + (Hitchcocks) + + 1998 Losung auf deutsch + (losung_de_98)
+ + International Standard + Bible Encyclopedia (ISBE) + + 1999 Losung auf deutsch + (losung_de_99)
+ + Nave's Topical Bible + (Naves) + + 1996 Watchwords (Losung) + in English (losung_en_96)
+ + Packard's Morphological + Analysis Codes (Packard) + + 1997 Watchwords (Losung) + in English (losung_en_97)
+ + Smith's Bible Dictionary + (Smiths) + + 1998 Watchwords (Losung) + in English (losung_en_98)
+ + Strong's Greek Bible + Dictionary (StrongsGreek) + + 1999 Watchwords (Losung) + in English (losung_en_99)
+ + Strong's Hebrew Bible + Dictionary (StrongsHebrew) + + 1999 Watchwords (Losung) + en Castellano (losung_es_99)
+ + Thayer's Greek Lexicon + (Thayer) + + 1999 Watchwords (Losung) + in Dutch (losung_nl_99)
+ + R. A. Torrey's New + Topical Textbook (Torrey) 
+ + Webster's Revised Unabridged + Dictionary 1913 (WebstersDict)  
+

+ +
+ Select default Bible version for cross-references: 

Select locale:  + + +
+Many of these modules require a browser with good Unicode support such as Internet Explorer 5.0+ and a good Unicode font such as Code 2000 (available at http://home.att.net/~jameskass/.) + + diff --git a/utilities/diatheke/corediatheke.cpp b/utilities/diatheke/corediatheke.cpp new file mode 100644 index 0000000..d691a2f --- /dev/null +++ b/utilities/diatheke/corediatheke.cpp @@ -0,0 +1,449 @@ +// Diatheke 4.2 by Chris Little +// Copyright 1999-2002 by CrossWire Bible Society +// http://www.crosswire.org/sword/diatheke +// Licensed under GNU General Public License (GPL) +// see accompanying LICENSE file for license details + +#include "corediatheke.h" +#include +#include +#include +#include +#include + +using std::list; +using std::cout; +using std::endl; +using std::ostream; + +void systemquery(const char * key, ostream* output){ + DiathekeMgr manager; + ModMap::iterator it; + + SWModule *target; + + bool types = false, descriptions = false, names = false; + + if (!::stricmp(key, "localelist")) { + LocaleMgr *lm = LocaleMgr::getSystemLocaleMgr(); + list loclist = lm->getAvailableLocales(); + list::iterator li = loclist.begin(); + for (;li != loclist.end(); li++) { + *output << li->c_str() << endl; + } + } + else if (!::stricmp(key, "modulelist")) { + types = true; + descriptions = true; + names = true; + } + else if (!::stricmp(key, "modulelistnames")) { + names = true; + } + else if (!::stricmp(key, "modulelistdescriptions")) { + descriptions = true; + } + + + if (types || descriptions || names) { + if (types) *output << "Biblical Texts:\n"; + for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { + target = it->second; + if (!strcmp(target->Type(), "Biblical Texts")) { + if (names) *output << target->Name(); + if (names && descriptions) *output << " : "; + if (descriptions) *output << target->Description(); + *output << endl; + } + } + if (types) *output << "Commentaries:\n"; + for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { + target = it->second; + if (!strcmp(target->Type(), "Commentaries")) { + if (names) *output << target->Name(); + if (names && descriptions) *output << " : "; + if (descriptions) *output << target->Description(); + *output << endl; + } + } + if (types) *output << "Dictionaries:\n"; + for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { + target = it->second; + if (!strcmp(target->Type(), "Lexicons / Dictionaries")) { + if (names) *output << target->Name(); + if (names && descriptions) *output << " : "; + if (descriptions) *output << target->Description(); + *output << endl; + } + } + } +} + +void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAIN, unsigned char outputencoding = ENC_UTF8, unsigned long optionfilters = 0, unsigned char searchtype = ST_NONE, const char *range = 0, const char *text = 0, const char *locale = 0, const char *ref = 0, ostream* output = &cout, const char *script = 0, signed short variants = 0) { + static DiathekeMgr manager; + + ModMap::iterator it; + ListKey listkey; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + + SWModule * target; + char *font = 0; + char inputformat = 0; + SWBuf encoding; + char querytype = 0; + + if (locale) { + LocaleMgr::getSystemLocaleMgr()->setDefaultLocaleName(locale); + } + VerseKey vk; + + //deal with queries to "system" + if (!::stricmp(text, "system")) { + querytype = QT_SYSTEM; + systemquery(ref, output); + } + if (!strnicmp(text, "info", 4)) { + querytype = QT_INFO; + text = ref; + } + //otherwise, we have a real book + it = manager.Modules.find(text); + if (it == manager.Modules.end()) { //book not found + return; + } + target = (*it).second; + + manager.Markup(outputformat); + manager.Encoding(outputencoding); + manager.bidi = ((OP_BIDI & optionfilters) == OP_BIDI); + manager.shape = ((OP_ARSHAPE & optionfilters) == OP_ARSHAPE); + + if ((sit = manager.config->Sections.find((*it).second->Name())) != manager.config->Sections.end()) { + if ((eit = (*sit).second.find("SourceType")) != (*sit).second.end()) { + if (!::stricmp((char *)(*eit).second.c_str(), "GBF")) + inputformat = FMT_GBF; + else if (!::stricmp((char *)(*eit).second.c_str(), "ThML")) + inputformat = FMT_THML; + else if (!::stricmp((char *)(*eit).second.c_str(), "OSIS")) + inputformat = FMT_OSIS; + } + encoding = ((eit = (*sit).second.find("Encoding")) != (*sit).second.end()) ? (*eit).second : (SWBuf)""; + } + + + if (querytype == QT_INFO) { + switch (inputformat) { + case FMT_THML : + *output << "ThML"; + break; + case FMT_GBF : + *output << "GBF"; + break; + case FMT_OSIS : + *output << "OSIS"; + break; + default: + *output << "Other"; + } + *output << ";"; + *output << target->Type(); + *output << ";"; + return; + } + + if (searchtype) + querytype = QT_SEARCH; + else if (!strcmp(target->Type(), "Biblical Texts")) + querytype = QT_BIBLE; + else if (!strcmp(target->Type(), "Commentaries")) + querytype = QT_COMM; + else if (!strcmp(target->Type(), "Lexicons / Dictionaries")) + querytype = QT_LD; + + if (optionfilters & OP_FOOTNOTES) + manager.setGlobalOption("Footnotes","On"); + else + manager.setGlobalOption("Footnotes","Off"); + if (optionfilters & OP_HEADINGS) + manager.setGlobalOption("Headings","On"); + else + manager.setGlobalOption("Headings","Off"); + if (optionfilters & OP_STRONGS) + manager.setGlobalOption("Strong's Numbers","On"); + else + manager.setGlobalOption("Strong's Numbers","Off"); + if (optionfilters & OP_MORPH) + manager.setGlobalOption("Morphological Tags","On"); + else + manager.setGlobalOption("Morphological Tags","Off"); + if (optionfilters & OP_CANTILLATION) + manager.setGlobalOption("Hebrew Cantillation","On"); + else + manager.setGlobalOption("Hebrew Cantillation","Off"); + if (optionfilters & OP_HEBREWPOINTS) + manager.setGlobalOption("Hebrew Vowel Points","On"); + else + manager.setGlobalOption("Hebrew Vowel Points","Off"); + if (optionfilters & OP_GREEKACCENTS) + manager.setGlobalOption("Greek Accents","On"); + else + manager.setGlobalOption("Greek Accents","Off"); + if (optionfilters & OP_LEMMAS) + manager.setGlobalOption("Lemmas","On"); + else + manager.setGlobalOption("Lemmas","Off"); + if (optionfilters & OP_SCRIPREF) + manager.setGlobalOption("Cross-references","On"); + else + manager.setGlobalOption("Cross-references","Off"); + if (optionfilters & OP_RED) + manager.setGlobalOption("Words of Christ in Red","On"); + else + manager.setGlobalOption("Words of Christ in Red","Off"); + if (optionfilters & OP_VARIANTS && variants) { + if (variants == -1) + manager.setGlobalOption("Variants", "All Readings"); + else if (variants == 1) + manager.setGlobalOption("Variants", "Secondary Readings"); + } + else + manager.setGlobalOption("Transliteration", "Primary Readings"); + + if (optionfilters & OP_TRANSLITERATOR && script) + manager.setGlobalOption("Transliteration", script); + else + manager.setGlobalOption("Transliteration", "Off"); + + if (querytype == QT_SEARCH) { + + //this test is just to determine if we've got SWKeys or VerseKeys + if (!strcmp(target->Type(), "Biblical Texts")) + querytype = QT_BIBLE; + else if (!strcmp(target->Type(), "Commentaries")) + querytype = QT_BIBLE; + else if (!strcmp(target->Type(), "Lexicons / Dictionaries")) + querytype = QT_LD; + + //do search stuff + char st = 1 - searchtype; + if (querytype == QT_BIBLE) { + *output << "Verses containing \""; + } + else *output << "Entries containing \""; + *output << ref; + *output << "\"-- "; + + if (range) { + VerseKey parser; + ListKey scope = parser.ParseVerseList(range, parser, true); + listkey = target->Search(ref, st, REG_ICASE, &scope); + } + else listkey = target->Search(ref, st, REG_ICASE); + + if (strlen((const char*)listkey)) { + if (!listkey.Error()) { + if (outputformat == FMT_CGI) *output << ""; + if (querytype == QT_BIBLE) { + vk = listkey; + *output << (const char *)vk; + } + else *output << (const char *)listkey; + if (outputformat == FMT_CGI) *output << ""; + } + listkey++; + while (!listkey.Error()) { + *output << " ; "; + if (outputformat == FMT_CGI) *output << ""; + if (querytype == QT_BIBLE) { + vk = listkey; + *output << (const char *)vk; + } + else *output << (const char *)listkey; + if (outputformat == FMT_CGI) *output << ""; + listkey++; + } + *output << " -- "; + + char *temp = new char[10]; + sprintf(temp, "%u", listkey.Count()); + *output << temp; + delete [] temp; + + *output << " matches total ("; + *output << target->Name(); + *output << ")\n"; + } + else { + *output << "none ("; + *output << target->Name(); + *output << ")\n"; + } + } + + else if (querytype == QT_LD) { + //do dictionary stuff + + target->setKey(ref); + + const char * text = (const char *) *target; + + if (outputformat == FMT_RTF) { + *output << "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\fdecor\\fprq2 "; + if (font) + *output << font; + else + *output << "Times New Roman"; + *output << ";}}"; + } + else if (outputformat == FMT_HTML) { + *output << ""; + } + + if (strlen(text)) { + *output << (char*)target->KeyText(); + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ": "; + } + else if (outputformat == FMT_RTF) { + *output << ": {\\f1 "; + } + else { + *output << ": "; + } + *output << text; + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ""; + } + else if (outputformat == FMT_RTF) { + *output << "}"; + } + + *output << "("; + *output << target->Name(); + *output << ")\n"; + } + + if (outputformat == FMT_RTF) { + *output << "}"; + } + + } + + else if (querytype == QT_BIBLE || querytype == QT_COMM) { + //do commentary/Bible stuff + + if ((sit = manager.config->Sections.find((*it).second->Name())) != manager.config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + font = (char *)(*eit).second.c_str(); + if (strlen(font) == 0) font = 0; + } + } + + listkey = vk.ParseVerseList(ref, "Gen1:1", true); + int i; + + if (outputformat == FMT_RTF) { + *output << "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\fdecor\\fprq2 "; + if (font) + *output << font; + else + *output << "Times New Roman"; + *output << ";}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}}"; + } + else if (outputformat == FMT_HTML) { + *output << ""; + } + + for (i = 0; i < listkey.Count() && maxverses; i++) { + VerseKey *element = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(i)); + if (element) { + target->Key(element->LowerBound()); + vk = element->UpperBound(); + while (maxverses && target->Key() <= vk) { + *output << (char*)target->KeyText(); + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ": "; + } + else if (outputformat == FMT_RTF) { + *output << ": {\\f1 "; + } + else { + *output << ": "; + } + *output << (const char*)*target; + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ""; + } + else if (outputformat == FMT_RTF) { + *output << "}"; + } + + if (inputformat != FMT_THML && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) + *output << "
"; + else if (outputformat == FMT_OSIS) + *output << ""; + else if (outputformat == FMT_RTF) + *output << "\\par "; + else if (outputformat == FMT_GBF) + *output << ""; + + *output << "\n"; + + if (target->Key() == vk) + break; + maxverses--; + (*target)++; + } + } + else { + target->Key(*listkey.GetElement(i)); + *output << (char*)target->KeyText(); + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ": "; + } + else if (outputformat == FMT_RTF) { + *output << ": {\\f1 "; + } + else { + *output << ": "; + } + *output << (const char*)*target; + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ""; + } + else if (outputformat == FMT_RTF) { + *output << "}"; + } + + if (inputformat != FMT_THML && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) + *output << "
"; + else if (outputformat == FMT_OSIS) + *output << ""; + else if (outputformat == FMT_RTF) + *output << "\\par "; + else if (outputformat == FMT_GBF) + *output << ""; + + *output << "\n"; + maxverses--; + } + } + + *output << "("; + *output << target->Name(); + *output << ")\n"; + + if (outputformat == FMT_RTF) { + *output << "}"; + } + + } +} + diff --git a/utilities/diatheke/corediatheke.h b/utilities/diatheke/corediatheke.h new file mode 100644 index 0000000..0364b37 --- /dev/null +++ b/utilities/diatheke/corediatheke.h @@ -0,0 +1,43 @@ +// Diatheke 4.2 by Chris Little +// Copyright 1999-2002 by CrossWire Bible Society http://www.crosswire.org +// Licensed under GNU General Public License (GPL) +// see accompanying LICENSE file for license details + +#include +#include + +#include "diathekemgr.h" +#include + +#define QT_BIBLE 1 +#define QT_COMM 2 +#define QT_LD 3 +#define QT_SEARCH 4 +#define QT_SYSTEM 5 +#define QT_INFO 6 + +#define OP_NONE 0 +#define OP_STRONGS 1 +#define OP_FOOTNOTES 2 +#define OP_HEADINGS 4 +#define OP_MORPH 8 +#define OP_CANTILLATION 16 +#define OP_HEBREWPOINTS 32 +#define OP_GREEKACCENTS 64 +#define OP_TRANSLITERATOR 128 +#define OP_LEMMAS 256 +#define OP_SCRIPREF 512 +#define OP_ARSHAPE 1024 +#define OP_BIDI 2048 +#define OP_VARIANTS 4096 +#define OP_RED 8192 + +#define ST_NONE 0 +#define ST_REGEX 1 //0 +#define ST_PHRASE 2 // -1 +#define ST_MULTIWORD 3 // -2 + +using namespace std; + +int hasalpha (char * string); +void doquery(unsigned long maxverses, unsigned char outputformat, unsigned char outputencoding, unsigned long optionfilters, unsigned char searchtype, const char *range, const char *text, const char *locale, const char *ref, ostream* output, const char* script, signed short variants); diff --git a/utilities/diatheke/diafiltmgr.cpp b/utilities/diatheke/diafiltmgr.cpp new file mode 100644 index 0000000..83b41ef --- /dev/null +++ b/utilities/diatheke/diafiltmgr.cpp @@ -0,0 +1,228 @@ +/****************************************************************************** + * diafiltmgr.cpp + * + * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "diafiltmgr.h" +#include "thmlcgi.h" +#include "gbfcgi.h" +#include "osiscgi.h" + +DiathekeFilterMgr::DiathekeFilterMgr (char mark, char enc) + : EncodingFilterMgr(enc) { + + markup = mark; + + CreateFilters(markup); +} + +DiathekeFilterMgr::~DiathekeFilterMgr() { + if (fromthml) + delete (fromthml); + if (fromgbf) + delete (fromgbf); + if (fromplain) + delete (fromplain); + if (fromosis) + delete (fromosis); +} + +void DiathekeFilterMgr::AddRenderFilters(SWModule *module, ConfigEntMap §ion) { + switch (module->Markup()) { + case FMT_THML: + if (fromthml) + module->AddRenderFilter(fromthml); + break; + case FMT_GBF: + if (fromgbf) + module->AddRenderFilter(fromgbf); + break; + case FMT_PLAIN: + if (fromplain) + module->AddRenderFilter(fromplain); + break; + case FMT_OSIS: + if (fromosis) + module->AddRenderFilter(fromosis); + break; + } + EncodingFilterMgr::AddRenderFilters(module, section); +} + + +char DiathekeFilterMgr::Markup(char mark) { + if (mark && mark != markup) { + markup = mark; + ModMap::const_iterator module; + + SWFilter * oldplain = fromplain; + SWFilter * oldthml = fromthml; + SWFilter * oldgbf = fromgbf; + SWFilter * oldosis = fromosis; + + CreateFilters(markup); + + for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++) + switch (module->second->Markup()) { + case FMT_THML: + if (oldthml != fromthml) { + if (oldthml) { + if (!fromthml) { + module->second->RemoveRenderFilter(oldthml); + } + else { + module->second->ReplaceRenderFilter(oldthml, fromthml); + } + } + else if (fromthml) { + module->second->AddRenderFilter(fromthml); + } + } + break; + case FMT_GBF: + if (oldgbf != fromgbf) { + if (oldgbf) { + if (!fromgbf) { + module->second->RemoveRenderFilter(oldgbf); + } + else { + module->second->ReplaceRenderFilter(oldgbf, fromgbf); + } + } + else if (fromgbf) { + module->second->AddRenderFilter(fromgbf); + } + break; + } + case FMT_PLAIN: + if (oldplain != fromplain) { + if (oldplain) { + if (!fromplain) { + module->second->RemoveRenderFilter(oldplain); + } + else { + module->second->ReplaceRenderFilter(oldplain, fromplain); + } + } + else if (fromplain) { + module->second->AddRenderFilter(fromplain); + } + break; + } + case FMT_OSIS: + if (oldosis != fromosis) { + if (oldosis) { + if (!fromosis) { + module->second->RemoveRenderFilter(oldosis); + } + else { + module->second->ReplaceRenderFilter(oldosis, fromosis); + } + } + else if (fromosis) { + module->second->AddRenderFilter(fromosis); + } + break; + } + } + + if (oldthml) + delete oldthml; + if (oldgbf) + delete oldgbf; + if (oldplain) + delete oldplain; + if (oldosis) + delete oldosis; + } + return markup; +} + +void DiathekeFilterMgr::CreateFilters(char markup) { + + switch (markup) { + case FMT_CGI: + fromplain = NULL; + fromthml = new ThMLCGI(); + fromgbf = new GBFCGI(); + fromosis = new OSISCGI(); + break; + case FMT_PLAIN: + fromplain = NULL; + fromthml = new ThMLPlain(); + fromgbf = new GBFPlain(); + fromosis = new OSISPlain(); + break; + case FMT_THML: + fromplain = NULL; + fromthml = NULL; + fromgbf = new GBFThML(); + fromosis = NULL; + break; + case FMT_GBF: + fromplain = NULL; + fromthml = new ThMLGBF(); + fromgbf = NULL; + fromosis = NULL; + break; + case FMT_HTML: + fromplain = new PLAINHTML(); + fromthml = new ThMLHTML(); + fromgbf = new GBFHTML(); + fromosis = NULL; + break; + case FMT_HTMLHREF: + fromplain = NULL; + fromthml = new ThMLHTMLHREF(); + fromgbf = new GBFHTMLHREF(); + fromosis = new OSISHTMLHREF(); + break; + case FMT_RTF: + fromplain = NULL; + fromthml = new ThMLRTF(); + fromgbf = new GBFRTF(); + fromosis = new OSISRTF(); + break; + case FMT_OSIS: + fromplain = NULL; + fromthml = new ThMLOSIS(); + fromgbf = new GBFOSIS(); + fromosis = NULL; + break; + } + +} diff --git a/utilities/diatheke/diafiltmgr.h b/utilities/diatheke/diafiltmgr.h new file mode 100644 index 0000000..2ca34eb --- /dev/null +++ b/utilities/diatheke/diafiltmgr.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * diafiltmgr.h + * + * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ + +#ifndef DIAFILTMGR_H +#define DIAFILTMGR_H + +#define FMT_CGI 127 + +#include +#ifndef NO_SWORD_NAMESPACE +using namespace sword; +#endif + +class SWDLLEXPORT DiathekeFilterMgr : public EncodingFilterMgr { +protected: + SWFilter* fromthml; + SWFilter* fromgbf; + SWFilter* fromplain; + SWFilter* fromosis; + + char markup; + + void CreateFilters(char markup); +public: + DiathekeFilterMgr(char markup = FMT_THML, char encoding = ENC_UTF8); + ~DiathekeFilterMgr(); + char Markup(char m = FMT_UNKNOWN); + virtual void AddRenderFilters(SWModule *module, ConfigEntMap §ion); +}; + +#endif diff --git a/utilities/diatheke/diatheke.cpp b/utilities/diatheke/diatheke.cpp new file mode 100644 index 0000000..0a99c07 --- /dev/null +++ b/utilities/diatheke/diatheke.cpp @@ -0,0 +1,225 @@ +// Diatheke 4.2.1 by Chris Little +// Copyright 1999-2005 by CrossWire Bible Society +// http://www.crosswire.org/sword/diatheke +// Licensed under GNU General Public License (GPL) +// see accompanying LICENSE file for license details + + +#include "corediatheke.h" +#include "diathekemgr.h" +#include "diafiltmgr.h" +#include + +using std::cout; + +#define RQ_REF 1 +#define RQ_BOOK 2 + +void printsyntax() { + //if we got this far without exiting, something went wrong, so print syntax + fprintf (stderr, "Diatheke command-line SWORD frontend Version 4.2.1\n"); + fprintf (stderr, "Copyright 1999-2005 by the CrossWire Bible Society\n"); + fprintf (stderr, "http://www.crosswire.org/sword/diatheke/\n"); + fprintf (stderr, "usage: \n "); + fprintf (stderr, "diatheke <-b module_name> [-s search_type] [-r search_range]\n"); + fprintf (stderr, "[-o option_filters] [-m maximum_verses] [-f output_format]\n"); + fprintf (stderr, "[-e output_encoding] [-t script] [-v variant#(-1=all|0|1)]\n"); + fprintf (stderr, "[-l locale] <-k query_key>\n"); + fprintf (stderr, "\n"); + fprintf (stderr, "If 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, " f (Footnotes), m (Morphology), h (Section Headings),\n"); + fprintf (stderr, " c (Cantillation), v (Hebrew Vowels), a (Greek Accents),\n"); + fprintf (stderr, " l (Lemmas), s (Scripture Crossrefs), r (Arabic Shaping,\n"); + fprintf (stderr, " b (Bi-Directional Reordering), x (Red Words of Christ)\n"); + + fprintf (stderr, "Maximum verses may be any integer value\n"); + fprintf (stderr, "Valid output_format values are: GBF, ThML, RTF, HTML, OSIS, CGI, and plain (def)\n"); + fprintf (stderr, "Valid output_encoding values are: Latin1, UTF8 (def), UTF16, HTML, and RTF\n"); + fprintf (stderr, "Valid locale values depend on installed locales. en is default.\n"); + fprintf (stderr, "The query_key must be the last argument because all following\n"); + fprintf (stderr, " arguments are added to the key.\n\n"); + + fprintf (stderr, "Example usage:\n"); + 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"); +} + +int main(int argc, char **argv) +{ + int maxverses = -1; + unsigned char outputformat = FMT_PLAIN, searchtype = ST_NONE, outputencoding = ENC_UTF8; + unsigned long optionfilters = OP_NONE; + char *text = 0, *locale = 0, *ref = 0, *script = 0, *range = 0; + signed short variants = 0; + + char runquery = 0; // used to check that we have enough arguments to perform a legal query + // (a querytype & text = 1 and a ref = 2) + + for (int i = 1; i < argc; i++) { + if (!::stricmp("-b", argv[i])) { + if (i+1 <= argc) { + text = argv[i+1]; + i++; + runquery |= RQ_BOOK; + } + } + else if (!::stricmp("-s", argv[i])) { + if (i+1 <= argc) { + if (!::stricmp("phrase", argv[i+1])) { + searchtype = ST_PHRASE; + i++; + } + else if (!::stricmp("regex", argv[i+1])) { + searchtype = ST_REGEX; + i++; + } + else if (!::stricmp("multiword", argv[i+1])) { + searchtype = ST_MULTIWORD; + i++; + } + else i++; + } + } + else if (!::stricmp("-r", argv[i])) { + if (i+1 <= argc) { + range = argv[i+1]; + i++; + } + } + else if (!::stricmp("-l", argv[i])) { + if (i+1 <= argc) { + locale = argv[i+1]; + i++; + } + } + else if (!::stricmp("-m", argv[i])) { + if (i+1 <= argc) { + maxverses = atoi(argv[i+1]); + i++; + } + } + else if (!::stricmp("-o", argv[i])) { + if (i+1 <= argc) { + if (strchr(argv[i+1], 'f')) + optionfilters |= OP_FOOTNOTES; + if (strchr(argv[i+1], 'n')) + optionfilters |= OP_STRONGS; + if (strchr(argv[i+1], 'h')) + optionfilters |= OP_HEADINGS; + if (strchr(argv[i+1], 'm')) + optionfilters |= OP_MORPH; + if (strchr(argv[i+1], 'c')) + optionfilters |= OP_CANTILLATION; + if (strchr(argv[i+1], 'v')) + optionfilters |= OP_HEBREWPOINTS; + if (strchr(argv[i+1], 'a')) + optionfilters |= OP_GREEKACCENTS; + if (strchr(argv[i+1], 'l')) + optionfilters |= OP_LEMMAS; + if (strchr(argv[i+1], 's')) + optionfilters |= OP_SCRIPREF; + if (strchr(argv[i+1], 'r')) + optionfilters |= OP_ARSHAPE; + if (strchr(argv[i+1], 'b')) + optionfilters |= OP_BIDI; + if (strchr(argv[i+1], 'x')) + optionfilters |= OP_RED; + i++; + } + } + else if (!::stricmp("-f", argv[i])) { + if (i+1 <= argc) { + if (!::stricmp("thml", argv[i+1])) { + outputformat = FMT_THML; + i++; + } + else if (!::stricmp("cgi", argv[i+1])) { + outputformat = FMT_CGI; + i++; + } + else if (!::stricmp("gbf", argv[i+1])) { + outputformat = FMT_GBF; + i++; + } + else if (!::stricmp("html", argv[i+1])) { + outputformat = FMT_HTML; + i++; + } + else if (!::stricmp("rtf", argv[i+1])) { + outputformat = FMT_RTF; + i++; + } + else if (!::stricmp("osis", argv[i+1])) { + outputformat = FMT_OSIS; + i++; + } + else i++; + } + } + else if (!::stricmp("-e", argv[i])) { + if (i+1 <= argc) { + if (!::stricmp("utf8", argv[i+1])) { + outputencoding = ENC_UTF8; + i++; + } + else if (!::stricmp("rtf", argv[i+1])) { + outputencoding = ENC_RTF; + i++; + } + else if (!::stricmp("html", argv[i+1])) { + outputencoding = ENC_HTML; + i++; + } + else if (!::stricmp("latin1", argv[i+1])) { + outputencoding = ENC_LATIN1; + i++; + } + else if (!::stricmp("utf16", argv[i+1])) { + outputencoding = ENC_UTF16; + i++; + } + else i++; + } + } + else if (!::stricmp("-k", argv[i])) { + i++; + if (i < argc) { + SWBuf key = argv[i]; + i++; + for (; i < argc; i++) + key = key + " " + argv[i]; + ref = new char[key.length() + 1]; + strcpy (ref, key.c_str()); + if (strlen(ref)) + runquery |= RQ_REF; + } + } + else if (!::stricmp("-v", argv[i])) { + if (i+1 <= argc) { + variants = atoi(argv[i+1]); + optionfilters |= OP_VARIANTS; + i++; + } + } + else if (!::stricmp("-t", argv[i])) { + if (i+1 <= argc) { + script = argv[i+1]; + optionfilters |= OP_TRANSLITERATOR; + i++; + } + } + } + + + if (runquery == (RQ_BOOK | RQ_REF)) { + doquery(maxverses, outputformat, outputencoding, optionfilters, searchtype, range, text, locale, ref, &cout, script, variants); + } + else printsyntax(); + + return 0; +} diff --git a/utilities/diatheke/diatheke.dsp b/utilities/diatheke/diatheke.dsp new file mode 100644 index 0000000..03085d3 --- /dev/null +++ b/utilities/diatheke/diatheke.dsp @@ -0,0 +1,204 @@ +# Microsoft Developer Studio Project File - Name="diatheke" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=diatheke - Win32 Debug with ICU +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "diatheke.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "diatheke.mak" CFG="diatheke - Win32 Debug with ICU" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "diatheke - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "diatheke - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "diatheke - Win32 Debug with ICU" (based on "Win32 (x86) Console Application") +!MESSAGE "diatheke - Win32 Release with ICU" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "diatheke - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /w /W0 /GX /O2 /I "../../include" /I "../../src/utilfuns/win32" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libswordvc6.lib /nologo /subsystem:console /machine:I386 /libpath:"../../lib" + +!ELSEIF "$(CFG)" == "diatheke - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /w /W0 /Gm /GX /ZI /Od /I "../../include" /I "../../src/utilfuns/win32" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libswordvc6d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../lib" + +!ELSEIF "$(CFG)" == "diatheke - Win32 Debug with ICU" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "diatheke___Win32_Debug_with_ICU" +# PROP BASE Intermediate_Dir "diatheke___Win32_Debug_with_ICU" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "ICUDebug" +# PROP Intermediate_Dir "ICUDebug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /w /W0 /Gm /GX /ZI /Od /I "../../include" /I "../../src/utilfuns/win32" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__VISUALC__" /FR /YX /FD /GZ /c +# ADD CPP /nologo /MDd /w /W0 /Gm /GX /ZI /Od /I "../../include" /I "../../src/utilfuns/win32" /I "../../../icu-sword/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "_ICU_" /D "_ICUSWORD_" /FR /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libsword.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../lib/vcppmake/vc6/Debug" +# ADD LINK32 icuin.lib icuuc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libswordvc6icud.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"../../../icu-sword/lib" /libpath:"../../lib" + +!ELSEIF "$(CFG)" == "diatheke - Win32 Release with ICU" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "diatheke___Win32_Release_with_ICU" +# PROP BASE Intermediate_Dir "diatheke___Win32_Release_with_ICU" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ICURelease" +# PROP Intermediate_Dir "ICURelease" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /w /W0 /GX /O2 /I "../../include" /I "../../src/utilfuns/win32" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__VISUALC__" /FR /YX /FD /c +# ADD CPP /nologo /MD /w /W0 /GX /O2 /I "../../include" /I "../../src/utilfuns/win32" /I "../../../icu-sword/include" /D "NDEBUG" /D "_ICU_" /D "_ICUSWORD_" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libsword.lib /nologo /subsystem:console /machine:I386 /libpath:"../../lib/vcppmake/vc6/Release" +# ADD LINK32 icuin.lib icuuc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libswordvc6icu.lib /nologo /subsystem:console /machine:I386 /libpath:"../../../icu-sword/lib" /libpath:"../../lib" + +!ENDIF + +# Begin Target + +# Name "diatheke - Win32 Release" +# Name "diatheke - Win32 Debug" +# Name "diatheke - Win32 Debug with ICU" +# Name "diatheke - Win32 Release with ICU" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\corediatheke.cpp +# End Source File +# Begin Source File + +SOURCE=.\diafiltmgr.cpp +# End Source File +# Begin Source File + +SOURCE=.\diatheke.cpp +# End Source File +# Begin Source File + +SOURCE=.\diathekemgr.cpp +# End Source File +# Begin Source File + +SOURCE=.\gbfcgi.cpp +# End Source File +# Begin Source File + +SOURCE=.\osiscgi.cpp +# End Source File +# Begin Source File + +SOURCE=.\thmlcgi.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\corediatheke.h +# End Source File +# Begin Source File + +SOURCE=.\diafiltmgr.h +# End Source File +# Begin Source File + +SOURCE=.\diathekemgr.h +# End Source File +# Begin Source File + +SOURCE=.\gbfcgi.h +# End Source File +# Begin Source File + +SOURCE=.\osiscgi.h +# End Source File +# Begin Source File + +SOURCE=.\thmlcgi.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/utilities/diatheke/diatheke.dsw b/utilities/diatheke/diatheke.dsw new file mode 100644 index 0000000..3bf8c0c --- /dev/null +++ b/utilities/diatheke/diatheke.dsw @@ -0,0 +1,44 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "diatheke"=.\diatheke.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libsword + End Project Dependency +}}} + +############################################################################### + +Project: "libsword"=..\..\lib\vcppmake\vc6\libsword.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/utilities/diatheke/diathekemgr.cpp b/utilities/diatheke/diathekemgr.cpp new file mode 100644 index 0000000..38cb46d --- /dev/null +++ b/utilities/diatheke/diathekemgr.cpp @@ -0,0 +1,109 @@ +//--------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "diafiltmgr.h" + +#ifdef _ICU_ +#include +#include +#include +#endif + +#ifdef WIN32 +#include +#endif + +#include "diathekemgr.h" +#include "gbfcgi.h" +#include "thmlcgi.h" + +//--------------------------------------------------------------------------- +DiathekeMgr::DiathekeMgr (SWConfig * iconfig, SWConfig * isysconfig, bool autoload, char enc, char mark, bool ibidi, bool ishape) + : SWMgr(iconfig, isysconfig, autoload, new DiathekeFilterMgr(mark, enc)) +{ + bidi = ibidi; + shape = ishape; + +#ifdef _ICU_ + arshaping = new UTF8arShaping(); + bidireorder = new UTF8BiDiReorder(); + transliterator = new UTF8Transliterator(); +#endif + Load(); + +#ifdef WIN32 + OSVERSIONINFO osvi; + memset (&osvi, 0, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + platformID = osvi.dwPlatformId; +#endif + +} + + +DiathekeMgr::~DiathekeMgr() +{ +#ifdef _ICU_ + if (arshaping) + delete arshaping; + if (bidireorder) + delete bidireorder; + if (transliterator) + delete transliterator; +#endif +} + + +void DiathekeMgr::AddRenderFilters(SWModule *module, ConfigEntMap §ion) +{ + 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_ + if (shape && !strnicmp(lang.c_str(), "ar", 2)) { + module->AddRenderFilter(arshaping); + } + if (bidi && rtl) { + module->AddRenderFilter(bidireorder); + } +#endif + SWMgr::AddRenderFilters(module, section); +} + +signed char DiathekeMgr::Load () { + signed char retval = SWMgr::Load(); +#ifdef _ICU_ + optionFilters["UTF8Transliterator"] = transliterator; + options.push_back(transliterator->getOptionName()); +#endif + return retval; +}; + +void DiathekeMgr::AddGlobalOptions (SWModule * module, ConfigEntMap & section, + ConfigEntMap::iterator start, + ConfigEntMap::iterator end) { + + SWMgr::AddGlobalOptions(module, section, start, end); +#ifdef _ICU_ + module->AddOptionFilter(transliterator); +#endif +}; + diff --git a/utilities/diatheke/diathekemgr.h b/utilities/diatheke/diathekemgr.h new file mode 100644 index 0000000..cbd8e6f --- /dev/null +++ b/utilities/diatheke/diathekemgr.h @@ -0,0 +1,35 @@ +#ifndef DIATHEKEMGR_H +#define DIATHEKEMGR_H + +#include +#include "diafiltmgr.h" + +enum PlatformIDs { WIN32S = 0, WIN9X, WINNT, WINCE }; + +class DiathekeMgr : public SWMgr { + SWFilter *arshaping; + SWFilter *bidireorder; + SWOptionFilter *transliterator; + +#ifdef WIN32 + char platformID; +#endif + +protected: + virtual void AddRenderFilters(SWModule *module, ConfigEntMap §ion); + virtual signed char Load (); + virtual void AddGlobalOptions (SWModule * module, ConfigEntMap & section, ConfigEntMap::iterator start, ConfigEntMap::iterator end); + +public: + bool shape; + bool bidi; + + unsigned char Markup(unsigned char m = FMT_UNKNOWN) {return ((DiathekeFilterMgr*)filterMgr)->Markup(m);}; + unsigned char Encoding(unsigned char e = ENC_UNKNOWN) {return ((EncodingFilterMgr*)filterMgr)->Encoding(e);}; + + DiathekeMgr(SWConfig * iconf = NULL, SWConfig * isysconfig = NULL, bool autoload = false, char enc = ENC_UTF8, char mark = FMT_PLAIN, bool bidi = false, bool shape = false); + virtual ~DiathekeMgr(); +}; + +#endif + diff --git a/utilities/diatheke/gbfcgi.cpp b/utilities/diatheke/gbfcgi.cpp new file mode 100644 index 0000000..c581fa1 --- /dev/null +++ b/utilities/diatheke/gbfcgi.cpp @@ -0,0 +1,138 @@ +/*************************************************************************** + gbfcgi.cpp - GBF to Diatheke/CGI format + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include "gbfcgi.h" + +SWORD_NAMESPACE_START + +GBFCGI::GBFCGI() { + setTokenStart("<"); + setTokenEnd(">"); + + setTokenCaseSensitive(true); + + addTokenSubstitute("Rf", ")
"); + addTokenSubstitute("FI", ""); // italics begin + addTokenSubstitute("Fi", ""); + addTokenSubstitute("FB", ""); // bold begin + addTokenSubstitute("Fb", ""); + addTokenSubstitute("FR", ""); // words of Jesus begin + addTokenSubstitute("Fr", ""); + addTokenSubstitute("FU", ""); // underline begin + addTokenSubstitute("Fu", ""); + addTokenSubstitute("FO", ""); // Old Testament quote begin + addTokenSubstitute("Fo", ""); + addTokenSubstitute("FS", ""); // Superscript begin// Subscript begin + addTokenSubstitute("Fs", ""); + addTokenSubstitute("FV", ""); // Subscript begin + addTokenSubstitute("Fv", ""); + addTokenSubstitute("TT", ""); // Book title begin + addTokenSubstitute("Tt", ""); + addTokenSubstitute("PP", ""); // poetry begin + addTokenSubstitute("Pp", ""); + addTokenSubstitute("Fn", "
"); // font end + addTokenSubstitute("CL", "
"); // new line + addTokenSubstitute("CM", "
"); // paragraph + addTokenSubstitute("CG", ">"); // ??? + addTokenSubstitute("CT", "<"); // ??? + addTokenSubstitute("JR", "
"); // right align begin + addTokenSubstitute("JC", "
"); // center align begin + addTokenSubstitute("JL", "
"); // align end + +} + + +bool GBFCGI::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) { + unsigned long i; + if (!substituteToken(buf, token)) { + if (!strncmp(token, "WG", 2) || !strncmp(token, "WH", 2)) { // strong's numbers + buf += " <"; + for (i = 2; i < strlen(token); i++) + buf += token[i]; + buf += ">"; + } + + else if (!strncmp(token, "WTG", 3) || !strncmp(token, "WTH", 3)) { // strong's numbers tense + buf += " <"; + for (i = 3; i < strlen(token); i++) + buf += token[i]; + buf += ">"; + } + + else if (!strncmp(token, "WT", 2)) { // morph tags + buf += " ("; + for (i = 1; i < strlen(token); i++) + buf += token[i]; + buf += ")"; + } + + else if (!strncmp(token, "RB", 2)) { + buf += ""; + userData["hasFootnotePreTag"] = "true"; + } + + else if (!strncmp(token, "RF", 2)) { + if(userData["hasFootnotePreTag"] == "true") { + userData["hasFootnotePreTag"] = "false"; + buf += " "; + } + buf += " ("; + } + + else if (!strncmp(token, "FN", 2)) { + buf += ""; + } + + else if (!strncmp(token, "CA", 2)) { // ASCII value + buf += (char)atoi(&token[2]); + } + + else { + return false; + } + } + return true; +} + +SWORD_NAMESPACE_END diff --git a/utilities/diatheke/gbfcgi.h b/utilities/diatheke/gbfcgi.h new file mode 100644 index 0000000..c2b68c9 --- /dev/null +++ b/utilities/diatheke/gbfcgi.h @@ -0,0 +1,38 @@ +/*-************************************************************************* + gbfcgi.h - description + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef GBFCGI_H +#define GBFCGI_H + +#include +#include +#include +#include + +SWORD_NAMESPACE_START + +typedef std::map DualStringMap; +/** this filter converts GBF text to Diatheke/CGI format + */ +class SWDLLEXPORT GBFCGI : public SWBasicFilter { +protected: + virtual bool handleToken(SWBuf &buf, const char *token, DualStringMap &userData); +public: + GBFCGI (); +}; + +SWORD_NAMESPACE_END +#endif diff --git a/utilities/diatheke/osiscgi.cpp b/utilities/diatheke/osiscgi.cpp new file mode 100644 index 0000000..68298e9 --- /dev/null +++ b/utilities/diatheke/osiscgi.cpp @@ -0,0 +1,325 @@ +/*************************************************************************** + osiscgi.cpp - OSIS to Diatheke/CGI format + ------------------- + begin : 2003-10-21 + copyright : 2003 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include "osiscgi.h" +#include +#include +#include +#include + +SWORD_NAMESPACE_START + + +OSISCGI::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) { + osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false"))); +} + + +OSISCGI::OSISCGI() { + setTokenStart("<"); + setTokenEnd(">"); + + setEscapeStart("&"); + setEscapeEnd(";"); + + setEscapeStringCaseSensitive(true); + + addEscapeStringSubstitute("amp", "&"); + addEscapeStringSubstitute("apos", "'"); + addEscapeStringSubstitute("lt", "<"); + addEscapeStringSubstitute("gt", ">"); + addEscapeStringSubstitute("quot", "\""); + addTokenSubstitute("lg", "
"); + addTokenSubstitute("/lg", "
"); + + setTokenCaseSensitive(true); +} + + +bool OSISCGI::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) { + // manually process if it wasn't a simple substitution + if (!substituteToken(buf, token)) { + MyUserData *u = (MyUserData *)userData; + XMLTag tag(token); + + // tag + if (!strcmp(tag.getName(), "w")) { + + // start tag + if ((!tag.isEmpty()) && (!tag.isEndTag())) { + u->w = token; + } + + // end or empty tag + else { + bool endTag = tag.isEndTag(); + SWBuf lastText; + bool show = true; // to handle unplaced article in kjv2003-- temporary till combined + + if (endTag) { + tag = u->w.c_str(); + lastText = u->lastTextNode.c_str(); + } + else lastText = "stuff"; + + const char *attrib; + const char *val; + if ((attrib = tag.getAttribute("xlit"))) { + val = strchr(attrib, ':'); + val = (val) ? (val + 1) : attrib; + buf.appendFormatted(" %s", val); + } + if ((attrib = tag.getAttribute("gloss"))) { + val = strchr(attrib, ':'); + val = (val) ? (val + 1) : attrib; + buf.appendFormatted(" %s", val); + } + if ((attrib = tag.getAttribute("lemma"))) { + int count = tag.getAttributePartCount("lemma"); + int i = (count > 1) ? 0 : -1; // -1 for whole value cuz it's faster, but does the same thing as 0 + do { + attrib = tag.getAttribute("lemma", i); + if (i < 0) i = 0; // to handle our -1 condition + val = strchr(attrib, ':'); + val = (val) ? (val + 1) : attrib; + const char *val2 = val; + if ((strchr("GH", *val)) && (isdigit(val[1]))) + val2++; + if ((!strcmp(val2, "3588")) && (lastText.length() < 1)) + show = false; + else { + if (!strchr("G", *val)) { + buf.appendFormatted(" <%s> ", val2, val); + } + else { + buf.appendFormatted(" <%s> ", val2, val); + } + } + } while (++i < count); + } + if ((attrib = tag.getAttribute("morph")) && (show)) { + SWBuf savelemma = tag.getAttribute("savlm"); + if ((strstr(savelemma.c_str(), "3588")) && (lastText.length() < 1)) + show = false; + if (show) { + int count = tag.getAttributePartCount("morph"); + int i = (count > 1) ? 0 : -1; // -1 for whole value cuz it's faster, but does the same thing as 0 + do { + attrib = tag.getAttribute("morph", i); + if (i < 0) i = 0; // to handle our -1 condition + val = strchr(attrib, ':'); + val = (val) ? (val + 1) : attrib; + const char *val2 = val; + if ((*val == 'T') && (strchr("GH", val[1])) && (isdigit(val[2]))) + val2+=2; + if (!strchr("G", *val)) { + buf.appendFormatted(" (;%s) ", val+1, tag.getAttribute("morph")); + } + else if (!strchr("H", *val)) { + buf.appendFormatted(" (%s) ", val+1, tag.getAttribute("morph")); + } + else { + buf.appendFormatted(" (%s) ", val, tag.getAttribute("morph")); + } + } while (++i < count); + } + } + if ((attrib = tag.getAttribute("POS"))) { + val = strchr(attrib, ':'); + val = (val) ? (val + 1) : attrib; + buf.appendFormatted(" %s", val); + } + + /*if (endTag) + buf += "}";*/ + } + } + + // tag + else if (!strcmp(tag.getName(), "note")) { + if (!tag.isEndTag()) { + if (!tag.isEmpty()) { + SWBuf type = tag.getAttribute("type"); + + if (type != "x-strongsMarkup" && // leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off + type != "strongsMarkup") { // deprecated + SWBuf footnoteNumber = tag.getAttribute("swordFootnote"); + VerseKey *vkey = NULL; + // see if we have a VerseKey * or descendant + SWTRY { + vkey = SWDYNAMIC_CAST(VerseKey, u->key); + } + SWCATCH ( ... ) { } + if (vkey) { + char ch = ((tag.getAttribute("type") && (!strcmp(tag.getAttribute("type"), "crossReference"))) ? 'x':'n'); + buf.appendFormatted("*%c ", vkey->getText(), ch, footnoteNumber.c_str(), ch); + } + } + u->suspendTextPassThru = true; + } + } + if (tag.isEndTag()) { + u->suspendTextPassThru = false; + } + } + + //

paragraph tag + else if (!strcmp(tag.getName(), "p")) { + if ((!tag.isEndTag()) && (!tag.isEmpty())) { // non-empty start tag + buf += "


"; + } + else if (tag.isEndTag()) { // end tag + buf += "


"; + userData->supressAdjacentWhitespace = true; + } + else { // empty paragraph break marker + buf += "


"; + userData->supressAdjacentWhitespace = true; + } + } + + // tag + else if (!strcmp(tag.getName(), "reference")) { + const char *attrib; + const char *val; + + if ((!tag.isEndTag()) && (!tag.isEmpty())) { + buf += ""; + } + else if (tag.isEndTag()) { + buf += ""; + } + } + + // poetry, etc + else if (!strcmp(tag.getName(), "l")) { + if (tag.isEmpty()) { + buf += "
"; + } + else if (tag.isEndTag()) { + buf += "
"; + } + else if (tag.getAttribute("sID")) { // empty line marker + buf += "
"; + } + } + + // or + else if ((!strcmp(tag.getName(), "lb")) || ((!strcmp(tag.getName(), "milestone")) && (tag.getAttribute("type")) && (!strcmp(tag.getAttribute("type"), "line")))) { + buf += "
"; + userData->supressAdjacentWhitespace = true; + } + + // + else if (!strcmp(tag.getName(), "title")) { + if ((!tag.isEndTag()) && (!tag.isEmpty())) { + buf += "<b>"; + } + else if (tag.isEndTag()) { + buf += "</b><br />"; + } + } + + // <hi> hi? hi contrast? + else if (!strcmp(tag.getName(), "hi")) { + SWBuf type = tag.getAttribute("type"); + if ((!tag.isEndTag()) && (!tag.isEmpty())) { + if (type == "bold" || type == "x-b") { + buf += "<b> "; + u->inBold = true; + } + else { // all other types + buf += "<i> "; + u->inBold = false; + } + } + else if (tag.isEndTag()) { + if(u->inBold) { + buf += "</b>"; + u->inBold = false; + } + else + buf += "</i>"; + } + else { // empty hi marker + // what to do? is this even valid? + } + } + + // <q> quote + else if (!strcmp(tag.getName(), "q")) { + SWBuf type = tag.getAttribute("type"); + SWBuf who = tag.getAttribute("who"); + const char *lev = tag.getAttribute("level"); + int level = (lev) ? atoi(lev) : 1; + + if ((!tag.isEndTag()) && (!tag.isEmpty())) { + /*buf += "{";*/ + + //alternate " and ' + if (u->osisQToTick) + buf += (level % 2) ? '\"' : '\''; + + if (who == "Jesus") { + buf += "<font color=\"red\"> "; + } + } + else if (tag.isEndTag()) { + //alternate " and ' + if (u->osisQToTick) + buf += (level % 2) ? '\"' : '\''; + //buf += "</font>"; + } + else { // empty quote marker + //alternate " and ' + if (u->osisQToTick) + buf += (level % 2) ? '\"' : '\''; + } + } + + // <transChange> + else if (!strcmp(tag.getName(), "transChange")) { + SWBuf type = tag.getAttribute("type"); + + if ((!tag.isEndTag()) && (!tag.isEmpty())) { + +// just do all transChange tags this way for now +// if (type == "supplied") + buf += "<i>"; + } + else if (tag.isEndTag()) { + buf += "</i>"; + } + else { // empty transChange marker? + } + } + + else { + return false; // we still didn't handle token + } + } + return true; +} + + +SWORD_NAMESPACE_END diff --git a/utilities/diatheke/osiscgi.h b/utilities/diatheke/osiscgi.h new file mode 100644 index 0000000..c6c6411 --- /dev/null +++ b/utilities/diatheke/osiscgi.h @@ -0,0 +1,48 @@ +/*************************************************************************** + osiscgi.h - OSIS to Diatheke/CGI format + ------------------- + begin : 2003-10-21 + copyright : 2003 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef OSISCGI_H +#define OSISCGI_H + +#include <swbasicfilter.h> + +#include <defs.h> + +SWORD_NAMESPACE_START + +/** this filter converts OSIS text to Diatheke/CGI format + */ +class SWDLLEXPORT OSISCGI : public SWBasicFilter { +private: +protected: + class MyUserData : public BasicFilterUserData { + public: + bool osisQToTick; + bool inBold; + SWBuf w; + SWBuf fn; + MyUserData(const SWModule *module, const SWKey *key); + }; + virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key) { + return new MyUserData(module, key); + } + virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData); +public: + OSISCGI(); +}; + +SWORD_NAMESPACE_END +#endif diff --git a/utilities/diatheke/pqa/Diatheke.pqa b/utilities/diatheke/pqa/Diatheke.pqa new file mode 100644 index 0000000..f357b3d Binary files /dev/null and b/utilities/diatheke/pqa/Diatheke.pqa differ diff --git a/utilities/diatheke/pqa/src/README b/utilities/diatheke/pqa/src/README new file mode 100644 index 0000000..277a643 --- /dev/null +++ b/utilities/diatheke/pqa/src/README @@ -0,0 +1 @@ +Use Palm's PQA Builder with the contents of this directory (except the README file) to build Diatheke.PQA. \ No newline at end of file diff --git a/utilities/diatheke/pqa/src/all.html b/utilities/diatheke/pqa/src/all.html new file mode 100644 index 0000000..0974033 --- /dev/null +++ b/utilities/diatheke/pqa/src/all.html @@ -0,0 +1,170 @@ +<html> +<head> +<title>HANDiatheke + + +

+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

English Bibles
+Analytical-Literal Trans. (ALT)
+American Standard Ver. (ASV)
+Bible in Basic English (BBE)
+Brenton's English LXX Trans. [OT]
+Darby's Bible
+Douay-Rheims (DR)
+Douay-Rheims 1899 American Ed.
+Hebrew Names Ver. (HNV)
+International Standard Ver. (ISV) [NT]
+JPS 1917 Tanakh [OT]
+21st Century King James Ver. (KJ21)
+King James Ver. (KJV/AV) *
+Green's Literal Trans. (LitV)
+The Living Oracles [NT]
+A Modern King James Ver. (MKJV)
+New American Standard (NASB)
+New American Standard, 95 Update
+New International Ver. (NIV)
+New International Ver., British Ed.
+New Jerusalem Bible (NJB)
+New King James Ver. (NKJV)
+New Living Trans. (NLT)
+New Revised Standard Ver. (NRSV)
+Orthodox Jewish Brit Chadasha [NT]
+Revised Standard Ver. (RSV)
+Revised 1833 Webster's Bible *
+World English Bible (WEB)
+Webster's Bible
+Weymouth New Testament [NT]
+Young's Literal Trans. (YLT)

+

Ancient Language Bibles
+Biblia Hebraica Stuttgartensia (BHS)
+1991 Byzantine/Majority Text
+Septuagint (LXX)
+Nestle-Aland 26th Ed. GNT
+1894 Scrivener Textus Receptus
+1550 Stephanus Textus Receptus
+Tischendorf's Eighth Ed. GNT
+Latin Vulgate
+1881 Westcott-Hort GNT
+Westcott-Hort with NA27U4 variants
+

+French Bibles
+French Haitian Creaole Ver.
+French Darby Trans.
+French 1910 Louis Segond (LSG)
+French Nouvelle Edition de Geneve 1979
+

+

German Bibles
+German Bengel [NT]
+German Einheitsuebersetzung
+German 1905 Darby Unrev. Elberfelder
+German 1912 Luther
+German 1545 Luther
+German 1993 Elberfelder, rev. Fassung
+German 1984 Revised Luther
+German 1951 Schlachter Bibel
+

+

+Spanish Bibles
+Spanish La Biblia de Las Americas (LBA)
+Spanish Reina-Valera
+Spanish 1960 Reina-Valera Revised
+Spanish 1995 Reina-Valera Update
+Spanish Ver. Reina-Valera Actualizada
+Spanish 1569 Ver. Antigua
+Spanish 1858 Valera[NT]
+

+

Other Bibles
+Albanian Bible
+Czech Bible Kralicka
+Czech Ekumenicky Cesky Preklad
+Czech Preklad KMS Nova Smlouva
+Czech Nova Kralicka Bible
+Danish Danske Bibel
+Dutch Leidse Vertaling
+Dutch Lutherse Vertaling
+Dutch 1951 Bijbelgenootschap Ver.
+Dutch Statenvertaling
+Equadoran Shuar [NT]
+Finish 1933 Phy~N Raamattu
+Hungarian Karoli
+Bahasa Indonesia Sehari-hari (BIS)
+Indonesian Terjemahan Baru (TB)
+Italian Nuovissima Ver., San Paolo Ed.
+Italian 1991 La Nuova Diodati
+Italian 1994 La Nuova Riveduta
+Maori Bible
+Melanesian Pidgin Bible
+Norwegian 1930 Bokmal
+Norwegian 1938 Bokmal
+Norwegian Bibel Konkordant
+Norwegian 1994 Nynorsk
+Norwegian Norsk Bible
+Philippine Nga Cebuano
+Polish 1984 Millenium Bible, 4th Ed.
+Portuguese 1995 Joao Ferreira
+Portuguese 1994 Almeida Biblia
+Romanian Cornilescu Ver.
+Swahili New Testament [NT]
+Swedish 1917 New Testament [NT]
+Turkish New Testament [NT]
+Uma New Testament [NT]
+Vietnamese 1934 Bible
+

+

English Commentaries
+Darby Translation Notes
+Family Bible Notes
+The Fourfold Gospel
+Geneva Bible Translation Notes
+Gill's Expositor
+Matthew Henry's Commentary
+Matthew Henry's Concise Commentary
+The People's New Testament
+Robertson's Word Pictures
+Scofield Reference Notes, 1917 Ed.
+John Wesley's Notes on the Bible
+

+

German Commentaries
+Matthias Ansorgs Kommentar
+Carl Heinrich Riegers Kommentar
+German Scofield 1917 Ed. (Gen-Eccl)
+

+

+Cross-references
+Treasury of Scriptural Knowledge
+

+

+Bible Dictionaries
+Easton's Bible Dictionary
+Hitchcock's Bible Names Dictionary
+Int'l Standard Bible Encyclopedia
+Smith's Bible Dictionary
+Vine's Bible Dictionary
+

+

+Topical References
+Naves' Topical Bible
+R. A. Torrey's New Topical Textbook
+

+

+Greek Lexica
+Strong's Greek Lexicon
+Thayer's Greek Lexicon
+

+

+Hebrew Lexica
+Strong's Hebrew Lexicon
+Brown-Driver-Briggs Hebrew Lexicon
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/ancient.html b/utilities/diatheke/pqa/src/ancient.html new file mode 100644 index 0000000..4be0036 --- /dev/null +++ b/utilities/diatheke/pqa/src/ancient.html @@ -0,0 +1,32 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Bibles
+Biblia Hebraica Stuttgartensia (BHS)
+1991 Byzantine/Majority Text
+Septuagint (LXX)
+Nestle-Aland 26th Ed. GNT
+1894 Scrivener Textus Receptus
+1550 Stephanus Textus Receptus
+Tischendorf's Eighth Ed. GNT
+Latin Vulgate
+1881 Westcott-Hort GNT
+Westcott-Hort with NA27U4 variants
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/dict.html b/utilities/diatheke/pqa/src/dict.html new file mode 100644 index 0000000..944bce3 --- /dev/null +++ b/utilities/diatheke/pqa/src/dict.html @@ -0,0 +1,32 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Bible Dictionaries
+Easton's Bible Dictionary
+Hitchcock's Bible Names Dictionary
+Int'l Standard Bible Encyclopedia
+Smith's Bible Dictionary
+Vine's Bible Dictionary
+

+

+Topical References
+Naves' Topical Bible
+R. A. Torrey's New Topical Textbook
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/english.html b/utilities/diatheke/pqa/src/english.html new file mode 100644 index 0000000..774245c --- /dev/null +++ b/utilities/diatheke/pqa/src/english.html @@ -0,0 +1,68 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Bibles
+Analytical-Literal Trans. (ALT)
+American Standard Ver. (ASV)
+Bible in Basic English (BBE)
+Brenton's English LXX Trans. [OT]
+Darby's Bible
+Douay-Rheims (DR)
+Douay-Rheims 1899 American Ed.
+Hebrew Names Ver. (HNV)
+International Standard Ver. (ISV) [NT]
+JPS 1917 Tanakh [OT]
+21st Century King James Ver. (KJ21)
+King James Ver. (KJV/AV) *
+Green's Literal Trans. (LitV)
+The Living Oracles [NT]
+A Modern King James Ver. (MKJV)
+New American Standard (NASB)
+New American Standard, 95 Update
+New International Ver. (NIV)
+New International Ver., British Ed.
+New Jerusalem Bible (NJB)
+New King James Ver. (NKJV)
+New Living Trans. (NLT)
+New Revised Standard Ver. (NRSV)
+Orthodox Jewish Brit Chadasha [NT]
+Revised Standard Ver. (RSV)
+Revised 1833 Webster's Bible *
+World English Bible (WEB)
+Webster's Bible
+Weymouth New Testament [NT]
+Young's Literal Trans. (YLT)

+

+Commentaries
+Darby Translation Notes
+Family Bible Notes
+The Fourfold Gospel
+Geneva Bible Translation Notes
+Gill's Expositor
+Matthew Henry's Commentary
+Matthew Henry's Concise Commentary
+The People's New Testament
+Robertson's Word Pictures
+Scofield Reference Notes, 1917 Ed.
+John Wesley's Notes on the Bible
+

+Cross-references
+Treasury of Scriptural Knowledge
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/french.html b/utilities/diatheke/pqa/src/french.html new file mode 100644 index 0000000..4aeea79 --- /dev/null +++ b/utilities/diatheke/pqa/src/french.html @@ -0,0 +1,26 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Bibles
+French Haitian Creaole Ver.
+French Darby Trans.
+French 1910 Louis Segond (LSG)
+French Nouvelle Edition de Geneve 1979
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/german.html b/utilities/diatheke/pqa/src/german.html new file mode 100644 index 0000000..d772a56 --- /dev/null +++ b/utilities/diatheke/pqa/src/german.html @@ -0,0 +1,35 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Bibles
+German Bengel [NT]
+German Einheitsuebersetzung
+German 1905 Darby Unrev. Elberfelder
+German 1912 Luther
+German 1545 Luther
+German 1993 Elberfelder, rev. Fassung
+German 1984 Revised Luther
+German 1951 Schlachter Bibel
+

+

Commentaries
+Matthias Ansorgs Kommentar
+Carl Heinrich Riegers Kommentar
+German Scofield 1917 Ed. (Gen-Eccl)
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/index.html b/utilities/diatheke/pqa/src/index.html new file mode 100644 index 0000000..ff7a8c4 --- /dev/null +++ b/utilities/diatheke/pqa/src/index.html @@ -0,0 +1,43 @@ + + +HANDiatheke + + + + +
+
+ Quick lookup in KJV, NIV, NAS, & WEB:
+ + + + + + + +

+ All Books
+

+ + + + + +
Dictionaries & Topics Lexica
+

+ Bibles & Commentaries:
+ + + + + + + + + + + +
English French German
Ancient Spanish Other
+
+ + diff --git a/utilities/diatheke/pqa/src/lex.html b/utilities/diatheke/pqa/src/lex.html new file mode 100644 index 0000000..29fe0f7 --- /dev/null +++ b/utilities/diatheke/pqa/src/lex.html @@ -0,0 +1,29 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Greek Lexica
+Strong's Greek Lexicon
+Thayer's Greek Lexicon
+

+

+Hebrew Lexica
+Strong's Hebrew Lexicon
+Brown-Driver-Briggs Hebrew Lexicon
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/other.html b/utilities/diatheke/pqa/src/other.html new file mode 100644 index 0000000..6184f94 --- /dev/null +++ b/utilities/diatheke/pqa/src/other.html @@ -0,0 +1,57 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Bibles
+Albanian Bible
+Czech Bible Kralicka
+Czech Ekumenicky Cesky Preklad
+Czech Preklad KMS Nova Smlouva
+Czech Nova Kralicka Bible
+Danish Danske Bibel
+Dutch Leidse Vertaling
+Dutch Lutherse Vertaling
+Dutch 1951 Bijbelgenootschap Ver.
+Dutch Statenvertaling
+Equadoran Shuar [NT]
+Finish 1933 Phy~N Raamattu
+Hungarian Karoli
+Bahasa Indonesia Sehari-hari (BIS)
+Indonesian Terjemahan Baru (TB)
+Italian Nuovissima Ver., San Paolo Ed.
+Italian 1991 La Nuova Diodati
+Italian 1994 La Nuova Riveduta
+Maori Bible
+Melanesian Pidgin Bible
+Norwegian 1930 Bokmal
+Norwegian 1938 Bokmal
+Norwegian Bibel Konkordant
+Norwegian 1994 Nynorsk
+Norwegian Norsk Bible
+Philippine Nga Cebuano
+Polish 1984 Millenium Bible, 4th Ed.
+Portuguese 1995 Joao Ferreira
+Portuguese 1994 Almeida Biblia
+Romanian Cornilescu Ver.
+Swahili New Testament [NT]
+Swedish 1917 New Testament [NT]
+Turkish New Testament [NT]
+Uma New Testament [NT]
+Vietnamese 1934 Bible
+

+
+
+ + diff --git a/utilities/diatheke/pqa/src/spanish.html b/utilities/diatheke/pqa/src/spanish.html new file mode 100644 index 0000000..e848003 --- /dev/null +++ b/utilities/diatheke/pqa/src/spanish.html @@ -0,0 +1,29 @@ + + +HANDiatheke + + +
+

Query: + + + +

+ +

+Stong's*| Footnotes| Search

+
+

+Bibles
+Spanish La Biblia de Las Americas (LBA)
+Spanish Reina-Valera
+Spanish 1960 Reina-Valera Revised
+Spanish 1995 Reina-Valera Update
+Spanish Ver. Reina-Valera Actualizada
+Spanish 1569 Ver. Antigua
+Spanish 1858 Valera[NT]
+

+
+
+ + diff --git a/utilities/diatheke/soap/sapouni.cgi b/utilities/diatheke/soap/sapouni.cgi new file mode 100755 index 0000000..24df769 --- /dev/null +++ b/utilities/diatheke/soap/sapouni.cgi @@ -0,0 +1,97 @@ +#!/usr/bin/perl + +#version 1.0 + +package sapouni; +$sapouni = "nice /usr/bin/diatheke"; # location of diatheke command line program -- if you are using a MS Windows server, you might need to remove the "nice" + +$sword_path = "/home/sword"; # SWORD_PATH environment variable you want to use +$maxverses = 0; # maximum number of verses diatheke will return per query (prevents people from asking for Gen1:1-Rev22:21; 0 for unlim.) +$defversion = "KJV"; # book to query when none is selected, but a verse/search is entered +$deflocale = "abbr"; # this is just the default for cases where user has not selected a locale and his browser does not reveal one -- you can also set locale using locael= in the GET URL + + +############################################################################### +## You should not need to edit anything below this line. +## Unless you want to modify functionality of course. :) +############################################################################### + +$ENV{'SWORD_PATH'} = $sword_path; + +use SOAP::Transport::HTTP; + +SOAP::Transport::HTTP::CGI + -> dispatch_to('sapouni') + -> handle; + +package sapouni; + +sub biblequery { + my ($class, $books, $key, $options, $encoding, $markup, $searchtype, $locale, $script, $max) = @_; + + if ($key eq "") { + $key = "Jn 3:16"; + } + + @booklist = split ' ', $books; + + $n = scalar(@booklist); + if ($n == 0) { + @booklist[0] = $defversion; + $n++; + } + + $query = ""; + + if ($options ne "") { + $query .= " -o \"$options\""; + } + + if ($encoding ne "") { + $query .= " -e \"$encoding\""; + } + else { + $query .= " -e UTF8"; + } + + if ($markup ne "") { + $query .= " -f \"$markup\""; + } + else { + $query .= " -f ThML"; + } + + if ($searchtype ne "") { + $query .= " -s \"$searchtype\""; + } + + if ($locale ne "") { + $query .= " -l \"$locale\""; + } + else { + $query .= " -l $deflocale"; + } + + if ($script ne "") { + $query .= " -t \"$script\""; + } + + if ($max ne "" && $max ne 0) { + $query .= " -m \"$max\""; + } + + $rval = ""; + for ($i = 0; $i < $n; $i++) { + $line = "$sapouni $query -b $booklist[$i] -k \"$key\" 2> /dev/null"; + + # uncomment to print the command line send to Diatheke (for debugging) + # $rval .= "$line\n"; + + $line = `$line`; + chomp($line); + + $rval .= "$line\n"; + } + + return "$rval"; +} diff --git a/utilities/diatheke/soap/soapatheke.pl b/utilities/diatheke/soap/soapatheke.pl new file mode 100755 index 0000000..e3f88ed --- /dev/null +++ b/utilities/diatheke/soap/soapatheke.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +## This is a test app and has no other purpose. + +use SOAP::Lite; + +my ($books, $key, $options, $encoding, $markup, $searchtype, $locale, $script, $max) = @ARGV; + +# uncomment to see parameters being passed to the SOAP server (for debugging) +# print "$books\n$key\n$options\n$encoding\n$markup\n$searchtype\n$locale\n$script\n$max\n"; + +print SOAP::Lite + -> uri('http://bible.gotjesus.org/sapouni') + -> proxy('http://bible.gotjesus.org/cgi-bin/sapouni.cgi') + -> biblequery($books, $key, $options, $encoding, $markup, $searchtype, $locale, $script, $max) + -> result; diff --git a/utilities/diatheke/tcl/biblebot-diatheke.tcl b/utilities/diatheke/tcl/biblebot-diatheke.tcl new file mode 100644 index 0000000..1fea379 --- /dev/null +++ b/utilities/diatheke/tcl/biblebot-diatheke.tcl @@ -0,0 +1,2131 @@ +# Diatheke/Tcl 3.0 by Chris Little +# Based on code schema of + +# Copyright 1999 by Chris Little +# Licensed under GNU General Public License (GPL) +# see accompanying LICENSE file for license details + +# This script is intended for use with libraries and modules from +# the SWORD Project, available at http://www.crosswire.org/ +# +# To install Diatheke/Tcl, install an eggdrop IRC bot, copy the +# Diatheke/Tcl .tcl file to your eggdrop scripts directory, and +# add a line to the end of your bot startup script to load the +# Diatheke/Tcl script. This script has been tested with eggdrop 1.3.23 +# but should function fine in later versions. +# +# This is script assumes you have every single SWORD module installed +# that was available at the time of release. Since you probably do not, +# remove all modules listed in the pub_books function that you do not +# have installed to hide them from end-users. +# +# The !history command only works if you have LOGGING turned on in +# diatheke (the command line C program). This command is commented out +# of the help function and must be uncommented to make it show up for +# end-users. +# +# When you get the script loaded, type !biblehelp in a channel where +# the bot is present and it will give you a full list of commands. +# More commands will appear to you depending upon which mode the bot is +# in and whether you are an op on the bot or voiced in the channel. + +set diaver 4.0 + +#modify this to reflect actual location of diatheke and dict binaries +set diatheke "/usr/bin/diatheke" +set dict "/usr/bin/dict" + +proc publookupverse {vlookup} { + global botnick chan bibver diatheke + + set arg "-b" + set n [string first "@" $vlookup] + if {$n > -1 && $n < 2} { + append arg n + } + + set n [string first "#" $vlookup] + if {$n > -1 && $n < 2} { + append arg f + } + set vlookup [string trimleft $vlookup "#"] + set vlookup [string trimleft $vlookup "@"] + set vlookup [string trimleft $vlookup "#"] + + catch {exec $diatheke -f plaintext -o $arg -b $bibver -k "$vlookup" >& /tmp/fooout.$botnick} + catch {set foofile [open /tmp/fooout.$botnick]} + while {[gets $foofile fooverse] >= 0} { + set len [string length $fooverse] + set i 0 + set j 255 + while {$j < $len} { + if {[regexp ">" $fooverse]} { + while {[string index $fooverse $j] != ">" && [string index $fooverse $j] != "\n"} {set j [expr $j - 1]} + } else { + while {[string index $fooverse $j] != " " && [string index $fooverse $j] != "\n"} {set j [expr $j - 1]} + } + set foo2 [string range $fooverse $i $j] + set foo2 [string trim $foo2] + regsub -all -nocase {(||)} $foo2 {} foo2 + regsub -all {} $foo2 {(footnote: } foo2 + regsub -all {} $foo2 {)} foo2 + putmsg $chan "$foo2" + set i [expr $j + 1] + set j [expr $j + 256] + if {$j > $len} {set j $len} + } + set foo2 [string range $fooverse $i end] + set foo2 [string trim $foo2] + regsub -all -nocase {(||)} $foo2 {} foo2 + regsub -all {} $foo2 {(footnote: } foo2 + regsub -all {} $foo2 {)} foo2 + putmsg $chan "$foo2" + } + + catch {close $foofile} + exec rm /tmp/fooout.$botnick + return 1 +} + + +proc pub_lookup {nick uhost hand channel arg} { + global von chan bibver + set chan $channel + if {$von==0} { + putmsg $nick "Verse display is currently off." + return 0 + } + if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} { + putmsg $nick "Only ops can display verses at this time." + return 0 + } + + publookupverse $arg + +} + +bind pub - !kjv setver_kjv +bind pub - !english setver_kjv + +proc setver_kjv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver KJV + pub_lookup $nick $uhost $hand $channel $arg +} + + +bind pub - !niv setver_niv + +proc setver_niv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NIV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !dr setver_dr +bind pub - !douayrheims setver_dr +bind pub - !dre setver_dr + +proc setver_dr {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DR + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !nas setver_nasb +bind pub - !nasb setver_nasb + +proc setver_nasb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NASB + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !hnv setver_hnv + +proc setver_hnv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver HNV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !web setver_web + +proc setver_web {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WEB + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !akjv setver_akjv + +proc setver_akjv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver AKJV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !bbe setver_bbe + +proc setver_bbe {nick uhost hand channel arg} { + global botnick chan bibver + set bibver BBE + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !webster setver_webster + +proc setver_webster {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Websters + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !jbc setver_jbc + +proc setver_jbc {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ORTHJBC + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !rva setver_rva +bind pub - !spanish setver_rva + +proc setver_rva {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaRVA + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lsg setver_lsg +bind pub - !french setver_lsg + +proc setver_lsg {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreLSG + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !bis setver_bis +bind pub - !indonesian setver_bis + +proc setver_bis {nick uhost hand channel arg} { + global botnick chan bibver + set bibver IndBIS + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !tb setver_tb + +proc setver_tb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver IndTB + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !sve setver_sve +bind pub - !swedish setver_sve + +proc setver_sve {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SweSve + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !vnt setver_vnt + +proc setver_vnt {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaVNT + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !asv setver_asv + +proc setver_asv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ASV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !rsv setver_rsv + +proc setver_rsv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RSV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !alt setver_alt + +proc setver_alt {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ALT + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !dby setver_dby +bind pub - !darby setver_dby + +proc setver_dby {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Darby + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !pr setver_pr +bind pub - !finnish setver_pr + +proc setver_pr {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FinPR + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lsg setver_lsg +bind pub - !french setver_lsg + +proc setver_lsg {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreLSG + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lut setver_lut +bind pub - !luther setver_lut +bind pub - !german setver_lut + +proc setver_lut {nick uhost hand channel arg} { + global botnick chan bibver + set bibver GerLut + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !sch setver_sch + +proc setver_sch {nick uhost hand channel arg} { + global botnick chan bibver + set bibver GerSch + pub_lookup $nick $uhost $hand $channel $arg +} + + +bind pub - !kar setver_kar +bind pub - !hungarian setver_kar + +proc setver_kar {nick uhost hand channel arg} { + global botnick chan bibver + set bibver HunKar + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !nrv setver_nrv +bind pub - !italian setver_nrv + +proc setver_nrv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ItaNRV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !jps setver_jps + +proc setver_jps {nick uhost hand channel arg} { + global botnick chan bibver + set bibver JPS + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !brp setver_brp +bind pub - !portuguese setver_brp + +proc setver_brp {nick uhost hand channel arg} { + global botnick chan bibver + set bibver PorBRP + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !sev setver_sev + +proc setver_sev {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaSEV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !swahili setver_swahili + +proc setver_swahili {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Swahili + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !wey setver_wey +bind pub - !weymouth setver_wey + +proc setver_wey {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Weymouth + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !ylt setver_ylt + +proc setver_ylt {nick uhost hand channel arg} { + global botnick chan bibver + set bibver YLT + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !alb setver_alb +bind pub - !albanian setver_alb + +proc setver_alb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Alb + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !gnpu setver_gnpu +bind pub - !chinese setver_gnpu + +proc setver_gnpu {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ChiGNPU + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !dan setver_dan +bind pub - !danish setver_dan + +proc setver_dan {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Dan + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lei setver_lei +bind pub - !dutch setver_lei + +proc setver_lei {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DutLEI + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lu setver_lu + +proc setver_lu {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DutLU + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !svv setver_svv + +proc setver_svv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DutSVV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !shr setver_shr +bind pub - !equadoran setver_shr + +proc setver_shr {nick uhost hand channel arg} { + global botnick chan bibver + set bibver EquShr + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !crl setver_crl +bind pub - !creole setver_crl + +proc setver_crl {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreCrl + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !fredrb setver_fredrb + +proc setver_fredrb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreDrb + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !ben setver_ben + +proc setver_ben {nick uhost hand channel arg} { + global botnick chan bibver + set bibver GerBen + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !elb setver_elb + +proc setver_elb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver GerElb + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !kj21 setver_kj21 + +proc setver_kj21 {nick uhost hand channel arg} { + global botnick chan bibver + set bibver KJ21 + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !litv setver_litv + +proc setver_litv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LITV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lo setver_lo + +proc setver_lo {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LO + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !maori setver_maori + +proc setver_maori {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Maori + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !mkjv setver_mkjv + +proc setver_mkjv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver MKJV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !nkj setver_nkjv +bind pub - !nkjv setver_nkjv + +proc setver_nkjv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NKJV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !ceb setver_ceb +bind pub - !filipino setver_ceb + +proc setver_ceb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver PhiCeb + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !rwebster setver_rwebster + +proc setver_rwebster {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RWebster + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !rv setver_rv + +proc setver_rv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaRV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !turkish setver_turkish + +proc setver_turkish {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Turkish + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !uma setver_uma + +proc setver_uma {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Uma + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !vulgate setver_vulgate +bind pub - !vulg setver_vulgate +bind pub - !latin setver_vulgate + +proc setver_vulgate {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Vulgate + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !nasb95 setver_nasb95 +bind pub - !nas95 setver_nasb95 +bind pub - !nau setver_nasb95 + +proc setver_nasb95 {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NASB95 + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !nivbr setver_nivbr +bind pub - !nib setver_nivbr + +proc setver_nivbr {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NIVBr + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !nlt setver_nlt + +proc setver_nlt {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NLT + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !nrsv setver_nrsv + +proc setver_nrsv {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NRSV + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !neg setver_neg + +proc setver_neg {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreNEG + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lnd setver_lnd + +proc setver_lnd {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ItaLND + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !mel setver_mel +bind pub - !melanesian setver_mel + +proc setver_mel {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Mel + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !norsk setver_norsk + +proc setver_norsk {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Norsk + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !cor setver_cor + +proc setver_cor {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RomCor + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lba setver_lba + +proc setver_lba {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaLBA + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !byz setver_byz + +proc setver_byz {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ByzX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !lxx setver_lxx + +proc setver_lxx {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LXXX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !na26 setver_na26 +bind pub - !greek setver_na26 + +proc setver_na26 {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NA26X + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !scrivner setver_scrivner + +proc setver_scrivner {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ScrivnerX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !stephanus setver_stephanus + +proc setver_stephanus {nick uhost hand channel arg} { + global botnick chan bibver + set bibver StephanusX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !tischendorf setver_tisch +bind pub - !tisch setver_tisch + +proc setver_tisch {nick uhost hand channel arg} { + global botnick chan bibver + set bibver TischX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !wh setver_wh + +proc setver_wh {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WHX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !whnu setver_whnu + +proc setver_whnu {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WHNUX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grkbyz setver_grkbyz + +proc setver_grkbyz {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Byz + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grklxx setver_grklxx + +proc setver_grklxx {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LXX + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grkna26 setver_grkna26 +bind pub - !grkgreek setver_na26 + +proc setver_grkna26 {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NA26 + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grkscrivner setver_grkscrivner + +proc setver_grkscrivner {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Scrivner + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grkstephanus setver_grkstephanus + +proc setver_grkstephanus {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Stephanus + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grktischendorf setver_grktisch +bind pub - !grktisch setver_grktisch + +proc setver_grktisch {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Tisch + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grkwh setver_grkwh + +proc setver_grkwh {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WH + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !grkwhnu setver_grkwhnu + +proc setver_grkwhnu {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WHNU + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !bhs setver_bhs +bind pub - !hebrew setver_bhs + +proc setver_bhs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver BHS + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !rst setver_rst + +proc setver_rst {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RST + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !ukrainian setver_ukrainian + +proc setver_ukrainian {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Ukrainian + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !arabic setver_arabic + +proc setver_arabic {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Arabic + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !n27u4 setver_n27u4 +bind pub - !nu setver_n27u4 +bind pub - !bgreek setver_n27u4 + +proc setver_n27u4 {nick uhost hand channel arg} { + global botnick chan bibver + set bibver N27U4 + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !umgreek setver_ukgreek + +proc setver_umgreek {nick uhost hand channel arg} { + global botnick chan bibver + set bibver UMGreek + pub_lookup $nick $uhost $hand $channel $arg +} + +bind pub - !viet setver_viet +bind pub - !vietnamese setver_viet + +proc setver_viet {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Viet + pub_lookup $nick $uhost $hand $channel $arg +} + + +# ---------------------------------------------------------------------- + +proc pubsearchword {vlookup} { + global botnick chan bibver diatheke + catch {exec $diatheke -s $bibver "$vlookup" >& /tmp/fooout.$botnick} + catch {set foofile [open /tmp/fooout.$botnick]} + + while {[gets $foofile fooverse] >= 0} { + set len [string length $fooverse] + set i 0 + set j 72 + while {$j < $len} { + while {[string index $fooverse $j] != ";" && [string index $fooverse $j] != ")" && [string index $fooverse $j] != "\n"} {set j [expr $j + 1]} + set foo2 [string range $fooverse $i $j] + set foo2 [string trim $foo2] + putmsg $chan "$foo2" + set i [expr $j + 1] + set j [expr $j + 73] + if {$j > $len} {set j $len} + } + set foo2 [string range $fooverse $i end] + set foo2 [string trim $foo2] + putmsg $chan "$foo2" + } + catch {close $foofile} + + putmsg $chan "$fooverse" + exec rm /tmp/fooout.$botnick + return 1 +} + + +proc pub_lookups {nick uhost hand channel arg} { + global von chan bibver + set chan $channel + if {$von==0} { + putmsg $nick "Verse display is currently off." + return 0 + } + if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $chan])} { + putmsg $nick "Sorry, only ops and voiced users can do searches right now." + return 0 + } + if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} { + putmsg $nick "Sorry, only ops can do searches right now." + return 0 + } + + pubsearchword $arg +} + +bind pub - !skjv setver_kjvs +bind pub - !senglish setver_kjvs + +proc setver_kjvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver KJV + pub_lookups $nick $uhost $hand $channel $arg +} + + +bind pub - !sniv setver_nivs + +proc setver_nivs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NIV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sdr setver_drs +bind pub - !sdouayrheims setver_drs +bind pub - !sdre setver_drs + +proc setver_drs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DR + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snas setver_nasbs +bind pub - !snasb setver_nasbs + +proc setver_nasbs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NASB + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !shnv setver_hnvs + +proc setver_hnvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver HNV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sweb setver_webs + +proc setver_webs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WEB + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sbbe setver_bbes + +proc setver_bbes {nick uhost hand channel arg} { + global botnick chan bibver + set bibver BBE + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !swebster setver_websters + +proc setver_websters {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Websters + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sjbc setver_jbcs + +proc setver_jbcs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ORTHJBC + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !srva setver_rvas +bind pub - !sspanish setver_rvas + +proc setver_rvas {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaRVA + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sbis setver_biss +bind pub - !sindonesian setver_biss + +proc setver_biss {nick uhost hand channel arg} { + global botnick chan bibver + set bibver IndBIS + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !stb setver_tbs + +proc setver_tbs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver IndTB + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !ssve setver_sves +bind pub - !sswedish setver_sves + +proc setver_sves {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SweSve + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !svnt setver_vnts + +proc setver_vnts {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaVNT + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sasv setver_asvs + +proc setver_asvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ASV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !srsv setver_rsvs + +proc setver_rsvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RSV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !salt setver_alts + +proc setver_alts {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ALT + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sdby setver_dbys +bind pub - !sdarby setver_dbys + +proc setver_dbys {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Darby + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !spr setver_prs +bind pub - !sfinnish setver_prs + +proc setver_prs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FinPR + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slsg setver_lsgs +bind pub - !sfrench setver_lsgs + +proc setver_lsgs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreLSG + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slut setver_luts +bind pub - !sluther setver_luts +bind pub - !sgerman setver_luts + +proc setver_luts {nick uhost hand channel arg} { + global botnick chan bibver + set bibver GerLut + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !ssch setver_schs + +proc setver_schs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver GerSch + pub_lookups $nick $uhost $hand $channel $arg +} + + +bind pub - !skar setver_kars +bind pub - !shungarian setver_kars + +proc setver_kars {nick uhost hand channel arg} { + global botnick chan bibver + set bibver HunKar + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snrv setver_nrvs +bind pub - !sitalian setver_nrvs + +proc setver_nrvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ItaNRV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sjps setver_jpss + +proc setver_jpss {nick uhost hand channel arg} { + global botnick chan bibver + set bibver JPS + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sbrp setver_brps +bind pub - !sportuguese setver_brps + +proc setver_brps {nick uhost hand channel arg} { + global botnick chan bibver + set bibver PorBRP + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !ssev setver_sevs + +proc setver_sevs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaSEV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sswahili setver_swahilis + +proc setver_swahilis {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Swahili + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !swey setver_weys +bind pub - !sweymouth setver_weys + +proc setver_weys {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Weymouth + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sylt setver_ylts + +proc setver_ylts {nick uhost hand channel arg} { + global botnick chan bibver + set bibver YLT + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !salb setver_albs +bind pub - !salbanian setver_albs + +proc setver_albs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ALB + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgnpu setver_gnpus +bind pub - !schinese setver_gnpus + +proc setver_gnpus {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ChiGNPU + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sdan setver_dans +bind pub - !sdanish setver_dans + +proc setver_dans {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Dan + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slei setver_leis +bind pub - !sdutch setver_leis + +proc setver_leis {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DutLEI + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slu setver_lus + +proc setver_lus {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DutLU + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !ssvv setver_svvs + +proc setver_svvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DutSVV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sshr setver_shrs +bind pub - !sequadoran setver_shrs + +proc setver_shrs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver EquShr + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !scrl setver_crls +bind pub - !screole setver_crls + +proc setver_crls {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreCrl + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sfredrb setver_fredrbs + +proc setver_fredrbs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreDrb + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sben setver_bens + +proc setver_bens {nick uhost hand channel arg} { + global botnick chan bibver + set bibver BerBen + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !selb setver_elbs + +proc setver_elbs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver GerElb + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !skj21 setver_kj21s + +proc setver_kj21s {nick uhost hand channel arg} { + global botnick chan bibver + set bibver KJ21 + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slitv setver_litvs + +proc setver_litvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LITV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slo setver_los + +proc setver_los {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LO + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !smaori setver_maoris + +proc setver_maoris {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Mao + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !smkjv setver_mkjvs + +proc setver_mkjvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver MKJV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snkjv setver_nkjvs + +proc setver_nkjvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NKJV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sceb setver_cebs +bind pub - !sfilipino setver_cebs + +proc setver_cebs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver PhiCeb + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !srwebster setver_rwebsters + +proc setver_rwebsters {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RWebster + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !srv setver_rvs + +proc setver_rvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaRV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sturkish setver_turkishs + +proc setver_turkishs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Turkish + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !suma setver_umas + +proc setver_umas {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Uma + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !svulgate setver_vulgates +bind pub - !svulg setver_vulgates +bind pub - !slatin setver_vulgates + +proc setver_vulgates {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Vulgate + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snasb95 setver_nasb95s +bind pub - !snas95 setver_nasb95s +bind pub - !snau setver_nasb95s + +proc setver_nasb95s {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NASB95 + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snivbr setver_nivbrs +bind pub - !snib setver_nivbrs + +proc setver_nivbrs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NIVBr + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snlt setver_nlts + +proc setver_nlts {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NLT + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snrsv setver_nrsvs + +proc setver_nrsvs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NRSV + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sneg setver_negs + +proc setver_negs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver FreNEG + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slnd setver_lnds + +proc setver_lnds {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ItaLND + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !smel setver_mels +bind pub - !smelanesian setver_mels + +proc setver_mels {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Mel + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !snorsk setver_norsks + +proc setver_norsks {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Norsk + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !scor setver_cors + +proc setver_cors {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RomCor + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slba setver_lbas + +proc setver_lbas {nick uhost hand channel arg} { + global botnick chan bibver + set bibver SpaLBA + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sbyz setver_byzs + +proc setver_byzs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ByzX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !slxx setver_lxxs + +proc setver_lxxs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LXXX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sna26 setver_na26s +bind pub - !sgreek setver_na26s + +proc setver_na26s {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NA26X + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sscrivner setver_scrivners + +proc setver_scrivners {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ScrivnerX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sstephanus setver_stephanuss + +proc setver_stephanuss {nick uhost hand channel arg} { + global botnick chan bibver + set bibver StephanusX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !stischendorf setver_tischs +bind pub - !stisch setver_tischs + +proc setver_tischs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver TischX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !swh setver_whs + +proc setver_whs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WHX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !swhnu setver_whnus + +proc setver_whnus {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WHNUX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrkbyz setver_grkbyzs + +proc setver_grkbyzs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Byz + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrklxx setver_grklxxs + +proc setver_grklxxs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver LXX + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrkna26 setver_grkna26s +bind pub - !sgrkgreek setver_na26s + +proc setver_grkna26s {nick uhost hand channel arg} { + global botnick chan bibver + set bibver NA26 + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrkscrivner setver_grkscrivners + +proc setver_grkscrivners {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Scrivner + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrkstephanus setver_grkstephanuss + +proc setver_grkstephanuss {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Stephanus + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrktischendorf setver_grktischs +bind pub - !sgrktisch setver_grktischs + +proc setver_grktischs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Tisch + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrkwh setver_grkwhs + +proc setver_grkwhs {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WH + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sgrkwhnu setver_grkwhnus + +proc setver_grkwhnus {nick uhost hand channel arg} { + global botnick chan bibver + set bibver WHNU + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sbhs setver_bhss +bind pub - !shebrew setver_bhss + +proc setver_bhss {nick uhost hand channel arg} { + global botnick chan bibver + set bibver BHS + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !srst setver_rsts + +proc setver_rsts {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RST + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sukrainian setver_ukrainians + +proc setver_ukrainians {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Ukrainian + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sarabic setver_arabics + +proc setver_arabics {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Arabic + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sn27u4 setver_n27u4s +bind pub - !snu setver_n27u4s +bind pub - !sbgreek setver_n27u4s + +proc setver_n27u4s {nick uhost hand channel arg} { + global botnick chan bibver + set bibver N27U4 + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sumgreek setver_ukgreeks + +proc setver_umgreeks {nick uhost hand channel arg} { + global botnick chan bibver + set bibver UMGreek + pub_lookups $nick $uhost $hand $channel $arg +} + +bind pub - !sviet setver_viets +bind pub - !svietnamese setver_viets + +proc setver_viets {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Viet + pub_lookups $nick $uhost $hand $channel $arg +} + +#---------------------------------------------------------------------- + + +proc publookupdict {vlookup} { + global botnick chan bibver diatheke + catch {exec $diatheke -f plaintext -b $bibver -k "$vlookup" >& /tmp/fooout.$botnick} + catch {set foofile [open /tmp/fooout.$botnick]} + + while {[gets $foofile fooverse] >= 0} { + putmsg $chan "$fooverse" + } + catch {close $foofile} + # exec rm /tmp/fooout.$botnick + return 1 +} + + +proc pub_lookupd {nick uhost hand channel arg} { + global von chan bibver + set chan $channel + if {$von==0} { + putmsg $nick "Verse display is currently off." + return 0 + } + if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $chan])} { + putmsg $nick "Sorry, only ops and voiced users can use dictionaries and indices right now." + return 0 + } + if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} { + putmsg $nick "Sorry, only ops can use dictionaries and indices right now." + return 0 + } + + publookupdict $arg +} + +bind pub - !losung setver_losung + +proc setver_losung {nick uhost hand channel arg} { + global botnick chan bibver + set bibver losung_en_99 + set arg [exec date "+%m.%d"] + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !vines setver_vines + +proc setver_vines {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Vines + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !naves setver_naves + +proc setver_naves {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Naves + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !eastons setver_eastons + +proc setver_eastons {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Eastons + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !strheb setver_strheb + +proc setver_strheb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver StrongsHebrew + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !strgrk setver_strgrk + +proc setver_strgrk {nick uhost hand channel arg} { + global botnick chan bibver + set bibver StrongsGreek + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !bdb setver_bdb + +proc setver_bdb {nick uhost hand channel arg} { + global botnick chan bibver + set bibver BDB + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !thayer setver_thayer + +proc setver_thayer {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Thayer + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !hitch setver_hitch + +proc setver_hitch {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Hitch + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !isbe setver_isbe + +proc setver_isbe {nick uhost hand channel arg} { + global botnick chan bibver + set bibver ISBE + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !smiths setver_smiths + +proc setver_smiths {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Smiths + pub_lookupd $nick $uhost $hand $channel $arg +} + +bind pub - !torrey setver_torrey + +proc setver_torrey {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Torrey + pub_lookupd $nick $uhost $hand $channel $arg +} + +#---------------------------------------------------------------------- + +proc publookupcomm {vlookup} { + global botnick chan bibver diatheke + catch {exec $diatheke -c $bibver "$vlookup" >& /tmp/fooout.$botnick} + catch {set foofile [open /tmp/fooout.$botnick]} + while {[gets $foofile fooverse] >= 0} { + set len [string length $fooverse] + set i 0 + set j 72 + while {$j < $len} { + while {[string index $fooverse $j] != " " && [string index $fooverse $j] != "\n"} {set j [expr $j + 1]} + set foo2 [string range $fooverse $i $j] + set foo2 [string trim $foo2] + regsub -all -nocase {(||)} $foo2 {} foo2 + regsub -all {} $foo2 {(footnote: } foo2 + regsub -all {} $foo2 {)} foo2 + putmsg $chan "$foo2" + set i [expr $j + 1] + set j [expr $j + 73] + if {$j > $len} {set j $len} + } + set foo2 [string range $fooverse $i end] + set foo2 [string trim $foo2] + regsub -all -nocase {(||)} $foo2 {} foo2 + regsub -all {} $foo2 {(footnote: } foo2 + regsub -all {} $foo2 {)} foo2 + putmsg $chan "$foo2" + } + catch {close $foofile} + exec rm /tmp/fooout.$botnick + return 1 +} + + +proc pub_lookupc {nick uhost hand channel arg} { + global von chan bibver + set chan $channel + if {$von==0} { + putmsg $nick "Verse display is currently off." + return 0 + } + if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $chan])} { + putmsg $nick "Sorry, only ops and voiced users can use commentaries right now." + return 0 + } + if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} { + putmsg $nick "Sorry, only ops can use commentaries right now." + return 0 + } + + publookupcomm $arg +} + +bind pub - !rwp setver_rwp + +proc setver_rwp {nick uhost hand channel arg} { + global botnick chan bibver + set bibver RWP + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !mhc setver_mhc + +proc setver_mhc {nick uhost hand channel arg} { + global botnick chan bibver + set bibver MHC + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !dtn setver_dtn + +proc setver_dtn {nick uhost hand channel arg} { + global botnick chan bibver + set bibver DTN + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !family setver_family + +proc setver_family {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Family + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !geneva setver_geneva + +proc setver_geneva {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Geneva + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !gill setver_gill + +proc setver_gill {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Gill + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !pnt setver_pnt + +proc setver_pnt {nick uhost hand channel arg} { + global botnick chan bibver + set bibver PNT + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !tfg setver_tfg + +proc setver_tfg {nick uhost hand channel arg} { + global botnick chan bibver + set bibver TFG + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !tsk setver_tsk + +proc setver_tsk {nick uhost hand channel arg} { + global botnick chan bibver + set bibver TSK + pub_lookupc $nick $uhost $hand $channel $arg +} + +bind pub - !wesley setver_wesley + +proc setver_wesley {nick uhost hand channel arg} { + global botnick chan bibver + set bibver Wesley + pub_lookupc $nick $uhost $hand $channel $arg +} + +#---------------------------------------------------------------------- + +bind pub - !dict dictlookup + +proc dictlookup {nick uhost hand channel arg} { + global botnick von dict + + if {$von==0} { + putmsg $nick "Verse display is currently off." + return 0 + } + if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $channel])} { + putmsg $nick "Sorry, only ops and voiced users can use dictionaries and indices right now." + return 0 + } + if {($von==2) && (![matchattr $hand 3]) && (![matchattr $hand o])} { + putmsg $nick "Only ops can use dictionaries and indices right now." + return 0 + } + + catch {exec $dict "$arg" >& /tmp/fooout.$botnick} + catch {set foofile [open /tmp/fooout.$botnick]} + catch {set fooverse [gets $foofile]} + while {[gets $foofile fooverse] >= 0} { + set fooverse [string trim $fooverse] + putmsg $channel "$fooverse" + } + catch {close $foofile} + exec rm /tmp/fooout.$botnick + return 1 +} + +#---------------------------------------------------------------------- + +bind pub - !biblehelp pub_help +bind msg - biblehelp pub_help + +proc pub_help {nick uhost hand channel arg} { + global diaver + global von + putserv "NOTICE $nick :Diatheke/Tcl BibleBot version $diaver" + + if {(($von==0) || ($von==2)) && (![matchattr $hand 3]) && (![matchattr $hand o])} { + putserv "NOTICE $nick :BibleBot displays are currently turned off." + return 1 + } + + putserv "NOTICE $nick :Supported commands:" + putserv "NOTICE $nick :Help, using \"!biblehelp\"" + putserv "NOTICE $nick :Book list, using \"!books\" (it's long)" +# Uncomment the next line if you have turned LOGGING on in diatheke to enable +# the history function. +# putserv "NOTICE $nick :See last 5 calls to BibleBot, using \"!history\"" + putserv "NOTICE $nick :Check display status, using \"!status\"" + putserv "NOTICE $nick :Bible lookups, using \"! :\"" + putserv "NOTICE $nick :verse ranges can be specified by adding \"-\" to this" + putserv "NOTICE $nick :To turn Strong's numbers and/or footnotes on, use @ and/or # respectively before the book name. For example \"!kjv @#Gen 1:4\" will retrieve Genesis 1:3 with the Strong's numbers and footnotes associated with it." + + if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $channel])} { + return 1 + } + + putserv "NOTICE $nick :Commentary lookups, using \"! :\"" + putserv "NOTICE $nick :Dictionary/index lookups, using \"! \"" + putserv "NOTICE $nick :Bible searches, using \"!s \"" + putserv "NOTICE $nick :Diatheke/Tcl defaults to PHRASE search mode. To use MULTI-WORD search mode, preface your search with an @. To use REGEX mode, preface your search with a #. For example: \"!skjv @Jesus love\" will print a list of all verses in the KJV containing the words Jesus and love." + + if {(![matchattr $hand 3]) && (![matchattr $hand o])} { + return 1 + } + + putserv "NOTICE $nick :To turn verse display off, use \"!verseoff\"" + putserv "NOTICE $nick :To turn all displays on for all users, use \"!verseon\"" + putserv "NOTICE $nick :To turn all displays on for ops only, use \"!verseon o\"" + putserv "NOTICE $nick :To turn verse diaplays on for regular users and all other displays on for ops and voiced users only, use \"!verseon v\" (default)" +} + +bind pub - !books pub_books +bind msg - books pub_books + +proc pub_books {nick uhost hand channel arg} { + global von + + if {(($von==0) || ($von==2)) && (![matchattr $hand 3]) && (![matchattr $hand o])} { + putserv "NOTICE $nick :BibleBot displays are currently turned off." + return 1 + } + + putserv "NOTICE $nick :English language Bibles (26):" + putserv "NOTICE $nick :Ameican Standard Version (!asv), Analytical Literal Translation (!alt), Bible in Basic English (!bbe), Darby (!dby), Douay-Rheims Bible (!dr), Green's Literal Translation (!litv), Green's Modern King James Version (!mkjv), Hebrew Names Version (!hnv), Jewish Publication Society 1917 (!jps), King James Version (!kjv), The Living Oracles NT (!lo)," + putserv "NOTICE $nick :New American Standard Bible (!nasb), New American Standard Bible, 95 Update (!nasb95), New International Version (!niv), New Internation Version, British Edition (!nivbr), New King James Version (!nkjv), New Living Translation (!nlt), New Revised Standard Version (!nrsv), Orthodox Jewish Brit ChadashaNT only (!jbc)," + putserv "NOTICE $nick :Revised Standard Version (!rsv), Revised 1833 Webster's (!rwebster), World English Bible (!web), Webster's (!webster), Weymouth NT (!wey), Young's Literal Translation (!ylt), 21st Century King James Version (!kj21)" + putserv "NOTICE $nick :Non-English language Bibles (39):" + putserv "NOTICE $nick :Albanian Bible (!alb), Chinese GNPU (!gnpu), Danish Bible (!dan), Dutch Leidse Vertaling (!lei), Dutch Lutherse Vertaling (!lu), Dutch Statemvertaling (!svv), Equadoran Shuar NT (!shr), Filipino Nga Cebuano (!ceb), Finnish Pyhz Raamattu (!pr), French Louis Segond Version (!lsg), French Haitian Creole Version (!crl), French Darby's Version (!fredrb)," + putserv "NOTICE $nick :French Nouvelle Edition de Geneve (!neg), German Luther Version (!lut), German Schlachter (!sch), German Bengel NT (!ben), German Elberfelder Version (!elb), Hungarian Karoli (!kar), Indonesian Bahasa Indonesia Sehari-hari (!bis), Indonesian Terjemahan Baru (!tb), Italian La Nouva Diodati (!lnd), Italian La Sacra Bibbia Nuova Riveduta (!nrv)," + putserv "NOTICE $nick :Maori Bible (!maori), Melanesian Pidgin Bible (!mel), Norsk Bible (!norsk), Portuguese A Biblia Sagrada Traduzida em Portugues (!brp), Spanish La Biblia de Las Americas (!lba), Spanish Reina-Valera Actualizada (!rva), Spanish Reina-Valera (!rv), Spanish Sagradas Escrituras (!sev), Spanish Valera NT only (!vnt), Swahili NT (!swahili)," + putserv "NOTICE $nick :Swedish 1917 Bible NT only (!sve), Turkish NT (!turkish), Uma NT (!uma)" + putserv "NOTICE $nick :Original Language Bibles (18): (NB, /'s divide transliterated/non-roman versions)" + putserv "NOTICE $nick :1991 Byzantine/Majority Text (!byz/!grkbyz), Nestle-Aland 26th/27th Ed. (!na26/!grkna26), 1894 Scrivner Textus Receptus (!scrivner/!grkscrivner), 1550 Stephanus Textus Receptus (!stephanus/!grkstephanus), Tischendorf' 8th Ed. GNT (!tisch/!grktisch), 1881 Westcott-Hort GNT (!wh/!grkwh), 1881 Westcott-Hort with NA26 alternate readings (!whnu/!grkwhnu)" + putserv "NOTICE $nick: Nestle-Aland 27th Ed./UBS 4th Ed. (!n27u4), Septuagint/LXX (!lxx/!grklxx), Biblia Hebraica Stuttgartensia in Hebrew font (!bhs), Jerome's Latin Vulgate (!vulg)" + putserv "NOTICE $nick :Non-Roman character Bibles (5):" + putserv "NOTICE $nick :Arabic Bible (!arabic), Russian Synodal Translation (!rst), Ukrainian Bible (!ukrainian), Unaccented Modern Greek Bible (!umgreek), Vietnamese Bible (!viet)" + + if {($von==3) && (![matchattr $hand 3]) && (![matchattr $hand o]) && (![isvoice $nick $channel])} { + return 1 + } + + putserv "NOTICE $nick :Dictionaries & Indices (12):" + putserv "NOTICE $nick :Webster's Dictionary (!dict), Vine's Bible Dictionary(!vines), Easton's Bible Dictionary (!eastons), Nave's Topical Bible (!naves), Smith's Bible Dictionary (!smiths), Hitchcock's Bible Names Dictionary (!hitch), International Standard Bible Dictionary (!isbe), Torrey's New Topical Textbook (!torrey), Strong's Hebrew Bible Dictionary (!strheb), Strong's Greek Bible Dictionary (!strgrk), Brown-Driver-Briggs Hebrew Lexicon (!bdb), Thayer's Greek Lexicon (!thayer)" + putserv "NOTICE $nick :Commentaries (10):" + putserv "NOTICE $nick :Darby's Translation Notes (!dtn), Family Bible Notes (!family), Geneva Bible Translation Notes (!geneva), John Gill's Expositor (!gill), Matthew Henry's Concise (!mhc), The People's New Testament (!pnt), Robertson's Word Pictures (!rwp), The Fourfold Gospel (!tfg), Treasury of Scriptural Knowledge (!tsk), Wesley's Bible Notes (!wesley)" +} + +#---------------------------------------------------------------------- + +bind pub - !status pub_status +bind msg - status pub_status + +proc pub_status {nick uhost hand channel arg} { + global von + + if {$von==0} { + putserv "NOTICE $nick :All BibleBot displays are currently off." + } elseif {$von==1} { + putserv "NOTICE $nick :All BibleBot displays are currently on." + } elseif {$von==2} { + putserv "NOTICE $nick :All BibleBot displays are currently on for ops only." + } else { + putserv "NOTICE $nick :Verse displays are currently on for all users, but other BibleBot displays are currently restricted to ops and voiced users." + } + return 1 +} + + +bind pub - !history pub_hist +bind msg - history pub_hist + +proc pub_hist {nick uhost hand channel arg} { + global botnick + catch {exec tail -n 5 /var/log/diatheke.log >& /tmp/fooout.$botnick} + catch {set foofile [open /tmp/fooout.$botnick]} + catch {set fooverse [gets $foofile]} + putserv "NOTICE $nick :Last 5 calls to Diatheke/Tcl BibleBot" + putserv "NOTICE $nick :$fooverse" + while {[gets $foofile fooverse] >= 0} { + putserv "NOTICE $nick :$fooverse" + } + catch {close $foofile} + exec rm /tmp/fooout.$botnick + return 1 +} + +#--------------------------------------------------------------------- + +proc pub_verseon {nick uhost hand channel arg} { + global von + if {![matchattr $hand 3] && ![matchattr $hand o]} { + return 0 + } elseif {$arg=="v"} { + set von 3 +# putserv "NOTICE $nick :Long Text Display is now on for voiced only!" + } elseif {$arg=="o"} { + set von 2 +# putserv "NOTICE $nick :Verse Display is now on for ops only!" + } else { + set von 1 +# putserv "NOTICE $nick :All Display is now on!" + } + pub_status $nick $uhost $hand $channel $arg + return 1 +} +bind pub - !verseon pub_verseon +bind msg - verseon pub_verseon + +proc pub_verseoff {nick uhost hand channel arg} { + global von + + if {![matchattr $hand 3] && ![matchattr $hand o]} { + return 0 + } + set von 0 +# putserv "NOTICE $nick :Verse Display is now off!" + pub_status $nick $uhost $hand $channel $arg + return 1 +} +bind pub - !verseoff pub_verseoff +bind msg - verseoff pub_verseoff + +proc dcc_verseoff {hand idx arg} { + global von + global whovoff + if {![matchattr $hand 3] && ![matchattr $hand o]} { + return 0 + } + set von 0 + set whovoff $hand + return 1 +} +bind dcc - verseoff dcc_verseoff + +proc dcc_verseon {hand idx arg} { + global von + if {![matchattr $hand 3] && ![matchattr $hand o]} { + return 0 + } + elseif {$arg=="v"} { + set von 3 + } + elseif {$arg=="o"} { + set von 2 + } else { + set von 1 + } + return 1 +} +bind dcc - verseon dcc_verseon + +#sets default von mode +set von 1 + + + + + + + + + + + + + + + diff --git a/utilities/diatheke/thmlcgi.cpp b/utilities/diatheke/thmlcgi.cpp new file mode 100644 index 0000000..5ad180d --- /dev/null +++ b/utilities/diatheke/thmlcgi.cpp @@ -0,0 +1,193 @@ +/*************************************************************************** + thmlcgi.cpp - ThML to Diatheke/CGI format + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include "thmlcgi.h" +#include + +SWORD_NAMESPACE_START + +ThMLCGI::ThMLCGI() { + setTokenStart("<"); + setTokenEnd(">"); + + setTokenCaseSensitive(true); + + addTokenSubstitute("note", " ("); + addTokenSubstitute("/note", ") "); +} + + +bool ThMLCGI::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) { + unsigned long i; + if (!substituteToken(buf, token)) { + // manually process if it wasn't a simple substitution + if (!strncmp(token, "sync ", 5)) { + buf += ""; + + if (*val) { + buf += val; + } + buf += ""; + } + + else if (!strncmp(token, "scripRef p", 10) || !strncmp(token, "scripRef v", 10)) { + userData["inscriptRef"] = "true"; + buf += ""; + } + + // we're starting a scripRef like "John 3:16" + else if (!strcmp(token, "scripRef")) { + userData["inscriptRef"] = "false"; + // let's stop text from going to output + userData["suspendTextPassThru"] = "true"; + } + + // we've ended a scripRef + else if (!strcmp(token, "/scripRef")) { + if (userData["inscriptRef"] == "true") { // like "John 3:16" + userData["inscriptRef"] = "false"; + buf += ""; + } + + else { // like "John 3:16" + buf += ""; + buf += userData["lastTextNode"].c_str(); + // let's let text resume to output again + userData["suspendTextPassThru"] = "false"; + buf += ""; + } + } + + else if (!strncmp(token, "div class=\"sechead\"", 19)) { + userData["SecHead"] = "true"; + buf += "
"; + } + else if (!strncmp(token, "div class=\"title\"", 19)) { + userData["SecHead"] = "true"; + buf += "
"; + } + else if (!strncmp(token, "/div", 4)) { + if (userData["SecHead"] == "true") { + buf += "
"; + userData["SecHead"] = "false"; + } + } + + else if(!strncmp(token, "note", 4)) { + buf += " {"; + } + + else { + buf += '<'; + for (i = 0; i < strlen(token); i++) + buf += token[i]; + buf += '>'; + //return false; // we still didn't handle token + } + } + return true; +} + + + + + + +SWORD_NAMESPACE_END diff --git a/utilities/diatheke/thmlcgi.h b/utilities/diatheke/thmlcgi.h new file mode 100644 index 0000000..efa9018 --- /dev/null +++ b/utilities/diatheke/thmlcgi.h @@ -0,0 +1,38 @@ +/*************************************************************************** + thmlcgi.h - OSIS to Diatheke/CGI format + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef THMLCGI_H +#define THMLCGI_H + +#include +#include + +#include + +SWORD_NAMESPACE_START + +typedef std::map DualStringMap; +/** this filter converts ThML text to Diatheke/CGI format + */ +class SWDLLEXPORT ThMLCGI : public SWBasicFilter { +protected: + virtual bool handleToken(SWBuf &buf, const char *token, DualStringMap &userData); +public: + ThMLCGI(); +}; + +SWORD_NAMESPACE_END +#endif -- cgit v1.2.3