From a88d2ae0574ef1422da03fe36a0d339a2af8cd88 Mon Sep 17 00:00:00 2001 From: danglassey Date: Sat, 7 Sep 2002 13:01:15 +0000 Subject: sync with crosswire 20020907-1300 --- INSTALL | 4 +- examples/cmdline/Makefile | 24 +++++----- utilities/bcppmake/cipherraw.bpf | 6 +-- utilities/bcppmake/cipherraw.bpr | 6 +-- utilities/bcppmake/imp2gbs.bpf | 6 +-- utilities/bcppmake/imp2gbs.bpr | 6 +-- utilities/bcppmake/imp2ld.bpf | 6 +-- utilities/bcppmake/imp2ld.bpr | 6 +-- utilities/bcppmake/imp2vs.bpf | 6 +-- utilities/bcppmake/imp2vs.bpr | 6 +-- utilities/bcppmake/mkfastmod.bpf | 6 +-- utilities/bcppmake/mkfastmod.bpr | 6 +-- utilities/bcppmake/mod2imp.bpf | 6 +-- utilities/bcppmake/mod2imp.bpr | 6 +-- utilities/bcppmake/mod2vpl.bpf | 6 +-- utilities/bcppmake/mod2vpl.bpr | 6 +-- utilities/bcppmake/mod2zmod.bpf | 6 +-- utilities/bcppmake/mod2zmod.bpr | 6 +-- utilities/bcppmake/thml2gbs.bpf | 6 +-- utilities/bcppmake/thml2gbs.bpr | 31 ++++++++----- utilities/bcppmake/vpl2mod.bpf | 6 +-- utilities/bcppmake/vpl2mod.bpr | 6 +-- utilities/imp2ld.cpp | 73 ++++++++++++++++++++++++------- utilities/imp2vs.cpp | 94 ++++++---------------------------------- utilities/kylixmake/mod2zmod.bpr | 4 +- utilities/mod2zmod.cpp | 7 ++- utilities/thml2gbs.cpp | 16 +++---- 27 files changed, 178 insertions(+), 189 deletions(-) diff --git a/INSTALL b/INSTALL index d8955fc..e4efd2c 100644 --- a/INSTALL +++ b/INSTALL @@ -57,13 +57,13 @@ http://www.crosswire.org or various mirrors. In a default SWORD configuration, a module install may look like this: -[download a module with you favourite client] +[download a module with your favourite client] su cd /usr/share/sword unzip ~/KJV.zip -If you want the detail, read on... +If you want the details, read on... A file named 'mods.conf' or directory named 'mods.d' contains all configuration diff --git a/examples/cmdline/Makefile b/examples/cmdline/Makefile index d01afb0..951d05e 100644 --- a/examples/cmdline/Makefile +++ b/examples/cmdline/Makefile @@ -38,10 +38,10 @@ pkglibdir = $(libdir)/sword pkgincludedir = $(includedir)/sword top_builddir = ../.. -ACLOCAL = ${SHELL} /space/home/scribe/src/sword/missing --run aclocal-1.6 -AUTOCONF = ${SHELL} /space/home/scribe/src/sword/missing --run autoconf -AUTOMAKE = ${SHELL} /space/home/scribe/src/sword/missing --run automake-1.6 -AUTOHEADER = ${SHELL} /space/home/scribe/src/sword/missing --run autoheader +ACLOCAL = ${SHELL} /home/scribe/src/sword/missing --run aclocal-1.6 +AUTOCONF = ${SHELL} /home/scribe/src/sword/missing --run autoconf +AUTOMAKE = ${SHELL} /home/scribe/src/sword/missing --run automake-1.6 +AUTOHEADER = ${SHELL} /home/scribe/src/sword/missing --run autoheader am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = /usr/bin/install -c @@ -65,27 +65,27 @@ host_triplet = i686-pc-linux-gnu EXEEXT = OBJEXT = o PATH_SEPARATOR = : -AMTAR = ${SHELL} /space/home/scribe/src/sword/missing --run tar +AMTAR = ${SHELL} /home/scribe/src/sword/missing --run tar AS = @AS@ AWK = gawk CC = gcc CURL_CFLAGS = CURL_CONFIG = /usr/bin/curl-config -CURL_LIBS = -lcurl -lssl -lcrypto -ldl +CURL_LIBS = -lssl -lcrypto -ldl CXX = g++ DEPDIR = .deps DLLTOOL = @DLLTOOL@ ECHO = echo -GENCCODE = /usr/sbin/genccode -GENCMN = /usr/sbin/gencmn -GENRB = /usr/sbin/genrb +GENCCODE = +GENCMN = +GENRB = INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s LIBTOOL = $(SHELL) $(top_builddir)/libtool LN_S = ln -s MAINT = # OBJDUMP = @OBJDUMP@ PACKAGE = sword -PKGDATA = /usr/sbin/pkgdata +PKGDATA = RANLIB = ranlib STRIP = strip VERSION = 1.5.4 @@ -94,14 +94,14 @@ am__quote = dir_confdef = no enable_debug = yes enable_profile = no -install_sh = /space/home/scribe/src/sword/install-sh +install_sh = /home/scribe/src/sword/install-sh target_cpu = i686 target_mingw32 = no target_os = linux-gnu target_system = intel target_vendor = pc with_conf = no -with_icu = yes +with_icu = no with_zlib = yes AUTOMAKE_OPTIONS = 1.6 INCLUDES = -I $(top_srcdir)/include diff --git a/utilities/bcppmake/cipherraw.bpf b/utilities/bcppmake/cipherraw.bpf index 3df5169..03a9c8a 100644 --- a/utilities/bcppmake/cipherraw.bpf +++ b/utilities/bcppmake/cipherraw.bpf @@ -1,8 +1,8 @@ USEUNIT("..\cipherraw.cpp"); USELIB("libsword.lib"); -USELIB("..\..\..\icu-sword\as_is\win32\borland\icui18n.lib"); -USELIB("..\..\..\icu-sword\as_is\win32\borland\icudatab.lib"); -USELIB("..\..\..\icu-sword\as_is\win32\borland\icucommon.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icui18n.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icucommon.lib"); //--------------------------------------------------------------------------- This file is used by the project manager only and should be treated like the project file diff --git a/utilities/bcppmake/cipherraw.bpr b/utilities/bcppmake/cipherraw.bpr index 096e325..b2e0df9 100644 --- a/utilities/bcppmake/cipherraw.bpr +++ b/utilities/bcppmake/cipherraw.bpr @@ -10,9 +10,9 @@ - + - + - + - + - + - + - + - + - + - + @@ -34,11 +34,14 @@ - - + + + - - + + @@ -92,9 +95,10 @@ Count=1 Item0=$(BCB)\source\vcl [HistoryLists\hlConditionals] -Count=2 -Item0=_ICU_;_ICUSWORD_ -Item1=_DEBUG +Count=3 +Item0=_ICU_;_ICUSWORD_;_DEBUG +Item1=_ICU_;_ICUSWORD_ +Item2=_DEBUG [Debugging] DebugSourceDirs=$(BCB)\source\vcl @@ -111,6 +115,11 @@ ShowInfoMsgs=0 LinkDebugVcl=0 LinkCGLIB=0 +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + [Language] ActiveLang= ProjectLang= diff --git a/utilities/bcppmake/vpl2mod.bpf b/utilities/bcppmake/vpl2mod.bpf index eb4b2c6..a31520b 100644 --- a/utilities/bcppmake/vpl2mod.bpf +++ b/utilities/bcppmake/vpl2mod.bpf @@ -1,8 +1,8 @@ USEUNIT("..\vpl2mod.cpp"); USELIB("libsword.lib"); -USELIB("..\..\..\icu-sword\as_is\win32\borland\icui18n.lib"); -USELIB("..\..\..\icu-sword\as_is\win32\borland\icudatab.lib"); -USELIB("..\..\..\icu-sword\as_is\win32\borland\icucommon.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icui18n.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icudatab.lib"); +USELIB("..\..\..\icu-sword\as_is\borland\icucommon.lib"); //--------------------------------------------------------------------------- This file is used by the project manager only and should be treated like the project file diff --git a/utilities/bcppmake/vpl2mod.bpr b/utilities/bcppmake/vpl2mod.bpr index 9eeb06d..54810be 100644 --- a/utilities/bcppmake/vpl2mod.bpr +++ b/utilities/bcppmake/vpl2mod.bpr @@ -10,9 +10,9 @@ - + [modname] [ 4 (default) | 2 | z - module driver]\n"; - + signed long i = 0; char* keybuffer = new char[2048]; char* entbuffer = new char[1048576]; char* linebuffer = new char[1048576]; char modname[16]; - + char links = 0; + char* linkbuffer[32]; + while (i < 32) { + linkbuffer[i] = new char[256]; + i++; + } if (argc > 2) { strcpy (modname, argv[2]); } @@ -57,7 +62,7 @@ int main(int argc, char **argv) { fprintf(stderr, helptext, argv[0]); exit(-1); } - + FILE *infile; infile = fopen(argv[1], "r"); @@ -74,7 +79,7 @@ int main(int argc, char **argv) { mode = 1; } } - + zLD* modZ; RawLD* mod2; RawLD4* mod4; @@ -95,9 +100,9 @@ int main(int argc, char **argv) { mod4 = new RawLD4(modname); key = mod4->CreateKey(); } - + key->Persist(1); - + while (readline(infile, linebuffer)) { if (!strncmp(linebuffer, "$$$", 3)) { if (strlen(keybuffer) && strlen(entbuffer)) { @@ -107,19 +112,40 @@ int main(int argc, char **argv) { if (mode == 3) { modZ->setKey(*key); modZ->setEntry(entbuffer, strlen(entbuffer)); + for (i = 0; i < links; i++) { + SWKey tmpkey = linkbuffer[i]; + modZ->linkEntry(&tmpkey); + std::cout << "Linking: " << linkbuffer[i] << std::endl; + } } else if (mode == 2) { mod2->setKey(*key); mod2->setEntry(entbuffer, strlen(entbuffer)); + for (i = 0; i < links; i++) { + SWKey tmpkey = linkbuffer[i]; + mod2->linkEntry(&tmpkey); + std::cout << "Linking: " << linkbuffer[i] << std::endl; + } } else if (mode == 1) { mod4->setKey(*key); mod4->setEntry(entbuffer, strlen(entbuffer)); + for (i = 0; i < links; i++) { + SWKey tmpkey = linkbuffer[i]; + mod4->linkEntry(&tmpkey); + std::cout << "Linking: " << linkbuffer[i] << std::endl; + } } } linebuffer[strlen(linebuffer) - 1] = 0; strcpy (keybuffer, linebuffer + 3); *entbuffer = 0; + links = 0; + } + else if (!strncmp(linebuffer, "%%%", 3)) { + strcpy (linkbuffer[links], linebuffer + 3); + linkbuffer[links][strlen(linkbuffer[links]) - 1] = 0; + links++; } else { strcat (entbuffer, linebuffer); @@ -132,24 +158,41 @@ int main(int argc, char **argv) { *key = keybuffer; if (mode == 3) { - modZ->setKey(*key); - modZ->setEntry(entbuffer, strlen(entbuffer)); + modZ->setKey(*key); + modZ->setEntry(entbuffer, strlen(entbuffer)); + for (i = 0; i < links; i++) { + SWKey tmpkey = linkbuffer[i]; + modZ->linkEntry(&tmpkey); + std::cout << "Linking: " << linkbuffer[i] << std::endl; + } } else if (mode == 2) { - mod2->setKey(*key); - mod2->setEntry(entbuffer, strlen(entbuffer)); + mod2->setKey(*key); + mod2->setEntry(entbuffer, strlen(entbuffer)); + for (i = 0; i < links; i++) { + SWKey tmpkey = linkbuffer[i]; + mod2->linkEntry(&tmpkey); + std::cout << "Linking: " << linkbuffer[i] << std::endl; + } + } else if (mode == 1) { - mod4->setKey(*key); - mod4->setEntry(entbuffer, strlen(entbuffer)); + mod4->setKey(*key); + mod4->setEntry(entbuffer, strlen(entbuffer)); + for (i = 0; i < links; i++) { + SWKey tmpkey = linkbuffer[i]; + mod4->linkEntry(&tmpkey); + std::cout << "Linking: " << linkbuffer[i] << std::endl; + } + } } - + //DEBUG printTree(root, treeKey); delete keybuffer; delete entbuffer; delete linebuffer; - + return 0; } diff --git a/utilities/imp2vs.cpp b/utilities/imp2vs.cpp index 9a47301..c7ee1c6 100644 --- a/utilities/imp2vs.cpp +++ b/utilities/imp2vs.cpp @@ -59,15 +59,18 @@ int main(int argc, char **argv) { RawText::createModule(modname); RawText modRaw(modname); mod = &modRaw; - + VerseKey* vkey = new VerseKey; vkey->Headings(1); vkey->AutoNormalize(0); vkey->Persist(1); mod->setKey(*vkey); - - while (readline(infile, linebuffer)) { - if (!strncmp(linebuffer, "$$$", 3)) { + char final; // 2 == pre-final line; 1 == final line; 0 == EOF + + final = ((bool)(readline(infile, linebuffer)) + 1); + + while (final) { + if (!strncmp(linebuffer, "$$$", 3) || final == 1) { if (strlen(keybuffer) && strlen(entbuffer)) { std::cout << "from file: " << keybuffer << std::endl; *vkey = keybuffer; @@ -87,7 +90,7 @@ int main(int argc, char **argv) { } vkey->Verse(0); } - + std::cout << "adding entry: " << *vkey << std::endl; mod->setEntry(entbuffer, strlen(entbuffer)); } @@ -108,12 +111,12 @@ int main(int argc, char **argv) { if (!havefirst) { havefirst = true; firstverse = *vkey; - + std::cout << "adding entry: " << *vkey << std::endl; mod->setEntry(entbuffer, strlen(entbuffer)); (*vkey)++; } - while (*vkey <= finalkey) { + while (! (finalkey < (*vkey))) { std::cout << "linking entry: " << *vkey << " to " << firstverse << std::endl; *mod << &firstverse; (*vkey)++; @@ -129,7 +132,7 @@ int main(int argc, char **argv) { *vkey = (*listkey.GetElement(i)); havefirst = true; firstverse = *vkey; - + std::cout << "adding entry: " << *vkey << std::endl; mod->setEntry(entbuffer, strlen(entbuffer)); } @@ -144,81 +147,12 @@ int main(int argc, char **argv) { else { strcat (entbuffer, linebuffer); } - } - - //handle final entry - if (strlen(keybuffer) && strlen(entbuffer)) { - std::cout << "from file: " << keybuffer << std::endl; - *vkey = keybuffer; - if (!vkey->Chapter()) { - // bad hack: 0:0 is Book intro; (chapter):0 is Chapter intro; 0:2 is Module intro; 0:1 is Testament intro - int backstep = vkey->Verse(); - if (backstep) { - vkey->Verse(1); - vkey->Chapter(1); - switch (backstep) { - case 2: - vkey->Book(1); - vkey->Testament(0); - case 1: - vkey->Book(0); - vkey->Chapter(0); - } - vkey->Verse(0); - } - - std::cout << "adding entry: " << *vkey << std::endl; - mod->setEntry(entbuffer, strlen(entbuffer)); - } - else { - ListKey listkey = vkey->ParseVerseList(keybuffer, "Gen1:1", true); - int i; - bool havefirst = false; - VerseKey firstverse; - firstverse.Headings(1); - firstverse.AutoNormalize(0); - for (i = 0; i < listkey.Count(); i++) { - VerseKey *element = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(i)); - if (element) { - *vkey = element->LowerBound(); - VerseKey finalkey = element->UpperBound(); - finalkey.Headings(1); - finalkey.AutoNormalize(0); - if (!havefirst) { - havefirst = true; - firstverse = *vkey; - - std::cout << "adding entry: " << *vkey << std::endl; - mod->setEntry(entbuffer, strlen(entbuffer)); - (*vkey)++; - } - while (*vkey <= finalkey) { - std::cout << "linking entry: " << *vkey << " to " << firstverse << std::endl; - *(SWModule*)mod << &firstverse; - (*vkey)++; - } - } - else { - if (havefirst) { - *vkey = (*listkey.GetElement(i)); - std::cout << "linking entry: " << *vkey << " to " << firstverse << std::endl; - *mod << &firstverse; - } - else { - *vkey = (*listkey.GetElement(i)); - havefirst = true; - firstverse = *vkey; - - std::cout << "adding entry: " << *vkey << std::endl; - mod->setEntry(entbuffer, strlen(entbuffer)); - } - } - } + final--; + if (final) { + final = ((bool)(readline(infile, linebuffer)) + 1); } } - //DEBUG printTree(root, treeKey); - delete entbuffer; delete linebuffer; delete keybuffer; diff --git a/utilities/kylixmake/mod2zmod.bpr b/utilities/kylixmake/mod2zmod.bpr index bc5ed1f..dc399a7 100644 --- a/utilities/kylixmake/mod2zmod.bpr +++ b/utilities/kylixmake/mod2zmod.bpr @@ -71,10 +71,10 @@ Item0=_DEBUG DebugSourceDirs= [Parameters] -RunParams= +RunParams=TEST ~/.sword/ztest/ 3 2 Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% UseLauncher=0 -DebugCWD= +DebugCWD=/space/home/scribe/src/sword/utilities/kylixmake HostApplication= [Compiler] diff --git a/utilities/mod2zmod.cpp b/utilities/mod2zmod.cpp index f015868..7d64b54 100644 --- a/utilities/mod2zmod.cpp +++ b/utilities/mod2zmod.cpp @@ -117,6 +117,7 @@ int main(int argc, char **argv) string lastBuffer = "Something that would never be first module entry"; SWKey bufferKey; + SWKey lastBufferKey; SWKey *outModuleKey = outModule->CreateKey(); VerseKey *vkey = SWDYNAMIC_CAST(VerseKey, outModuleKey); outModuleKey->Persist(1); @@ -132,11 +133,13 @@ int main(int argc, char **argv) bufferKey = *(SWKey *)(*inModule); // pseudo-check for link. Will get most common links. if ((lastBuffer == inModule->getRawEntry()) &&(lastBuffer.length() > 0)) { - (*outModule) << &bufferKey; // link to last key - cout << "Adding [" << bufferKey << "] link to: \n"; + *outModuleKey = bufferKey; + outModule->linkEntry(&lastBufferKey); // link to last key + cout << "Adding [" << bufferKey << "] link to: [" << lastBufferKey << "]\n"; } else { lastBuffer = inModule->getRawEntry(); + lastBufferKey = inModule->KeyText(); if (lastBuffer.length() > 0) { cout << "Adding [" << bufferKey << "] new text. \n"; *outModuleKey = bufferKey; diff --git a/utilities/thml2gbs.cpp b/utilities/thml2gbs.cpp index e95f4ab..df85806 100644 --- a/utilities/thml2gbs.cpp +++ b/utilities/thml2gbs.cpp @@ -103,9 +103,8 @@ int main(int argc, char **argv) { char* n = new char[256]; char* type = new char[256]; char* title= new char[512]; - - char* strtmp; + char* strtmp; if (argc > 2) { strcpy (modname, argv[2]); } @@ -120,7 +119,6 @@ int main(int argc, char **argv) { exit(-1); } - FILE *infile; infile = fopen(argv[1], "r"); FILE *outfile; @@ -128,7 +126,7 @@ int main(int argc, char **argv) { strcat (modname, ".imp"); outfile = fopen(modname, "w"); } - + TreeKeyIdx * treeKey; RawGenBook *book; @@ -142,7 +140,7 @@ int main(int argc, char **argv) { //DEBUG TreeKeyIdx root = *((TreeKeyIdx *)((SWKey *)(*book))); treeKey = ((TreeKeyIdx *)((SWKey *)(*book))); } - + int c; while ((c = fgetc(infile)) != EOF) { if (c == '<') { @@ -160,7 +158,7 @@ int main(int argc, char **argv) { } if (level) { - std::cout << keybuffer << std::endl; + printf ("%s\n", keybuffer); if (exportfile) { fprintf (outfile, "$$$%s\n%s\n", keybuffer, entbuffer); } @@ -200,7 +198,7 @@ int main(int argc, char **argv) { } if (level) { - std::cout << keybuffer << std::endl; + printf ("%s\n", keybuffer); if (exportfile) { fprintf (outfile, "$$$%s\n%s\n", keybuffer, entbuffer); } @@ -227,7 +225,7 @@ int main(int argc, char **argv) { } } keybuffer[keysize] = 0; - + type[0] = 0; strtmp = strstr(keybuffer, "type=\""); if (strtmp) { @@ -303,7 +301,9 @@ int main(int argc, char **argv) { entbuffer[entrysize] = 0; } } + //DEBUG printTree(root, treeKey); + return 0; delete treeKey; delete book; -- cgit