aboutsummaryrefslogtreecommitdiffstats
path: root/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'utilities')
-rw-r--r--utilities/addgb.cpp7
-rw-r--r--utilities/addld.cpp8
-rw-r--r--utilities/addvs.cpp18
-rw-r--r--utilities/cipherraw.cpp6
-rw-r--r--utilities/ciphertest.cpp6
-rw-r--r--utilities/ciphertest2.cpp5
-rw-r--r--utilities/emptyvss.cpp9
-rw-r--r--utilities/imp2gbs.cpp12
-rw-r--r--utilities/imp2ld.cpp8
-rw-r--r--utilities/imp2vs.cpp7
-rw-r--r--utilities/mkfastmod.cpp7
-rw-r--r--utilities/mod2imp.cpp20
-rw-r--r--utilities/mod2osis.cpp7
-rw-r--r--utilities/mod2vpl.cpp8
-rw-r--r--utilities/mod2zmod.cpp20
-rw-r--r--utilities/modwrite.cpp10
-rw-r--r--utilities/step2vpl.cpp3
-rw-r--r--utilities/stepdump.cpp3
-rw-r--r--utilities/thml2gbs.cpp8
-rw-r--r--utilities/txt2sword.cpp5
-rw-r--r--utilities/vpl2mod.cpp9
21 files changed, 169 insertions, 17 deletions
diff --git a/utilities/addgb.cpp b/utilities/addgb.cpp
index 4926725..034dc5e 100644
--- a/utilities/addgb.cpp
+++ b/utilities/addgb.cpp
@@ -21,6 +21,13 @@
#define O_BINARY 0
#endif
+#ifndef NO_SWORD_NAMESPACE
+using sword::TreeKeyIdx;
+using sword::RawGenBook;
+using sword::SWKey;
+#endif
+
+
void printTree(TreeKeyIdx treeKey, TreeKeyIdx *target = 0, int level = 1) {
if (!target)
target = &treeKey;
diff --git a/utilities/addld.cpp b/utilities/addld.cpp
index 272460a..0171445 100644
--- a/utilities/addld.cpp
+++ b/utilities/addld.cpp
@@ -16,6 +16,14 @@
#include <zld.h>
#include <zipcomprs.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::ZipCompress;
+using sword::RawLD4;
+using sword::SWKey;
+using sword::zLD;
+using sword::RawLD;
+#endif
#ifndef O_BINARY
#define O_BINARY 0
diff --git a/utilities/addvs.cpp b/utilities/addvs.cpp
index 1efeede..b736c00 100644
--- a/utilities/addvs.cpp
+++ b/utilities/addvs.cpp
@@ -14,6 +14,14 @@
#include <rawtext.h>
#include <iostream>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::RawText;
+using sword::SWKey;
+using sword::VerseKey;
+using sword::ListKey;
+using sword::SWModule;
+#endif
#ifndef O_BINARY
#define O_BINARY 0
@@ -73,7 +81,7 @@ int main(int argc, char **argv) {
if (element) {
mod->Key(element->LowerBound());
VerseKey finalkey = element->UpperBound();
- std::cout << (const char*)mod->Key() << "-" << (const char*)finalkey << endl;
+ std::cout << (const char*)mod->Key() << "-" << (const char*)finalkey << std::endl;
if (!havefirst) {
havefirst = true;
firstverse = mod->Key();
@@ -87,11 +95,11 @@ int main(int argc, char **argv) {
entrysize = fread(buffer, sizeof(char), sizeof(buffer), infile);
mod->setEntry(buffer, entrysize); // save text to module at current position
- std::cout << "f" << (const char*)firstverse << endl;
+ std::cout << "f" << (const char*)firstverse << std::endl;
(*mod)++;
}
while (mod->Key() <= finalkey) {
- std::cout << (const char*)mod->Key() << endl;
+ std::cout << (const char*)mod->Key() << std::endl;
*(SWModule*)mod << &firstverse;
(*mod)++;
}
@@ -100,7 +108,7 @@ int main(int argc, char **argv) {
if (havefirst) {
mod->Key(*listkey.GetElement(i));
*(SWModule*)mod << &firstverse;
- std::cout << (const char*)mod->Key() << endl;
+ std::cout << (const char*)mod->Key() << std::endl;
}
else {
mod->Key(*listkey.GetElement(i));
@@ -116,7 +124,7 @@ int main(int argc, char **argv) {
entrysize = fread(buffer, sizeof(char), sizeof(buffer), infile);
mod->setEntry(buffer, entrysize); // save text to module at current position
- std::cout << "f" << (const char*)firstverse << endl;
+ std::cout << "f" << (const char*)firstverse << std::endl;
}
}
}
diff --git a/utilities/cipherraw.cpp b/utilities/cipherraw.cpp
index 8550609..a297f86 100644
--- a/utilities/cipherraw.cpp
+++ b/utilities/cipherraw.cpp
@@ -14,7 +14,11 @@
#include <swcipher.h>
#include <versekey.h>
#include <rawverse.h>
-
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWCipher;
+using sword::VerseKey;
+using sword::RawVerse;
+#endif
int main(int argc, char **argv) {
SWCipher *zobj;
diff --git a/utilities/ciphertest.cpp b/utilities/ciphertest.cpp
index b889324..26d3495 100644
--- a/utilities/ciphertest.cpp
+++ b/utilities/ciphertest.cpp
@@ -13,7 +13,11 @@
#include <swcipher.h>
#include <versekey.h>
#include <rawverse.h>
-
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWCipher;
+using sword::VerseKey;
+using sword::RawVerse;
+#endif
int main(int argc, char **argv) {
SWCipher *zobj;
diff --git a/utilities/ciphertest2.cpp b/utilities/ciphertest2.cpp
index 5c7014e..bac5c0c 100644
--- a/utilities/ciphertest2.cpp
+++ b/utilities/ciphertest2.cpp
@@ -14,6 +14,11 @@
#include <versekey.h>
#include <rawtext.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::VerseKey;
+using sword::RawText;
+using sword::CipherFilter;
+#endif
int main(int argc, char **argv) {
VerseKey key;
diff --git a/utilities/emptyvss.cpp b/utilities/emptyvss.cpp
index 4224c16..10a5b28 100644
--- a/utilities/emptyvss.cpp
+++ b/utilities/emptyvss.cpp
@@ -2,6 +2,15 @@
#include <versekey.h>
#include <iostream>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::VerseKey;
+using sword::ModMap;
+using sword::SWKey;
+using sword::SWModule;
+using sword::SW_POSITION;
+#endif
+
int main(int argc, char **argv) {
if (argc < 2) {
fprintf(stderr, "usage: %s <Mod Name>\n", argv[0]);
diff --git a/utilities/imp2gbs.cpp b/utilities/imp2gbs.cpp
index 73d72ea..b693e0f 100644
--- a/utilities/imp2gbs.cpp
+++ b/utilities/imp2gbs.cpp
@@ -19,6 +19,12 @@
#define O_BINARY 0
#endif
+#ifndef NO_SWORD_NAMESPACE
+using sword::TreeKeyIdx;
+using sword::RawGenBook;
+using sword::SWKey;
+#endif
+
void printTree(TreeKeyIdx treeKey, TreeKeyIdx *target = 0, int level = 1) {
if (!target)
target = &treeKey;
@@ -64,7 +70,7 @@ void setkey (TreeKeyIdx * treeKey, char* keybuffer) {
treeKey->save();
}
- //DEBUG std::cout << treeKey->getLocalName() << " : " << tok << endl;
+ //DEBUG std::cout << treeKey->getLocalName() << " : " << tok << std::endl;
tok = strtok(NULL, "/");
@@ -126,7 +132,7 @@ int main(int argc, char **argv) {
while (readline(infile, linebuffer)) {
if (!strncmp(linebuffer, "$$$", 3)) {
if (strlen(keybuffer) && strlen(entbuffer)) {
- std::cout << keybuffer << endl;
+ std::cout << keybuffer << std::endl;
treeKey->root();
setkey(treeKey, keybuffer);
book->setEntry(entbuffer, strlen(entbuffer));
@@ -142,7 +148,7 @@ int main(int argc, char **argv) {
//handle final entry
if (strlen(keybuffer) && strlen(entbuffer)) {
- std::cout << keybuffer << endl;
+ std::cout << keybuffer << std::endl;
treeKey->root();
setkey(treeKey, keybuffer);
book->setEntry(entbuffer, strlen(entbuffer));
diff --git a/utilities/imp2ld.cpp b/utilities/imp2ld.cpp
index 86c8394..ff265a7 100644
--- a/utilities/imp2ld.cpp
+++ b/utilities/imp2ld.cpp
@@ -21,6 +21,14 @@
#define O_BINARY 0
#endif
+#ifndef NO_SWORD_NAMESPACE
+using sword::zLD;
+using sword::ZipCompress;
+using sword::RawLD4;
+using sword::RawLD;
+using sword::SWKey;
+#endif
+
int readline(FILE* infile, char* linebuffer) {
signed char c;
char* lbPtr = linebuffer;
diff --git a/utilities/imp2vs.cpp b/utilities/imp2vs.cpp
index c7ee1c6..c4365d2 100644
--- a/utilities/imp2vs.cpp
+++ b/utilities/imp2vs.cpp
@@ -18,6 +18,13 @@
#define O_BINARY 0
#endif
+#ifndef NO_SWORD_NAMESPACE
+using sword::RawText;
+using sword::VerseKey;
+using sword::SWText;
+using sword::ListKey;
+#endif
+
int readline(FILE* infile, char* linebuffer) {
signed char c;
char* lbPtr = linebuffer;
diff --git a/utilities/mkfastmod.cpp b/utilities/mkfastmod.cpp
index a1664f8..2553af6 100644
--- a/utilities/mkfastmod.cpp
+++ b/utilities/mkfastmod.cpp
@@ -1,6 +1,13 @@
#include <stdio.h>
#include <rawtext.h>
#include <swmgr.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::SWModule;
+using sword::ListKey;
+using sword::VerseKey;
+using sword::ModMap;
+#endif
int main(int argc, char **argv)
{
diff --git a/utilities/mod2imp.cpp b/utilities/mod2imp.cpp
index 1bc5ece..a979407 100644
--- a/utilities/mod2imp.cpp
+++ b/utilities/mod2imp.cpp
@@ -20,10 +20,20 @@
#include <versekey.h>
#include <stdio.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWModule;
+using sword::SWMgr;
+using sword::ModMap;
+using sword::SWKey;
+using sword::VerseKey;
+using sword::SW_POSITION;
+#endif
+
+
void errorOutHelp(char *appName) {
- cerr << appName << " - a tool to output a Sword module in SWORD's 'imp' import format\n";
- cerr << "usage: "<< appName << " <modname> \n";
- cerr << "\n\n";
+ std::cerr << appName << " - a tool to output a Sword module in SWORD's 'imp' import format\n";
+ std::cerr << "usage: "<< appName << " <modname> \n";
+ std::cerr << "\n\n";
exit(-1);
}
@@ -57,8 +67,8 @@ int main(int argc, char **argv)
vkey->Headings(1);
for ((*inModule) = TOP; !inModule->Error(); (*inModule)++) {
- cout << "$$$" << inModule->KeyText() << endl;
- cout << inModule->getRawEntry() << endl;
+ std::cout << "$$$" << inModule->KeyText() << std::endl;
+ std::cout << inModule->getRawEntry() << std::endl;
}
return 0;
}
diff --git a/utilities/mod2osis.cpp b/utilities/mod2osis.cpp
index e9327e4..250ceee 100644
--- a/utilities/mod2osis.cpp
+++ b/utilities/mod2osis.cpp
@@ -22,6 +22,13 @@
#include <markupfiltmgr.h>
#include <algorithm>
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
+using std::endl;
+using std::cerr;
+using std::cout;
+
void errorOutHelp(char *appName) {
cerr << appName << " - a tool to output a Sword module in OSIS format\n";
cerr << "usage: "<< appName << " <modname> \n";
diff --git a/utilities/mod2vpl.cpp b/utilities/mod2vpl.cpp
index d5b11ed..1cbf398 100644
--- a/utilities/mod2vpl.cpp
+++ b/utilities/mod2vpl.cpp
@@ -1,6 +1,14 @@
#include <swmgr.h>
#include <versekey.h>
#include <iostream>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::VerseKey;
+using sword::SWModule;
+using sword::SWKey;
+using sword::SW_POSITION;
+using sword::ModMap;
+#endif
void cleanbuf(char *buf) {
char *from = buf;
diff --git a/utilities/mod2zmod.cpp b/utilities/mod2zmod.cpp
index de7a3e3..d635047 100644
--- a/utilities/mod2zmod.cpp
+++ b/utilities/mod2zmod.cpp
@@ -20,6 +20,26 @@
#include <versekey.h>
#include <stdio.h>
#include <cipherfil.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWCompress;
+using sword::CipherFilter;
+using sword::SWModule;
+using sword::SWMgr;
+using sword::ModMap;
+using sword::zText;
+using sword::zLD;
+using sword::zCom;
+using sword::SWFilter;
+using sword::VerseKey;
+using sword::SWKey;
+using sword::SW_POSITION;
+using sword::ZipCompress;
+using sword::LZSSCompress;
+#endif
+
+using std::cerr;
+using std::string;
+using std::cout;
void errorOutHelp(char *appName) {
cerr << appName << " - a tool to create compressed Sword modules\n";
diff --git a/utilities/modwrite.cpp b/utilities/modwrite.cpp
index 1caee81..32a7759 100644
--- a/utilities/modwrite.cpp
+++ b/utilities/modwrite.cpp
@@ -3,7 +3,7 @@
#include <fcntl.h>
#include <iostream>
#include <fstream>
-#include <string>
+//#include <string>
#ifndef __GNUC__
#include <io.h>
@@ -14,6 +14,14 @@
#include <swmgr.h>
#include <stdio.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::SWModule;
+using sword::ModMap;
+using sword::SWKey;
+#endif
+
+using std::cerr;
int main(int argc, char **argv)
{
diff --git a/utilities/step2vpl.cpp b/utilities/step2vpl.cpp
index e43b1bd..06e0aeb 100644
--- a/utilities/step2vpl.cpp
+++ b/utilities/step2vpl.cpp
@@ -17,6 +17,9 @@
#endif
using namespace std;
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
long SECTIONSLEVELSTART = 38;
long SECTIONSLEVELSIZE = 29;
diff --git a/utilities/stepdump.cpp b/utilities/stepdump.cpp
index 313efbc..e13a826 100644
--- a/utilities/stepdump.cpp
+++ b/utilities/stepdump.cpp
@@ -17,6 +17,9 @@
using namespace std;
+#ifndef NO_SWORD_NAMESPACE
+using namespace sword;
+#endif
typedef struct {
short versionRecordSize;
diff --git a/utilities/thml2gbs.cpp b/utilities/thml2gbs.cpp
index df85806..ca5b31c 100644
--- a/utilities/thml2gbs.cpp
+++ b/utilities/thml2gbs.cpp
@@ -21,6 +21,12 @@
#define O_BINARY 0
#endif
+#ifndef NO_SWORD_NAMESPACE
+using sword::TreeKeyIdx;
+using sword::RawGenBook;
+using sword::SWKey;
+#endif
+
void printTree(TreeKeyIdx treeKey, TreeKeyIdx *target = 0, int level = 1) {
if (!target)
target = &treeKey;
@@ -81,7 +87,7 @@ int main(int argc, char **argv) {
const char * helptext ="thml2gbs 1.0 General Book module creation tool for the SWORD Project\n usage:\n %s <filename> [modname] [0|1 - long names] [0|1 - output in 'import format']\n";
signed long i = 0;
- string divs[6];
+ std::string divs[6];
int level = 0;
char* keybuffer = new char[2048];
char* entbuffer = new char[1048576];
diff --git a/utilities/txt2sword.cpp b/utilities/txt2sword.cpp
index c373f30..1e37c72 100644
--- a/utilities/txt2sword.cpp
+++ b/utilities/txt2sword.cpp
@@ -6,6 +6,11 @@
#include <versekey.h>
#include <sys/stat.h>
#include <iostream>
+
+#ifndef NO_SWORD_NAMESPACE
+using sword::VerseKey;
+#endif
+
const long MAXVLEN = 8192;
int fp, vfp, cfp, bfp, dfp;
diff --git a/utilities/vpl2mod.cpp b/utilities/vpl2mod.cpp
index 3760d42..0b65a87 100644
--- a/utilities/vpl2mod.cpp
+++ b/utilities/vpl2mod.cpp
@@ -19,6 +19,15 @@
#define O_BINARY 0
#endif
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::RawText;
+using sword::VerseKey;
+using sword::SW_POSITION;
+#endif
+
+using std::string;
+
char readline(int fd, char **buf) {
char ch;
if (*buf)