1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
#include <swmodule.h>
#include <swmgr.h>
#include <iostream>
#include <stdio.h>
using namespace sword;
using namespace std;
int main(int argc, char **argv) {
if (argc < 2) {
fprintf(stderr, "usage: %s <lexdict_name>\n", *argv);
exit(-1);
}
SWMgr library;
SWModule *module = library.getModule(argv[1]);
if (!module) {
cerr << "\nCouldn't find module: " << argv[1] << "\n" << endl;
exit(-2);
}
int i = 0;
for ((*module) = TOP; !module->popError(); module->increment()) {
cout << module->getKeyText() << ": " << module->stripText() << "\n";
if (++i > 10) {
cout << "ERROR: more than 10 iterations. stopping.\n";
break;
}
}
return 0;
}
|