[sword-svn] r1708 - in trunk: . include src/keys src/mgr src/utilfuns tests tests/testsuite

scribe at crosswire.org scribe at crosswire.org
Fri Feb 4 01:13:53 MST 2005


Author: scribe
Date: 2005-02-04 01:13:53 -0700 (Fri, 04 Feb 2005)
New Revision: 1708

Modified:
   trunk/configure.ac
   trunk/include/ftptrans.h
   trunk/src/keys/versekey.cpp
   trunk/src/mgr/ftplibftpt.cpp
   trunk/src/mgr/ftptrans.cpp
   trunk/src/mgr/stringmgr.cpp
   trunk/src/utilfuns/Makefile.am
   trunk/tests/Makefile.am
   trunk/tests/testsuite/verseparsing.good
   trunk/tests/tlitmgrtest.cpp
   trunk/usrinst.sh
Log:
Made FTPLib transport work again after I broke it when separating in diff classes.
Added usage of ICU if present in StringMgr
change around some parsing logic in versekey-- seems we've gone backwards.  Still need to debug.
Newest ICU apparently doesn't need rbt.h, also let icu-config tell us what libs to include
Added protected SWBuf FTPTransport::host;



Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/configure.ac	2005-02-04 08:13:53 UTC (rev 1708)
@@ -288,6 +288,7 @@
 #AM_CONDITIONAL(INTERNALFTPLIB, test x$with_installmgr = xinternal)
 #AM_CONDITIONAL(WITHCURL, test x$with_installmgr = xcurl)
 AM_CONDITIONAL(WITHCURL, test x$with_curl = xyes)
+AM_CONDITIONAL(INTERNALFTPLIB, test x$with_curl != xyes)
 #AM_CONDITIONAL(WITHFTPLIB, test x$with_installmgr = xftplib)
 AM_CONDITIONAL(CONFDEF, test x$dir_confdef = xyes)
 AM_CONDITIONAL(USE_PKGCONF, test x$use_pkgconfig = xyes)

Modified: trunk/include/ftptrans.h
===================================================================
--- trunk/include/ftptrans.h	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/include/ftptrans.h	2005-02-04 08:13:53 UTC (rev 1708)
@@ -3,6 +3,7 @@
 
 #include <vector>
 #include <defs.h>
+#include <swbuf.h>
 
 //SWORD_NAMESPACE_START
 
@@ -31,6 +32,7 @@
 	StatusReporter *statusReporter;
 	bool passive;
 	bool term;
+	SWBuf host;
 	
 public:
 	FTPTransport(const char *host, StatusReporter *statusReporter = 0);

Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/src/keys/versekey.cpp	2005-02-04 08:13:53 UTC (rev 1708)
@@ -414,6 +414,16 @@
 	
 	while (*buf) {
 		switch (*buf) {
+		case ':':
+			if (buf[1] != ' ') {		// for silly Mat 1:1: this verse....
+				number[tonumber] = 0;
+				tonumber = 0;
+				if (*number)
+					chap = atoi(number);
+				*number = 0;
+				break;
+			}
+			// otherwise drop down to next case
 		case ' ':
 			inTerm = true;
 			while (true) {
@@ -429,16 +439,6 @@
 				book[tobook++] = ' ';
 				break;
 			}
-		case ':':
-			if (buf[1] != ' ') {		// for silly Mat 1:1: this verse....
-				number[tonumber] = 0;
-				tonumber = 0;
-				if (*number)
-					chap = atoi(number);
-				*number = 0;
-				break;
-			}
-			// otherwise drop down to next case
 
 		case '-': 
 		case ',': // on number new verse

Modified: trunk/src/mgr/ftplibftpt.cpp
===================================================================
--- trunk/src/mgr/ftplibftpt.cpp	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/src/mgr/ftplibftpt.cpp	2005-02-04 08:13:53 UTC (rev 1708)
@@ -53,21 +53,23 @@
 
 char FTPLibFTPTransport::getURL(const char *destPath, const char *sourceURL) {
 	char retVal = 0;
-	fprintf(stderr, "getting file %s to %s\n", sourceURL, destPath);
+	SWBuf sourcePath = sourceURL;
+	sourcePath << (6 + host.length()); // shift << "ftp://hostname";
+	fprintf(stderr, "getting file %s to %s\n", sourcePath.c_str(), destPath);
 	if (passive)
 		FtpOptions(FTPLIB_CONNMODE, FTPLIB_PASSIVE, (netbuf *)nControl);
 	else
 		FtpOptions(FTPLIB_CONNMODE, FTPLIB_PORT, (netbuf *)nControl);
 	// !!!WDG also want to set callback options
 	if (!strcmp(destPath, "dirlist")) {
-		fprintf(stderr, "getting test directory %s\n", sourceURL);
-		FtpDir(NULL, sourceURL, (netbuf *)nControl);
-		fprintf(stderr, "getting real directory %s\n", sourceURL);
-		retVal = FtpDir(destPath, sourceURL, (netbuf *)nControl) - 1;
+		fprintf(stderr, "getting test directory %s\n", sourcePath.c_str());
+		FtpDir(NULL, sourcePath, (netbuf *)nControl);
+		fprintf(stderr, "getting real directory %s\n", sourcePath.c_str());
+		retVal = FtpDir(destPath, sourcePath, (netbuf *)nControl) - 1;
 	}
 	else {
-		fprintf(stderr, "getting file %s\n", sourceURL);
-		retVal = FtpGet(destPath, sourceURL, FTPLIB_IMAGE, (netbuf *)nControl) - 1;
+		fprintf(stderr, "getting file %s\n", sourcePath.c_str());
+		retVal = FtpGet(destPath, sourcePath, FTPLIB_IMAGE, (netbuf *)nControl) - 1;
 	}
 
 	return retVal;

Modified: trunk/src/mgr/ftptrans.cpp
===================================================================
--- trunk/src/mgr/ftptrans.cpp	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/src/mgr/ftptrans.cpp	2005-02-04 08:13:53 UTC (rev 1708)
@@ -32,8 +32,9 @@
 }
 
 
-FTPTransport::FTPTransport(const char *host, StatusReporter *sr) {
-	statusReporter = sr;
+FTPTransport::FTPTransport(const char *host, StatusReporter *statusReporter) {
+	this->statusReporter = statusReporter;
+	this->host = host;
 	term = false;
 }
 

Modified: trunk/src/mgr/stringmgr.cpp
===================================================================
--- trunk/src/mgr/stringmgr.cpp	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/src/mgr/stringmgr.cpp	2005-02-04 08:13:53 UTC (rev 1708)
@@ -97,13 +97,13 @@
 */
 StringMgr* StringMgr::getSystemStringMgr() {
 	if (!m_systemStringMgr) {
-/*#ifndef _ICU_*/
+#ifdef _ICU_
+		m_systemStringMgr = new ICUStringMgr();
+// 		SWLog::getSystemLog()->logInformation("created default ICUStringMgr");
+#else
 		m_systemStringMgr = new StringMgr();
 //  		SWLog::getSystemLog()->logInformation("created default StringMgr");
-/*#else
-		m_systemStringMgr = new ICUStringMgr();
- 		SWLog::getSystemLog()->logInformation("created default IcuStringMgr");
-#endif	*/
+#endif
 	}
 	
 	return m_systemStringMgr;

Modified: trunk/src/utilfuns/Makefile.am
===================================================================
--- trunk/src/utilfuns/Makefile.am	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/src/utilfuns/Makefile.am	2005-02-04 08:13:53 UTC (rev 1708)
@@ -11,11 +11,11 @@
 libsword_la_SOURCES += $(utilfunsdir)/ftpparse.c
 libsword_la_SOURCES += $(utilfunsdir)/url.cpp
 
-#if INTERNALFTPLIB
-#ftpsrc = $(utilfunsdir)/ftplib.c
-#else
-#ftpsrc =
-#endif
+if INTERNALFTPLIB
+ftpsrc = $(utilfunsdir)/ftplib.c
+else
+ftpsrc =
+endif
 
 if ZLIB
 UNTGZ = $(utilfunsdir)/zlib/untgz.c
@@ -24,7 +24,7 @@
 endif
 
 libsword_la_SOURCES += $(UNTGZ) 
-#libsword_la_SOURCES += $(ftpsrc)
+libsword_la_SOURCES += $(ftpsrc)
 
 if MINGW
 SWREGEX = $(utilfunsdir)/regex.c

Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/tests/Makefile.am	2005-02-04 08:13:53 UTC (rev 1708)
@@ -33,7 +33,7 @@
 icutest_SOURCES = icutest.cpp
 translittest_SOURCES = translittest.cpp
 tlitmgrtest_SOURCES = tlitmgrtest.cpp
-tlitmgrtest_LDADD = -lustdio
+#tlitmgrtest_LDADD = -lustdio
 endif
 
 if ZLIB

Modified: trunk/tests/testsuite/verseparsing.good
===================================================================
--- trunk/tests/testsuite/verseparsing.good	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/tests/testsuite/verseparsing.good	2005-02-04 08:13:53 UTC (rev 1708)
@@ -43,13 +43,23 @@
 1. Johannes 1:1 - 1. Johannes 3:10
 1. Johannes 1:1 - 1. Johannes 3:10
 I John 1:1 - I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
-I John 1:1, I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10
+I John 1:1
+I John 3:10

Modified: trunk/tests/tlitmgrtest.cpp
===================================================================
--- trunk/tests/tlitmgrtest.cpp	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/tests/tlitmgrtest.cpp	2005-02-04 08:13:53 UTC (rev 1708)
@@ -219,7 +219,7 @@
 }
 */
 
-#include "unicode/rbt.h"
+//#include "unicode/rbt.h"
 #include "unicode/resbund.h"
 #include "unicode/translit.h"
 #include "unicode/ustream.h"

Modified: trunk/usrinst.sh
===================================================================
--- trunk/usrinst.sh	2005-02-02 15:41:54 UTC (rev 1707)
+++ trunk/usrinst.sh	2005-02-04 08:13:53 UTC (rev 1708)
@@ -4,11 +4,12 @@
 OPTIONS="--disable-shared $OPTIONS"
 OPTIONS="--without-conf $OPTIONS"
 OPTIONS="--sysconfdir=/etc $OPTIONS"
-#OPTIONS="--with-icu $OPTIONS"
+OPTIONS="--with-icu $OPTIONS"
 #OPTIONS="--with-vcl $OPTIONS"
 OPTIONS="--enable-debug $OPTIONS"
 #OPTIONS="--enable-profile $OPTIONS"
 #OPTIONS="--with-lucene $OPTIONS"
+#OPTIONS="--without-curl $OPTIONS"
 #OPTIONS="--enable-tests $OPTIONS"
 
 



More information about the sword-cvs mailing list