[sword-cvs] sword/src/modules/common zverse2.cpp,1.1,1.2

sword at www.crosswire.org sword at www.crosswire.org
Fri May 7 10:24:42 MST 2004


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

Modified Files:
	zverse2.cpp 
Log Message:

dglassey: use file names text.* rather than ot.*


Index: zverse2.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/common/zverse2.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- zverse2.cpp	12 Apr 2004 13:53:04 -0000	1.1
+++ zverse2.cpp	7 May 2004 17:24:40 -0000	1.2
@@ -71,19 +71,19 @@
 		fileMode = O_RDWR;
 	}
 		
-	buf.setFormatted("%s/ot.%czs", path, uniqueIndexID[blockType]);
+	buf.setFormatted("%s/text.%czs", path, uniqueIndexID[blockType]);
 	idxfp = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
-	buf.setFormatted("%s/ot.%czz", path, uniqueIndexID[blockType]);
+	buf.setFormatted("%s/text.%czz", path, uniqueIndexID[blockType]);
 	textfp = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
-	buf.setFormatted("%s/ot.%czv", path, uniqueIndexID[blockType]);
+	buf.setFormatted("%s/text.%czv", path, uniqueIndexID[blockType]);
 	compfp = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
-	buf.setFormatted("%s/ot.%czm", path, uniqueIndexID[blockType]);
+	buf.setFormatted("%s/text.%czm", path, uniqueIndexID[blockType]);
 	markupfp = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
-	buf.setFormatted("%s/ot.%czr", path, uniqueIndexID[blockType]);
+	buf.setFormatted("%s/text.%czr", path, uniqueIndexID[blockType]);
 	midxfp = FileMgr::getSystemFileMgr()->open(buf, fileMode|O_BINARY, true);
 
 	
@@ -157,22 +157,25 @@
 	long newOffset = lseek(compfp->getFd(), idxoff, SEEK_SET);
 	if (newOffset == idxoff) {
 		if (read(compfp->getFd(), &ulBuffNum, 4) != 4) {
-			printf ("Error reading ulBuffNum\n");
+			printf ("Error reading ulBuffNum from %d\n", idxoff);
 			return;
 		}
 	}
-	else return;
+	else {
+		printf ("Error seeking to ulBuffNum from %d\n", idxoff);
+		return;
+	}
 
 	ulBuffNum = swordtoarch32(ulBuffNum);
 
 	if (read(compfp->getFd(), &ulVerseStart, 4) != 4)
 	{
-		printf ("Error reading ulVerseStart\n");
+		printf ("Error reading ulVerseStartfrom %d\n", idxoff);
 		return;
 	}
 	if (read(compfp->getFd(), &usVerseSize, 2) != 2)
 	{
-		printf ("Error reading usVerseSize\n");
+		printf ("Error reading usVerseSize from %d\n", idxoff);
 		return;
 	}
 
@@ -438,32 +441,30 @@
 	if ((path[strlen(path)-1] == '/') || (path[strlen(path)-1] == '\\'))
 		path[strlen(path)-1] = 0;
 
-	sprintf(buf, "%s/ot.%czs", path, uniqueIndexID[blockBound]);
+	sprintf(buf, "%s/text.%czs", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
 	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
 	FileMgr::getSystemFileMgr()->close(fd);
 
-	sprintf(buf, "%s/ot.%czz", path, uniqueIndexID[blockBound]);
+	sprintf(buf, "%s/text.%czz", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
 	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
 	FileMgr::getSystemFileMgr()->close(fd);
 
-	sprintf(buf, "%s/ot.%czm", path, uniqueIndexID[blockBound]);
+	sprintf(buf, "%s/text.%czm", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
 	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
 	FileMgr::getSystemFileMgr()->close(fd);
 
-	sprintf(buf, "%s/ot.%czr", path, uniqueIndexID[blockBound]);
+	sprintf(buf, "%s/text.%czr", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
 	fd = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd->getFd();
-	FileMgr::getSystemFileMgr()->close(fd);
 
-	
-	sprintf(buf, "%s/ot.%czv", path, uniqueIndexID[blockBound]);
+	sprintf(buf, "%s/text.%czv", path, uniqueIndexID[blockBound]);
 	FileMgr::removeFile(buf);
 	fd2 = FileMgr::getSystemFileMgr()->open(buf, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE);
 	fd2->getFd();
@@ -473,6 +474,7 @@
 	long offset = 0;
 	short size = 0;
 	for (vk = TOP; !vk.Error(); vk++) {
+		//printf("vk %s %d\n", vk.getText(), vk.Index());
 		write(fd->getFd(), &offset, 4);	//compBufIdxOffset
 		write(fd->getFd(), &offset, 4);
 		write(fd->getFd(), &size, 2);




More information about the sword-cvs mailing list