[sword-svn] r2284 - in trunk: . include src/modules/common utilities

scribe at crosswire.org scribe at crosswire.org
Mon Mar 16 12:53:42 MST 2009


Author: scribe
Date: 2009-03-16 12:53:42 -0700 (Mon, 16 Mar 2009)
New Revision: 2284

Modified:
   trunk/
   trunk/include/rawcom.h
   trunk/include/rawcom4.h
   trunk/include/rawtext.h
   trunk/include/rawtext4.h
   trunk/include/rawverse.h
   trunk/include/rawverse4.h
   trunk/include/utilstr.h
   trunk/include/versemgr.h
   trunk/include/zcom.h
   trunk/include/ztext.h
   trunk/include/zverse.h
   trunk/src/modules/common/rawverse.cpp
   trunk/src/modules/common/rawverse4.cpp
   trunk/src/modules/common/zverse.cpp
   trunk/utilities/imp2vs.cpp
Log:
Added v11n support to createModule methods
Added v11n param to imp2vs



Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
   - .deps
.libs
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
mkinstalldirs
sword.conf
sword.pc
sword.spec
testlib
.project

   + .deps
.libs
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.guess
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
mkinstalldirs
sword.conf
sword.pc
sword.spec
testlib
.project
.cproject
.usrinst.sh.swp


Modified: trunk/include/rawcom.h
===================================================================
--- trunk/include/rawcom.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/rawcom.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -48,7 +48,7 @@
 
 	// write interface ----------------------------
 	virtual bool isWritable();
-	static char createModule(const char *path) { return RawVerse::createModule(path); }
+	static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse::createModule(path, v11n); }
 	virtual void setEntry(const char *inbuf, long len = -1);	// Modify current module entry
 	virtual void linkEntry(const SWKey *linkKey);	// Link current module entry to other module entry
 	virtual void deleteEntry();	// Delete current module entry

Modified: trunk/include/rawcom4.h
===================================================================
--- trunk/include/rawcom4.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/rawcom4.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -48,7 +48,7 @@
 
 	// write interface ----------------------------
 	virtual bool isWritable();
-	static char createModule(const char *path) { return RawVerse4::createModule(path); }
+	static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse4::createModule(path, v11n); }
 	virtual void setEntry(const char *inbuf, long len = -1);	// Modify current module entry
 	virtual void linkEntry(const SWKey *linkKey);	// Link current module entry to other module entry
 	virtual void deleteEntry();	// Delete current module entry

Modified: trunk/include/rawtext.h
===================================================================
--- trunk/include/rawtext.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/rawtext.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -43,7 +43,7 @@
 	virtual void decrement(int steps = 1) { increment(-steps); }
 	// write interface ----------------------------
 	virtual bool isWritable();
-	static char createModule(const char *path) { return RawVerse::createModule(path); }
+	static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse::createModule(path, v11n); }
 	virtual void setEntry(const char *inbuf, long len = -1);	// Modify current module entry
 	virtual void linkEntry(const SWKey *linkKey);	// Link current module entry to other module entry
 	virtual void deleteEntry();	// Delete current module entry

Modified: trunk/include/rawtext4.h
===================================================================
--- trunk/include/rawtext4.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/rawtext4.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -44,7 +44,7 @@
 	virtual void decrement(int steps = 1) { increment(-steps); }
 	// write interface ----------------------------
 	virtual bool isWritable();
-	static char createModule(const char *path) { return RawVerse4::createModule(path); }
+	static char createModule(const char *path, const char *v11n = "KJV") { return RawVerse4::createModule(path, v11n); }
 	virtual void setEntry(const char *inbuf, long len = -1);	// Modify current module entry
 	virtual void linkEntry(const SWKey *linkKey);	// Link current module entry to other module entry
 	virtual void deleteEntry();	// Delete current module entry

Modified: trunk/include/rawverse.h
===================================================================
--- trunk/include/rawverse.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/rawverse.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -34,7 +34,7 @@
 	virtual ~RawVerse();
 	void findOffset(char testmt, long idxoff, long *start,	unsigned short *end);
 	void readText(char testmt, long start, unsigned short size, SWBuf &buf);
-	static char createModule(const char *path);
+	static char createModule(const char *path, const char *v11n = "KJV");
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/include/rawverse4.h
===================================================================
--- trunk/include/rawverse4.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/rawverse4.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -34,7 +34,7 @@
 	virtual ~RawVerse4();
 	void findOffset(char testmt, long idxoff, long *start,	unsigned long *end);
 	void readText(char testmt, long start, unsigned long size, SWBuf &buf);
-	static char createModule(const char *path);
+	static char createModule(const char *path, const char *v11n = "KJV");
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/include/utilstr.h
===================================================================
--- trunk/include/utilstr.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/utilstr.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -28,7 +28,7 @@
 
 /** stdstr - clone a string
 */
-char *stdstr (char **iistr, const char *istr, unsigned int memPadFactor = 1);
+SWDLLEXPORT char *stdstr (char **iistr, const char *istr, unsigned int memPadFactor = 1);
 char *strstrip (char *istr);
 const char *stristr (const char *s1, const char *s2);
 int strnicmp(const char *s1, const char *s2, int len);

Modified: trunk/include/versemgr.h
===================================================================
--- trunk/include/versemgr.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/versemgr.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -82,7 +82,7 @@
 	static VerseMgr *systemVerseMgr;
 
 public:
-	class Book {
+	class SWDLLEXPORT Book {
 		friend class System;
 		friend struct BookOffsetLess;
 		class Private;
@@ -121,7 +121,7 @@
 		int getVerseMax(int chapter) const;
 	};
 
-	class System {
+	class SWDLLEXPORT System {
 		class Private;
 		Private *p;
 		SWBuf name;
@@ -154,7 +154,7 @@
 	void registerVersificationSystem(const char *name, const TreeKey *);
 };
 
-extern const struct abbrev builtin_abbrevs[];
+SWDLLEXPORT extern const struct abbrev builtin_abbrevs[];
 
 SWORD_NAMESPACE_END
 #endif

Modified: trunk/include/zcom.h
===================================================================
--- trunk/include/zcom.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/zcom.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -51,8 +51,8 @@
 
 	// write interface ----------------------------
 	virtual bool isWritable();
-	static char createModule(const char *path, int blockBound) {
-		return zVerse::createModule(path, blockBound);
+	static char createModule(const char *path, int blockBound, const char *v11n = "KJV") {
+		return zVerse::createModule(path, blockBound, v11n);
 	}
 	virtual void setEntry(const char *inbuf, long len = -1);	// Modify current module entry
 	virtual void linkEntry(const SWKey * linkKey);	// Link current module entry to other module entry

Modified: trunk/include/ztext.h
===================================================================
--- trunk/include/ztext.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/ztext.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -66,8 +66,8 @@
 
   // write interface ----------------------------
 	virtual bool isWritable();
-	static char createModule(const char *path, int blockBound) {
-		return zVerse::createModule(path, blockBound);
+	static char createModule(const char *path, int blockBound, const char *v11n = "KJV") {
+		return zVerse::createModule(path, blockBound, v11n);
 	}
 
      virtual void setEntry(const char *inbuf, long len = -1);	// Modify current module entry

Modified: trunk/include/zverse.h
===================================================================
--- trunk/include/zverse.h	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/include/zverse.h	2009-03-16 19:53:42 UTC (rev 2284)
@@ -52,7 +52,7 @@
 	void findOffset(char testmt, long idxoff, long *start, unsigned short *end);
 	void zReadText(char testmt, long start, unsigned short size, SWBuf &buf);
 	virtual void rawZFilter(SWBuf &buf, char direction = 0) {}
-	static char createModule(const char *path, int blockBound);
+	static char createModule(const char *path, int blockBound, const char *v11n = "KJV");
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/common/rawverse.cpp
===================================================================
--- trunk/src/modules/common/rawverse.cpp	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/src/modules/common/rawverse.cpp	2009-03-16 19:53:42 UTC (rev 2284)
@@ -243,7 +243,7 @@
  * RET: error status
  */
 
-char RawVerse::createModule(const char *ipath)
+char RawVerse::createModule(const char *ipath, const char *v11n)
 {
 	char *path = 0;
 	char *buf = new char [ strlen (ipath) + 20 ];
@@ -277,6 +277,7 @@
 	fd2->getFd();
 
 	VerseKey vk;
+	vk.setVersificationSystem(v11n);
 	vk.Headings(1);
 
 	__s32 offset = 0;

Modified: trunk/src/modules/common/rawverse4.cpp
===================================================================
--- trunk/src/modules/common/rawverse4.cpp	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/src/modules/common/rawverse4.cpp	2009-03-16 19:53:42 UTC (rev 2284)
@@ -243,7 +243,7 @@
  * RET: error status
  */
 
-char RawVerse4::createModule(const char *ipath)
+char RawVerse4::createModule(const char *ipath, const char *v11n)
 {
 	char *path = 0;
 	char *buf = new char [ strlen (ipath) + 20 ];
@@ -277,6 +277,7 @@
 	fd2->getFd();
 
 	VerseKey vk;
+	vk.setVersificationSystem(v11n);
 	vk.Headings(1);
 	__u32 offset = 0;
 	__u32 size = 0;

Modified: trunk/src/modules/common/zverse.cpp
===================================================================
--- trunk/src/modules/common/zverse.cpp	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/src/modules/common/zverse.cpp	2009-03-16 19:53:42 UTC (rev 2284)
@@ -419,7 +419,7 @@
  * RET: error status
  */
 
-char zVerse::createModule(const char *ipath, int blockBound)
+char zVerse::createModule(const char *ipath, int blockBound, const char *v11n)
 {
 	char *path = 0;
 	char *buf = new char [ strlen (ipath) + 20 ];
@@ -465,6 +465,7 @@
 	fd2->getFd();
 
 	VerseKey vk;
+	vk.setVersificationSystem(v11n);
 	vk.Headings(1);
 
 	__s32 offset = 0;

Modified: trunk/utilities/imp2vs.cpp
===================================================================
--- trunk/utilities/imp2vs.cpp	2009-03-15 01:48:41 UTC (rev 2283)
+++ trunk/utilities/imp2vs.cpp	2009-03-16 19:53:42 UTC (rev 2284)
@@ -37,6 +37,7 @@
 		"\t -a augment module if exists (default is to create new)\n"
 		"\t -o <output_path> where to write data files.\n"
 		"\t -4 use 4 byte size entries (default is 2).\n\n"
+		"\t -v <v11n> use versification scheme other than KJV.\n\n"
 		"'imp' format is a simple standard for importing data into SWORD modules.\n"
 		"Required is a plain text file containing $$$key lines followed by content.\n\n"
 		"$$$Gen.1.1\n"
@@ -62,6 +63,7 @@
 
 	const char *progName   = argv[0];
 	const char *inFileName = argv[1];
+	SWBuf v11n             = "KJV";
 	SWBuf outPath          = "./";
 	bool fourByteSize      = false;
 	bool append            = false;
@@ -70,10 +72,17 @@
 		if (!strcmp(argv[i], "-a")) {
 			append = true;
 		}
+		if (!strcmp(argv[i], "-4")) {
+			fourByteSize = true;
+		}
 		else if (!strcmp(argv[i], "-o")) {
 			if (i+1 < argc) outPath = argv[++i];
 			else usage(progName, "-o requires <output_path>");
 		}
+		else if (!strcmp(argv[i], "-v")) {
+			if (i+1 < argc) v11n = argv[++i];
+			else usage(progName, "-v requires <v11n>");
+		}
 		else usage(progName, (((SWBuf)"Unknown argument: ")+ argv[i]).c_str());
 	}
 	// -----------------------------------------------------
@@ -82,13 +91,13 @@
 	// setup module
 	if (!append) {
 		if (!fourByteSize)
-			RawText::createModule(outPath);
-		else	RawText4::createModule(outPath);
+			RawText::createModule(outPath, v11n);
+		else	RawText4::createModule(outPath, v11n);
 	}
 
 	SWModule *module = (!fourByteSize)
-			? (SWModule *)new RawText(outPath)
-			: (SWModule *)new RawText4(outPath);
+			? (SWModule *)new RawText(outPath, 0, 0, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, v11n)
+			: (SWModule *)new RawText4(outPath, 0, 0, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, v11n);
 	// -----------------------------------------------------
 			
 




More information about the sword-cvs mailing list