[sword-devel] Are there actual "raw" files for KJV and WEB?

Lynn Allan sword-devel@crosswire.org
Fri, 24 Oct 2003 01:12:09 -0600


> So, if you are looking for a way to read raw data in a module stored in
> the RawText format, then you can:
>
> SWModule *bible = new RawText("/path/to/kjv",...);
> bible->SetKey("jn 3:16");
> cout << *bible;
>
> Troy

I'm attempting to put together a "micro-Diatheke" to learn more about how
Sword works. It uses the approach suggested above, except only including
<canon.h> and doing raw reads of the .vss files (no versekey, filters,
RawText, etc.).

It works ok for an actual "raw" file like the BBE, and only requires about
30 lines of code (+ canon.h for lookup). However, when I look at
texts\rawtext\kjv\ot and texts\raw\rawtext\web\ot, they aren't really "raw".
There is quite of bit of "mark-up" included, such as <WCF>, etc. I notice a
variety of prep and filter routines to take out these tags.

Are there actual "raw" files for kjv\ot, kjv\nt, web\ot, and web\nt? Would
they be in an older archive, along with the corresponding .vss files? Can
they be generated? (Same questions apply for acv, bwe, godsword, isv, litv,
mkjv, rsv, etc.)

TIA,
Lynn Allan

*******************
*******************
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
#include "canon.h"

void main(int argc, char **argv)
{
 int otFdVss =
_open("X:\\DevTools\\Crosswire\\Sword\\modules\\texts\\rawtext\\bbe\\ot.vss"
, _O_RDONLY);
 int otFdRawText =
_open("X:\\DevTools\\Crosswire\\Sword\\modules\\texts\\rawtext\\bbe\\ot",
_O_RDONLY);

  char buf[1024];
  long  offset = 0, testament = 1, book  = 2, chapter = 20;
  long  index, start;
  unsigned short size;
  long  *offsets[2][2]  = {{otbks, otcps}, {ntbks, ntcps}};
// Ten Commandments: Exodus 20:1-17
  for (long verse = 1; verse <= 17; ++verse) {
   offset = offsets[testament-1][0][book];
   offset = offsets[testament-1][1][(int)offset + chapter];
   index = (offset + verse) * 6;
   lseek(otFdVss, index, SEEK_SET);
   read(otFdVss, &start, 4);
   read(otFdVss, &size, 2);
   lseek(otFdRawText, start, SEEK_SET);
   read(otFdRawText, buf, (int)size);
   buf[size] = 0;
   printf("%s\n", buf);
  }
}