[sword-cvs] sword/utilities cipherraw.cpp,1.9,1.10 ciphertest.cpp,1.5,1.6

sword@www.crosswire.org sword@www.crosswire.org
Thu, 27 Feb 2003 01:17:08 -0700


Update of /usr/local/cvsroot/sword/utilities
In directory www:/tmp/cvs-serv30117/utilities

Modified Files:
	cipherraw.cpp ciphertest.cpp 
Log Message:


Index: cipherraw.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/utilities/cipherraw.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** cipherraw.cpp	1 Oct 2002 19:52:41 -0000	1.9
--- cipherraw.cpp	27 Feb 2003 08:17:06 -0000	1.10
***************
*** 15,22 ****
  #include <versekey.h>
  #include <rawverse.h>
  #ifndef NO_SWORD_NAMESPACE
! using sword::SWCipher;
! using sword::VerseKey;
! using sword::RawVerse;
  #endif
  
--- 15,21 ----
  #include <versekey.h>
  #include <rawverse.h>
+ #include <swbuf.h>
  #ifndef NO_SWORD_NAMESPACE
! using namespace sword;
  #endif
  
***************
*** 64,68 ****
  	key.Headings(1);
  	for (key.Index(0); (!key.Error()); key++) {
! 		rawdrv->findoffset(key.Testament(), key.Index(), &offset, &size);
  		printf("%s: OLD offset: %d; size: %d\n", (const char *)key, offset, size);
  
--- 63,67 ----
  	key.Headings(1);
  	for (key.Index(0); (!key.Error()); key++) {
! 		rawdrv->findOffset(key.Testament(), key.Index(), &offset, &size);
  		printf("%s: OLD offset: %d; size: %d\n", (const char *)key, offset, size);
  
***************
*** 79,87 ****
  
  			if (size) {
! 				tmpbuf = (char *) calloc(size + 2, 1);
! 				rawdrv->readtext(key.Testament(), offset, size + 2, tmpbuf);
! 				zobj->Buf(tmpbuf, size);
  				zobj->cipherBuf((unsigned int *)&size);
- 				free(tmpbuf);
  			}
  			offset = lseek(ofd[key.Testament() - 1], 0, SEEK_CUR);
--- 78,85 ----
  
  			if (size) {
! 				SWBuf tmpbuf;
! 				rawdrv->readText(key.Testament(), offset, size, tmpbuf);
! 				zobj->Buf(tmpbuf.c_str(), size);
  				zobj->cipherBuf((unsigned int *)&size);
  			}
  			offset = lseek(ofd[key.Testament() - 1], 0, SEEK_CUR);

Index: ciphertest.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/utilities/ciphertest.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ciphertest.cpp	1 Oct 2002 19:52:41 -0000	1.5
--- ciphertest.cpp	27 Feb 2003 08:17:06 -0000	1.6
***************
*** 14,21 ****
  #include <versekey.h>
  #include <rawverse.h>
  #ifndef NO_SWORD_NAMESPACE
! using sword::SWCipher;
! using sword::VerseKey;
! using sword::RawVerse;
  #endif
  
--- 14,20 ----
  #include <versekey.h>
  #include <rawverse.h>
+ #include <swbuf.h>
  #ifndef NO_SWORD_NAMESPACE
! using namespace sword;
  #endif
  
***************
*** 47,57 ****
  	key.Headings(1);
  	for (key.Index(0); (!key.Error()); key++) {
! 		rawdrv->findoffset(key.Testament(), key.Index(), &offset, &size);
! 		tmpbuf = (char *) calloc(size + 2, 1);
! 		rawdrv->readtext(key.Testament(), offset, size + 2, tmpbuf);
  		len = size;
! 		zobj->cipherBuf(&len, tmpbuf);
  		printf("%s\n", zobj->Buf());
- 				free(tmpbuf);
  	}
  	delete zobj;
--- 46,55 ----
  	key.Headings(1);
  	for (key.Index(0); (!key.Error()); key++) {
! 		rawdrv->findOffset(key.Testament(), key.Index(), &offset, &size);
! 		SWBuf tmpbuf;
! 		rawdrv->readText(key.Testament(), offset, size, tmpbuf);
  		len = size;
! 		zobj->cipherBuf(&len, tmpbuf.c_str());
  		printf("%s\n", zobj->Buf());
  	}
  	delete zobj;