123 lines
4.2 KiB
Plaintext
123 lines
4.2 KiB
Plaintext
|
// JNI functions for the Go <=> Java bridge.
|
||
|
// gobind -lang=java structs
|
||
|
//
|
||
|
// File is generated by gobind. Do not edit.
|
||
|
|
||
|
#include <android/log.h>
|
||
|
#include <stdint.h>
|
||
|
#include "seq.h"
|
||
|
#include "structs.h"
|
||
|
#include "_cgo_export.h"
|
||
|
|
||
|
|
||
|
static jclass proxy_class_structs_I;
|
||
|
static jmethodID proxy_class_structs_I_cons;
|
||
|
static jmethodID mid_I_M;
|
||
|
static jclass proxy_class_structs_S;
|
||
|
static jmethodID proxy_class_structs_S_cons;
|
||
|
static jclass proxy_class_structs_S2;
|
||
|
static jmethodID proxy_class_structs_S2_cons;
|
||
|
|
||
|
JNIEXPORT void JNICALL
|
||
|
Java_go_structs_Structs_init(JNIEnv *env, jclass _unused) {
|
||
|
jclass clazz;
|
||
|
clazz = (*env)->FindClass(env, "go/structs/Structs$S");
|
||
|
proxy_class_structs_S = (*env)->NewGlobalRef(env, clazz);
|
||
|
proxy_class_structs_S_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||
|
clazz = (*env)->FindClass(env, "go/structs/Structs$S2");
|
||
|
proxy_class_structs_S2 = (*env)->NewGlobalRef(env, clazz);
|
||
|
proxy_class_structs_S2_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||
|
clazz = (*env)->FindClass(env, "go/structs/Structs$I$Proxy");
|
||
|
proxy_class_structs_I = (*env)->NewGlobalRef(env, clazz);
|
||
|
proxy_class_structs_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
|
||
|
clazz = (*env)->FindClass(env, "go/structs/Structs$I");
|
||
|
mid_I_M = (*env)->GetMethodID(env, clazz, "M", "()V");
|
||
|
|
||
|
}
|
||
|
|
||
|
JNIEXPORT jobject JNICALL
|
||
|
Java_go_structs_Structs_Identity(JNIEnv* env, jclass clazz, jobject s) {
|
||
|
int32_t _s = go_seq_to_refnum(env, s);
|
||
|
int32_t r0 = proxystructs__Identity(_s);
|
||
|
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_structs_S, proxy_class_structs_S_cons);
|
||
|
return _r0;
|
||
|
}
|
||
|
|
||
|
JNIEXPORT jobject JNICALL
|
||
|
Java_go_structs_Structs_IdentityWithError(JNIEnv* env, jclass clazz, jobject s) {
|
||
|
int32_t _s = go_seq_to_refnum(env, s);
|
||
|
struct proxystructs__IdentityWithError_return res = proxystructs__IdentityWithError(_s);
|
||
|
jobject _r0 = go_seq_from_refnum(env, res.r0, proxy_class_structs_S, proxy_class_structs_S_cons);
|
||
|
jstring _r1 = go_seq_to_java_string(env, res.r1);
|
||
|
go_seq_maybe_throw_exception(env, _r1);
|
||
|
return _r0;
|
||
|
}
|
||
|
|
||
|
JNIEXPORT jobject JNICALL
|
||
|
Java_go_structs_Structs_00024S_Identity(JNIEnv* env, jobject this) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
struct proxystructs_S_Identity_return res = proxystructs_S_Identity(o);
|
||
|
jobject _r0 = go_seq_from_refnum(env, res.r0, proxy_class_structs_S, proxy_class_structs_S_cons);
|
||
|
jstring _r1 = go_seq_to_java_string(env, res.r1);
|
||
|
go_seq_maybe_throw_exception(env, _r1);
|
||
|
return _r0;
|
||
|
}
|
||
|
|
||
|
JNIEXPORT jdouble JNICALL
|
||
|
Java_go_structs_Structs_00024S_Sum(JNIEnv* env, jobject this) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
double r0 = proxystructs_S_Sum(o);
|
||
|
jdouble _r0 = (jdouble)r0;
|
||
|
return _r0;
|
||
|
}
|
||
|
|
||
|
JNIEXPORT void JNICALL
|
||
|
Java_go_structs_Structs_00024S_setX(JNIEnv *env, jobject this, jdouble v) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
double _v = (double)v;
|
||
|
proxystructs_S_X_Set(o, _v);
|
||
|
}
|
||
|
|
||
|
JNIEXPORT jdouble JNICALL
|
||
|
Java_go_structs_Structs_00024S_getX(JNIEnv *env, jobject this) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
double r0 = proxystructs_S_X_Get(o);
|
||
|
jdouble _r0 = (jdouble)r0;
|
||
|
return _r0;
|
||
|
}
|
||
|
|
||
|
JNIEXPORT void JNICALL
|
||
|
Java_go_structs_Structs_00024S_setY(JNIEnv *env, jobject this, jdouble v) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
double _v = (double)v;
|
||
|
proxystructs_S_Y_Set(o, _v);
|
||
|
}
|
||
|
|
||
|
JNIEXPORT jdouble JNICALL
|
||
|
Java_go_structs_Structs_00024S_getY(JNIEnv *env, jobject this) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
double r0 = proxystructs_S_Y_Get(o);
|
||
|
jdouble _r0 = (jdouble)r0;
|
||
|
return _r0;
|
||
|
}
|
||
|
|
||
|
JNIEXPORT void JNICALL
|
||
|
Java_go_structs_Structs_00024S2_M(JNIEnv* env, jobject this) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
proxystructs_S2_M(o);
|
||
|
}
|
||
|
|
||
|
JNIEXPORT void JNICALL
|
||
|
Java_go_structs_Structs_00024I_00024Proxy_M(JNIEnv* env, jobject this) {
|
||
|
int32_t o = go_seq_to_refnum(env, this);
|
||
|
proxystructs_I_M(o);
|
||
|
}
|
||
|
|
||
|
void cproxystructs_I_M(int32_t refnum) {
|
||
|
JNIEnv *env = go_seq_push_local_frame(10);
|
||
|
jobject o = go_seq_from_refnum(env, refnum, proxy_class_structs_I, proxy_class_structs_I_cons);
|
||
|
(*env)->CallVoidMethod(env, o, mid_I_M);
|
||
|
go_seq_pop_local_frame(env);
|
||
|
}
|
||
|
|