1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 10:47:28 +00:00

Refactoring

This commit is contained in:
M66B 2022-01-06 21:45:41 +01:00
parent ee55958dcb
commit 84f7df5099

View file

@ -6,6 +6,7 @@
#include <sys/socket.h>
#include <netinet/tcp.h>
#include <sys/ioctl.h>
#include <netdb.h>
#include "compact_enc_det/compact_enc_det.h"
#include "cld_3/src/nnet_language_identifier.h"
@ -21,9 +22,11 @@ void log_android(int prio, const char *fmt, ...) {
}
}
extern "C" JNIEXPORT jobject JNICALL
Java_eu_faircode_email_CharsetHelper_jni_1detect_1charset(JNIEnv *env, jclass type,
jbyteArray _octets) {
extern "C"
JNIEXPORT jobject JNICALL
Java_eu_faircode_email_CharsetHelper_jni_1detect_1charset(
JNIEnv *env, jclass type,
jbyteArray _octets) {
int len = env->GetArrayLength(_octets);
jbyte *octets = env->GetByteArrayElements(_octets, nullptr);
@ -62,8 +65,9 @@ Java_eu_faircode_email_CharsetHelper_jni_1detect_1charset(JNIEnv *env, jclass ty
extern "C"
JNIEXPORT jobject JNICALL
Java_eu_faircode_email_TextHelper_jni_1detect_1language(JNIEnv *env, jclass clazz,
jbyteArray _octets) {
Java_eu_faircode_email_TextHelper_jni_1detect_1language(
JNIEnv *env, jclass clazz,
jbyteArray _octets) {
int len = env->GetArrayLength(_octets);
jbyte *octets = env->GetByteArrayElements(_octets, nullptr);
@ -152,4 +156,4 @@ Java_eu_faircode_email_ConnectionHelper_jni_1socket_1get_1send_1buffer(
if (res != 0)
log_android(ANDROID_LOG_DEBUG, "ioctl(TIOCOUTQ) res=%d queued=%d", res, queued);
return (res == 0 ? queued : 0);
}
}