[sword-cvs] sword/src/modules/common rawstr.cpp,1.41,1.42 rawstr4.cpp,1.23,1.24 rawverse.cpp,1.34,1.35 zstr.cpp,1.24,1.25 zverse.cpp,1.35,1.36

sword@www.crosswire.org sword@www.crosswire.org
Fri, 6 Feb 2004 14:01:04 -0700


Update of /cvs/core/sword/src/modules/common
In directory www:/tmp/cvs-serv27118/src/modules/common

Modified Files:
	rawstr.cpp rawstr4.cpp rawverse.cpp zstr.cpp zverse.cpp 
Log Message:
	Changed system[Log|File|Locale]Mgr to
		*Mgr *[get|set]System*Mgr() per Daniel Glassey's
		discovery of potential problems from order of
		initializing statics.

	Added new prefix recognition for OSIS lemma prefix
		"strong:"



Index: rawstr.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/common/rawstr.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- rawstr.cpp	16 Jan 2004 03:42:42 -0000	1.41
+++ rawstr.cpp	6 Feb 2004 21:01:01 -0000	1.42
@@ -56,10 +56,10 @@
 	}
 		
 	sprintf(buf, "%s.idx", path);
-	idxfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	idxfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s.dat", path);
-	datfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	if (datfd < 0) {
 		sprintf(buf, "Error: %d", errno);
@@ -81,8 +81,8 @@
 
 	--instance;
 
-	FileMgr::systemFileMgr.close(idxfd);
-	FileMgr::systemFileMgr.close(datfd);
+	FileMgr::getSystemFileMgr()->close(idxfd);
+	FileMgr::getSystemFileMgr()->close(datfd);
 }
 
 
@@ -490,7 +490,7 @@
 		if (idxBytes) {
 			write(idxfd->getFd(), idxBytes+6, shiftSize-6);
 			lseek(idxfd->getFd(), -1, SEEK_CUR);	// last valid byte
-			FileMgr::systemFileMgr.trunc(idxfd);	// truncate index
+			FileMgr::getSystemFileMgr()->trunc(idxfd);	// truncate index
 			delete [] idxBytes;
 		}
 	}
@@ -537,15 +537,15 @@
 
 	sprintf(buf, "%s.dat", path);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s.idx", path);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
-	FileMgr::systemFileMgr.close(fd2);
+	FileMgr::getSystemFileMgr()->close(fd2);
 
 	delete [] path;
 	

Index: rawstr4.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/common/rawstr4.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- rawstr4.cpp	16 Jan 2004 03:42:42 -0000	1.23
+++ rawstr4.cpp	6 Feb 2004 21:01:01 -0000	1.24
@@ -55,10 +55,10 @@
 	}
 		
 	sprintf(buf, "%s.idx", path);
-	idxfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	idxfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s.dat", path);
-	datfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	if (datfd < 0) {
 		sprintf(buf, "Error: %d", errno);
@@ -80,8 +80,8 @@
 
 	--instance;
 
-	FileMgr::systemFileMgr.close(idxfd);
-	FileMgr::systemFileMgr.close(datfd);
+	FileMgr::getSystemFileMgr()->close(idxfd);
+	FileMgr::getSystemFileMgr()->close(datfd);
 }
 
 
@@ -496,7 +496,7 @@
 		if (idxBytes) {
 			write(idxfd->getFd(), idxBytes+8, shiftSize-8);
 			lseek(idxfd->getFd(), -1, SEEK_CUR);	// last valid byte
-			FileMgr::systemFileMgr.trunc(idxfd);	// truncate index
+			FileMgr::getSystemFileMgr()->trunc(idxfd);	// truncate index
 			delete [] idxBytes;
 		}
 	}
@@ -543,15 +543,15 @@
 
 	sprintf(buf, "%s.dat", path);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s.idx", path);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
-	FileMgr::systemFileMgr.close(fd2);
+	FileMgr::getSystemFileMgr()->close(fd2);
 
 	delete [] path;
 	

Index: rawverse.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/common/rawverse.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- rawverse.cpp	16 Jan 2004 03:42:42 -0000	1.34
+++ rawverse.cpp	6 Feb 2004 21:01:02 -0000	1.35
@@ -60,16 +60,16 @@
 	}
 		
 	sprintf(buf, "%s/ot.vss", path);
-	idxfp[0] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	idxfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/nt.vss", path);
-	idxfp[1] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	idxfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/ot", path);
-	textfp[0] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	textfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/nt", path);
-	textfp[1] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	textfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	delete [] buf;
 	instance++;
@@ -90,8 +90,8 @@
 	--instance;
 
 	for (loop1 = 0; loop1 < 2; loop1++) {
-		FileMgr::systemFileMgr.close(idxfp[loop1]);
-		FileMgr::systemFileMgr.close(textfp[loop1]);
+		FileMgr::getSystemFileMgr()->close(idxfp[loop1]);
+		FileMgr::getSystemFileMgr()->close(textfp[loop1]);
 	}
 }
 
@@ -308,24 +308,24 @@
 
 	sprintf(buf, "%s/ot", path);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s/nt", path);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s/ot.vss", path);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
 
 	sprintf(buf, "%s/nt.vss", path);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
 
 	VerseKey vk;
@@ -337,8 +337,8 @@
 		write((vk.Testament() == 1) ? fd->getFd() : fd2->getFd(), &size, 2);
 	}
 
-	FileMgr::systemFileMgr.close(fd);
-	FileMgr::systemFileMgr.close(fd2);
+	FileMgr::getSystemFileMgr()->close(fd);
+	FileMgr::getSystemFileMgr()->close(fd2);
 
 	delete [] path;
 	delete [] buf;

Index: zstr.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/common/zstr.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- zstr.cpp	16 Jan 2004 03:42:42 -0000	1.24
+++ zstr.cpp	6 Feb 2004 21:01:02 -0000	1.25
@@ -58,16 +58,16 @@
 	}
 		
 	sprintf(buf, "%s.idx", path);
-	idxfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	idxfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s.dat", path);
-	datfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	datfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s.zdx", path);
-	zdxfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	zdxfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s.zdt", path);
-	zdtfd = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	zdtfd = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	if (datfd <= 0) {
 		sprintf(buf, "Error: %d", errno);
@@ -95,10 +95,10 @@
 
 	--instance;
 
-	FileMgr::systemFileMgr.close(idxfd);
-	FileMgr::systemFileMgr.close(datfd);
-	FileMgr::systemFileMgr.close(zdxfd);
-	FileMgr::systemFileMgr.close(zdtfd);
+	FileMgr::getSystemFileMgr()->close(idxfd);
+	FileMgr::getSystemFileMgr()->close(datfd);
+	FileMgr::getSystemFileMgr()->close(zdxfd);
+	FileMgr::getSystemFileMgr()->close(zdtfd);
 
 
 	if (compressor)
@@ -578,7 +578,7 @@
 		if (idxBytes) {
 			write(idxfd->getFd(), idxBytes+IDXENTRYSIZE, shiftSize-IDXENTRYSIZE);
 			lseek(idxfd->getFd(), -1, SEEK_CUR);	// last valid byte
-			FileMgr::systemFileMgr.trunc(idxfd);	// truncate index
+			FileMgr::getSystemFileMgr()->trunc(idxfd);	// truncate index
 		}
 	}
 
@@ -688,27 +688,27 @@
 
 	sprintf(buf, "%s.dat", path);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s.idx", path);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
-	FileMgr::systemFileMgr.close(fd2);
+	FileMgr::getSystemFileMgr()->close(fd2);
 
 	sprintf(buf, "%s.zdt", path);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
-	FileMgr::systemFileMgr.close(fd2);
+	FileMgr::getSystemFileMgr()->close(fd2);
 
 	sprintf(buf, "%s.zdx", path);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
-	FileMgr::systemFileMgr.close(fd2);
+	FileMgr::getSystemFileMgr()->close(fd2);
 
 	delete [] path;
 	

Index: zverse.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/common/zverse.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- zverse.cpp	16 Jan 2004 03:42:42 -0000	1.35
+++ zverse.cpp	6 Feb 2004 21:01:02 -0000	1.36
@@ -71,22 +71,22 @@
 	}
 		
 	sprintf(buf, "%s/ot.%czs", path, uniqueIndexID[blockType]);
-	idxfp[0] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	idxfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/nt.%czs", path, uniqueIndexID[blockType]);
-	idxfp[1] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	idxfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/ot.%czz", path, uniqueIndexID[blockType]);
-	textfp[0] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	textfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/nt.%czz", path, uniqueIndexID[blockType]);
-	textfp[1] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	textfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/ot.%czv", path, uniqueIndexID[blockType]);
-	compfp[0] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	compfp[0] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	sprintf(buf, "%s/nt.%czv", path, uniqueIndexID[blockType]);
-	compfp[1] = FileMgr::systemFileMgr.open(buf, fileMode|O_BINARY, true);
+	compfp[1] = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 	
 	instance++;
 }
@@ -114,9 +114,9 @@
 	--instance;
 
 	for (loop1 = 0; loop1 < 2; loop1++) {
-		FileMgr::systemFileMgr.close(idxfp[loop1]);
-		FileMgr::systemFileMgr.close(textfp[loop1]);
-		FileMgr::systemFileMgr.close(compfp[loop1]);
+		FileMgr::getSystemFileMgr()->close(idxfp[loop1]);
+		FileMgr::getSystemFileMgr()->close(textfp[loop1]);
+		FileMgr::getSystemFileMgr()->close(compfp[loop1]);
 	}
 }
 
@@ -420,36 +420,36 @@
 
 	sprintf(buf, "%s/ot.%czs", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s/nt.%czs", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s/ot.%czz", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s/nt.%czz", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
-	FileMgr::systemFileMgr.close(fd);
+	FileMgr::getSystemFileMgr()->close(fd);
 
 	sprintf(buf, "%s/ot.%czv", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
-	fd = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
 
 	sprintf(buf, "%s/nt.%czv", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
-	fd2 = FileMgr::systemFileMgr.open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
+	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
 
 	VerseKey vk;
@@ -462,8 +462,8 @@
 		write((vk.Testament() == 1) ? fd->getFd() : fd2->getFd(), &size, 2);
 	}
 
-	FileMgr::systemFileMgr.close(fd);
-	FileMgr::systemFileMgr.close(fd2);
+	FileMgr::getSystemFileMgr()->close(fd);
+	FileMgr::getSystemFileMgr()->close(fd2);
 
 	delete [] path;
 	delete [] buf;