summaryrefslogtreecommitdiffstats
path: root/flashtools
diff options
context:
space:
mode:
authorTroy A. Griffitts <scribe@crosswire.org>2007-09-04 00:48:05 +0000
committerTroy A. Griffitts <scribe@crosswire.org>2007-09-04 00:48:05 +0000
commitc249f2401aec8638a0ae1487cc1e91ea196c63d0 (patch)
tree84d7393e7464d00758c53a15797271b3538739e9 /flashtools
parentb417226d898c600740b148e55d536b27e60534b7 (diff)
downloadsword-tools-c249f2401aec8638a0ae1487cc1e91ea196c63d0.tar.gz
Applied patch from Lyndon Drake fixing strongs def card
and verifying KJV module is installed with user feedback if not Added standard crosswire header git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@97 07627401-56e2-0310-80f4-f8cd0041bdcd
Diffstat (limited to 'flashtools')
-rw-r--r--flashtools/Makefile2
-rw-r--r--flashtools/flash.cpp32
2 files changed, 31 insertions, 3 deletions
diff --git a/flashtools/Makefile b/flashtools/Makefile
index dc41e0a..47852f0 100644
--- a/flashtools/Makefile
+++ b/flashtools/Makefile
@@ -7,6 +7,6 @@ clean:
rm $(TARGETS)
.cpp:
- g++ -g `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword`
+ g++ -g `pkg-config --static --cflags sword` $< -o $@ `pkg-config --static --libs sword`
diff --git a/flashtools/flash.cpp b/flashtools/flash.cpp
index 71d4e42..012496d 100644
--- a/flashtools/flash.cpp
+++ b/flashtools/flash.cpp
@@ -1,3 +1,25 @@
+/******************************************************************************
+ * flash.cpp - Automation of flashcards generation
+ *
+ * Copyright 2007 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * Contributors:
+ * Lyndon Drake <lyndon at arotau dot com>
+ * Troy A. Griffitts <scribe at crosswire dot org>
+ */
+
#include <map>
#include <vector>
#include <iostream>
@@ -201,7 +223,7 @@ void outputFlash(const vector<Word> &wordList, const char *outputDir = ".", bool
}
// if we would rather have short strongs
else {
- SWBuf answers = w.def;
+ answers = w.def;
strip.processText(answers); // remove html tags
answers.replaceBytes("\n\r", ' '); // remove newlines
}
@@ -241,13 +263,19 @@ void outputFlash(const vector<Word> &wordList, const char *outputDir = ".", bool
*/
vector<Word> processWords(const char *range, bool addAll = true) {
SWMgr manager;
- SWModule &bible = *manager.getModule("KJV");
map<SWBuf, Word> wordList;
SWConfig hutf8("hwords.conf");
SWConfig hdefs("hdefs.conf");
SWConfig gutf8("gwords.conf");
SWConfig gdefs("gdefs.conf");
+
+ SWModule *tmpBible = manager.getModule("KJV");
+ if (!tmpBible) {
+ cerr << "Unable to locate KJV module" << endl;
+ exit(1);
+ }
+ SWModule &bible = *tmpBible;
VerseKey parser;
ListKey r = parser.ParseVerseList(range, 0, true);