summaryrefslogtreecommitdiff
path: root/utilities/imp2ld.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utilities/imp2ld.cpp')
-rw-r--r--utilities/imp2ld.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/utilities/imp2ld.cpp b/utilities/imp2ld.cpp
index e9bd0c7..11f5d6b 100644
--- a/utilities/imp2ld.cpp
+++ b/utilities/imp2ld.cpp
@@ -36,7 +36,7 @@ using namespace sword;
int main(int argc, char **argv) {
- const char * helptext ="imp2ld 1.0 Lexicon/Dictionary/Daily Devotional/Glossary module creation tool for the SWORD Project\n usage:\n %s <filename> [modname] [ 4 (default) | 2 | z - module driver]\n";
+ const char * helptext ="imp2ld 1.0 Lexicon/Dictionary/Daily Devotional/Glossary module creation tool for the SWORD Project\n usage:\n %s <filename> [modname] [ 4 (default) | 2 | z - module driver] [entries per compression block]\n";
signed long i = 0;
string keybuffer;
@@ -44,6 +44,7 @@ int main(int argc, char **argv) {
string linebuffer;
char modname[16];
char links = 0;
+ long blockCount = 30;
std::vector<string> linkbuffer;
if (argc > 2) {
@@ -71,13 +72,25 @@ int main(int argc, char **argv) {
}
}
+ if (argc > 4) {
+ long bcTemp = atoi(argv[4]);
+ if (bcTemp > 0) {
+ blockCount = bcTemp;
+ }
+ }
+
SWModule *mod = 0;
SWKey *key, *linkKey;
switch (mode) {
case 3:
+#ifndef EXCLUDEZLIB
zLD::createModule(modname);
- mod = new zLD(modname, 0, 0, 30, new ZipCompress());
+ mod = new zLD(modname, 0, 0, blockCount, new ZipCompress());
+#else
+ fprintf(stderr, "ERROR: %s: SWORD library not compiled with ZIP compression support.\n\tBe sure libzip is available when compiling SWORD library", *argv);
+ exit(-2);
+#endif
break;
case 2:
RawLD::createModule(modname);