[sword-svn] r2894 - in trunk/bindings/java-jni: . jni
scribe at crosswire.org
scribe at crosswire.org
Mon Jul 15 21:38:43 MST 2013
Author: scribe
Date: 2013-07-15 21:38:43 -0700 (Mon, 15 Jul 2013)
New Revision: 2894
Added:
trunk/bindings/java-jni/jni/Application.mk
Modified:
trunk/bindings/java-jni/README
trunk/bindings/java-jni/jni/Android.mk
trunk/bindings/java-jni/jni/swordstub.cpp
trunk/bindings/java-jni/jni/webmgr.hpp
Log:
updated android NDK bindings to build with stock Android NDK
Modified: trunk/bindings/java-jni/README
===================================================================
--- trunk/bindings/java-jni/README 2013-07-16 03:07:02 UTC (rev 2893)
+++ trunk/bindings/java-jni/README 2013-07-16 04:38:43 UTC (rev 2894)
@@ -1,21 +1,10 @@
Android Build Instructions
-You'll need an NDK with STL support. I have been trying crystax' release
-lately. You can find it on the web.
+You'll need the Android NDK.
-After that, you'll need a basic Application.mk file to place in your
-apps folder. Mine for bishop is here:
+Then link the sword/bindings/java-jni folder to your project's /jni folder.
+I have a symlink:
-~/android-ndk-r3-crystax/apps/bishop/Application.mk
-
-and contains:
-
-APP_PROJECT_PATH := $(call my-dir)/../../../src/bishop
-APP_MODULES := sword swordcore
-APP_PLATFORM := android-3
-
-and I have a symlink:
-
~/src/bishop/jni -> ~/src/sword/bindings/java-jni/jni/
~/src/sword is simply a checkout of the current sword svn repository.
@@ -26,8 +15,7 @@
/home/scribe/src/sword/
/home/scribe/src/bishop/
-/home/scribe/android-ndk-r3-crystax/
-/home/scribe/android-ndk-r3-crystax/apps/bishop/Application.mk
+/home/scribe/android-ndk-r8e/
with:
Modified: trunk/bindings/java-jni/jni/Android.mk
===================================================================
--- trunk/bindings/java-jni/jni/Android.mk 2013-07-16 03:07:02 UTC (rev 2893)
+++ trunk/bindings/java-jni/jni/Android.mk 2013-07-16 04:38:43 UTC (rev 2894)
@@ -28,7 +28,8 @@
LOCAL_MODULE := libswordcore
LOCAL_C_INCLUDES := ../sword/include ../sword/include/internal/regex
LOCAL_CFLAGS += -D__unix__ \
- -Dunix \
+ -DSTDC_HEADERS \
+ -Dunix \
-D_FTPLIB_NO_COMPAT \
-DANDROID \
-DOS_ANDROID
@@ -53,6 +54,8 @@
../../../src/modules/common/rawstr4.cpp \
../../../src/modules/common/lzsscomprs.cpp \
../../../src/modules/common/zipcomprs.cpp \
+../../../src/modules/common/bz2comprs.cpp \
+../../../src/modules/common/xzcomprs.cpp \
../../../src/modules/common/rawverse4.cpp \
../../../src/modules/common/swcipher.cpp \
../../../src/modules/common/swcomprs.cpp \
@@ -69,8 +72,8 @@
../../../src/modules/filters/gbfwebif.cpp \
../../../src/modules/filters/utf8transliterator.cpp \
../../../src/modules/filters/gbfstrongs.cpp \
-../../../src/modules/filters/osisplain.cpp \
../../../src/modules/filters/thmlhtmlhref.cpp \
+../../../src/modules/filters/thmlxhtml.cpp \
../../../src/modules/filters/thmlgbf.cpp \
../../../src/modules/filters/utf8utf16.cpp \
../../../src/modules/filters/utf8cantillation.cpp \
@@ -83,16 +86,34 @@
../../../src/modules/filters/thmlosis.cpp \
../../../src/modules/filters/utf8nfkd.cpp \
../../../src/modules/filters/thmlstrongs.cpp \
+../../../src/modules/filters/osisenum.cpp \
+../../../src/modules/filters/osisfootnotes.cpp \
+../../../src/modules/filters/osisglosses.cpp \
+../../../src/modules/filters/osisheadings.cpp \
+../../../src/modules/filters/osishtmlhref.cpp \
+../../../src/modules/filters/osislemma.cpp \
+../../../src/modules/filters/osismorph.cpp \
+../../../src/modules/filters/osismorphsegmentation.cpp \
+../../../src/modules/filters/osisosis.cpp \
+../../../src/modules/filters/osisplain.cpp \
+../../../src/modules/filters/osisredletterwords.cpp \
+../../../src/modules/filters/osisrtf.cpp \
+../../../src/modules/filters/osisscripref.cpp \
+../../../src/modules/filters/osisstrongs.cpp \
../../../src/modules/filters/osisvariants.cpp \
+../../../src/modules/filters/osiswebif.cpp \
+../../../src/modules/filters/osiswordjs.cpp \
+../../../src/modules/filters/osisxhtml.cpp \
+../../../src/modules/filters/osisxlit.cpp \
../../../src/modules/filters/thmlmorph.cpp \
../../../src/modules/filters/gbfplain.cpp \
../../../src/modules/filters/gbfhtmlhref.cpp \
+../../../src/modules/filters/gbfxhtml.cpp \
../../../src/modules/filters/utf8html.cpp \
../../../src/modules/filters/utf8nfc.cpp \
../../../src/modules/filters/rtfhtml.cpp \
../../../src/modules/filters/gbfredletterwords.cpp \
../../../src/modules/filters/latin1utf16.cpp \
-../../../src/modules/filters/osisscripref.cpp \
../../../src/modules/filters/thmlhtml.cpp \
../../../src/modules/filters/gbfthml.cpp \
../../../src/modules/filters/teihtmlhref.cpp \
@@ -102,36 +123,24 @@
../../../src/modules/filters/teirtf.cpp \
../../../src/modules/filters/thmlwordjs.cpp \
../../../src/modules/filters/papyriplain.cpp \
-../../../src/modules/filters/osisfootnotes.cpp \
-../../../src/modules/filters/osiswordjs.cpp \
-../../../src/modules/filters/osismorph.cpp \
-../../../src/modules/filters/osislemma.cpp \
-../../../src/modules/filters/osisredletterwords.cpp \
-../../../src/modules/filters/osisrtf.cpp \
+../../../src/modules/filters/utf8bidireorder.cpp \
../../../src/modules/filters/gbfheadings.cpp \
-../../../src/modules/filters/osisruby.cpp \
-../../../src/modules/filters/osishtmlhref.cpp \
-../../../src/modules/filters/utf8bidireorder.cpp \
../../../src/modules/filters/thmlrtf.cpp \
../../../src/modules/filters/swoptfilter.cpp \
../../../src/modules/filters/utf8arabicpoints.cpp \
-../../../src/modules/filters/osisstrongs.cpp \
-../../../src/modules/filters/osisheadings.cpp \
../../../src/modules/filters/unicodertf.cpp \
../../../src/modules/filters/gbffootnotes.cpp \
../../../src/modules/filters/greeklexattribs.cpp \
-../../../src/modules/filters/osiswebif.cpp \
../../../src/modules/filters/thmlfootnotes.cpp \
../../../src/modules/filters/thmlplain.cpp \
-../../../src/modules/filters/osisosis.cpp \
../../../src/modules/filters/utf8hebrewpoints.cpp \
-../../../src/modules/filters/osismorphsegmentation.cpp \
../../../src/modules/filters/thmlwebif.cpp \
../../../src/modules/filters/thmlvariants.cpp \
../../../src/modules/filters/thmllemma.cpp \
../../../src/modules/filters/gbfmorph.cpp \
../../../src/modules/filters/teiplain.cpp \
../../../src/modules/filters/swbasicfilter.cpp \
+../../../src/modules/filters/scsuutf8.cpp \
../../../src/mgr/stringmgr.cpp \
../../../src/mgr/swmgr.cpp \
../../../src/mgr/swsearchable.cpp \
@@ -144,8 +153,8 @@
../../../src/mgr/installmgr.cpp \
../../../src/mgr/swlocale.cpp \
../../../src/mgr/filemgr.cpp \
-../../../src/mgr/versemgr.cpp \
-../../../src/mgr/ftptrans.cpp \
+../../../src/mgr/versificationmgr.cpp \
+../../../src/mgr/remotetrans.cpp \
../../../src/mgr/ftplibftpt.cpp \
../../../src/utilfuns/swobject.cpp \
../../../src/utilfuns/roman.cpp \
Added: trunk/bindings/java-jni/jni/Application.mk
===================================================================
--- trunk/bindings/java-jni/jni/Application.mk (rev 0)
+++ trunk/bindings/java-jni/jni/Application.mk 2013-07-16 04:38:43 UTC (rev 2894)
@@ -0,0 +1 @@
+APP_STL := stlport_static
Modified: trunk/bindings/java-jni/jni/swordstub.cpp
===================================================================
--- trunk/bindings/java-jni/jni/swordstub.cpp 2013-07-16 03:07:02 UTC (rev 2893)
+++ trunk/bindings/java-jni/jni/swordstub.cpp 2013-07-16 04:38:43 UTC (rev 2894)
@@ -181,7 +181,7 @@
SWModule *module = it->second;
if ((!(module->getConfigEntry("CipherKey"))) || (*(module->getConfigEntry("CipherKey")))) {
- SWBuf type = module->Type();
+ SWBuf type = module->getType();
SWBuf cat = module->getConfigEntry("Category");
SWBuf version = module->getConfigEntry("Version");
if (cat.length() > 0) type = cat;
@@ -222,7 +222,7 @@
env->ReleaseStringUTFChars(modNameJS, modName);
if (module) {
- SWBuf type = module->Type();
+ SWBuf type = module->getType();
SWBuf cat = module->getConfigEntry("Category");
if (cat.length() > 0) type = cat;
jfieldID fieldID;
@@ -596,7 +596,7 @@
SWModule *module = getModule(env, me);
- return (module) ? module->Error() : -99;
+ return (module) ? module->popError() : -99;
}
@@ -731,15 +731,15 @@
sword::VerseKey *parser = SWDYNAMIC_CAST(VerseKey, k);
if (parser) {
sword::ListKey result;
- result = parser->ParseVerseList(keyListText, *parser, true);
+ result = parser->parseVerseList(keyListText, *parser, true);
int count = 0;
- for (result = sword::TOP; !result.Error(); result++) {
+ for (result = sword::TOP; !result.popError(); result++) {
count++;
}
ret = (jobjectArray) env->NewObjectArray(count, clazzString, NULL);
count = 0;
- for (result = sword::TOP; !result.Error(); result++) {
+ for (result = sword::TOP; !result.popError(); result++) {
env->SetObjectArrayElement(ret, count++, env->NewStringUTF(assureValidUTF8((const char *)result)));
}
}
@@ -1139,21 +1139,21 @@
sword::ListKey result;
if ((scope) && (strlen(scope)) > 0) {
- sword::SWKey *p = module->CreateKey();
+ sword::SWKey *p = module->createKey();
sword::VerseKey *parser = SWDYNAMIC_CAST(VerseKey, p);
if (!parser) {
delete p;
parser = new VerseKey();
}
*parser = module->getKeyText();
- lscope = parser->ParseVerseList(scope, *parser, true);
+ lscope = parser->parseVerseList(scope, *parser, true);
result = module->search(expression, srchType, flags, &lscope, 0, &percentUpdate, &peeuuu);
delete parser;
}
else result = module->search(expression, srchType, flags, 0, 0, &percentUpdate, &peeuuu);
int count = 0;
- for (result = sword::TOP; !result.Error(); result++) count++;
+ for (result = sword::TOP; !result.popError(); result++) count++;
if (count > MAX_RETURN_COUNT) count = MAX_RETURN_COUNT;
@@ -1169,7 +1169,7 @@
jfieldID fieldIDModName = env->GetFieldID(clazzSearchHit, "modName", "Ljava/lang/String;");
jfieldID fieldIDKey = env->GetFieldID(clazzSearchHit, "key" , "Ljava/lang/String;");
jfieldID fieldIDScore = env->GetFieldID(clazzSearchHit, "score" , "J");
- for (result = sword::TOP; !result.Error(); result++) {
+ for (result = sword::TOP; !result.popError(); result++) {
jfieldID fieldID;
jobject searchHit = env->AllocObject(clazzSearchHit);
@@ -1354,7 +1354,7 @@
if (it->second & InstallMgr::MODSTAT_OLDER) statusString = "-";
if (it->second & InstallMgr::MODSTAT_UPDATED) statusString = "+";
- SWBuf type = module->Type();
+ SWBuf type = module->getType();
SWBuf cat = module->getConfigEntry("Category");
if (cat.length() > 0) type = cat;
jobject modInfo = env->AllocObject(clazzModInfo);
@@ -1447,7 +1447,7 @@
env->ReleaseStringUTFChars(modNameJS, modName);
if (module) {
- SWBuf type = module->Type();
+ SWBuf type = module->getType();
SWBuf cat = module->getConfigEntry("Category");
if (cat.length() > 0) type = cat;
jfieldID fieldID;
Modified: trunk/bindings/java-jni/jni/webmgr.hpp
===================================================================
--- trunk/bindings/java-jni/jni/webmgr.hpp 2013-07-16 03:07:02 UTC (rev 2893)
+++ trunk/bindings/java-jni/jni/webmgr.hpp 2013-07-16 04:38:43 UTC (rev 2894)
@@ -73,12 +73,12 @@
void AddGlobalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end) {
// ThML word stuff needs to process before strongs strip
- if (module->Markup() == FMT_THML) {
- module->AddOptionFilter(thmlWordJS);
+ if (module->getMarkup() == FMT_THML) {
+ module->addOptionFilter(thmlWordJS);
}
- if (module->Markup() == FMT_GBF) {
- module->AddOptionFilter(gbfWordJS);
+ if (module->getMarkup() == FMT_GBF) {
+ module->addOptionFilter(gbfWordJS);
}
// add other module filters
@@ -100,12 +100,12 @@
if (module->getConfig().has("GlobalOptionFilter", "ThMLVariants")) {
OptionFilterMap::iterator it = optionFilters.find("ThMLVariants");
if (it != optionFilters.end()) {
- module->AddOptionFilter((*it).second); // add filter to module and option as a valid option
+ module->addOptionFilter((*it).second); // add filter to module and option as a valid option
}
}
- if (module->Markup() == FMT_OSIS) {
- module->AddOptionFilter(osisWordJS);
+ if (module->getMarkup() == FMT_OSIS) {
+ module->addOptionFilter(osisWordJS);
}
}
More information about the sword-cvs
mailing list