diff options
Diffstat (limited to 'flashtools')
-rw-r--r-- | flashtools/Makefile | 2 | ||||
-rw-r--r-- | flashtools/flash.cpp | 32 |
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); |