[sword-svn] r3723 - in trunk: bindings bindings/cordova/cordova-plugin-crosswire-sword/src/ios bindings/objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad include
scribe at crosswire.org
scribe at crosswire.org
Mon Apr 20 02:47:26 MST 2020
Author: scribe
Date: 2020-04-20 02:47:26 -0700 (Mon, 20 Apr 2020)
New Revision: 3723
Modified:
trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift
trunk/bindings/flatapi.cpp
trunk/bindings/objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad/UserInterfaceState.xcuserstate
trunk/include/flatapi.h
Log:
Added setLogLevel to flatapi. Fixed misname SWlog -> SWLog. Fixed BibleSync crash in SWIFT bindings
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift 2020-04-19 16:45:48 UTC (rev 3722)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift 2020-04-20 09:47:26 UTC (rev 3723)
@@ -19,7 +19,13 @@
var VERSEKEY_SHORTTEXT = Int(org_crosswire_sword_SWModule_VERSEKEY_SHORTTEXT);
var VERSEKEY_BOOKABBREV = Int(org_crosswire_sword_SWModule_VERSEKEY_BOOKABBREV);
var VERSEKEY_OSISBOOKNAME = Int(org_crosswire_sword_SWModule_VERSEKEY_OSISBOOKNAME);
-
+
+ var LOG_ERROR = Int32(org_crosswire_sword_SWLog_LOG_ERROR);
+ var LOG_WARN = Int32(org_crosswire_sword_SWLog_LOG_WARN);
+ var LOG_INFO = Int32(org_crosswire_sword_SWLog_LOG_INFO);
+ var LOG_TIMEDINFO = Int32(org_crosswire_sword_SWLog_LOG_TIMEDINFO);
+ var LOG_DEBUG = Int32(org_crosswire_sword_SWLog_LOG_DEBUG);
+
@objc(initSWORD:)
func initSWORD(command: CDVInvokedUrlCommand) {
mgr = 0
@@ -38,6 +44,14 @@
VERSEKEY_BOOKABBREV = Int(org_crosswire_sword_SWModule_VERSEKEY_BOOKABBREV);
VERSEKEY_OSISBOOKNAME = Int(org_crosswire_sword_SWModule_VERSEKEY_OSISBOOKNAME);
+ LOG_ERROR = Int32(org_crosswire_sword_SWLog_LOG_ERROR);
+ LOG_WARN = Int32(org_crosswire_sword_SWLog_LOG_WARN);
+ LOG_INFO = Int32(org_crosswire_sword_SWLog_LOG_INFO);
+ LOG_TIMEDINFO = Int32(org_crosswire_sword_SWLog_LOG_TIMEDINFO);
+ LOG_DEBUG = Int32(org_crosswire_sword_SWLog_LOG_DEBUG);
+
+ org_crosswire_sword_SWLog_setLogLevel(LOG_ERROR);
+
org_crosswire_sword_StringMgr_setToUpper({ (text: Optional<UnsafePointer<Int8>>, maxBytes: u_long) in
let lower = String(cString: text!)
let upper = lower.uppercased()
@@ -94,19 +108,19 @@
}
func logError(message: String) {
- org_crosswire_sword_SWlog_logError(message)
+ org_crosswire_sword_SWLog_logError(message)
}
func logDebug(message: String) {
- org_crosswire_sword_SWlog_logDebug(message)
+ org_crosswire_sword_SWLog_logDebug(message)
}
func logWarning(message: String) {
- org_crosswire_sword_SWlog_logWarning(message)
+ org_crosswire_sword_SWLog_logWarning(message)
}
func logInformation(message: String) {
- org_crosswire_sword_SWlog_logInformation(message)
+ org_crosswire_sword_SWLog_logInformation(message)
}
func logTimedInformation(message: String) {
- org_crosswire_sword_SWlog_logTimedInformation(message)
+ org_crosswire_sword_SWLog_logTimedInformation(message)
}
@@ -616,7 +630,7 @@
@objc(SWMgr_sendBibleSyncMessage:)
func SWMgr_sendBibleSyncMessage(command: CDVInvokedUrlCommand) {
initMgr()
- let osisRef = command.arguments[1] as? String ?? ""
+ let osisRef = command.arguments[0] as? String ?? ""
org_crosswire_sword_SWMgr_sendBibleSyncMessage(mgr, osisRef)
self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: "SWMgr_sendBibleSyncMessage"), callbackId: command.callbackId)
}
Modified: trunk/bindings/flatapi.cpp
===================================================================
--- trunk/bindings/flatapi.cpp 2020-04-19 16:45:48 UTC (rev 3722)
+++ trunk/bindings/flatapi.cpp 2020-04-20 09:47:26 UTC (rev 3723)
@@ -392,27 +392,35 @@
//
//
-void SWDLLEXPORT org_crosswire_sword_SWlog_logError(const char *msg) {
+void SWDLLEXPORT org_crosswire_sword_SWLog_logError(const char *msg) {
SWLog::getSystemLog()->logError(msg);
}
-void SWDLLEXPORT org_crosswire_sword_SWlog_logDebug(const char *msg) {
+void SWDLLEXPORT org_crosswire_sword_SWLog_logDebug(const char *msg) {
SWLog::getSystemLog()->logDebug(msg);
}
-void SWDLLEXPORT org_crosswire_sword_SWlog_logWarning(const char *msg) {
+void SWDLLEXPORT org_crosswire_sword_SWLog_logWarning(const char *msg) {
SWLog::getSystemLog()->logWarning(msg);
}
-void SWDLLEXPORT org_crosswire_sword_SWlog_logInformation(const char *msg) {
+void SWDLLEXPORT org_crosswire_sword_SWLog_logInformation(const char *msg) {
SWLog::getSystemLog()->logInformation(msg);
}
-void SWDLLEXPORT org_crosswire_sword_SWlog_logTimedInformation(const char *msg) {
+void SWDLLEXPORT org_crosswire_sword_SWLog_logTimedInformation(const char *msg) {
SWLog::getSystemLog()->logTimedInformation(msg);
}
+void SWDLLEXPORT org_crosswire_sword_SWLog_setLogLevel(int level) {
+ SWLog::getSystemLog()->setLogLevel((char)level);
+}
+int SWDLLEXPORT org_crosswire_sword_SWLog_getLogLevel() {
+ return SWLog::getSystemLog()->getLogLevel();
+}
+
+
//
// SWModule methods
//
Modified: trunk/bindings/objc/SWORD/SWORD.xcodeproj/project.xcworkspace/xcuserdata/scribe.xcuserdatad/UserInterfaceState.xcuserstate
===================================================================
(Binary files differ)
Modified: trunk/include/flatapi.h
===================================================================
--- trunk/include/flatapi.h 2020-04-19 16:45:48 UTC (rev 3722)
+++ trunk/include/flatapi.h 2020-04-20 09:47:26 UTC (rev 3723)
@@ -76,6 +76,11 @@
// for backward compat. Remove
const int org_crosswire_sword_SWModule_VERSEKEY_CHAPMAX = 4;
+ const int org_crosswire_sword_SWLog_LOG_ERROR = 1;
+ const int org_crosswire_sword_SWLog_LOG_WARN = 2;
+ const int org_crosswire_sword_SWLog_LOG_INFO = 3;
+ const int org_crosswire_sword_SWLog_LOG_TIMEDINFO = 4;
+ const int org_crosswire_sword_SWLog_LOG_DEBUG = 5;
@@ -608,11 +613,13 @@
void SWDLLEXPORT org_crosswire_sword_SWMgr_sendBibleSyncMessage
(SWHANDLE hMgr, const char *osisRefRaw);
-void SWDLLEXPORT org_crosswire_sword_SWlog_logError(const char *msg);
-void SWDLLEXPORT org_crosswire_sword_SWlog_logDebug(const char *msg);
-void SWDLLEXPORT org_crosswire_sword_SWlog_logWarning(const char *msg);
-void SWDLLEXPORT org_crosswire_sword_SWlog_logInformation(const char *msg);
-void SWDLLEXPORT org_crosswire_sword_SWlog_logTimedInformation(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWLog_logError(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWLog_logDebug(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWLog_logWarning(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWLog_logInformation(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWLog_logTimedInformation(const char *msg);
+void SWDLLEXPORT org_crosswire_sword_SWLog_setLogLevel(int level);
+int SWDLLEXPORT org_crosswire_sword_SWLog_getLogLevel();
#ifdef __cplusplus
}
More information about the sword-cvs
mailing list